Simple Algorithm
Quantum Computing · Ground State · 15 min

Interference

Amplitudes can cancel. That one fact powers every quantum algorithm.

Fire single photons, one at a time, at two half-silvered mirrors. Each mirror on its own is a fair coin toss, yet together they send every photon to the same detector. The reason, amplitudes that can cancel, is the engine inside every quantum algorithm.

What you’ll learn

  • Explain why quantum probabilities come from adding amplitudes first and squaring second.
  • Predict the detector statistics of a Mach–Zehnder interferometer from its phase setting.
  • Explain why which-path information destroys interference, even when nobody reads it.
  • Read beam splitters as Hadamard gates, and HH=IHH = I and HZH=XHZH = X as interference.
  • Describe in one sentence how phase estimation uses interference to measure a phase.

Two fair coins that are not fair

A beam splitter is a half-silvered mirror: half the light goes through, half is reflected. Fire a single photon at one and it is detected on one side or the other, 50/50, at random.

Now build a Mach–Zehnder interferometer. A first beam splitter (BS₁) sends the photon into two arms, mirrors bring the arms back together at a second beam splitter (BS₂), and two detectors, D0 and D1, wait behind it. Two fair coin tosses in a row should give 50/50 at the detectors. Fire some photons and see.

Think first With BS₂ in place, every photon reached D0. With BS₂ removed, the split was 50/50. Why can't "each photon secretly takes one arm at random" explain both results?

If each photon really travelled one definite arm, BS₂ would toss a fresh fair coin for it and the detectors would see 50/50 either way. The perfect 100 : 0 result means that both arms contribute to every single photon's outcome, and the two contributions to D1 cancel.

Amplitudes add, probabilities don’t

Quantum mechanics assigns every way an event can happen an amplitude: a number that can be positive, negative or even complex. The recipe has three steps:

  1. For each path to an outcome, multiply the amplitudes along the path.
  2. Add the path amplitudes of all paths that end in the same outcome.
  3. Only then take the squared magnitude to get the probability (the Born rule).

Each beam splitter contributes 12\tfrac{1}{\sqrt2} per route. Conservation of probability forces one route through BS₂ to carry a minus sign (you will prove this in the Excited State lesson). Here is the bookkeeping:

PathAmplitude to D0Amplitude to D1
via the lower arm12⋅12=12\tfrac{1}{\sqrt2}\cdot\tfrac{1}{\sqrt2} = \tfrac1212\tfrac12
via the upper arm12\tfrac12−12-\tfrac12
sum of amplitudes1100
probability∣1∣2=1\abs{1}^2 = 1∣0∣2=0\abs{0}^2 = 0
This cancellation is called interference: destructive at D1, constructive at D0.
P=∣a1+a2∣2=∣a1∣2+∣a2∣2+2 Re ⁣(a1∗a2)P = \abs{a_1 + a_2}^2 = \abs{a_1}^2 + \abs{a_2}^2 + 2\,\mathrm{Re}\!\left(a_1^{*} a_2\right)
The last term is the interference term. Classical probability has no such term. Here it can add to the plain sum or subtract from it.
Predict before you look

Two paths lead to D0, each with amplitude 12\tfrac12. Adding probabilities would give 14+14=50%\tfrac14+\tfrac14 = 50\%. What does adding amplitudes give, in percent?

Show the answer

100 %

∣12+12∣2=1\abs{\tfrac12+\tfrac12}^2 = 1: certainty. For D1 the amplitudes are 12\tfrac12 and −12-\tfrac12, so its probability is ∣0∣2=0\abs{0}^2 = 0. The total is still 11; interference moves probability from D1 to D0 rather than creating it.

Phase steers the photon

Lengthen the upper arm a tiny bit and its amplitude picks up a phase φ\varphi: it gets multiplied by eiφe^{i\varphi}, a rotation in the complex plane. The two contributions then no longer line up perfectly:

P(D0)=cos⁡2φ2,P(D1)=sin⁡2φ2.P(\text{D0}) = \cos^2\tfrac{\varphi}{2}, \qquad P(\text{D1}) = \sin^2\tfrac{\varphi}{2}.

At φ=0\varphi = 0 the arms reinforce at D0. At φ=π\varphi = \pi the upper amplitude is flipped to its negative, so the arms cancel at D0 and reinforce at D1. In between, the photon is steered smoothly from one detector to the other.

Predict before you look

You set φ=2π/3\varphi = 2\pi/3 (that is, 120°). What percentage of photons will reach D0?

Show the answer

25 %

cos⁡2(π/3)=(12)2=14\cos^2(\pi/3) = \left(\tfrac12\right)^2 = \tfrac14. One photon in four reaches D0 and three in four reach D1. Test it in the simulator below.

Knowing the path erases the pattern

What if you check which arm the photon takes? Put an absorber in one arm. Now each photon either hits it and is lost, or it definitely went the other way. With only one path left, there is nothing to cancel against.

Check your understanding

The phase is φ=0\varphi = 0, so with both arms open D1 never clicks. A friend may or may not have blocked one arm. You fire one photon and D1 clicks. What do you now know?

  1. Nothing: D1 clicks at random half the time anyway
  2. An arm is definitely blocked, although this photon never touched the blocker
  3. Both arms are definitely open
  4. The photon was absorbed and then re-emitted toward D1
Show the answer

B. An arm is definitely blocked, although this photon never touched the blocker

With both arms open at φ=0\varphi = 0, the two routes to D1 cancel exactly, so a D1 click is impossible. A click therefore proves that one route was removed, yet the photon that clicked must have travelled the open arm, since one entering the blocked arm is absorbed. This is the Elitzur–Vaidman bomb tester, an interaction-free measurement you can study at the Rydberg State level.

Beam splitters are Hadamard gates

Call the lower arm ∣0⟩\ket{0} and the upper arm ∣1⟩\ket{1}: the photon's path is a qubit. A 50/50 beam splitter then acts like the Hadamard gate

H=12(111−1),H = \tfrac{1}{\sqrt2}\begin{pmatrix}1&1\\1&-1\end{pmatrix},

and its minus sign is exactly the one in the path table. The phase shifter multiplies ∣1⟩\ket{1} by eiφe^{i\varphi}. The whole interferometer is "HH, phase, HH". With no phase, HH=IHH = I: the photon leaves exactly as it came in, because the two paths to ∣1⟩\ket{1} cancel.

Phase between the HH'sInterferometerOutput qubit
none: HHHHall photons at D0∣0⟩\ket{0}
SS (φ=π/2\varphi=\pi/2)50/5012(∣0⟩−i∣1⟩)\tfrac{1}{\sqrt2}(\ket0 - i\ket1)
ZZ (φ=π\varphi=\pi)all photons at D1∣1⟩\ket{1}
Same physics, two languages. Output states are shown up to a global phase.

The circuit view: wrong answers cancel

In a quantum circuit the same choreography happens on qubits. The circuit below is HHHH. Scrub through it and watch the state go from ∣0⟩\ket{0} to an equal superposition and back. Then rebuild it, using only HH and ZZ, so that the output is ∣1⟩\ket{1} with certainty.

Every quantum algorithm is this trick at scale. With nn qubits there are 2n2^n amplitudes and astronomically many paths. A good algorithm (Deutsch–Jozsa, Grover, Shor) arranges the signs so that paths to wrong answers cancel and paths to the right answer reinforce before you measure.

Interference measures phase

Interference turns an invisible phase into visible statistics: in the interferometer, φ\varphi became cos⁡2(φ/2)\cos^2(\varphi/2). Quantum computers use the same move. Through phase kickback, a controlled operation leaves its phase on a control qubit, and a final Hadamard turns that phase into a measurable bias.

One qubit gives one blurry reading. Phase estimation uses tt control qubits, where the kk-th one sees the phase multiplied by 2k2^k, and interferes them all at once (with the quantum Fourier transform) so that the output is the phase, written as a tt-bit binary fraction.

Key takeaways

  • Probabilities come from adding amplitudes over all indistinguishable paths, then squaring: P=∣∑pathsa∣2P = \abs{\sum_{\text{paths}} a}^2.
  • Opposite amplitudes cancel (destructive interference); aligned ones reinforce (constructive).
  • In a Mach–Zehnder interferometer P(D0)=cos⁡2(φ/2)P(\text{D0}) = \cos^2(\varphi/2): a phase steers the photon between the detectors.
  • Which-path information, even if never read, destroys interference.
  • A beam splitter acts as a Hadamard gate; HH=IHH = I and HZH=XHZH = X are interference identities.
  • Phase estimation uses interference to read a phase out as binary digits, and every quantum speedup is choreographed interference.

Check yourself

In the interactive lesson these are scored with your confidence, and what you miss comes back for review.

Question 1

Two indistinguishable paths lead to the same outcome, with amplitudes 12\tfrac12 and −12-\tfrac12. What is the probability of that outcome?

  1. 12\tfrac12
  2. 14\tfrac14
  3. 00
  4. 11
Show the answer

C. 00

Add first, then square: ∣12−12∣2=0\abs{\tfrac12 - \tfrac12}^2 = 0. This is destructive interference.

Question 2

In the interferometer P(D0)=cos⁡2(φ/2)P(\text{D0}) = \cos^2(\varphi/2). Which phase sends exactly half of the photons to each detector?

  1. φ=0\varphi = 0
  2. φ=π/2\varphi = \pi/2
  3. φ=π\varphi = \pi
  4. φ=2π\varphi = 2\pi
Show the answer

B. φ=π/2\varphi = \pi/2

cos⁡2(π/4)=12\cos^2(\pi/4) = \tfrac12. At φ=0\varphi = 0 and φ=2π\varphi = 2\pi everything goes to D0; at φ=π\varphi = \pi everything goes to D1.

Question 3

You remove the second beam splitter. How do the detector counts depend on the phase φ\varphi?

  1. They don't: each detector gets 50% for every φ\varphi
  2. D0 still gets cos⁡2(φ/2)\cos^2(\varphi/2)
  3. All photons go to D0
  4. All photons are absorbed
Show the answer

A. They don't: each detector gets 50% for every φ\varphi

Without BS₂ the two arms never recombine, so each detector sees only one arm and there is nothing to interfere. A phase on one arm changes no probability.

Question 4

In one arm you rotate the photon's polarization so that it records which arm was taken. Nobody ever reads the polarization. What happens to the interference?

  1. Nothing: the mark is never read, so interference is unaffected
  2. It survives, but at half the strength
  3. The photon splits into two half-photons that each reach a detector
  4. It disappears: the two paths are now distinguishable, so their amplitudes no longer meet in the same final state
Show the answer

D. It disappears: the two paths are now distinguishable, so their amplitudes no longer meet in the same final state

Interference requires the alternatives to end in the same final state. A perfect polarization mark puts the two paths into different (orthogonal) states, so their amplitudes add to different outcomes and can never cancel, whether or not anyone looks.

Question 5

Which circuit returns ∣0⟩\ket{0} to ∣0⟩\ket{0} with certainty, because its two paths to ∣1⟩\ket{1} cancel?

  1. HH alone
  2. HH, then ZZ, then HH
  3. HH then HH
  4. XX then HH
Show the answer

C. HH then HH

HH=IHH = I. The paths 0→0→10\to0\to1 and 0→1→10\to1\to1 have amplitudes +12+\tfrac12 and −12-\tfrac12, which cancel, while the two paths back to ∣0⟩\ket{0} add up to 11.

Go deeper

Further reading

  • R. P. Feynman, R. B. Leighton & M. Sands, The Feynman Lectures on Physics, Vol. III, Ch. 1, "Quantum Behavior" (Addison-Wesley, 1965).
  • M. A. Nielsen & I. L. Chuang, Quantum Computation and Quantum Information, Ch. 1 and §5.2 (Cambridge, 10th anniv. ed., 2010).