Project: Benchmark Grover
Grover's algorithm is not just a one-shot circuit — it is a loop. You apply an oracle-then-diffuser block times, and the success probability oscillates with . Knowing where the peak is and confirming it experimentally is the first step in benchmarking any quantum search.
How success probability varies with iterations
For a search space of items with exactly one marked item, the probability of finding that item after Grover iterations is
The circuit rotates the initial equal superposition toward the marked state by each iteration. After iterations the state is as close to the marked item as the rotation can take it.
For (four computational basis states, ):
The probability after iterations is therefore
| | | | |-----|--------------|--------| | 0 | | | | 1 | | | | 2 | | | | 3 | | |
The algorithm peaks at with certainty and then falls back — running too many iterations is worse than running too few. A benchmark must find this peak.
Circuit structure for two qubits
A single Grover iteration on consists of:
- Superposition layer — apply to start from the uniform state .
- Oracle — the phase-kickback oracle for the marked state is a controlled-: , leaving all other states unchanged.
- Grover diffuser — reflection about , implemented as .
The diffuser sandwiches the "flip about zero" operation between two changes of basis. In the basis "flip about zero" maps every amplitude to except , which stays positive, producing the mean-inversion that amplifies the oracle-marked state.
Try it
Complete the circuit by adding the oracle and the diffuser. The grader measures the output
distribution — all probability should land on (the "11" outcome) after
exactly one optimal iteration.
After grading, try mentally replacing the one-iteration structure with two iterations: the table above predicts , identical to the zero-iteration baseline. That is the overshoot phenomenon every Grover benchmark must guard against.
Sign in on the full site to ask questions and join the discussion.