ψQuantum Computing 2026

CHAPTER 12

Fourier transforms and phase estimation

Learning goals. Calculate a quantum Fourier transform, track bit reversal, derive the phase-estimation distribution, and account for controlled powers.

12.1 The QFT is a unitary change of amplitudes

For N=2nN=2^n, define

FN|x=1Ny=0N1e2πixy/N|y.F_N|x\rangle=\frac1{\sqrt N}\sum_{y=0}^{N-1} e^{2\pi ixy/N}|y\rangle.

The inverse uses the negative sign in the exponent. To verify unitarity, take the overlap of columns x and x’:

1Ny=0N1e2πi(xx)y/N=δxx.\frac1N\sum_{y=0}^{N-1}e^{2\pi i(x-x')y/N} =\delta_{xx'}.

For x≠x’, the ratio r=e2πi(xx)/Nr=e^{2\pi i(x-x')/N} obeys rN=1r^N=1 but r≠1, so the geometric sum (1rN)/(1r)(1-r^N)/(1-r) vanishes.

Worked example.

F4|1=|0+i|1|2i|32.F_4|1\rangle=\frac{|0\rangle+i|1\rangle-|2\rangle-i|3\rangle}{2}.

The four probabilities are equal. The transform has encoded x in relative phases. Measuring immediately in Z does not reveal those phases or return a table of classical Fourier coefficients.

For |ψ=xax|x|\psi\rangle=\sum_xa_x|x\rangle, the output amplitudes are by=N1/2xaxe2πixy/Nb_y=N^{-1/2}\sum_xa_xe^{2\pi ixy/N}. A QFT circuit can transform a register with O(n²) elementary controlled-phase and Hadamard gates, but generic amplitude loading and complete output readout can cost exponentially in n. Comparing this operation directly with an FFT that writes all N coefficients is an input-output mismatch.

12.2 Building the circuit and tracking order

Write x in binary. Factoring the phase across output bits gives tensor factors with binary-fraction phases. One standard construction applies H to a wire, controlled phase rotations from later wires, repeats down the register, and finally reverses wire order with swaps.

For two qubits in our most-significant-first convention, a forward QFT is: H on q0q_0; controlled phase π/2\pi/2 between q1q_1 and q0q_0; H on q1q_1; then SWAP. The controlled phase multiplies only |11|11\rangle by i. Omitting final swaps implements a bit-reversed output convention, not the exact F4F_4 defined above.

An exact two-qubit forward QFT in the book’s wire order. The controlled phase contributes i only to the 11 component; the final swap fixes output order.

Small controlled rotations can sometimes be omitted for an approximate QFT with a bounded error. A valid approximation statement specifies the norm or algorithmic success criterion, not just the number of gates removed.

Laboratory L16 — Fourier transform. Prepare a basis state or an editable periodic amplitude pattern. Inspect complex output amplitudes, switch forward/inverse sign, and apply the inverse to verify recovery.

12.3 Phase estimation derives a measurable phase

Suppose U|u=e2πiϕ|uU|u\rangle=e^{2\pi i\phi}|u\rangle, with 0ϕ<10\le\phi<1. Use an m-qubit control register, Q=2mQ=2^m, prepared uniformly. Controlled powers U2m1jU^{2^{m-1-j}} act from control wire j under our ordering. Phase kickback gives

1Qx=0Q1e2πiϕx|x|u.\frac1{\sqrt Q}\sum_{x=0}^{Q-1}e^{2\pi i\phi x}|x\rangle|u\rangle.

Phase estimation with three control qubits. Their powers are 4, 2, and 1 from top to bottom. The inverse QFT converts the kicked-back phase into a binary estimate.

Apply FQF_Q^\dagger to the controls. The amplitude of y is

Ay=1Qx=0Q1e2πix(ϕy/Q).A_y=\frac1Q\sum_{x=0}^{Q-1}e^{2\pi ix(\phi-y/Q)}.

If ϕ=k/Q\phi=k/Q exactly, orthogonality gives output y=k with certainty. Otherwise let δ=ϕy/Q\delta=\phi-y/Q. The geometric sum gives

p(y)=|Ay|2=sin2(πQδ)Q2sin2(πδ),p(y)=|A_y|^2 =\frac{\sin^2(\pi Q\delta)}{Q^2\sin^2(\pi\delta)},

using the continuous limiting value one when δ\delta is an integer. The distribution peaks near y/Q≈φ, including wraparound near zero.

Worked exact phase. Let m=3 and ϕ=3/8=0.0112\phi=3/8=0.011_2. The phase-kicked control amplitudes are e2πi3x/8/8e^{2\pi i3x/8}/\sqrt8. Inverse QFT returns integer three, bit string 011. The eigentarget stays in |u|u\rangle.

For a target superposition jcj|uj\sum_jc_j|u_j\rangle, linearity creates correlated phase-register and eigenstate branches. Resolvable eigenphases appear with probabilities approximately |cj|2|c_j|^2. Phase estimation does not generally return the expectation of U’s phase; it samples eigencomponents.

Laboratory L17 — Phase estimation. Adjust φ and control precision. Inspect the phase-kicked amplitudes, inverse-QFT distribution, sampled estimates, and circular error. Compare exactly representable and nearby phases.

12.4 Precision has a physical cost

m control qubits provide grid spacing 2m2^{-m}. But the controlled powers collectively use U a total of 1+2++2m1=2m11+2+\cdots+2^{m-1}=2^m-1 times if implemented by repetition. Thus increasing precision is not free because the QFT has only polynomial gate count.

Sometimes controlled powers can be implemented more efficiently using known structure, as in modular arithmetic. For Hamiltonian evolution, long controlled evolution time remains a resource. Iterative phase estimation can reduce simultaneous ancilla qubits by using repeated experiments and feed-forward, but does not remove the fundamental need for sufficient phase information [18, 19].

The eigenphase is only defined modulo one. When converting a Hamiltonian energy E using U=eiHtU=e^{-iHt}, ϕ=Et/(2π)\phi=-Et/(2\pi) modulo one. The energy range and evolution time must avoid ambiguity or supply a known offset. A phase estimate without its sign and units is incomplete.

12.5 Exercises

12.1. Calculate F4|2F_4|2\rangle.

Show solution / guidance

The phases are eiπy=(1)ye^{i\pi y}=(-1)^y, so the amplitudes are (1,1,1,1)/2(1,-1,1,-1)/2.

12.2. What does inverse QFT do to a uniform state?

Show solution / guidance

It returns |0|0\rangle, since the sum of all nontrivial roots of unity vanishes.

12.3. For m=4 and ϕ=11/16\phi=11/16, give the certain bit string in our convention.

Show solution / guidance

Integer 11 is 1011. The leftmost bit has weight eight.

12.4. How many repeated U applications implement all controlled powers for m=10?

Show solution / guidance

2101=10232^{10}-1=1023, excluding control overhead, preparation, QFT, and repetitions.

12.5. A target is (|u0+|u1)/2(|u_0\rangle+|u_1\rangle)/\sqrt2 with exactly resolvable phases 1/4 and 3/4. What does phase estimation measure?

Show solution / guidance

Each phase occurs with probability 1/21/2, and the target is conditioned on the associated eigenstate. It does not return their mean phase 1/2.