|q⟩ Bad Qubits

intermediate · Programming · Grover's Search Algorithm

Quadratic Speedup

You have now seen all the pieces of Grover's algorithm: the uniform superposition, the oracle phase-flip, the diffuser reflection, and the geometric picture of rotations in a two-dimensional plane. This lesson steps back and asks the deeper question: exactly how much faster is Grover's algorithm than any classical method, and why can't quantum computers do even better?

The classical baseline

For an unstructured search over NN items with a single marked element xx^*, the best classical strategy (deterministic or randomised) needs Θ(N)\Theta(N) oracle queries in the worst case. A sequential scan finds xx^* in at most NN queries, so the classical complexity is Θ(N)\Theta(N). No classical algorithm can beat linear time without structural information about ff — each unanswered query tells you nothing about the remaining items.

What Grover achieves

Grover's algorithm finds xx^* with high probability using O(N)O(\sqrt{N}) queries. The precise statement: starting from the uniform superposition over N=2nN = 2^n basis states, running

t=π4Nt^* = \left\lfloor \frac{\pi}{4}\sqrt{N} \right\rfloor

Grover iterations yields a measurement outcome equal to xx^* with probability at least 11/N1 - 1/N.

The N\sqrt{N} factor comes directly from the geometry. Each iteration rotates the state vector by angle 2θ2\theta in the two-dimensional ω|\omega\rangleω|\omega^\perp\rangle plane, where sinθ=1/N\sin\theta = 1/\sqrt{N}. For large NN we have θ1/N\theta \approx 1/\sqrt{N} radians. To reach the target at π/2\pi/2, the algorithm needs

tπ/22θπ4Nt^* \approx \frac{\pi/2}{2\theta} \approx \frac{\pi}{4}\sqrt{N}

iterations — growing as N\sqrt{N}, not NN.

Why quantum cannot do better

The quadratic speedup is optimal: no quantum algorithm can search an unstructured database of NN items in fewer than Ω(N)\Omega(\sqrt{N}) queries. This tight lower bound was proved by Bennett, Bernstein, Brassard, and Vazirani (BBBV, 1997) using a technique called the hybrid argument (also analysed via the polynomial method and via adversary arguments in later work).

The key insight of the BBBV argument is that after TT queries, any quantum algorithm can have accumulated a total amplitude on the marked item of at most O(T/N)O(T/\sqrt{N}). Concretely, if the amplitude on ω|\omega\rangle starts at 1/N1/\sqrt{N} and each query can increase it by at most O(1/N)O(1/\sqrt{N}), reaching amplitude close to 11 requires Ω(N)\Omega(\sqrt{N}) queries. The proof formalises this by comparing two worlds — one with a marked item and one without — and bounding how fast a quantum algorithm can distinguish them.

Quadratic vs. exponential speedup

It is worth situating this speedup in the landscape of quantum algorithms:

| Algorithm | Classical complexity | Quantum complexity | Speedup type | |---|---|---|---| | Grover search | O(N)O(N) | O(N)O(\sqrt{N}) | Quadratic | | Shor factoring | exp(O(n1/3))\exp\bigl(O(n^{1/3})\bigr) | O(n2logn)O(n^2 \log n) | Super-polynomial | | Deutsch–Jozsa | Θ(N)\Theta(N) (deterministic) | O(1)O(1) | Exponential |

Grover's speedup is quadratic, not exponential. This means it does not make NP-complete problems tractable: searching 2n2^n candidate solutions still takes O(2n/2)O(2^{n/2}) quantum steps, which is still exponential in nn.

Amplitude amplification: the general principle

Grover's algorithm is the simplest instance of a broader technique called amplitude amplification. Given any quantum algorithm A\mathcal{A} that finds a "good" state with success probability pp, amplitude amplification boosts the success probability to near 11 in O(1/p)O(1/\sqrt{p}) applications of A\mathcal{A} and its inverse — a quadratic improvement over the naive strategy of repeating A\mathcal{A} independently O(1/p)O(1/p) times. Grover search is the special case A=Hn\mathcal{A} = H^{\otimes n} with p=1/Np = 1/N.

This generality makes the quadratic speedup widely applicable: anywhere a classical algorithm succeeds with probability pp per trial, amplitude amplification can quadratically reduce the number of trials required.

Summary

Sign in on the full site to ask questions and join the discussion.