intermediate · Programming · The Quantum Fourier Transform
QFT on One Qubit
The Quantum Fourier Transform (QFT) is the quantum analogue of the discrete Fourier transform
(DFT). For an n-qubit register it maps computational basis states as
QFTn∣j⟩=2n1k=0∑2n−1e2πijk/2n∣k⟩.
Before building the full n-qubit circuit it pays to study the smallest case: a single qubit.
In matrix form, using the columns QFT1∣0⟩ and QFT1∣1⟩:
QFT1=21(111−1)=H.
The single-qubit QFT is the Hadamard gate — exactly the gate you already know.
Why the DFT viewpoint matters
The classical DFT maps a length-N vector x to its frequency components Xk=∑jxje2πijk/N.
The QFT does the same thing but encodes the 2n amplitudes of a quantum state, operating in O(n2)
gates rather than the classical fast Fourier transform's O(n⋅2n) — an exponential speedup in
circuit depth. For n=1 there is a single amplitude "frequency component" and one Hadamard suffices.
Try it
Implement the 1-qubit QFT. The grader checks the unitary matrix of your circuit, so an empty
circuit will not pass.
Run your code to see the quantum state.
After running, the statevector panel shows both amplitudes equal to 1/2≈0.707 when
started from ∣0⟩ — consistent with H∣0⟩=∣+⟩.
Sign in on the full site to ask questions and join the discussion.