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

Superposition

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

10 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.

L03 · INTERACTIVE LABRuns on your device

Superposition & interference

The two Hadamard gates recombine amplitudes. A relative phase between them changes the result even though the intermediate Z-basis probabilities stay at 50/50.

Make a prediction first

H then H returns 0. What do you expect if a Z gate is placed between them?

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

P(φ) = diag(1, e^(iφ)). P(180°) is the Z gate.

Exact probability
|0⟩
100.0%
|1⟩
0.0%

Exact ideal-model predictions · run a measurement experiment to compare.

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

Set the phase to 180°. Explain why the final probability of 1 becomes 100%.

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.

Reference: IBM Quantum — Quantum mechanics basics.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.