Interference: how phase becomes odds

A measurement only sees the arrow's height. Turning a qubit about the z axis changes its phase but not its height, so on its own it doesn't change the odds at all. Yet phase is what quantum algorithms work with. The way they use it is interference: a gate mixes the two amplitudes so that they add up or cancel out, and the phase decides which.

The simplest example takes three gates: H, a turn by an angle φ about z, and H again. Change φ, and measuring 0 at the end goes from certain to impossible.

A Bloch sphere: the path of |0⟩ through H, a 60-degree turn about z, and H again, as three solid arcs, and a dashed arc for the single 60-degree turn about x that has the same effect. A level line marks the arrow's height at the end.|0⟩|1⟩|+⟩|−⟩|+i⟩|−i⟩
∣0⟩|{0}\rangle through H, a 60° turn about z, and H again: a solid arc for each turn. Together they make one 60° turn about x (dashed), which leaves the arrow at height 0.5, so P(0) = 75%.

Step by step

Follow ∣0⟩|{0}\rangle through the three gates.

  1. H takes ∣0⟩|{0}\rangle to ∣+⟩|{+}\rangle: equal amplitudes, with the arrow on the equator.
  2. A turn by φ about z changes only the relative phase. The arrow moves around the equator, and the odds stay 50/50, so measuring now would tell you nothing about φ. Up to a global phase, the state is
    12 (∣0⟩+eiφ ∣1⟩)\tfrac{1}{\sqrt{2}}\,\big(|0\rangle + e^{i\varphi}\,|1\rangle\big)
  3. H again mixes the amplitudes. The new amplitude of ∣0⟩|{0}\rangle is the sum of the old two, and the new amplitude of ∣1⟩|{1}\rangle is their difference, each divided by 2\sqrt{2}:
    1+eiφ2 ∣0⟩+1−eiφ2 ∣1⟩\tfrac{1 + e^{i\varphi}}{2}\,|0\rangle + \tfrac{1 - e^{i\varphi}}{2}\,|1\rangle

Adding up and canceling out

The second H gives each new amplitude two contributions, one from the old ∣0⟩|{0}\rangle part and one from the old ∣1⟩|{1}\rangle part. How they combine depends on the angle between them, which is the phase φ:

  • φ = 0°: the two contributions point the same way. They add up for ∣0⟩|{0}\rangle and cancel out for ∣1⟩|{1}\rangle, so the qubit ends at ∣0⟩|{0}\rangle: P(0) = 100%. This adding up is called constructive interference, and the canceling out destructive interference.
  • φ = 180°: the other way round. They cancel for ∣0⟩|{0}\rangle and add up for ∣1⟩|{1}\rangle, so the qubit ends at ∣1⟩|{1}\rangle.
  • In between, they partly cancel:
P(0)=∣1+eiφ2∣2=cos⁡2φ2,P(1)=sin⁡2φ2P(0) = \left|\tfrac{1 + e^{i\varphi}}{2}\right|^2 = \cos^2\tfrac{\varphi}{2}, \qquad P(1) = \sin^2\tfrac{\varphi}{2}

With gates from the app's gate bar in the middle:

In the middleTurn about z, φP(0)P(1)
nothing0°100%0%
TT45°85.4%14.6%
SS90°50%50%
Rz(120∘)R_z(120^\circ)120°25%75%
ZZ180°0%100%

The phase that no measurement could see after step 2 now sets the odds. The app's State panel shows it happening in circle notation: after the turn, the line in the ∣1⟩|{1}\rangle circle points φ around, and after the second H, how full each circle is depends on that angle.

On the sphere

On the Bloch sphere the three gates add up to one turn. H swaps the x and z axes, so a turn about z between two Hadamards becomes the same turn about x (see Hadamard):

H Rz(φ) H=Rx(φ)H\,R_z(\varphi)\,H = R_x(\varphi)

A turn by φ about x tilts ∣0⟩|{0}\rangle down by φ, to height cos⁡φ\cos\varphi, and the rule from Measuring a qubit gives P(0)=1+cos⁡φ2=cos⁡2φ2P(0) = \tfrac{1 + \cos\varphi}{2} = \cos^2\tfrac{\varphi}{2}: the same answer as adding up amplitudes. The figure shows it for φ = 60°.

Try it

The second link starts four qubits on the equator, a different phase each, so one H shows the whole table at once. For another case of interference, see the square root of NOT.