1. Start with uniform superposition (all equal)
2. Oracle: flip the sign of the target state
3. Diffusion: reflect all amplitudes about the mean
4. Repeat ~π/4 · √N times for maximum probability
Grover's algorithm finds a marked item in an unsorted database of N items using only √N queries — a quadratic speedup over the classical O(N) search. It works by repeatedly applying two operations: an oracle that flips the phase of the target state, and a diffusion operator that amplifies the marked amplitude while suppressing the rest.
Each iteration (called a "Grover step") rotates the state vector slightly toward the target. After approximately π/4 × √N iterations, the target state's probability is near 100%. Crucially, too many iterations overshoot — the probability starts decreasing, making timing essential.
This interactive lets you choose the number of qubits and target state, then step through the oracle and diffusion operations one at a time, watching amplitude amplification unfold in the probability histogram.