The QFT versus the classical FFT: what the speed-up really is
n squared gates on n qubits sounds exponentially cheaper than the n times 2^n steps of the fast Fourier transform. The gap is real, but only if you can load the input and live with reading a single sample.
8 min read · reviewed December 2026
The classical side
A naive Fourier transform of N numbers takes about N² multiplications, since each of the N outputs is a sum of N terms. The fast Fourier transform, published in its modern form by Cooley and Tukey in 1965, reduces this to about N log N by splitting the sum recursively into even and odd parts. It is one of the most heavily used algorithms in computing, and for the sizes people use in practice it is extremely fast.
With N = 2^n, the classical cost is about n·2^n arithmetic operations. For n = 30, which means about a billion numbers, that is around thirty billion operations. The count grows a little faster than the vector length itself.
The quantum side
The QFT circuit on n qubits uses n(n − 1)/2 controlled phases, n Hadamards and ⌊n/2⌋ swaps, as the previous guide counted. For n = 30 that is 435 + 30 + 15 = 480 gates. The table below puts the exact gate counts next to the classical count. The gap grows without limit, since n² against n·2^n is polynomial against exponential in n.
| Qubits n | Hadamards | Controlled phases | Swaps | Total gates | Classical FFT, about n·2^n |
|---|---|---|---|---|---|
| 4 | 4 | 6 | 2 | 12 | 64 |
| 8 | 8 | 28 | 4 | 40 | 2,048 |
| 16 | 16 | 120 | 8 | 144 | 1,048,576 |
| 32 | 32 | 496 | 16 | 544 | 137,438,953,472 |
| 64 | 64 | 2016 | 32 | 2112 | 64 × 2^64 |
The catch, part one: getting data in
The classical FFT starts from a list of N numbers that already sits in memory. The QFT starts from a quantum state whose amplitudes are those numbers. Preparing a general state with N arbitrary amplitudes takes, in the worst case, a number of operations that grows with N, which cancels the advantage before the transform even starts. The QFT only pays off when the input state can be prepared cheaply, for example because it comes out of an earlier quantum step. In Shor’s algorithm, the input is a periodic state produced by modular exponentiation on a superposition, which is cheap relative to N.
The catch, part two: getting data out
At the end of the classical FFT, you hold all N output numbers. At the end of the QFT, you hold a quantum state with N amplitudes, and a measurement gives you one n-bit outcome drawn with probability equal to the squared size of the amplitude. You cannot copy the state to read the amplitudes one by one. To estimate all N amplitudes to a fixed accuracy you would need a number of runs that grows with N.
So the QFT is not a drop-in replacement for the FFT. It is a way to make a peak appear at a location that you then read with one or a few measurements. The algorithms that use it are designed so that this is enough: the position of the peak is the answer.
When is it useful?
The two main users are period finding, covered in a separate guide, and phase estimation. Both take advantage of the same fact: a state with a hidden regularity is cheap to make, and the QFT turns the regularity into a readable number.
- When the input state has hidden structure, such as a period, that the transform will concentrate into a few outputs.
- When the input is prepared by a quantum process rather than stored as data.
- When the answer you want is a property, such as the period or a phase, that a peak reveals in one measurement.
Compare like with like. The QFT’s gate count is for a transform you cannot read out in full. The FFT’s operation count is for a transform you can.
A fair way to say it
It is accurate to say that the QFT circuit is exponentially smaller than the best known classical circuit for the same linear map on the same N amplitudes. It is not accurate to say that quantum computers compute Fourier transforms exponentially faster, without adding that the input and output conditions above are part of the claim. The honest summary is that the QFT is a subroutine whose advantage is real inside algorithms that are built to use it.
Try it
Questions
Does the QFT make Fourier analysis of my data faster?
Not for ordinary data. Loading N numbers into amplitudes costs about N operations and reading them back needs many repeated runs.
Where does the exponential gap come from?
From the circuit: n² gates acting on 2^n amplitudes at once. The register is exponentially large in the number of qubits, while the gate count is not.
Is the classical FFT optimal?
It is the best widely used algorithm, at about N log N. A matching lower bound for general inputs is not something I can cite here.
Read next
Sources and further reading
- P. Shor, “Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer” (1994, journal version 1997)
- A. Kitaev, “Quantum measurements and the Abelian stabilizer problem” (1995)
- R. Cleve, A. Ekert, C. Macchiavello and M. Mosca, “Quantum algorithms revisited” (1998)
- D. Coppersmith, “An approximate Fourier transform useful in quantum factoring” (1994, IBM research report)
- J. Cooley and J. Tukey, “An algorithm for the machine calculation of complex Fourier series” (1965)
- M. Nielsen and I. Chuang, Quantum Computation and Quantum Information, chapter 5
Check the original sources for exact citations.