Skip to content
Quantum ComputingAN INTERACTIVE OPEN TEXTBOOK
charithj.com.au

Superposition

A combination of amplitudes is more than uncertainty about a hidden bit.

16 min readDr. Charith Jayasekara↓ Chapter PDF
By the end, you’ll be able to
  • Construct the plus and minus states using H and Z.
  • Explain why an equal mixture differs from a coherent superposition.

Apply H to ∣0⟩\lvert0\rangle:

H∣0⟩=∣+⟩=∣0⟩+∣1⟩2.H\lvert0\rangle=\lvert+\rangle=\frac{\lvert0\rangle+\lvert1\rangle}{\sqrt2}.

Both Z outcomes have probability 1/21/2. The state is a coherent combination of amplitudes relative to this basis. Superposition is basis-dependent: ∣+⟩\lvert+\rangle is itself one basis vector in the X basis.

A classical random bit can also produce equal 0/1 counts. Those counts alone do not distinguish it from ∣+⟩\lvert+\rangle. The difference appears when you apply another operation.

Applying H again maps ∣+⟩\lvert+\rangle to ∣0⟩\lvert0\rangle deterministically. An equal classical mixture of ∣0⟩\lvert0\rangle and ∣1⟩\lvert1\rangle stays 50/50 under H. The coherent state has a stable relative phase; the mixture does not.

Insert Z between the two H gates. It changes ∣+⟩\lvert+\rangle into ∣−⟩\lvert-\rangle. The second H now gives ∣1⟩\lvert1\rangle. The intermediate Z-basis probabilities did not change, but the final outcome did.

Compare phase settings 0°, 90° and 180°. Calculate or read the final probability of 1 for each. You should find 0, 1/21/2 and 1. Explain the result using amplitudes rather than a claim that measurement reads both possibilities.

Superposition gives algorithms a state space to transform. It does not by itself reveal exponentially many answers, eliminate data-loading costs or guarantee a speedup.

WORKED DIAGRAM · F08Coherence survives a change of basis
Coherence survives a change of basisEqual Z counts do not make these preparations equivalent. The mixture randomly prepares a basis state; the pure plus state has a definite relative phase.Pure statePrepare |+⟩Apply HZ: always 0Mixture50% |0⟩, 50% |1⟩Apply HZ: 50/50
Equal Z counts do not make these preparations equivalent. The mixture randomly prepares a basis state; the pure plus state has a definite relative phase.

Procedure A prepares zero and applies H every time. Procedure B uses a classical random choice to prepare zero on half the trials and one on the others. Both procedures give equal Z frequencies. They do not prepare the same state. Procedure A has a stable phase relationship between its basis components; procedure B has classical uncertainty about which basis state was prepared.

This distinction is operational. Add H before the final readout. Procedure A returns zero with certainty in the ideal model. For procedure B, H maps either possible input into a state with equal Z probabilities, so the overall output remains half-and-half. The diagram compares these experiments. Calling both preparations “a fifty-fifty qubit” would conceal the information needed to predict the second stage.

For a real state with amplitudes a and b, H gives a zero amplitude of their sum divided by the square root of two. Its probability is

P(0)=(a+b)22=a2+b2+2ab2.P(0)=\frac{(a+b)^2}{2} =\frac{a^2+b^2+2ab}{2}.

When a and b are equal positive amplitudes of a plus state, the cross term supplies the extra one half that raises the zero probability from one half to one. For a minus state, the cross term is negative and the zero probability falls to zero. A classical mixture combines probabilities from its alternative preparations and does not include this coherent cross term between them.

For complex amplitudes, the corresponding cross term uses the real part of the conjugate product. This generalisation explains why a 90-degree relative phase gives no preference for zero after a final H, while a 180-degree phase swaps the constructive and destructive outputs. You can understand the effect first as vector addition in the complex plane, then use the formula to calculate it precisely.

The plus state is a superposition of zero and one, but it is a single definite vector in the X basis. Conversely, zero is an equal superposition of plus and minus. A statement that a qubit “is in superposition” therefore needs a reference basis. The physical state has not changed when you rewrite its coordinates; the description has changed.

A gate and a coordinate rewrite are different actions. Re-expressing plus in the X basis does not physically apply H. Applying H transforms plus into zero in the original computational basis. The two calculations use closely related matrices, which can make the distinction easy to miss. In an experiment, identify whether a basis change is part of the apparatus or simply part of your mathematical account.

If you measure the plus state in Z and forget the outcome, later trials behave like the classical mixture described above. If you keep the outcome, you know which basis state remains on each trial. In either case, applying H afterward does not reconstruct the original uninterrupted two-H experiment. Recovering a coherent state would require a new preparation or an appropriately modelled control process; a missing phase relationship cannot be restored by relabelling probabilities.

This observation matters for debugging. Looking at a simulated statevector is harmless because it is a classical data structure. Measuring an actual qubit halfway through a circuit changes the physical process. A simulator interface that exposes amplitudes is therefore a teaching aid with more access than a hardware operator has. Keep that difference visible when moving from exercises to programming real devices.

The lab prepares zero, applies H, applies a selected phase and applies H again. At phase zero, predict the final zero outcome. At phase 180 degrees, predict the final one outcome. Enter each prediction before revealing the model. The phase setting describes the coherent intermediate state; the displayed amplitude table describes the final state after the complete circuit.

L03 · INTERACTIVE LABRuns on your device

Superposition & interference

The circuit is H → P(φ) → H on |0⟩. Relative phase changes interference at the final H. The intermediate and final Z probabilities need not agree.

Experiment controls
|0⟩ — H — P(φ) — H — M

P(φ) = diag(1, exp(iφ)). P(180°) is Z.

At the selected φ, predict the final state or probabilities. Explain which amplitudes will reinforce or cancel.

Record a prediction to enable the results.

Results are hidden.

Prepare your experiment using the controls. Record a prediction, then reveal the statevector or run the experiment.

Changing the preparation or circuit starts a new prediction.

MODEL · Ideal pure-state vector, complex double precisionORDER · q0 is the leftmost bit
Take it further

Compare φ = 0°, 90° and 180°. Connect the complex amplitude table to the final distribution.

For a third trial, choose phase 90 degrees. Work out the two final complex amplitudes and their squared magnitudes. Compare these with the equal-probability result from the classical mixture, while remembering that matching one histogram does not establish that the states match. You would need an appropriate additional setting to investigate other components of the state.

Practice: choose a distinguishing experiment

Section titled “Practice: choose a distinguishing experiment”

A preparation is either the coherent plus state or an equal classical mixture of zero and one. You can request many fresh preparations. Explain why Z measurements alone are insufficient and propose a test using H. What conclusion can a finite number of observations support?

Check your reasoning

Both candidates give equal Z probabilities. H before readout makes the coherent plus preparation deterministic zero, while the mixture stays half-and-half. Observing a one rules out the ideal plus model for that trial, but a finite all-zero sample does not logically exclude the mixture: it has a small nonzero probability. State preparation and gate errors would require a more realistic statistical comparison.

PAUSE & THINK

How does H readout distinguish plus from an equal zero/one mixture?

Choose your answer

Reference: IBM Quantum — Quantum mechanics basics.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.