Quantum Computing · Part B — 07

Phase Estimation

This is the workhorse subroutine of quantum computing — the engine inside Shor, inside quantum chemistry, inside linear-systems solvers. Its whole job: a gate U hides a phase φ in its eigenvalue, and phase estimation reads that number out in binary. It is simply kickback and the inverse QFT, bolted together.

↩ before you start · keep these handy
·From QC 03: a controlled-U on an eigenstate kicks its phase e2πiφ onto the control.
·From QC 06: the QFT turns a winding rate into a number; its inverse turns a number back out of a winding.
·From QI 23: you’ve met the result — here we see exactly how it’s assembled.
🔑 symbol decoder · every new mark, in plain words
φ (phi)the phase hidden in the eigenvalue: U|u⟩ = e2πiφ|u⟩, with φ between 0 and 1. counting registerthe n top qubits that will hold the binary readout of φ. controlled-U2ᵃapply U twice, four times, eight times… so each counting qubit grabs a different bit of φ. QFT† (inverse)run the QFT backward on the counting register to decode the winding into a plain integer. resolution 1/2ⁿthe bin width: n counting qubits split [0,1) into 2ⁿ equal slots. φ̂ (estimate)your readout: the measured integer y divided by 2ⁿ.
feel

Reading a gate’s secret number

A unitary spins its eigenstate by some angle and otherwise leaves it alone. That angle is the gate’s hidden number. Phase estimation gathers many copies of that spin into a counting register — doubling the dose for each qubit — so the register ends up winding at rate φ. Then the inverse QFT collapses that winding into a sharp peak at the bin closest to φ. Measure, divide, and you’ve read the number.

⏱️ everyday picture

You can’t read a clock’s rate from a single glance, but watch the second hand for a while and you can time it precisely. Phase estimation does the same: it lets the gate “tick” 1, 2, 4, 8… times into different qubits, so the slow-moving high bits and fast-moving low bits together pin down the rate. The inverse QFT is the read-off: it converts the accumulated ticking into a number on a dial.

recapLet U tick 1, 2, 4… times into a counting register, then inverse-QFT to read its rate φ as a number.
play

The readout histogram

Set the gate’s true phase φ and the number of counting qubits n. The bars show the probability of each possible readout. When 2ⁿφ is a whole number you get one perfect spike; otherwise the peak sits at the nearest bin, with a little spread. Add qubits to sharpen it.

▸ phase-estimation readoutmeasure the counting register
true φ {{ t.label }}
true phase φ = {{ phiStr }}
counting qubits n = {{ n }}  ({{ Npow }} bins)
most likely readout
y = {{ bestY }} = |{{ bestBin }}⟩
φ̂ = {{ bestY }}/{{ Npow }} = {{ estStr }}
P(peak) = {{ peakPct }}%
error |φ̂ − φ| = {{ errStr }}
{{ exactNote }}
recapThe readout peaks at the bin nearest 2ⁿφ; exact when 2ⁿφ is whole, and sharper with more qubits.
math

Kickback in, inverse QFT out

Put the n counting qubits in |+⟩ and the target in the eigenstate |u⟩. Each controlled-U2ᵃ kicks back the phase of that many U’s. After all of them the counting register holds exactly the QFT of the number 2ⁿφ:

(1/√N) ∑x e2πi xφ|x⟩   — a register winding at rate φ
apply QFT† → peaks at y ≈ 2ⁿφ,   φ̂ = y/2ⁿ

That winding state is precisely what the QFT was designed to read. So phase estimation = kickback writes the rate in, inverse QFT reads the number out. Each extra counting qubit doubles the bins, adding one more bit of φ.

✎ worked example · n = 3, φ = 0.5 vs φ = 0.3
1.3 qubits → 2³ = 8 bins, resolution 1/8 = 0.125
2.φ = 0.5: 2³·0.5 = 4 (whole) → single spike at |100⟩, φ̂ = 4/8 = 0.5 exact
3.φ = 0.3: 2³·0.3 = 2.4 (not whole) → peak at the nearest bin, y = 2
4.φ̂ = 2/8 = 0.25, off by 0.05; add qubits to shrink the error. ✓
recapKickback makes the counting register wind at rate φ; QFT† reads it as y ≈ 2ⁿφ.
⚠ common misconceptions

“You must already have the eigenstate.” Helpful, but not required. Feed any state — it’s a blend of eigenstates — and the algorithm returns one of their phases at random, weighted by how much of that eigenstate was present. Shor exploits exactly this.

“More counting qubits always means more accuracy for free.” They add resolution, but each also demands applying U up to 2ⁿ times — the cost grows too. And on noisy hardware those long controlled-U powers are the hard part.

“If 2ⁿφ isn’t a whole number the algorithm fails.” It still works — you just get a peaked distribution around the true value, and the most likely outcome is the closest bin. A few repeats nail it down.

✓ you can now
describe the QPE circuit: Hadamards, controlled-U2ᵃ, then inverse QFT
explain it as kickback (write the rate in) + inverse QFT (read the number out)
predict the readout y ≈ 2ⁿφ and the resolution 1/2ⁿ
say why it’s the workhorse behind Shor, chemistry, and more
← 06 The QFT next · 08 Shor, Assembled