QFT vs FFT Complexity
The Quantum Fourier Transform (QFT) on qubits computes the same mathematical object as the classical Discrete Fourier Transform (DFT) on elements — yet it does so with exponentially fewer operations. Understanding exactly where the saving comes from is essential before using the QFT as a subroutine in phase estimation or Shor's algorithm.
The classical FFT
The Fast Fourier Transform (FFT) invented by Cooley and Tukey evaluates the DFT of numbers in operations. For this is arithmetic operations. No classical algorithm can do better in general — computing all output amplitudes requires touching at least values.
Gate count of the QFT
The QFT circuit on qubits uses exactly Hadamard gates (one per qubit) and
two-qubit controlled-phase gates, for a combined total of
elementary gates. Since , this is — exponentially fewer operations than the classical .
To see where the controlled-phase count comes from: qubit (counting from the most significant, ) receives controlled- rotations from each of the subsequent qubits, giving
controlled-phase gates in total. Adding the Hadamards recovers the overall gate count.
The exponential caveat
The gate count is a genuine asymptotic improvement, but it carries a crucial qualification: the QFT only prepares the Fourier-transformed quantum state. Measuring that state samples from the output distribution, but does not directly hand you all Fourier coefficients.
In algorithms like phase estimation, only a single phase is needed — and the QFT delivers it efficiently. In Shor's algorithm, the QFT reveals the period of a modular function, again requiring only the dominant frequency. These are tasks where the quantum speedup is real and useful.
If your goal were to store and inspect all Fourier coefficients, the QFT would not help: you would need measurements to reconstruct the full output, recovering the classical barrier.
Side-by-side comparison
| Quantity | Classical FFT | QFT | |---|---|---| | Input size | complex numbers | -qubit state ( amplitudes) | | Operation count | | gates | | Output | All Fourier coefficients | Quantum state encoding them | | Readable outputs | (all coefficients) | (one sample per measurement) |
The table makes the trade-off concrete. The quantum circuit is exponentially faster at building the Fourier state, but exponential effort is needed to read it out in full. The power of the QFT lies in downstream quantum operations that exploit the state directly, without collapsing it first.
Approximate QFT
In practice, controlled- gates with contribute a global error less than and are dropped. This reduces the gate count to while preserving the output to within any desired precision — a further practical advantage over exact classical methods.
Sign in on the full site to ask questions and join the discussion.