Sign in
← Atlas
Strong empiricalAlgorithmsFourier transform primitive

Quantum Fourier Transform

The unitary that maps computational basis states to Fourier-basis phase patterns, and the phase-estimation primitive behind Shor's and HHL's speedups.

fourier transformphase estimationqftcircuit primitive

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

The QFT is the quantum analogue of the discrete Fourier transform, acting on amplitudes rather than a classical vector. It underlies period finding, phase estimation, and several Hamiltonian-simulation techniques.

Circuit & simulation
Uniform across 8 outcomes (|0⟩ input)13%
8th-root-of-unity phase pattern (|1⟩ input)13%
What this takes and returns
TakesNothingWhat joins here

No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.

Nothing in the Atlas meets this end.

ReturnsNothingWhat joins here

No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.

Nothing in the Atlas meets this end.

This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →

Where this sits

This record is named by the layer graph at:

  • Phase estimation into an ancilla register Method

    Takes A circuit for U that can be applied as controlled U^(2^j), a preparation routine for a state whose overlap with the target eigenvector is not negligible, the number of bits of the phase wanted, and the failure probability that may be tolerated. Returns An estimate of the eigenphase to the requested number of bits, with the failure probability it was obtained at, plus the two costs that actually differ between routes: how many ancillas were held at once, and how many sequential rounds were run.

How it works

The Quantum Fourier Transform on nn qubits (N=2nN=2^n basis states) is the unitary

QFTNj=1Nk=0N1e2πijk/Nk.\mathrm{QFT}_N|j\rangle = \frac{1}{\sqrt{N}}\sum_{k=0}^{N-1} e^{2\pi i jk/N}|k\rangle .

Unlike the classical discrete Fourier transform, which returns a full length-NN output vector, the QFT acts on the amplitudes of an nn-qubit register and its output can only be sampled through measurement — it is a resource for building algorithms, not a way to read out a classical spectrum for free.

Circuit structure. The standard decomposition applies, for each qubit jj (most significant first), a Hadamard followed by controlled phase gates Rk=diag(1,e2πi/2k)R_k=\mathrm{diag}(1,e^{2\pi i/2^k}) controlled by the less significant qubits, and finishes with a reversal of qubit order (implemented as n/2\lfloor n/2\rfloor SWAPs, or by relabeling wires in software). This gives exactly nn Hadamards and n(n1)/2n(n-1)/2 controlled-phase gates: O(n2)O(n^2) gates total. Coppersmith's approximate QFT drops controlled rotations with angle smaller than 2π/2m2\pi/2^m for a cutoff mm, reducing the gate count to O(nlogn)O(n\log n) while introducing only exponentially small error for many downstream uses (period finding, phase estimation).

Small worked instance. Take n=3n=3 (N=8N=8) and the input j=0=000|j=0\rangle = |000\rangle. Every phase factor e2πi0k/8=1e^{2\pi i \cdot 0 \cdot k/8}=1, so

QFT8000=18k=07k,\mathrm{QFT}_8|000\rangle = \frac{1}{\sqrt8}\sum_{k=0}^{7}|k\rangle,

exactly the state produced by applying HH to each of the three qubits independently — a directly checkable identity, since no controlled phase can fire when every control qubit is 0|0\rangle. For j=1j=1, QFT8001=18ke2πik/8k\mathrm{QFT}_8|001\rangle=\frac{1}{\sqrt8}\sum_k e^{2\pi i k/8}|k\rangle, i.e. the amplitudes trace out the eight 8th roots of unity in order — exactly the classical DFT of a Kronecker delta at index 1.

Where it is used. The QFT (or its inverse) is the last step of quantum phase estimation, the core of Shor's period-finding routine, and a building block for quantum arithmetic and some Hamiltonian-simulation schemes.

Implementation
Native
quantum_fourier_transform.py
from qiskit import QuantumCircuit
import numpy as np

def qft(n):
    qc = QuantumCircuit(n, name="QFT")
    for j in range(n):
        qc.h(j)
        for k in range(j + 1, n):
            qc.cp(np.pi / 2 ** (k - j), k, j)
    for i in range(n // 2):
        qc.swap(i, n - i - 1)
    return qc

qc = QuantumCircuit(3, 3)
qc.append(qft(3), [0, 1, 2])
qc.measure(range(3), range(3))

FINAL_CIRCUIT = qc
Quantum vs classical
MetricClassicalQuantum
Operation countO(N log N) — FFTO(n²) = O(log²N)
Register sizeN complex valuesn = log₂N qubits
Output accessfull vectorsampled amplitudes only

Classical baseline

The classical fast Fourier transform (FFT) computes a full length-N output vector explicitly in O(N log N) arithmetic operations.

Quantum claim

The QFT transforms the amplitudes of an n = log N qubit register with O(n²) gates, but the output is only accessible through sampling, not as a free classical vector.

How to compare

Compare circuit depth, approximation cutoff, state preparation cost, and the actual downstream measurement objective against the classical FFT cost for the same task.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
An approximate Fourier transform useful in quantum factoring2002 · D. Coppersmith

Introduces the approximate QFT that drops small-angle controlled rotations, giving O(n log n) gates.

arxiv.org/abs/quant-ph/0201067
Quantum Computation and Quantum Information: 10th Anniversary Edition2010 · Michael A. Nielsen and Isaac L. Chuang

Standard textbook derivation of the QFT circuit and its role in phase estimation (Ch. 5).

doi.org/10.1017/cbo9780511976667