Home › Articles › Modern Physics › Quantum Computing Basics: Qubits and Superposition
Quantum Computing Basics: Qubits and Superposition
Modern Physics
A quantum computer stores information in qubits, which can be in a superposition of 0 and 1. By using superposition and entanglement, it can process some problems in ways no ordinary computer can.
What a qubit is
A classical computer stores information in bits, each definitely 0 or 1. A quantum computer stores information in qubits, which can be made from the quantum state of an electron, an ion, a photon or a superconducting circuit. A qubit can be in a superposition, a combination of the 0 and 1 states, with amplitudes that set the probability of each outcome when it is measured. Measuring a qubit forces it to give a single definite answer, 0 or 1, and the superposition is lost. Quantum gates change qubits by rotating their states, in the same way that classical logic gates change bits, but a quantum gate acts on the whole superposition at once.
Superposition and entanglement
Entanglement is a second key resource: two or more qubits can be linked so that their states cannot be described independently, even when they are far apart. Measuring one entangled qubit instantly tells you something about the other, although no information travels faster than light. A quantum algorithm prepares a superposition, applies gates that make the wrong answers interfere destructively and the right answer interfere constructively, and then measures the result. This is why a quantum computer can be much faster for certain tasks: it does not try answers one by one, but uses interference to amplify the correct one.
What quantum computers can do
Quantum computers are promising for simulating molecules and materials, because those are quantum systems themselves, and for certain problems in optimisation, searching and factoring large numbers. Shor's algorithm can in principle factor large numbers far faster than any known classical method, which is why post-quantum cryptography is being developed. They are not expected to replace ordinary computers for everyday tasks such as word processing or web browsing. Building them is hard: qubits lose their quantum state through decoherence, so they must be cooled to near absolute zero or isolated in vacuum, and error correction needs many physical qubits for each reliable logical qubit.
Worked example: three qubits and eight states
A classical bit can be 0 or 1, but a qubit can be in a superposition of 0 and 1. Three classical bits can hold only one of 8 possible values at a time, such as 101. Three qubits can be in a superposition of all 8 values at once: 000, 001, 010, 011, 100, 101, 110 and 111. That is 2^3 = 8 states in superposition. Measuring the three qubits gives only one of the 8 results, with a probability set by the quantum state. The advantage comes from using interference between the states during the computation, not from simply reading out all 8 values at once.
Common mistakes
- Saying a qubit is both 0 and 1 at the same time in the everyday sense: a qubit is in a superposition, and a measurement gives a single definite result, 0 or 1.
- Thinking more qubits always means more power: qubits must be high quality, well connected and error-corrected, or extra qubits add noise rather than useful computation.
- Claiming quantum computers try all answers at once and read them all out: measurement returns one outcome, so algorithms use interference to make the correct answer more likely.
Practice questions
- How many basis states can 4 qubits be in superposition over?
Show answer
2^4 = 16 states.
- A qubit has probability 0.75 of measuring 0. What is the probability of measuring 1?
Show answer
0.25, because probabilities must add to 1, so |beta|^2 = 1 - 0.75 = 0.25.
- What is the key difference between a bit and a qubit?
Show answer
A classical bit is always 0 or 1; a qubit can be in a superposition of 0 and 1 before measurement.
Frequently asked questions
Will a quantum computer be faster at everything?
No. A quantum computer is not simply a faster ordinary computer; it is faster only for certain problems with a suitable quantum algorithm.
Why are quantum computers hard to build?
Decoherence, where interaction with the environment destroys the delicate superposition and entanglement, so qubits must be isolated and cooled.