Quantum phase estimation: exact readout, the 4/π² bound and the two-index 8/π² bound #
Category: 1-Mathlib (CSD-free).
Glossary: https://glossary.constraintsurfacedynamics.com/phase-estimation/
Plain-language, CSD-role and formal statements of phase estimation, with this
module as its Lean anchor. Kept symmetric by scripts/check-glossary.sh.
Phase estimation on a T-level counting register EuclideanSpace ℂ (Fin T), entirely generic
in T — the standard textbook results (Nielsen–Chuang §5.2), machine-checked:
The exact case. The inverse QFT inverts the QFT (
applyQFTinv_phaseColumn), so the phase state carrying an exact phasej₀/T— the QFT columnphaseColumn T j₀— is read out as|j₀⟩with certainty (phase_estimation_exact).The
4/π²bound (the headline). For an arbitrary real phaseφ, the phase statephaseStateR T φ = (1/√T) ∑_x e^{2πiφx} |x⟩read at the counting indexcclosest toφ·T(|φ − c/T| ≤ 1/(2T)) succeeds with probability at least4/π²(phase_estimation_lower_bound). The amplitude is the Dirichlet sum(1/T) ∑_{x<T} e^{2πi(φ−c/T)x}(applyQFTinv_phaseStateR_apply), closed bygeom_sum_eqand reduced to a ratio of sines viaComplex.norm_exp_I_mul_ofReal_sub_one(prob_phaseStateR_eq); the bound is the Jordan inequality (Real.mul_abs_le_abs_sin) on the numerator against|sin t| ≤ |t|(Real.abs_sin_le_abs) on the denominator.The two-index
8/π²bound. Both grid points straddlingφ·T—cat phase distance0 ≤ φ − c/T ≤ 1/Tandc + 1(read moduloT) — jointly carry at least8/π²(phase_estimation_two_index, BHMT Theorem 11 atk = 1), from the two-index Dirichlet bounddirichlet_two_indexand the elementary inequalitysin²(πx)(1/x² + 1/(1−x)²) ≥ 8(eight_mul_sq_le_sin_sq_pi_mul); a lower straddling index exists for every phase in[0, 1)(exists_straddle_index).
Support: applyQFT/applyQFTinv (the QFT action on the register, with the coordinate lemmas
applyQFT_apply/applyQFTinv_apply), on the Register.lean primitives basisState/prob.
Honest scope #
This is the single-phase statement: one phase state, one readout, the per-index bound. A
consumer racing several eigenvalue branches (Shor's r eigenvectors, say) must control the
cross-terms of its own joint state — that composition is the consumer's affair and is not done
here (Empirical/QM/Algorithms/ShorCore.lean documents the deferred two-register marginal).
Provenance: extracted verbatim from ShorCore.lean (S3 + S4, 2026-08-29) — the statements
never mentioned orders, orbits, or ZMod; no new mathematics. The Shor-specific bridge
(qftω_div, eigenPhase_eq_phaseColumn, shor_order_readout, shor_phase_estimation_lower_bound)
stays in ShorCore.lean.
The QFT action on the counting register #
The QFT action on the counting register.
Equations
Instances For
The inverse-QFT action on the counting register (Fᴴ).
Equations
Instances For
The exact case: a QFT column is read with certainty #
The QFT column j₀: the phase state (1/√T) ∑_x ω_T^{x j₀} |x⟩.
Equations
Instances For
Phase-estimation exactness: the inverse QFT inverts the QFT, so the QFT column j₀ is
sent back to the basis state |j₀⟩.
The exact case: phase estimation reads the QFT column j₀ with certainty.
The general case: the 4/π² lower bound (Dirichlet kernel) #
For a phase state carrying a real phase φ, inverse-QFT concentrates the amplitude near
c ≈ φ·T. When c is the closest counting index to φ·T (|φ − c/T| ≤ 1/(2T)), the readout
probability is at least 4/π², the Dirichlet-kernel constant.
The counting-register phase state carrying a real phase φ:
phaseStateR φ = (1/√T) ∑_x e^{2πi φ x} |x⟩. For φ = j₀/T this is phaseColumn T j₀, no
longer required to land on an exact QFT column.
Equations
- QuantumInfo.phaseStateR T φ = (↑√↑T)⁻¹ • ∑ x : Fin T, Complex.exp (2 * ↑Real.pi * Complex.I * ↑φ * ↑↑x) • QuantumInfo.basisState x
Instances For
The inverse-QFT amplitude of the phase state. Reading out index c, the amplitude is
the Dirichlet sum (1/T) ∑_{x<T} e^{2πi (φ − c/T) x}. The two (√T)⁻¹ factors (one from the
phase state, one from Fᴴ) collapse to T⁻¹; the per-term phases e^{2πiφx} and
conj(ω_T)^{xc} merge into e^{2πi(φ − c/T)x}.
The closed-form readout probability. With δ = φ − c/T and z = e^{2πiδ}: in the
on-resonance case δ = 0 the amplitude is 1 (so prob = 1); off resonance with
sin(πδ) ≠ 0 the geometric sum collapses (geom_sum_eq) and the norm reduces, via
Complex.norm_exp_I_mul_ofReal_sub_one, to prob = T⁻² · sin²(πδT) / sin²(πδ).
The 4/π² phase-estimation lower bound (HEADLINE). For any real phase φ and a
counting index c that is the closest index to φ·T (|φ − c/T| ≤ 1/(2T)), inverse-QFT reads
out c with probability at least 4/π². On resonance (φ = c/T) the probability is 1;
otherwise the Jordan inequality bounds the Dirichlet numerator from below and |sin t| ≤ |t|
the denominator from above. Nielsen–Chuang §5.2.
Both grid points: the two-index 8/π² bound (BHMT Theorem 11, k = 1) #
phase_estimation_lower_bound is the single-index 4/π². Counting both counting indices
straddling φ·T — the lower one at phase distance δ ∈ [0, 1/T] and the upper one at
1/T − δ — the pair carries 8/π². This is a genuinely two-index inequality on the Dirichlet
kernel: a single index at distance up to 1/T can carry probability 0. The analytic core is
eight_mul_sq_le_sin_sq_pi_mul, the elementary inequality
sin²(πx) (1/x² + 1/(1−x)²) ≥ 8 on (0, 1) (equality at x = 1/2).
The cosine range 1/4 ≤ x ≤ 1/2: sin(πx) = cos(πy) with y = 1/2 − x, cos t ≥ 1 − t²/2,
then a polynomial estimate in v = y² ≤ 1/16.
★ The two-point kernel inequality. For 0 < x < 1,
sin²(πx) · (x² + (1−x)²) ≥ 8 · (x(1−x))², i.e. sin²(πx)(1/x² + 1/(1−x)²) ≥ 8, with equality
at x = 1/2. The bound BHMT assert by calculus in the proof of their Theorem 11.
The phase state is 1-periodic in the phase: e^{2πi(φ+1)x} = e^{2πiφx}.
Reading index c at phase φ is reading index 0 at phase φ − c/T: the Dirichlet
amplitude depends only on the difference.
On resonance the readout is certain: prob (phaseStateR T 0) 0 = 1.
★ The two-index Dirichlet bound. For 0 ≤ δ ≤ 1/T the two readouts at phase distance
δ and δ − 1/T — the two grid points straddling the phase — jointly carry at least 8/π².
On the boundary one of them is on resonance; inside, both closed forms
(prob_phaseStateR_eq) share the numerator sin²(πδT), the denominators are bounded by
|sin t| ≤ |t|, and eight_mul_sq_le_sin_sq_pi_mul at x = δT finishes.
★★ The two-index phase-estimation bound (BHMT Theorem 11, k = 1, one phase). If the
counting index c sits at phase distance 0 ≤ φ − c/T ≤ 1/T below the phase, then c and
c + 1 — the two grid points straddling φ·T, the second read modulo T — jointly carry at
least 8/π².