The geometry of Grover: why each iteration is a rotation

Grover’s algorithm moves a state vector around a plane by a fixed angle each time. Seeing that picture explains the √N count and the overshoot.

8 min read · reviewed December 2026

Two directions are enough

Group the candidates into two sets: the M correct answers and the N − M wrong ones. Let |good⟩ be the equal superposition of all correct answers and |bad⟩ the equal superposition of all wrong ones. These two directions are perpendicular, and the whole algorithm happens in the plane they span.

The starting state, an equal superposition of everything, is a mix of the two: cos θ·|bad⟩ + sin θ·|good⟩, where sin θ = √(M/N). For one correct answer among a million, θ is tiny, about 0.001 radians. The state starts almost perfectly along |bad⟩.

sin θ = √(M / N)

start state = cos θ·|bad⟩ + sin θ·|good⟩

The oracle is a reflection

Flipping the sign of the good part, and leaving the bad part alone, is a reflection of the plane across the |bad⟩ axis. The state moves from angle θ above the bad axis to angle θ below it.

Diffusion is a second reflection

Reflecting every amplitude about the mean is a reflection across the starting state itself. Two reflections in a row make a rotation. The rotation angle is twice the angle between the two mirror lines, which is 2θ.

So each Grover iteration rotates the state by 2θ towards |good⟩. After k iterations the state sits at angle (2k + 1)θ from the bad axis.

after k iterations: angle = (2k + 1)·θ

P(success) = sin²((2k + 1)·θ)

Where √N comes from

We want the state to reach angle π/2, which is purely |good⟩. Each step covers 2θ and θ ≈ √(M/N) for small θ, so the number of steps is about (π/2)/(2θ) = π/(4θ) ≈ (π/4)·√(N/M).

That is the whole story of the quadratic speedup. Each step moves a fixed distance, and the distance to travel is a quarter turn. A classical search can only add a little probability per query, so it needs about N/M queries.

Why overshoot happens

A rotation does not stop at the target. If you keep applying iterations, the state passes π/2 and swings back towards |bad⟩. The success probability follows a sine wave in the iteration count. This is why Grover’s algorithm needs a good estimate of how many solutions exist.

The Success curve in the lab draws this wave. Slide the iteration count past the marked optimum and watch the probability drop.

Checking the formula

The table above is generated by the same code that runs the lab. For N = 8 and one marked item, θ = arcsin(1/√8) ≈ 0.3614 radians. The best iteration count is 2, with success about 94.5 percent. A third iteration rotates the state past the target and the probability falls to about 33 percent.

N = 8 items, 1 marked. Exact values from sin²((2k + 1)θ).
Iterations kChance of a marked resultNote
012.5%plain guess
178.1%
294.5%best count
333.0%overshoot
41.2%overshoot
554.8%overshoot

Try it

Questions

Is the state ever outside the two-dimensional plane?

No. Because the oracle and diffusion treat all good items alike and all bad items alike, the state stays in the plane spanned by |good⟩ and |bad⟩ at every step. That is why the lab can compute huge cases exactly.

Why twice the angle?

Two reflections compose into a rotation by twice the angle between their mirror lines.

Read next

Sources and further reading