QFT on Periodic States
The quantum Fourier transform is far more than a clever circuit: it is the key that unlocks periodicity hidden inside a quantum state. Whenever amplitudes repeat with period in a register of size , the QFT concentrates all measurement probability on the multiples of . This "periodicity detection" is the engine of Shor's factoring algorithm and quantum phase estimation.
Periodic states
Call a state -periodic in an -qubit register if its amplitudes satisfy for all , with . A simple example for () and is the uniform superposition over even computational-basis states:
The amplitudes are at and zero at — a period-2 pattern in an 8-element register.
This state is easy to prepare: qubits 0 and 1 each get a Hadamard (creating ) while qubit 2 stays at , giving . The tensor product expands to exactly when qubit 0 is the most significant bit.
What the QFT does to a periodic state
The QFT maps . Applying this linearly to and switching the order of summation:
The inner sum is a geometric series in . It equals 4 whenever and 0 otherwise (the complex phases cancel for all other ). So:
Measuring yields or each with probability . Both outcomes are multiples of — the spacing in frequency space that corresponds to the spacing in the original state.
The 3-qubit QFT circuit (with bit reversal)
The standard circuit for the 3-qubit QFT proceeds qubit by qubit and ends with a SWAP to correct the output bit order (because the product-form derivation builds qubits in reversed order):
- , then with control , target , then with control , target .
- , then with control , target .
- .
- to restore standard bit order.
Without the SWAP the circuit still implements a valid unitary (the bit-reversed QFT), but the
output frequencies appear at permuted positions. Including the SWAP ensures that the outcome
is reported as the binary string 100, and as 000 — exactly the results
the calculation above predicts.
Try it
The starter code prepares the period-2 state and contains the QFT rotation steps. Add the final
SWAP and the measurement. The grader checks the output distribution: it should place
roughly 50% of probability on 000 and 50% on 100.
After running, open the Probabilities tab. You will see two equal bars at positions 0 and 4 — every other outcome has probability zero. That is the QFT's periodicity fingerprint: a state with in an space maps to peaks spaced exactly apart in frequency space.
Sign in on the full site to ask questions and join the discussion.