Part IV. Protocols and Algorithms · Chapter 32
Phase Estimation
Phase estimation turns "this unitary has structure" into a number: it reads eigenphases at a precision you choose and pay for, one counting qubit at a time.
In this chapter 9 sections
Reader question. How does quantum phase estimation convert an eigenphase into a bit string, and what controls its precision and success probability?
Controlled powers of a unitary accumulate binary-weighted phase on a counting register, and an inverse QFT converts that phase pattern into a sampled estimate; counting-register width, input eigenstate overlap, controlled-U cost, and approximation determine the useful precision.
- Eigenstate preparation and controlled powers remain explicit resource costs.
- A t-bit register yields a distribution whose accuracy depends on the phase and success criterion, rather than t guaranteed correct bits.
The eigenphase contract
Specify U|u>=e^{2πiφ}|u> and input overlap.
Every unitary has eigenstates that it leaves alone except for a phase:
Phase estimation is the algorithm that measures . Prepare the eigenstate on one register, put counting qubits into superposition on another, apply controlled powers of —, , , and so on, each controlled by one counting qubit—and finish with the inverse QFT. The counting register then holds an -bit estimate of , readable by an ordinary measurement.
This single subroutine is the engine room of the algorithms that made the field famous. Factoring, discrete logarithms, quantum chemistry energies, linear-systems solvers; all can be reframed as "learn a phase of a structured unitary." Learn to read a phase-estimation circuit and you can read most of the heavyweight algorithm literature.
Evidence boundary. Phase estimation estimates an eigenvalue phase using controlled powers and inverse QFT. Kitaev's Abelian stabilizer formulation is a primary source for the phase-estimation method; the textbook and lecture notes provide later systematic treatments. [A. Yu. Kitaev] [Michael A. Nielsen] [John Preskill]
Binary-weighted powers write a phase gradient
Trace each counting qubit after controlled U^{2^j}.
If U|psi>=exp(2 pi i phi)|psi>, controlled powers U^(2^j) write phases exp(2 pi i 2^j phi) on the control register. The inverse QFT converts that gradient into an m-bit estimate. Counting m controlled operations can conceal exponential evolution time: expanded base-U use totals 2^m-1 applications.
Evidence boundary. Finite counting-register width produces a probability distribution whose concentration depends on phase representability and precision. [John Watrous] [Don Coppersmith]
Inverse QFT decodes the exact-grid case
Derive a deterministic representable phase.
The counting register sets the resolution:
Each additional counting qubit doubles the resolution; and demands controlled applications of ever-higher powers of . The inverse QFT that gets all the attention is, by comparison, a modest tail of Hadamards and controlled phase gates:
The accounting is the lesson: how many counting qubits do you need? is simultaneously a question about the precision your application requires and about the deepest, most expensive part of the circuit. Precision is not a footnote to phase estimation. It is the budget.
Evidence boundary. Resource cost depends on controlled powers of U and eigenstate preparation, not only counting qubits. [Peter W. Shor] [National Academies of Sciences]
Notation contract: φ∈[0,1); U|u>=e^{2πiφ}|u>; t counting qubits; bit significance and inverse-QFT convention declared.
Off-grid phases spread probability
Calculate the nearest estimates and success mass.
When 2^m phi is not an integer, the inverse-QFT amplitudes form a Dirichlet-kernel distribution rather than a single basis state. The nearest integer is most likely, but success within a requested error needs enough precision bits and repetitions. Report the complete distribution or a confidence bound; a rounded binary string alone hides the algorithm's probabilistic contract.
Resource account: precision carries a controlled-evolution bill
Account for qubits, maximum power, synthesis, and repetitions.
| Resource | Required account |
|---|---|
| Counting qubits | m, giving grid spacing 2^-m before confidence padding. |
| Controlled evolutions | Powers U, U^2, ..., U^(2^(m-1)); expanded base-U use totals 2^m-1. |
| Inverse QFT | m Hadamards and m(m-1)/2 controlled rotations before approximation. |
| Repetitions | Chosen from the required success interval for off-grid phases and input eigenstate overlap. |
| State preparation | Separate gate/depth/success budget; never charge it implicitly to the phase register. |
Phase estimation is a subroutine with a sharp interface:
- Input: an eigenstate of , or a state with useful overlap on one;
- Operation: controlled powers of , up to ;
- Register: counting qubits;
- Transform: inverse QFT;
- Output: a sampled -bit phase estimate;
- Post-processing: interpret the bits, with a confidence statement.
The interface is only as useful as its feasibility conditions. Textbook diagrams assume the input is an eigenstate. Real workflows often prepare a superposition of eigenstates, so the measurement samples from several phases at once; still useful, but the output is evidence with probabilities attached, and the state-preparation cost belongs in the budget next to the controlled unitaries.
Eigenstate preparation is a separate algorithm
Expose overlap and postselection consequences.
Phase estimation preserves an eigenstate and reports its phase only when that eigenstate is supplied. A superposition of eigenstates produces the corresponding mixture of phase estimates and projects onto one component. Preparing appreciable overlap with the desired eigenstate can dominate chemistry or simulation workflows, so it belongs as its own resource and success assumption.
Phase-estimation precision workbench
| Field | Reader-visible record |
|---|---|
| Format | Statevector simulator with exact/off-grid cases and controlled-power ledger |
| Verification | Tests exactly representable phases, off-grid distributions, inverse-QFT ordering, precision scaling, and explicit controlled-U call counts. |
| Availability | Source-embedded acceptance record; no separate download is claimed |
{
"artifact": "Phase-estimation precision workbench",
"format": "Statevector simulator with exact/off-grid cases and controlled-power ledger",
"acceptance_test": "Tests exactly representable phases, off-grid distributions, inverse-QFT ordering, precision scaling, and explicit controlled-U call counts.",
"publication_state": "source-embedded contract and worked fixture"
}Executable reference fixture
Run with Python 3.11 or later. The final assertion is the chapter-level pass condition for this small instance.
import cmath
def phase_distribution(bits, theta):
if type(bits) is not int or bits < 1 or not 0.0 <= theta < 1.0:
raise ValueError("bits must be positive and phase must be in [0, 1)")
size = 2 ** bits
probabilities = []
for outcome in range(size):
amplitude = sum(cmath.exp(2j * cmath.pi * k * (theta - outcome / size))
for k in range(size)) / size
probabilities.append(abs(amplitude) ** 2)
return probabilities
def estimate(bits, theta):
probabilities = phase_distribution(bits, theta)
peak = max(range(len(probabilities)), key=probabilities.__getitem__)
return {"bits": bits, "peak": peak, "phase": peak / (2 ** bits),
"peak_probability": probabilities[peak], "mass": sum(probabilities)}
exact = estimate(3, 3 / 8)
coarse = estimate(3, 1 / 3)
fine = estimate(5, 1 / 3)
invalid_rejected = False
try:
estimate(3, 1.0)
except ValueError:
invalid_rejected = True
assert exact["peak"] == 3 and abs(exact["mass"] - 1.0) < 1e-12
assert abs(fine["phase"] - 1 / 3) < abs(coarse["phase"] - 1 / 3)
assert invalid_rejected and exact["peak_probability"] > 1.0 - 1e-12
print(f"PASS: 32 phase estimation exact={exact['peak']:03b} coarse_error={abs(coarse['phase']-1/3):.6f} fine_error={abs(fine['phase']-1/3):.6f}")
Scope boundary
- Eigenstate preparation and controlled powers remain explicit resource costs.
- A t-bit register yields a distribution whose accuracy depends on the phase and success criterion, rather than t guaranteed correct bits.
Depth commitment. One exact derivation, one off-grid case, one overlap boundary, and one resource ledger.
Practice problem
Run three-bit phase estimation for φ=3/8 and φ=0.3; derive the first output exactly and compare the second with simulated probabilities.
- Deliverable
- Controlled-phase states, inverse-QFT result, probability table, and controlled-U ledger.
- Pass condition
- The workbench asserts output 011 for 3/8 under the declared bit order and reproduces the off-grid distribution.
Verification record
Expected solution form. Exact-grid derivation plus off-grid numerical report.
Model answer. For three bits and phi=3/8, phase estimation returns 011 with probability one. For phi=0.3, the distribution follows the squared Dirichlet-kernel amplitudes and peaks at y=2 (phase 0.25), with y=3 next. The largest controlled power is U^4; powers 1,2,4 represent seven base-U applications if expanded.
Model result and check. CI compares analytic and simulated probabilities and recomputes maximum power/query cost.
Acceptance test. The workbench asserts output 011 for 3/8 under the declared bit order and reproduces the off-grid distribution.
Companion work
Artifacts for this chapter
These entries resolve to checked-in local source. Commands are reproduced exactly from the chapter manifest, and source-embedded fixtures are exported as direct downloads.
algorithm fixture
Phase-estimation precision workbench
Reproduce or test
python3 tools/validate_briefs.py --briefs data/editorial_briefs_00_35.json --from 0 --through 35 --check-rewritten-sources --execute-artifacts
Provenance
Sources and review
- A. Yu. Kitaev. Quantum measurements and the Abelian Stabilizer Problem. arXiv. 1995primary preprint
- Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press. 2010textbook
- John Preskill. Lecture Notes for Physics 219: Quantum Computation. California Institute of Technology. 2018graduate lecture notes
- John Watrous. The Theory of Quantum Information. Cambridge University Press / University of Waterloo. 2018textbook
- Don Coppersmith. An approximate Fourier transform useful in quantum factoring. IBM Research report / arXiv. 2002primary paper
- Peter W. Shor. Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Journal on Computing. 1997primary paper
- National Academies of Sciences, Engineering, and Medicine. Quantum Computing: Progress and Prospects. National Academies Press. 2019consensus study report
The load-bearing claims in the chapter are mapped inline to this registered source set. A citation supports only the bounded claim beside it.