The Quantum Fourier Transform

qc/algorithms

The QFT is the classical Discrete Fourier Transform () applied to a quantum state instead of a classical array: . Key insight: the QFT circuit itself is exponentially cheaper than the classical FFT — gates versus the FFT’s — but that speedup evaporates the moment you need real classical data in or out, which is why the QFT is almost never used to “Fourier-transform a dataset” and instead shows up buried inside other algorithms like Quantum Phase Estimation (QPE).

Circuit

Built from Hadamards and controlled phase gates — the same general phase gate already defined in Z Gate and Relative Phase, just with . Each qubit gets an followed by controlled- gates from every qubit below it, then a final qubit-reversal (swap) pass restores the expected bit order:

from qiskit.circuit.library import QFT
qc = QFT(num_qubits=4)   # or build by hand: H + controlled-P_k per qubit + swaps

Why the speedup doesn’t survive contact with real data

Loading a classical array of values into amplitude-encoded form () costs at least operations — you have to touch every data point once — which already erases the QFT’s asymptotic advantage before the transform even runs. Reading the output back out is worse: extracting all amplitudes needs exponentially many measurement shots unless the output distribution happens to be sharply peaked. This is exactly why Quantum Phase Estimation (QPE) exists as the QFT’s real use case — QPE never loads a classical signal; it only ever reads a phase already encoded by a quantum evolution , and only ever needs a peaked output (the eigenvalue), so neither of the QFT’s usual failure modes applies.

Self-Check

  • Why is the QFT circuit exponentially cheaper than the classical FFT, and why doesn’t that make it useful for Fourier-transforming ordinary classical data?
  • What are the controlled- gates inside the QFT circuit, in terms of a gate already covered in Z Gate and Relative Phase?
  • Why does Quantum Phase Estimation (QPE) avoid both of the QFT’s usual bottlenecks (data loading and output readout)?