Grover's Search
Find one item in an unsorted list of N in about √N steps — by making the wrong answers cancel each other out.
Grover's Search visualization
Bars are amplitudes, not probabilities — they can go negative. The dashed amber line is the mean the diffusion step reflects about.
Searching without looking
An unsorted list of N items takes about N/2 checks classically: there is nothing to exploit, so you look at entries one at a time until one matches. Grover finds the marked item in roughly √N steps instead — for a million items, about a thousand.
It does not do this by being clever about the list. It does it by putting every candidate into superposition at once and then arranging for the wrong answers to interfere destructively while the right one survives.
The two moves
The oracle flips the sign of the marked amplitude. Press Step once and watch: the marked bar goes negative, and nothing gets taller. Measured at that moment, the state is exactly as useless as it was before — every outcome is still equally likely.
The diffusion step then reflects every amplitude about their mean. Because the marked amplitude sits far below the mean, reflecting it throws it far above. Step through and watch the amber mean line: after the sign flip the mean drops slightly, and the reflection converts that asymmetry into height on exactly one bar.
Why you can overshoot
Keep pressing Step past the optimum and the probability of the marked state goes back down. Grover is a rotation in a two-dimensional plane — one axis is the marked state, the other is everything else — and each iteration turns the state by a fixed angle toward the answer.
Run it too long and you rotate straight past. That is why the iteration count matters, and why the optimal number is ⌊(π/4)√N⌋ = 1 here rather than “as many as you can afford”.
Quantum advantage at scale
The 2-3 qubit demo above is small enough to watch step by step, but the formula driving it — ⌊(π/4)√N⌋ Grover iterations against up to N classical checks — holds at any size. Drag the slider to see where the gap actually becomes dramatic.
652× fewer queries than an average-case classical search, at this size.
This is a query-count comparison, not a wall-clock benchmark — Qubit16’s simulator runs on an ordinary CPU, so it cannot demonstrate real quantum hardware speed, and no page on this site claims it does. What the formula above describes is the actual, provable basis for Grover’s speedup: the quadratic gap between N and √N is a mathematical property of the algorithm, not a hardware claim, and you can verify it yourself at small N by counting the steps in the live demo above.
Keep going
Build this yourself
Every visualization on this page is computed by the same engine as the simulator. Open it to place the gates by hand, up to 16 qubits, free and without an account. Or install Qubit16 so the whole lab is one tap away and works offline.