When the phase φ is exactly representable in n bits — meaning 2nφ is an integer — the inverse QFT collapses the counting register onto the single correct state and measurement succeeds with probability 1. Real-world phases are rarely so cooperative. This lesson analyses what happens when φ falls between two consecutive n-bit grid points.
The general amplitude formula
Write the true phase as φ. After phase kickback and before the inverse QFT, the counting register holds
2n1∑k=02n−1e2πikφ∣k⟩.
Let b be any candidate integer in {0,1,…,2n−1}. The inverse QFT maps this state to one whose amplitude on ∣b⟩ is
αb=2n1∑k=02n−1e2πik(φ−b/2n).
Setting δ=φ−b/2n (the mismatch between φ and the grid point b/2n), the geometric sum evaluates to
αb=2n1⋅1−e2πiδ1−e2πi⋅2nδ(δ=0).
The measurement probability is ∣αb∣2. Using ∣1−eiθ∣=2∣sin(θ/2)∣:
P(b)=2nsin(πδ)sin(π⋅2nδ)2.
The best estimate
The best estimate is the integer m such that ∣m/2n−φ∣ is smallest, i.e. ∣δ∣≤1/2n+1. For that estimate the mismatch satisfies ∣δ∣≤1/(2⋅2n), and it can be shown that
P(m)≥π24≈0.405.
This bound is tight: it is achieved in the worst case ∣δ∣=1/(2⋅2n) and follows from the inequality sinθ≤θ (for θ≥0) combined with the bound sinθ≥2θ/π for θ∈[0,π/2]. Concretely,
At ∣δ∣=1/(2⋅2n) the numerator is ∣sin(π/2)∣=1 and the denominator is π/2, giving (2/π)2=4/π2.
Amplifying the success probability
Several strategies push the success probability above 4/π2:
Use more counting qubits. Each additional qubit doubles the grid resolution, making a worst-case tie less likely and increasing the typical probability.
Repeat and take the median. Running QPE O(log(1/δ)) times and taking the median estimate reduces the failure probability to δ exponentially fast.
Phase amplification. Quantum amplitude amplification can be used to boost the success probability of any QPE run from 4/π2 to near 1 with a modest circuit overhead.
Numerical check
For the T gate, φ=1/8. With n=3 counting qubits, 23φ=1 is exactly an integer, so P=1 and QPE is deterministic. To see the non-trivial bound you need a phase like φ=1/3, where no power of 2 makes 2nφ an integer. For n=3 and φ=1/3, the best estimate is m=3 (since 3/8=0.375 is closest to 1/3≈0.333), giving ∣δ∣=1/24, and the exact probability is
P(3)=8sin(π/24)sin(π/3)2≈0.688,
comfortably above 4/π2≈0.405 as the bound guarantees.
Try it
QPE's worst-case success probability for the best estimate is 4/π2. Return that value as a number.
Run your code to see the quantum state.
Sign in on the full site to ask questions and join the discussion.