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

Quantum phase and interference

The invisible difference that another gate can make visible.

15 min readDr. Charith Jayasekara↓ Chapter PDF
By the end, you’ll be able to
  • Distinguish global phase from relative phase.
  • Derive the output of an H–phase–H circuit.

Multiplying an entire state by eiγe^{i\gamma} does not change measurement probabilities. For any measurement vector ∣v⟩\lvert v\rangle,

∣⟨v∣eiγψ⟩∣2=∣eiγ∣2∣⟨v∣ψ⟩∣2=∣⟨v∣ψ⟩∣2.|\langle v|e^{i\gamma}\psi\rangle|^2=|e^{i\gamma}|^2|\langle v|\psi\rangle|^2=|\langle v|\psi\rangle|^2.

Relative phase is different. Multiplying just one component changes its relationship with the others.

Prepare ∣0⟩\lvert0\rangle, apply H, then P(ϕ)=diag⁡(1,eiϕ)P(\phi)=\operatorname{diag}(1,e^{i\phi}), then H again:

∣0⟩⟼∣0⟩+∣1⟩2⟼∣0⟩+eiϕ∣1⟩2⟼1+eiϕ2∣0⟩+1−eiϕ2∣1⟩.\lvert0\rangle\longmapsto \frac{\lvert0\rangle+\lvert1\rangle}{\sqrt2} \longmapsto\frac{\lvert0\rangle+e^{i\phi}\lvert1\rangle}{\sqrt2} \longmapsto\frac{1+e^{i\phi}}2\lvert0\rangle+\frac{1-e^{i\phi}}2\lvert1\rangle.

The final probabilities are

P(0)=cos⁡2(ϕ/2),P(1)=sin⁡2(ϕ/2).P(0)=\cos^2(\phi/2),\qquad P(1)=\sin^2(\phi/2).

Before the second H, the Z probabilities are always 50/50. The final H recombines amplitudes and exposes the phase difference.

  • At 0°, the amplitudes for 1 cancel; the result is 0.
  • At 180°, the amplitudes for 0 cancel; the result is 1.
  • At 90°, the output probabilities are equal.

Challenge: explain why applying a global minus sign at the middle of the circuit cannot replace the Z gate. Z changes the relative sign; a global minus multiplies both amplitudes.

Follow amplitudes through the whole circuit

Section titled “Follow amplitudes through the whole circuit”
WORKED DIAGRAM · F10Relative phase becomes an output difference
Relative phase becomes an output differenceBoth circuits have equal Z probabilities immediately before the last H. Their different relative signs determine which output amplitude cancels.φ = 0H|0⟩ = |+⟩P(0): |+⟩H: |0⟩φ = πH|0⟩ = |+⟩P(π): |−⟩H: |1⟩
Both circuits have equal Z probabilities immediately before the last H. Their different relative signs determine which output amplitude cancels.

The diagram shows two settings of the same interferometer. Before the final H, phase zero and phase pi both give equal Z probabilities. Their signs differ. The last H combines those signed contributions and routes probability to different outputs. A phase operation changes what a later operation can reveal even when an immediate histogram stays fixed.

Think of the two components as contributions to each possible final output. Contributions to the same outcome must be added as complex numbers before taking the squared magnitude. Contributions associated with distinguishable classical alternatives require a different probability calculation. Interference depends on retaining coherence between the alternatives; a recorded intermediate measurement changes that condition.

After the first H, both amplitudes are one over the square root of two. A phase of 90 degrees multiplies the one component by i. The final H therefore produces

αout=1+i2,βout=1−i2.\alpha_{\rm out}=\frac{1+i}{2},\qquad \beta_{\rm out}=\frac{1-i}{2}.

Each squared magnitude is one half. This is an intermediate case between complete reinforcement at phase zero and complete transfer at phase pi. The output is still a pure state, even though the Z probabilities are equal. Reading only those probabilities would hide the remaining relative phase between the final components.

For a phase of 60 degrees, the final zero probability is three quarters and the one probability is one quarter. You can calculate this from the cosine-squared and sine-squared half-angle expressions, or by inserting the real and imaginary parts of the phase factor. The two methods should agree. Checking both is useful when debugging a sign convention in an implementation.

Suppose a common phase multiplies the entire input. Linearity carries that common factor through every later unitary operation. Every final amplitude acquires the same factor, whose magnitude is one, so every final probability stays the same. The argument applies to any measurement basis, not only Z. A change that is invisible immediately but becomes visible after H was therefore relative phase, not global phase.

This gives a practical way to compare statevectors. Two vectors that differ only by a common unit-magnitude factor describe the same pure physical state. Comparing their entries for exact equality can produce a false disagreement. You can compare their overlap magnitude or align one nonzero component’s phase before checking the remaining entries. Do not align each component separately: that would remove physical relative phases too.

On the one basis state, Z produces a global minus sign. On plus, Z changes only one of two nonzero components and produces minus. The same matrix entry can therefore correspond to a global or relative phase depending on the input. Always inspect the whole state before assigning physical meaning to a sign.

The distinction becomes even more important with controlled operations. A phase common to a unitary acting on an isolated system may become conditional when the operation is controlled, making it a relative phase between control branches. You will meet that idea in phase kickback and phase estimation. Keeping track of conventions now avoids treating every printed minus sign as either always observable or always irrelevant.

Use phases zero, 60, 90 and 180 degrees in that order. For each setting, calculate both probabilities, enter a prediction and reveal the model. Include a short explanation of which output becomes more likely. The table shows the final complex amplitudes; the circuit strip identifies the phase operation before the last H.

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.

At phase 180 degrees, the zero component should vanish. Its displayed phase is undefined because a zero amplitude has no direction. Near that setting, small numerical values may be rounded to zero. Interpret the state through the theoretical calculation and stated precision rather than treating a rounding artefact as a small physical leakage process.

Practice: can a Z histogram detect every phase?

Section titled “Practice: can a Z histogram detect every phase?”

You prepare plus and apply a phase gate, then measure immediately in Z. You obtain approximately equal counts for every phase setting. Has the gate failed? Design an extra operation that makes the phase influence the final distribution, and explain how finite shots affect your conclusion.

Check your reasoning

The observation is expected: a diagonal phase gate preserves the two Z probabilities. Add H before readout to obtain probabilities determined by the phase half-angle. Repeated settings can test the predicted fringe. Finite shots produce fluctuations around that curve; hardware errors may also reduce contrast. Neither a single equal histogram nor a single surprising count is sufficient to identify the cause.

Use radians in algebra and degrees only when entering this lab’s controls. A quarter turn is 90 degrees or pi over two radians. Confusing those units changes the phase factor and the predicted interference fringe. Write the conversion once in your experiment record so another reader can reproduce the setting without guessing.

PAUSE & THINK

In H–P(90°)–H on zero, what are the output probabilities?

Choose your answer

Reference: IBM Quantum — Quantum information.

ONE IDEA FURTHER

Ready for the next step?

Your progress stays in this browser.