Quantum amplitudes are complex numbers, and their phase — the argument of the complex number —
carries real physical information. A lone phase difference between ∣0⟩ and ∣1⟩ is
completely invisible in a computational-basis measurement: only the absolute squares of the
amplitudes determine probabilities. But once we sandwich the phase gate between two Hadamards, that
hidden phase becomes a measurable amplitude difference. This is interference.
Relative phase is invisible by itself
Consider the state ∣+⟩=21(∣0⟩+∣1⟩). Applying the
T gate — which adds a phase of eiπ/4 to the ∣1⟩ component — gives
T∣+⟩=21(∣0⟩+eiπ/4∣1⟩).
The probabilities are still 50/50: ∣1/2∣2=1/2 for both outcomes. The phase eiπ/4
is there, but a Z-basis measurement cannot see it.
H–phase–H reveals the phase
To make the phase visible we apply H after T, which mixes the two amplitudes together. Starting
from ∣0⟩:
using the identity ∣1+eiθ∣2=2+2cosθ and the half-angle formula
21+cosθ=cos2(θ/2).
Similarly P(1)=sin2(π/8)≈0.146.
The two outcomes are no longer equally likely. The π/4 phase introduced by T has been turned
into a measurable amplitude imbalance by the second H gate.
General rule
For any phase gate P(θ) (which multiplies ∣1⟩ by eiθ), the H–P(θ)–H
sandwich on ∣0⟩ yields
P(0)=cos2(2θ),P(1)=sin2(2θ).
At θ=0 (no phase) you get P(0)=1, the qubit stays in ∣0⟩. At θ=π
(the Z gate) you get P(0)=0, the qubit flips to ∣1⟩ — which is exactly the identity
HZH=X we saw in an earlier lesson.
Try it
Build the circuit H⋅T⋅H on qubit 0. The statevector grader will check that your final
state has the correct complex amplitudes. A circuit that does nothing, or that skips the second H,
will fail — only the full sandwich produces the asymmetric output.
Run your code to see the quantum state.
After running, look at the State vector panel: the amplitude for ∣0⟩ should have
magnitude cos(π/8)≈0.924 and the amplitude for ∣1⟩ magnitude
sin(π/8)≈0.383. The Probabilities panel should show roughly 85 % and 15 %.
Sign in on the full site to ask questions and join the discussion.