Grover search
Also known as Grover's algorithm, Amplitude amplification
quantum quantum-planning
Grover search finds a marked candidate among N = 2^n basis states with about √N oracle queries, where a classical scan needs about N. It prepares the even superposition and repeats a Grover iteration: a phase oracle flips the sign of every state whose candidate passes the validity check, and the diffusion H, X, MCZ, X, H reflects the state about the even superposition. With M marked states and sin²θ = M/N, search_known runs k = ⌊π/(4θ)⌋ iterations (none when M = 0 or M ≥ N), measures once and checks the measured candidate classically, so it returns only a valid index and returns nothing with probability at most M/N. Each oracle application and each check counts as one query, so a run costs k + 1; the simulator's work per basis state does not count, and it holds at most 24 qubits, with qubit 0 as the least significant bit of the index. Use it when you know how many solutions exist and want to compare query counts with a classical scan; for an unknown count, use BBHT.
Pseudocode
algorithm Grover-Search(oracle, n, M)input: phase oracle over N = 2ⁿ basis states, n ≤ 24 qubits, qubit 0 the lowest index bitinput: the number M of marked statesoutput: a marked index, or nilif M = 0 or M ≥ N thenk ← 0 ▷ iterations cannot helpelseθ ← arcsin √(M / N)k ← ⌊π / (4θ)⌋ ▷ success probability sin²((2k + 1)θ)amplify(oracle, k)i ← sample(measure all qubits)if check(oracle, i) then ▷ one classical queryreturn ireturn nil ▷ probability at most M / N; run againprocedure amplify(oracle, k)ψ ← H on every qubit of |0…0⟩ ▷ the even superpositionfor t in 1, …, k donegate every basis state that oracle marks ▷ one quantum queryapply H, X, MCZ, X, H to all qubits ▷ diffusion, up to a global phase of −1In the crates
quantum-planningAmplitude amplification with a phase oracle built from a validity check, run on the state-vector simulator for a known number of solutions, counting oracle queries.
Lineage
Comes from
Nothing on this site.
Led to
BBHT exponential search builds on it
Papers
- A fast quantum mechanical algorithm for database search Lov K. Grover · 1996· Proceedings of the 28th Annual ACM Symposium on Theory of Computing (STOC 1996)
- Tight Bounds on Quantum Searching Michel Boyer, Gilles Brassard, Peter Høyer, Alain Tapp · 1998· Fortschritte der Physik