Simon’s problem (1994) is the first example of a problem where the quantum algorithm is exponentially faster than the best possible classical algorithm, even if the classical algorithm uses randomness. This was a huge deal at the time — Deutsch-Jozsa’s speedup depended on insisting on zero error, but Simon’s speedup doesn’t. It’s genuine.
And historically, Simon’s algorithm is the direct ancestor of Shor’s factoring algorithm. The core idea — using the quantum Fourier transform to extract hidden periodicity — is the same in both.
The problem
You’re given with the promise that there exists a hidden period , , such that:
In words: is 2-to-1, and two inputs map to the same output if and only if they differ by . Your job: find .
The classical lower bound
Think about how you’d approach this classically. You need to find two distinct inputs such that — then . This is essentially a collision search.
By the birthday paradox, you expect to find a collision after about queries. That’s still exponential in . And this is actually the best classical algorithm (with or without randomness): any classical algorithm needs exponentially many queries.
The quantum algorithm
Quantum algorithm: queries. That’s polynomially many — an exponential speedup, no caveats.
The structure is, again, “Hadamard, oracle, Hadamard”:
- Initialize qubits: “input” and “output” registers, all in .
- Apply to each input qubit: uniform superposition on the input register.
- Apply the oracle: .
- Measure the output register. This leaves the input register in a superposition of exactly two values: for some random .
- Apply to each input qubit.
- Measure the input register. The measurement outcome satisfies .
A single run yields one linear equation in (over ). Repeat the algorithm times to get independent linear equations, and solve the resulting linear system to find .
Why it works
After step 4, the input register holds an equal superposition of the two inputs that share the measured output value:
Apply :
Factor the phase:
The amplitude on is zero unless . So measurement always yields a orthogonal (in ) to . Collect such s, and you can solve for up to the one-dimensional null space.
Why it matters
Simon’s algorithm is the template for Shor’s factoring algorithm. Shor’s insight was: factoring a number reduces to finding the period of the function for a randomly chosen . The quantum Fourier transform generalizes Simon’s Hadamard trick from the group to , which is exactly what you need to extract periodic structure from modular exponentiation.
Simon’s isn’t the headline algorithm, but it’s the one that convinced Shor the approach would work on a deeper problem.
What’s next
Grover’s search is the other famous quantum algorithm. It’s not exponentially faster than classical, but it gives a quadratic speedup for an enormous class of problems: unstructured search. This is the algorithm you get to actually see running in the next lesson.