Project 05 · Ladder 2 · Intermediate
Grover's Algorithm: build the fastest quantum search there can ever be
How it works
- Sixteen names, all equally likely. One of them is the name you're looking for.
- Each round, the oracle flips the target's sign (red) and the diffuser reflects every bar about the mean.
- After three rounds the target holds about 96% of the probability: one name in 16, found in three looks.
Build the fastest quantum search that can ever exist. That's not a slogan, it's a proof: no quantum algorithm can search an unsorted list faster than Grover's. Build it gate by gate, then watch 4 qubits find one name in 16 in 3 looks instead of 8.5.
- Level
- Intermediate
- Hours
- 5 to 7
- Automated tests
- 20
- Ships to
- GitHub
What you build
Grover's Search in Python and Qiskit
In 1996 Lov Grover showed that a quantum computer can find a marked item in an unsorted list of N items with about √N questions, where any classical method needs about N/2 on average. In 1997 Bennett, Bernstein, Brassard and Vazirani proved that no quantum algorithm can do it with fewer, and in 1999 Christof Zalka showed that Grover's algorithm meets that limit exactly.
You build Grover's algorithm from individual gates, use it to look up a name in a 16-entry database with 4 qubits, prove with an exact statevector that your circuit matches the textbook formula to nine decimal places, and chart the strange, beautiful way the success rate rises, peaks and falls again if you keep going. Then you learn exactly where quantum search wins. That's what makes you sound like a quantum engineer, not a press release.
The quantum ideas inside
- Phase oracles
- The diffuser
- Amplitude amplification
- Statevectors
- Quadratic speed-up
Warm up free: the Deutsch-Jozsa and Bernstein-Vazirani tutorials in Qiskit use the same ideas, in one script you can run tonight.
Real output · Project 05Qiskit Aer simulator
python quantum_search.py --target Lise --seed 7 --plot search_results.png
Database: 16 entries, 4 qubits. Target(s): ['Lise']
Classical linear search: found 'Lise' at index 12 after 13 checks (average over random orderings: 8.5)
Grover: optimal iterations k = 3 (one oracle query each), theory P(success) = 0.9613
One Grover iteration (oracle + diffuser):
(your circuit drawing: Section 7, Step 3 shows it)
Most frequent result: 'Lise'. Simulated success rate: 0.956 over 1024 shots
k=0: simulated 0.074 theory 0.062
k=1: simulated 0.454 theory 0.473
k=2: simulated 0.897 theory 0.908
k=3: simulated 0.966 theory 0.961
(and on to k=8: Section 8 shows every line)
Chart saved to search_results.png
By the end
What you walk away with
- a phase oracle and a diffuser built from basic gates
- a complete Grover circuit that finds one or several targets among 2ⁿ entries
- a classical linear-search baseline with the exact expected number of checks
search_results.png: the result histogram and the famous rise-and-fall curve, theory against simulation- 20 tests, including exact statevector checks that need no statistics at all, plus 5 bonus tests for Grover's strangest edge cases
- a public GitHub repo, a portfolio paragraph and a LinkedIn post
Where it sits
Ladder 2: Intermediate
IntermediateLadder 2
Grover's Search
Find one name in 16 in 3 looks.
Quantum Maze Solver
An oracle that never sees the answer.
BB84 Key Distribution
Catch a spy on the line. Its inventors won the 2025 Turing Award.
Your first circuit is 10 minutes away
Stop watching quantum. Start shipping it.
$0 today. 7 days free, then $7.99 a week or $190 a year. Cancel any time.