Quantum superposition: what a qubit holds before you measure it
A qubit in superposition is a weighted combination of 0 and 1, with a complex number called an amplitude on each. Measuring it gives 0 or 1, with probabilities equal to the squared sizes of the amplitudes. What makes it more than a coin you have not looked at is that amplitudes can cancel, and quantum algorithms are built on that cancellation.
Updated
At a glance
- The state of one qubit
- , with complex amplitudes and and
- What a measurement returns
- 0 with probability , 1 with probability , and the qubit is left in that state
- How many amplitudes n qubits carry
- , one for every bit string of length
- What it is not
- Hidden uncertainty about a value the qubit already has: amplitudes can cancel, probabilities cannot
- What algorithms use
- Interference: gates arranged so wrong answers cancel and the right one grows before the measurement
- Why it is fragile
- Noise from the environment turns a superposition into an ordinary mixture of 0 and 1 (decoherence)
What a superposition is
A classical bit is 0 or 1. A qubit has two basis states, written and , and its general state is a combination of both: . The numbers and are amplitudes. They are complex, so each has a size and a phase, and their squared sizes add up to one.
The amplitudes are not observed directly. A measurement in the computational basis returns 0 with probability and 1 with probability , and afterwards the qubit is in the state that was measured. This is the Born rule[1]. The state , called , gives 0 and 1 half the time each.
A picture that helps is the Bloch sphere: every state of one qubit is a point on a sphere, with at the north pole and at the south pole. The balance between and sets the latitude, and the relative phase between them sets the longitude. States on the equator are equal superpositions that differ only in their phase.
With more qubits the count grows fast. A register of qubits has a basis state for every bit string of length , so its state carries amplitudes: 1,024 for ten qubits, about a million for twenty. Writing that state down on a classical computer takes complex numbers, which is why exact simulation runs out of memory at a few dozen qubits.
One Hadamard gate, read back
from eigenkit import Circuit, CircuitBuilder, Z
qc = CircuitBuilder(n_qubits=1)
qc.h(0) # |0⟩ becomes (|0⟩ + |1⟩)/√2
plus = Circuit(qc.build(), observables=Z(0))
print(plus.statevector([])) # 0.7071 on |0⟩ and 0.7071 on |1⟩
print(plus.probabilities([])) # 0.5 and 0.5The built-in NumPy simulator returns the exact state, so the two amplitudes of are visible. A real device would only return counts of 0 and 1.
Superposition is not uncertainty
It is tempting to read as a qubit that is secretly 0 or 1 and we do not know which. That reading fails. Take . Measured directly, it gives 0 and 1 half the time each, exactly like . No experiment that only measures in the computational basis can tell the two apart.
Yet they are different states. Apply a Hadamard gate to and you get every time; apply it to and you get every time. The two paths to each outcome carry amplitudes, and in one state they add while in the other they cancel. A probability distribution cannot do this, because probabilities are never negative and so they can only add.
This is interference, and it is the part of superposition that computes. Nothing collapses when the second Hadamard acts: the amplitudes recombine, and the measurement comes later.
Two Hadamards: the amplitudes recombine
from eigenkit import Circuit, CircuitBuilder, Z
def run(start_in_one):
qc = CircuitBuilder(n_qubits=1)
if start_in_one:
qc.x(0) # start from |1⟩, so the first H gives |−⟩
qc.h(0)
qc.h(0)
return Circuit(qc.build(), observables=Z(0)).probabilities([])
print(run(False)) # 1 and 0: |+⟩ goes back to |0⟩
print(run(True)) # 0 and 1: |−⟩ goes back to |1⟩After the first gate both states give 0 and 1 half the time. After the second, each gives one answer with certainty.
How a quantum algorithm uses superposition
Most gate-based algorithms follow the same five moves. They differ in what they put into the amplitudes and how they make them interfere.
Set amplitudes and phases
Rotation gates turn numbers into angles, and angles into amplitudes and phases. In quantum machine learning this is usually how classical features enter the circuit (angle encoding); amplitude and basis encodings exist too.
Make the amplitudes interfere
A sequence of gates is arranged so that the amplitudes of wrong answers cancel and the amplitude of the right one grows. This is the step that has to be designed for each problem, and it is where any speed-up comes from.
Entangle where the problem needs it
Two-qubit gates such as CNOT, acting on a superposition, correlate qubits so that the state no longer splits into one state per qubit. The next section shows the smallest case.
Measure, then repeat
One run of the circuit returns one bit string. To estimate the distribution, the circuit is run many times (shots) and the outcomes are counted. A simulator can return the exact probabilities instead.
Run it on a real QPU with EigenOrbit RouterIn eigenkit:
pip install "eigenkit[router]", thenprovider=RouterConfig(device=...)(docs).
Superposition and entanglement
Superposition is a property of any state that is a combination of basis states. Entanglement is a property of some multi-qubit superpositions: those that cannot be written as one state per qubit.
Two qubits that are each in are in a superposition of all four bit strings, , , and , with equal amplitudes, but they are not entangled: the state is , and measuring one qubit tells you nothing about the other. Put the first qubit in and apply a CNOT with it as the control, and you get , a Bell state. It is a superposition of only two bit strings, and it is entangled: the two qubits always agree.
A Bell pair
from eigenkit import Circuit, CircuitBuilder, Z
qc = CircuitBuilder(n_qubits=2)
qc.h(0)
qc.cnot(0, 1)
bell = Circuit(qc.build(), observables=Z(0) * Z(1))
print(bell.probabilities([])) # 0.5 on 00 and on 11, 0 on 01 and 10
print(bell([])) # 1.0 (to rounding): the two qubits always agree
print(bell.draw())Probabilities are listed for 00, 01, 10 and 11, with qubit 0 as the leftmost bit.
What superposition gives you, and what it does not
The amplitudes of a register are often described as parallel computing. The limits below are what keeps that description from being true.
| Claim | What holds |
|---|---|
| A register tries every input at once | A function can be applied to a superposition of all inputs in one pass, but a measurement returns one input and its output. The rest is lost unless interference moved it into the answer first. |
| Search gets faster | Grover's algorithm finds one marked item among N in about [3] steps[2], against on average classically. For a search with no structure, a quadratic gain is the most any quantum algorithm can reach[4]. |
| Estimating a probability gets cheaper | Amplitude estimation reaches error with [5] calls to the circuit that encodes the probability, against samples for Monte Carlo. That is a count of oracle calls, not of wall-clock time on today's hardware. |
| Data gets an exponentially large feature space | Encoding features into amplitudes and phases does give a space of dimension . A large space alone gives no advantage: quantum kernel values can concentrate exponentially around one value as the qubit count grows, and a model trained from a realistic number of measurements then predicts the same thing whatever the input[8]. |
| amplitudes store numbers | At most n classical bits can be read out of n qubits, without entanglement shared in advance[6]. |
| A superposition can be backed up | An unknown quantum state cannot be copied[7]. This is also why quantum error correction needs its own methods. |
Why superpositions are fragile
A superposition lasts only while the qubit is isolated. Any interaction with the environment that leaks which basis state the qubit is in destroys the interference between them, and the state becomes an ordinary mixture of 0 and 1. This is decoherence.
Hardware reports it as two times. is how long an excited qubit takes to relax from to . is how long the relative phase between and survives, and it is the one that limits interference. On top of that, every gate adds a small error and the final measurement misreads some outcomes; counts from a device are often corrected for readout error before they are read.
Error correction spreads one logical qubit over many physical ones so that errors can be found and undone without measuring the logical state. Until that is routine, circuits are kept short enough to finish well within T2.
Run it on a real QPU with EigenOrbit RouterA Hadamard, a wait and a second Hadamard show interference fading as the wait grows.In eigenkit: pip install "eigenkit[router]", then provider=RouterConfig(device=...) (docs).
Questions
What is quantum superposition in simple terms?
It is the state of a qubit that is a weighted combination of 0 and 1 rather than one of them. Each of the two carries an amplitude. Measuring the qubit gives 0 or 1 at random, with probabilities set by the amplitudes, and before the measurement the qubit has no definite value.
Is a qubit in superposition both 0 and 1 at the same time?
That phrase is a shorthand and it misleads in both directions. The qubit is not two bits, and it is not secretly one of them either. Its state is one vector with an amplitude on 0 and an amplitude on 1, and only a measurement turns it into a single bit.
How is superposition different from probability?
Probabilities are never negative, so two ways of reaching an outcome can only add. Amplitudes are complex numbers, so two ways of reaching an outcome can cancel. The states |+⟩ and |−⟩ give the same measurement statistics, yet one Hadamard gate sends the first to 0 and the second to 1. No probability distribution behaves like that.
What is the difference between superposition and entanglement?
Any state that combines basis states is a superposition, including a single qubit's. Entanglement needs two or more qubits and describes a superposition that cannot be split into one state per qubit. Two qubits each in |+⟩ are in superposition but not entangled; the Bell state (|00⟩ + |11⟩)/√2 is both.
What happens to a superposition when it is measured?
The measurement returns one basis state, at random, with the probability given by its squared amplitude, and leaves the qubit in that state. The other amplitudes are gone. To learn the distribution, the same circuit is run many times and the outcomes are counted.
Does superposition make quantum computers faster?
Not on its own. Evaluating a function on a superposition of every input still returns one input and output per measurement. Speed-ups come from interference that a specific algorithm sets up, and for unstructured search the best possible gain is quadratic. Superposition is necessary for those algorithms, but it is not sufficient.
Sources
- M. A. Nielsen, I. L. Chuang. Quantum Computation and Quantum Information, 10th anniversary edition. Cambridge University Press, 2010.
- L. K. Grover. A fast quantum mechanical algorithm for database search. Proceedings of the 28th Annual ACM Symposium on Theory of Computing, 1996. arXiv:quant-ph/9605043.
- M. Boyer, G. Brassard, P. Høyer, A. Tapp. Tight bounds on quantum searching. Fortschritte der Physik 46, 1998. arXiv:quant-ph/9605034.
- C. H. Bennett, E. Bernstein, G. Brassard, U. Vazirani. Strengths and weaknesses of quantum computing. SIAM Journal on Computing 26(5), 1997. arXiv:quant-ph/9701001.
- G. Brassard, P. Høyer, M. Mosca, A. Tapp. Quantum amplitude amplification and estimation. Contemporary Mathematics 305, 2002. arXiv:quant-ph/0005055.
- A. S. Holevo. Bounds for the quantity of information transmitted by a quantum communication channel. Problems of Information Transmission 9(3), 1973.
- W. K. Wootters, W. H. Zurek. A single quantum cannot be cloned. Nature 299, 1982.
- S. Thanasilp, S. Wang, M. Cerezo, Z. Holmes. Exponential concentration in quantum kernel methods. Nature Communications 15, 2024. arXiv:2208.11060.
- E. Farhi, J. Goldstone, S. Gutmann. A quantum approximate optimization algorithm. arXiv preprint, 2014. arXiv:1411.4028.
Run it yourself with eigenkit
eigenkit is EigenOrbit's open-source Python library: write a circuit once, run it on any simulator or QPU, and test it against a classical baseline on your own data before you invest in it or rule it out.
$ pip install eigenkit