Quantum Fourier Transform
The discrete Fourier transform over the cyclic group is a fixed unitary change of basis — the same linear map that a classical fast Fourier transform computes in arithmetic operations. The quantum Fourier transform (QFT) performs that identical map, but on the complex amplitudes that live inside the state of just qubits, and it does so with only elementary gates. That is an exponential compression of the transform itself, and it is why the QFT sits at the heart of almost every quantum algorithm with an exponential speedup. The engine behind the efficient circuit is the product (Coppersmith) form. When , the QFT of a computational basis state does not entangle the output qubits at all: it factors into a tensor product in which the -th output qubit carries a single relative phase written as a binary fraction. Each factor is manufactured by one Hadamard followed by a short cascade of controlled-phase rotations conditioned on the lower-order input bits, and a final layer of SWAPs reverses the qubit order. One must be honest about what the QFT does not buy. Like quantum parallelism, it cannot hand you a classical Fourier spectrum: a single measurement afterwards returns one index with probability , not the whole vector of amplitudes. The power appears only when the input carries hidden periodic structure — as in order finding or Simon's algorithm — so that interference concentrates the output onto multiples of and reveals the period . Conceptually the QFT is the character transform of an abelian group: it diagonalizes cyclic shifts and turns translation-invariant information into localized labels.
- The QFT is the unitary that sends a basis state over to the Fourier superposition — a change to the "frequency" basis.
- For it factors into a tensor product of single-qubit phases, giving a circuit of Hadamard and controlled-phase gates, exponentially cheaper than the classical FFT.
- Physically it turns the period or eigenphase hidden in a state's relative phases into a position in the computational basis that a measurement can read.
- It is the working engine of quantum phase estimation, order finding, Shor's factoring and discrete-log algorithms, and the whole abelian hidden-subgroup framework.
- The QFT alone gives no speedup: it needs an oracle to first prepare a periodic state and (in factoring) classical continued-fraction post-processing; dropping its tiny rotations yields the approximate QFT used under fault tolerance.
- Key idea: the QFT diagonalizes cyclic shifts, so it transforms a hidden period (or eigenphase) encoded in relative phases into a measurable position in the computational basis, and for it factors into single-qubit phases, giving an -gate circuit.
The QFT diagonalizes cyclic shifts, so it converts a hidden period (or eigenphase) carried in a state's relative phases into a position in the computational basis that a single measurement can read out; for the transform factors into single-qubit phases, giving an -gate circuit.
Where this lives today
The QFT is now a line item in every serious estimate of what a code-breaking quantum computer would cost. In the landmark 2019 resource analysis by Gidney and Ekerå, factoring a 2048-bit RSA integer is projected to take about 8 hours on roughly 20 million noisy physical qubits — and a central reason that number is even conceivable is that the QFT (in its approximate, rotation-truncated form) and the surrounding phase-estimation circuitry are so gate-efficient. Phase estimation built on small QFTs and inverse QFTs is routinely demonstrated on trapped-ion and superconducting processors, and it is the workhorse subroutine proposed for early fault-tolerant quantum chemistry, where a molecule's ground-state energy reduces to reading an eigenphase to several bits. The same transform, run over as , powers Simon's and Bernstein–Vazirani algorithms, and its generalization is the open frontier: the non-abelian hidden subgroup problem — whose solution would crack graph isomorphism and certain lattice problems — is unsolved because no efficient QFT-style interference is known for the relevant non-commuting groups.
The physical picture
Think of the QFT as the quantum way of asking "what frequencies are present?" If a state's amplitudes repeat with period — the same complex weight every basis states — the transform routes that periodicity into a handful of sharp peaks at the multiples of , while destructive interference cancels everything between. A hidden period in real space becomes a visible spike in Fourier space, and the trick of order finding and Shor's algorithm is to make the answer you want the location of one of those spikes. The circuit that does this is astonishingly cheap. Each output qubit of the QFT ends up holding one bit of a binary-fraction phase : a Hadamard extracts the leading bit's phase into the relative phase, and the controlled rotations add finer corrections from the less significant input bits. The circuit literally writes a number's binary expansion into a chain of phases, as the first figure shows for three qubits.
Underneath the circuit is a piece of pure structure: the QFT diagonalizes the cyclic shift . Its eigenvectors are exactly the Fourier states, with eigenvalues , so anything built out of shifts — any periodic function — becomes block-diagonal after the transform, which is why periodic information localizes. No information is created: the QFT is unitary, hence reversible, and its magic is purely interferential — a basis in which the answer you want is localized and one measurement is informative. The second figure shows that interference concretely, with numbers.
The core equations
The definition is a single line: the QFT relabels every basis state by the full set of characters (roots of unity) evaluated at that state. It is written most compactly by its action on a basis vector, from which linearity fixes its action on any superposition.
where: — dimension of the cyclic group , and for qubits ; — computational basis state, an integer ; — the -th character (root of unity) of . The input index sets the rate at which the output phase winds across , spreading a "position" into a phase gradient. Assembling those column vectors gives the matrix — a symmetric, unitary matrix of equal-modulus roots of unity, entirely fixed once is chosen.
where: — the primitive -th root of unity; — the matrix element in row , column . Every entry has modulus , so all of the transform's selectivity comes from phase interference, never amplitude weighting. The whole efficiency of the circuit rests on one algebraic fact: for the transformed state does not entangle its output qubits but factors into a tensor product of single-qubit states, each carrying a binary-fraction phase.
where: — the binary expansion, ; — a binary fraction. The first output qubit holds only , the last holds the full tail — which is why the outputs emerge in reversed bit order. Each tensor factor is produced by a fixed toolkit: a Hadamard plus controlled versions of the phase gate .
where: — the Hadamard gate, itself the single-qubit QFT; — the phase gate applying to . The angle halves with every extra qubit of separation, so distant controls contribute exponentially tiny rotations — the fact that later makes the approximate QFT possible. Counting those gates gives the headline complexity, whose comparison with the classical FFT is the entire point of the subroutine.
where: — the number of qubits, ; — controlled-phase gates; — the Hadamards; and a further SWAPs undo the bit reversal. The quantum cost is polynomial in while the classical cost is quasilinear in — an exponential separation. Finally, the structural fact that makes the QFT natural for periodic problems: it diagonalizes the cyclic shift.
where: — the cyclic shift (translation) operator on ; — the eigenvalue of the shift on Fourier eigenstate . In the Fourier basis translation is a pure phase, so periodic data is diagonal and its structure becomes discrete labels .
The QFT is only a legitimate quantum operation if it is unitary — norm-preserving and reversible — so before using it we must prove . The goal here is to establish that directly from the matrix elements of equation (2), using the single most important identity in the subject: a complete sum of -th roots of unity vanishes unless the exponent is a multiple of . Every interference argument in Fourier-based quantum algorithms is this one geometric sum in a different costume, worth seeing cleanly once.
Step 1. Multiply the matrix by its conjugate transpose element-by-element. Since and carries the conjugate phase , the entry is . Why: unitarity means the columns are orthonormal, and this sum is the inner product of columns and .
Step 2. Evaluate the geometric series . If every term is and the sum is . If then is itself a nontrivial root of unity, and the finite geometric sum because . Hence . Why: this "roots of unity sum to zero" fact is the mathematical form of destructive interference — off-diagonal overlaps cancel perfectly.
Step 3. Substitute back: , so . The transform is unitary, its inverse is (the same matrix with ), and it runs backwards at identical cost. Why: the inverse QFT — not the forward one — appears at the end of phase estimation, so equal cost matters in practice.
Go deeper · Derivation B · 1 minFrom the exponential sum to the product-form circuit
The definition (1) is a sum over terms, which looks like it should cost exponentially many operations. The goal here is to show it collapses into a tensor product of single-qubit states, and then to read the elementary circuit — Hadamards and controlled rotations — straight off that product. This is the Coppersmith factorization, the precise reason a transform over an exponentially large space needs only polynomially many gates.
Step 1. Expand the output index in binary, , so that and the exponent becomes . Why: splitting into bits lets the one big sum split into independent per-qubit sums.
Step 2. Because the exponential of a sum is a product, , and summing over all turns the into a tensor product , one factor for each output bit . Why: this is where the state factorizes — no output entanglement, so each qubit is built separately.
Step 3. Simplify each phase. In the integer part of contributes and drops out, leaving only the fractional binary tail: . This is precisely the product form (3). Why: only the low-order bits of survive in each factor, fixing which controls each gate needs.
Step 4. Build one output qubit. A Hadamard on qubit maps , writing the leading fractional bit. Then each lower qubit supplies a controlled- that appends its bit, extending the phase to the full . Processing qubits in turn realizes every factor. Why: the controlled rotations stitch the less significant input bits into one qubit's relative phase.
Step 5. Count and clean up. The construction uses Hadamards, controlled rotations, and SWAPs to reverse the output order, for gates total — the exponential improvement over the FFT's . Why: the swaps are needed because the product form delivers qubit holding , in reversed significance.
Go deeper · Derivation C · 1 minHow a hidden period becomes a comb of measurable peaks
Limiting cases
How the QFT specializes and degrades:
| Case | Result | Meaning |
|---|---|---|
| (one qubit) | the single-qubit QFT is exactly the Hadamard; the whole case is , the transform behind Deutsch–Jozsa, Bernstein–Vazirani and Simon | |
| Approximate QFT | drop with , error | discarding rotations below angle gives an -gate circuit with provably small operator-norm error; essential under fault tolerance |
| Inverse / phase estimation | phase estimation applies to read an eigenphase; the inverse just conjugates the phase, same gate count | |
| Non-power-of-two | no exact qubit tensor factorization | the clean product form needs ; for other one embeds into with and recovers the answer by continued fractions |
Worked examples
1 · Reading a period off the two-qubit QFT (fully worked)
Take () and the period-2 state . Apply explicitly and show the output is peaked on the multiples of .
Step 1. Write the two needed columns of from equation (1) with . For : . For the phases are , so .
Step 2. Superpose with the prefactor: . The terms cancel and the terms reinforce: .
Step 3. Read the distribution. Measurement gives or , each with probability , and never or — exactly the multiples of , matching equation (7) with . The period-2 input produces peaks only at and , each with probability 0.5; the spacing betrays .
2 · The exponential gate advantage, and what the approximate QFT saves
Compare the quantum and classical cost of Fourier-transforming registers of and qubits, then estimate how much the approximate QFT trims the large case.
Step 1. For (): the exact QFT uses Hadamard-and-controlled-phase gates plus SWAPs, so gates total. The classical FFT on points costs operations — already a factor of roughly .
Step 2. For (): the QFT still needs only gates, while the classical FFT needs operations — a circuit smaller by about 13 orders of magnitude, an exponential separation rather than a constant-factor win.
Step 3. Trim with the approximate QFT. To hold the operator-norm error below it suffices to keep controlled rotations down to level ; for , this is , so . Each qubit then carries at most rotations, giving — about half the exact count, and an scaling that keeps the fault-tolerant rotation-synthesis cost bounded. Exact: ; approximate: with error .
Physics of the portrait
The QFT is where the classical fast Fourier transform meets quantum interference and becomes exponentially cheaper. Its efficient circuit has a clear author: the cryptographer who, in a short 1994 IBM note written in the wake of Shor's algorithm, wrote down both the product-form circuit and its approximate cousin.
Origins · 1 minDon Coppersmith and how this was discovered
Don Coppersmith is an American mathematician and cryptographer who spent most of his career at IBM's Thomas J. Watson Research Center — a gold medallist at the 1971 International Mathematical Olympiad, a three-time Putnam Fellow, and the author of a remarkable spread of results from the design of DES to the Coppersmith–Winograd matrix-multiplication algorithm and "Coppersmith's method" of small-root attacks on RSA. In 1994, immediately after Peter Shor announced a polynomial-time quantum factoring algorithm, Coppersmith circulated a brief IBM note, An Approximate Fourier Transform Useful in Quantum Factoring, that did two lasting things. First, it laid out the tensor-product ("product form") circuit for the QFT on qubits — the arrangement of Hadamards and controlled-phase rotations that every textbook now draws. Second, it observed that the controlled rotations shrink geometrically with qubit separation, so the tiny ones can simply be dropped: the resulting approximate transform costs only gates yet is provably close in operator norm. That second point matters enormously for fault-tolerant machines, where each precise rotation is expensive to synthesize from a discrete gate set — the approximate QFT is what keeps Shor's algorithm affordable in a resource count.
Going further
Texts. Nielsen & Chuang, Quantum Computation and Quantum Information, §5.1 (QFT) and §5.3 (order finding) · Preskill, Lecture Notes on Quantum Computation, Ch. 6 · Kitaev, Shen & Vyalyi, Classical and Quantum Computation, Ch. 13 · Mermin, Quantum Computer Science, Ch. 3 · Watrous, The Theory of Quantum Information · Coppersmith, An Approximate Fourier Transform Useful in Quantum Factoring (IBM Research, 1994). The peak probability in the period-to-peaks result is (amplitude ). Key identities to keep in mind: ; the binary-fraction factorization of underlies the product form; the gate count is ; the two-qubit example gives ; and .
Builds on: Quantum Parallelism and the Oracle Model · Simon's Algorithm. Leads to: Quantum Phase Estimation · Order Finding and Period Finding · Shor's Factoring Algorithm · Hidden Subgroup Problem.
Ask the tutor: Ask me to run the two- or three-qubit QFT by hand on a state of your choice, or to walk through how the period-to-peaks interference powers Shor's algorithm.
Is the QFT just the classical FFT run on a quantum computer?
Not quite — it is the same linear map, but the quantum version buys something the classical one cannot. The classical FFT explicitly outputs all Fourier amplitudes in steps. The QFT acts on the amplitudes encoded in the state of qubits and rearranges them in gates — exponentially fewer operations. The catch is access: you never see all output amplitudes, only one measured index. So the QFT is not a faster FFT for classical data; it is a device for interfering amplitudes you have already arranged, so a measurement lands informatively.
Why do the output qubits come out in reversed bit order?
It falls straight out of the product form. Output qubit ends up holding the binary fraction , so the first output qubit carries only the least significant input bit , while the last carries the whole tail . The significance order of the outputs is therefore the mirror image of the inputs. You fix it with SWAP gates exchanging qubit with qubit , or simply relabel the wires and let the next circuit absorb the reversal. Either way it is bookkeeping, not physics.
What is the QFT over Z₂ⁿ, and why does it look so different?
Over the group — the Boolean cube, not the cyclic group of order — the Fourier transform is simply , a Hadamard on every qubit and nothing else. There are no controlled-phase gates because every character is just , a sign rather than a general root of unity. This is the transform behind Deutsch–Jozsa, Bernstein–Vazirani and Simon's algorithm. It differs from the QFT because the underlying group differs: is a product of two-element groups, whereas is a single cyclic group of size , so their character tables — hence their Fourier transforms — are genuinely distinct.
Where exactly does the exponential speedup in Shor's algorithm come from?
Not from the QFT by itself — the speedup is a partnership. First, a modular-exponentiation oracle uses quantum parallelism to prepare a state periodic in the exponent register, with period equal to the multiplicative order you want. Second, the QFT converts that period into a distribution sharply peaked at multiples of — this is where interference does the real work, cheaply. Third, a measurement plus a classical continued-fraction computation extracts . Remove any leg and the advantage vanishes: without the oracle there is no periodicity to transform, without the QFT the period stays hidden in inaccessible phases, and without continued fractions the measured peak is not yet the answer.
How accurate does each controlled rotation have to be?
Less accurate than you would guess, which is the whole point of the approximate QFT. The controlled rotation between qubits and applies an angle , which halves with every extra qubit of separation, so distant pairs contribute exponentially tiny phases. Coppersmith noticed you can simply omit every rotation below a cutoff level and keep the total operator-norm error under ; choosing holds the error below while cutting the gate count from to . This matters most under fault tolerance, where each arbitrary rotation is expensive to synthesize from a discrete gate set.
In what sense is the QFT the "natural" transform for periodic problems?
Because it diagonalizes the cyclic shift . The eigenvectors of are precisely the Fourier states , with eigenvalues — a pure phase. Any operator built out of shifts (any translation-invariant, i.e. periodic, structure) is therefore diagonal in the Fourier basis, so what was smeared across many positions in real space becomes a set of isolated labels . That is exactly why a hidden period turns into discrete, measurable peaks: periodicity is invariance under a shift, and the QFT is the basis in which shifts stop mixing states and act by phases alone.