Unstructured Search
Imagine a phone book with entries listed in random order. You want to find the one entry for "Alice." Classically the only strategy is to check entries one by one. On average you need checks; in the worst case, . No classical algorithm — deterministic or randomised — can do better than queries in the worst case when the list has no structure to exploit.
This is the unstructured search problem: given a black-box function
that returns for exactly one "marked" input and for all others, find using as few evaluations of as possible.
Why "unstructured"?
The word unstructured means reveals nothing beyond its output. There is no sorted order, no index, no hash table — each item looks the same until you query it. The function is therefore modelled as an oracle: a sealed box that answers when you hand it , but whose internals you cannot inspect.
Classical lower bound
Suppose you have queried distinct inputs and all returned . The marked item could be any of the remaining unchecked inputs with equal probability, so no algorithm can guarantee success in fewer than queries in the worst case. A randomised search finds in expected queries. The lower bound is tight: a simple sequential scan achieves .
The quantum advantage
In 1996 Lov Grover showed that a quantum computer can solve unstructured search in oracle queries, achieving a quadratic speedup over any classical approach. For that means roughly queries instead of — a million-fold practical difference.
The speedup is provably optimal: Bennett, Bernstein, Brassard, and Vazirani proved in 1997 that any quantum algorithm requires queries, so Grover's algorithm is asymptotically tight.
| Strategy | Query complexity | |---|---| | Classical worst-case | | | Classical average-case (random) | | | Grover's algorithm | |
The key ingredient is amplitude amplification: starting from a uniform superposition over all inputs, each Grover iteration steers probability toward using the oracle and a reflection operator called the diffuser. After iterations the marked state has amplitude close to , so a single measurement finds it with high probability.
What comes next
The rest of this module unpacks each component:
- The search oracle encodes as a phase-kickback gate.
- The diffuser reflects amplitudes about their mean.
- Putting it together — the full Grover iteration and its geometric interpretation as a sequence of rotations in a two-dimensional plane.
- Multi-solution search — handling the case where more than one item is marked.
By the end you will implement Grover's algorithm for small instances directly in the circuit simulator and watch the probability concentrate on the marked item in real time.
Sign in on the full site to ask questions and join the discussion.