Let . The quantum Fourier transform modulo is the unitary operator
Its images form the Fourier basis.
Changing the summation variable from to gives
Thus the quantum Fourier transform diagonalizes the cyclic shift.
For ,
Consequently the product states
form an eigenbasis, with corresponding eigenvalues
Choose a power of two with
Since the multiplicative order is less than , this guarantees . Prepare two quantum registers in the state
and use quantum modular exponentiation to obtain
Measure the second register. The order as the exact period of modular exponentiation implies that, conditional on the measured value, the first register is a normalized truncated periodic coset
where is the largest integer for which .
Apply the quantum Fourier transform to the first register and measure it, obtaining . The supplied Fourier-transform theorem states that, with probability of order , is an integer nearest to for some coprime to . On that event,
The supplied continued-fraction theorem, applied through continued-fraction recovery in quantum order finding, therefore recovers the reduced fraction from . Because and are coprime, its denominator is the exact order . The candidate is checked classically by verifying .
The quantum Fourier transform, quantum modular exponentiation, continued-fraction algorithm, and final modular check all take polynomial time in . Since , the successful event has probability of order , as required.
For , the quantum Fourier transform is
Its matrix is unitary because character orthogonality for the cyclic group gives orthogonal rows.
The matrix-element orthogonality theorem for irreducible unitary representations states
and . Consequently the normalized vectors
form an orthonormal basis. The non-abelian quantum Fourier transform is the unitary basis change
up to the harmless choice of transform direction and complex-conjugation convention.
Use control qubits and exact quantum phase estimation. A controlled on the unknown eigenstate can be synthesized from the available uncontrolled operation and the known eigenstate : conditionally swap into an auxiliary register initialized to , apply to that register, and swap back. The auxiliary state is restored, while the control-one branch acquires .
After Hadamard gates and these controlled powers, the control register is
The inverse quantum Fourier transform maps this state exactly to , so measurement determines with certainty. There are controlled swaps of qubits, each promised power costs , and the inverse transform uses elementary gates. The total cost is therefore .
Prepare , query the oracle, and measure or discard the output register. For , the input register becomes the coset state
Apply , the quantum Fourier transform over . The two amplitudes interfere destructively unless the binary inner product satisfies
and every vector in this orthogonal subspace is sampled uniformly. Repeat until independent equations have been collected, then use Gaussian elimination over to find their one-dimensional null space; its nonzero vector is . This is Simon's algorithm. It uses oracle queries with high probability and polynomial classical work. When , the function is injective and the samples eventually span all of , which distinguishes that case with arbitrarily high probability.
Writing , the quantum Fourier transform acts on a computational-basis state as
The two registers start in . A quantum Fourier transform on the first and evaluation of give
The first measurement, on the function register, returns . The compatible inputs are , so the normalized state becomes
Apply to the first register and put . Its state is
The geometric sum vanishes unless . Thus this is
up to the unchanged second register. The outcomes each have probability , in accordance with the quantum Fourier transform of a periodic coset state.
For the stated second outcome,
The continued-fraction algorithm therefore returns denominator . Since the numerator is coprime to the true period, exact period recovery from a Fourier sample succeeds, and direct evaluation confirms that the least period is
The quantum Fourier transform measurement supplies a rational approximation
where is the desired multiplicative order. Here
Its reduced continued fraction convergent has denominator two, so continued-fraction recovery in quantum order finding proposes . Direct order verification from divisors confirms it:
Hence
As a check, the classical final step of the Shor algorithm gives
Using the convention
part (ii) applies the extra phase to term . The resulting first register is the quantum Fourier transform of . Applying its inverse therefore produces
With , the quantum Fourier transform acts by
(The opposite phase convention gives the same measurement probabilities.)
With , the quantum Fourier transform over the additive group is
Start with and a zeroed second register. Apply the coherent construction from part (a)(iv) to obtain
Now run the inverse of the phase-estimation map from part (b) on the two registers. It erases the first label in both branches:
Discarding the zeroed register leaves the required quantum Fourier transform of the superposition. The coherent use of a computed label followed by its inverse is an uncomputation.
In quantum order finding, a phase produces amplitude after an inverse quantum Fourier transform. Its nearest grid point has probability at least , by bounding the sine ratio of this finite geometric Fourier amplitude. The initial modular orbit state is an equal-weight superposition of the phase eigenstates, so the phase label is uniform.
Quantum period finding Created 2026-09-24 Updated 2026-09-24
For a function of period dividing , prepare a uniform superposition of inputs, evaluate the function into a second register, and measure that register. The first register becomes a periodic coset state. Applying the quantum Fourier transform and measuring gives
A modular-addition quantum oracle for a linear function over the three-element finite field reveals its two coefficients in one query. Prepare the answer qutrit in , whose unit shift eigenvalue is . Quantum phase kickback produces a product of Fourier states labelled by the coefficients; inverse quantum Fourier transforms read both coefficients exactly.
Simon's algorithm 2026-09-28
Simon's algorithm prepares hidden-subgroup coset states, applies the quantum Fourier transform over , and samples vectors satisfying over . Repeated samples and Gaussian elimination recover with oracle queries and polynomial computation.