Before you can understand why Grover's algorithm works, you need to see the state vector through a
geometric lens. In this lesson we reduce the full 2n-dimensional Hilbert space to a two-dimensional
picture that makes every step of the algorithm visually obvious.
The two-subspace decomposition
Label the single marked basis state ∣ω⟩ and collect every other computational basis
state into the equal superposition
∣ω⊥⟩=N−11∑x=ω∣x⟩,
where N=2n. The set {∣ω⟩,∣ω⊥⟩} is an orthonormal basis for
the two-dimensional plane that Grover's algorithm never leaves. Every state the algorithm visits is
a linear combination of these two vectors.
The initial state as an angle
The uniform superposition produced by H⊗n∣0⟩ is
∣s⟩=N1∑x=0N−1∣x⟩.
Decomposed into the two-subspace basis this is
∣s⟩=sinθ∣ω⟩+cosθ∣ω⊥⟩,
where the angle θ satisfies
sinθ=⟨ω∣s⟩=N1.
For N=4 (two qubits) this gives θ=arcsin(1/2)=30°, while for N=1024 it gives
θ≈1.8° — the initial state is nearly perpendicular to the target.
Visualizing the plane
Draw a unit circle in the ∣ω⊥⟩–∣ω⟩ plane (horizontal and vertical
axes respectively). The initial state ∣s⟩ sits at angle θ from the horizontal axis.
The goal is to rotate the state vector to 90°, i.e., to ∣ω⟩ itself.
Goal: rotate ∣s⟩Grover iterations∣ω⟩.
Each Grover iteration is a rotation by 2θ in this plane:
Oracle reflection: reflect about the ∣ω⊥⟩ axis (the horizontal). This
moves the angle from α to −α, negating the component along ∣ω⟩.
Diffuser reflection: reflect about ∣s⟩. Combined with step 1, the net effect is a
rotation by +2θ toward ∣ω⟩.
After k iterations the state is at angle (2k+1)θ, so the amplitude on the marked state is
sin((2k+1)θ).
This equals 1 — perfect retrieval — when (2k+1)θ=π/2, giving
k=2θπ/2−θ=4θπ−21.
Using θ≈1/N for large N, the optimal number of iterations is
k≈4πN, recovering the famous O(N) speedup.
The two-qubit case: exact geometry
For n=2, N=4, θ=30°. One iteration rotates by 2×30°=60°, bringing the
state from 30° to 90°: exactly ∣ω⟩. The probability of success after one step is
sin2(90°)=1. This is why the two-qubit Grover algorithm finds the marked item with
certainty in a single iteration — not just very likely, but with probability exactly 1.
Amplitudes are coordinates
In the two-dimensional picture, the state at any point in the algorithm is a unit vector
∣ψ⟩=α∣ω⟩+β∣ω⊥⟩,∣α∣2+∣β∣2=1.
The probability of finding the marked item on measurement is ∣α∣2=sin2((2k+1)θ).
By maximizing α and minimizing β over the course of O(N) reflections, Grover
transfers probability mass from the entire non-target subspace into the single target state — this
process is called amplitude amplification, and the geometric picture makes it transparent.
Sign in on the full site to ask questions and join the discussion.