KnowledgeCookies logo Understanding the language of quantum science
QPicDepict / Quantum computing

Grover search

Repeated phase marking and reflection rotate a uniform state towards the marked search subspace.

Grover search infographic. A reading guide and explanation follow.
Ideal search, N=4N = 4 and M=1M = 1. k=0k = 0 0.25, k=1k = 1 1, k=2k = 2 0.25, k=3k = 3 0.25. Open full-size image Download PNG

How it works

  1. Prepare

    Put N basis states in a uniform superposition.

  2. Mark

    Apply an oracle that reverses the sign of amplitudes on marked states.

  3. Reflect

    Reflect about the uniform state. Together the two reflections rotate the state by 2θ2\theta in the marked–unmarked plane.

Equation and quantities

pk=sin⁡2 ⁣((2k+1)θ)p_k=\sin^2\!\bigl((2k+1)\theta\bigr)

Worked example

In a four-item search with one marked item, θ=π/6\theta = \pi /6 and one iteration gives sin⁡2(π/2)=1\sin^2(\pi/2)=1. The second iteration overshoots the target.

Why it matters

Grover provides a quadratic query improvement for unstructured search and generalizes to amplitude amplification.

Limits and assumptions

Query count excludes the cost of building and running an oracle. A practical algorithm must include oracle resources and data access.

Why can extra iterations make the answer worse?

The amplitude rotates periodically and passes the marked direction.

Related reading