Algorithms

Quantum Fourier Transform

The quantum version of the discrete Fourier transform, used inside Shor's algorithm and phase estimation.

Definition

The quantum Fourier transform, or QFT, is a quantum circuit that applies the discrete Fourier transform to the amplitudes of a quantum state. It converts information stored in the phases of a register into information stored in the measurable bits, which is why it appears inside Shor's algorithm and quantum phase estimation.

In depth

The circuit is a pattern of Hadamard gates and controlled rotations. Each qubit receives a Hadamard, then controlled phase gates from the qubits below it with angles π/2, π/4, π/8 and so on, halving each time. The gate count is n Hadamards plus n(n − 1)/2 controlled phases, which is n(n + 1)/2 in total before swaps. For n = 3 that is 6 gates, for n = 10 it is 55, and for n = 2048 it is about 2.1 million.

The tiny rotations are a practical concern. The angle π/2^k becomes extremely small for large k, and real hardware cannot apply arbitrarily small rotations accurately. Approximate QFT circuits drop the smallest rotations and lose little accuracy, which reduces the gate count to roughly n log n.

The QFT is the bridge between phase and measurement. If a register holds a state whose phases advance by a fixed amount from one basis state to the next, the QFT converts that regular phase pattern into a sharp peak at one basis state. That is exactly how phase estimation and period finding extract their answers. Our Qiskit lesson on the quantum Fourier transform builds the circuit step by step.

Technical Definition

On n qubits, the QFT maps the basis state |j⟩ to (1/√N) Σ_k e^(2πi jk/N) |k⟩ with N = 2^n. It can be built from n Hadamard gates and n(n − 1)/2 controlled phase rotations, plus optional swaps to reverse the qubit order, for a total of order n² gates. The classical fast Fourier transform needs order n·2ⁿ operations on the same data.

Visual Explanation: An Analogy

Think of a musical chord played on a piano. The sound wave mixes several notes together, and a Fourier transform is the ear's ability to pick out which notes are present. The QFT does the same for a quantum state: it reads off which frequencies are hidden in the pattern of phases.

Key facts

ItemDetail
Gate countn(n + 1)/2 gates before swaps, order n²
Classical comparisonFFT takes order n·2ⁿ operations on 2ⁿ numbers
Main usesShor's algorithm, phase estimation
Approximate QFTDropping tiny rotations reduces cost to about n log n

Where the idea comes from

The quantum Fourier transform was developed in the early 1990s and became central when Peter Shor used it for period finding in 1994. Don Coppersmith described an approximate version with fewer gates.

Real-World Use Cases

  • Finding the period of a function in Shor's algorithm
  • Reading out the phase in quantum phase estimation
  • Quantum simulation and other algorithms that need frequency information

How it differs from related ideas

  • The classical FFT works on a list of numbers stored in memory, while the QFT works on amplitudes of a quantum state and cannot be read out directly.
  • Both transforms use the same mathematical definition, but the QFT uses exponentially fewer operations relative to the number of values.

Common Misconceptions

  • The QFT does not give you the full Fourier spectrum. A measurement returns one frequency sampled according to the squared amplitudes.
  • The QFT is not magically faster at the same job as the classical FFT. Its advantage appears only when the input is already a quantum state, produced by a larger algorithm.

Frequently asked questions

How many gates does a QFT on 3 qubits need?

Three Hadamards and three controlled phase gates, six gates in total, plus an optional swap.

Is the QFT used outside Shor's algorithm?

Yes. It is part of phase estimation and of algorithms for simulation, linear systems and others.

Why is the output order reversed?

The standard circuit produces the output qubits in reverse order, so a final swap layer is often added.

Related Terms

Learn it in a lesson

← Back to the dictionary