The exact circuit for the Fourier transform on n qubits, read off from the product representation - n Hadamards, n(n-1)/2 controlled phase rotations and a final reversal of the qubit order - with a proof that it is correct.
Established resultMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01
AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.
Gates.H, and for k≥2 the phase gate
Rk=diag(1,e2πi/2k)=P(2π/2k) controlled by another
qubit. The controlled-Rk gate is symmetric in its two qubits: it multiplies
∣11⟩ by e2πi/2k and fixes the other basis states.
Input.n qubits in a basis state ∣j1j2⋯jn⟩ (or any
superposition, by linearity), qubit m holding bit jm (qubit m is the wire
labelled qm−1 in the diagram, so q0 holds the most significant bit).
Procedure. For m=1,2,…,n:
apply H to qubit m;
for k=2,…,n−m+1, apply controlled-Rk with control qubit
m+k−1 and target qubit m.
Finally reverse the order of the qubits with ⌊n/2⌋ SWAP gates
(qubit m with qubit n+1−m).
The four-qubit QFT. Qubit q0 holds the most significant input bit. Each wire receives a Hadamard and then controlled phase rotations from the wires below it; the angle halves with each step down. The two SWAP gates reverse the order of the wires.
Correctness. Consider stage m. Qubits m+1,…,n have not been touched yet
and still hold jm+1,…,jn. The Hadamard maps ∣jm⟩ to
(∣0⟩+e2πi0.jm∣1⟩)/2, since (−1)jm=e2πijm/2.
Controlled-Rk with control jm+k−1 multiplies the ∣1⟩ component by
e2πijm+k−1/2k, which appends the digit jm+k−1 at position k of the
binary fraction. After the stage, qubit m is in
(∣0⟩+e2πi0.jmjm+1⋯jn∣1⟩)/2 and is not touched
again. By the product representation this is
the factor that belongs on output qubit ℓ=n−m+1, so after the reversal the
register is in F2n∣j⟩.
Cost.n Hadamards, ∑m=1n(n−m)=n(n−1)/2 controlled rotations and
⌊n/2⌋ SWAPs: Θ(n2) gates on n qubits with no ancillas. The
reversal is often omitted and the output wires relabelled instead. The
inverseF2n† is the same circuit run backwards with every angle negated.
Claude (AI drafting assistant)Writing, original draft (CRediT roles)
Review history
Automated source check · Pass with notes · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)
Procedure, correctness argument and gate counts re-derived; the circuit (H then controlled-R_k from qubit m+k-1, final reversal) simulated exactly for n = 1..5 and found equal to the defining matrix of F_(2^n); count n(n-1)/2 of controlled rotations confirmed in the same run; the four-qubit diagram checked gate by gate against the procedure (CP(pi/2) = R_2 etc.). Attributions compared with Coppersmith arXiv:quant-ph/0201067 (two-bit phase-shift network, truncated AFFT with about Lm operations, bit-reversed output), Cleve-Ekert-Macchiavello-Mosca arXiv:quant-ph/9708016 Section 4 (eqs. 4.2-4.6), and Nielsen-Chuang Section 5.1 via the publisher's table of contents.
The procedure numbers qubits 1..n while the assumption and diagram use q0 for the most significant bit; added a clause mapping qubit m to wire q_(m-1) so the indexing is unambiguous.
Revision history
2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10
Current revision 8d5e6616fefc1014. Source file knowledge/records/algorithm/quantum-fourier-transform-circuit.md in the content repository (readable there once it is public).