Skip to content
Current section
The Quantum Computing Enthusiast’s Hub
Saved
All sections

All sections

Saved
Skip Learn navigation
Encyclopedia
Topic

Grover search

A quantum amplitude-amplification procedure for finding marked items using quadratically fewer oracle queries than unstructured classical search.

Also called Grover's algorithm

Edition released Coverage: Overview · Technical
On this page

Definition and significance

Grover search rotates an initial superposition toward the subspace of marked solutions. It applies when a predicate can coherently identify a correct answer. Its characteristic advantage is quadratic in oracle-query complexity. It neither reads all database records into classical memory nor guarantees a useful wall-clock speedup after data loading and fault-tolerant overhead.

The important comparison is a precisely defined search task. Sorted data, algebraic structure or effective heuristics can give classical alternatives far better than a naive scan.

Mechanism and mathematical treatment

For N basis states and M marked states, define normalized uniform states |G> and |B> on the good and bad sectors. The initial uniform state is sin(θ)|G⟩+cos(θ)|B⟩, with sin2(θ)=MN. The phase oracle reflects the good component, and diffusion reflects about the initial state. Their composition rotates the state by 2theta in this plane. After k iterations, success probability is sin2((2k+1)θ).

The common estimate k approximately pi/(4theta)-1/2 applies when selecting a near-optimal integer. More iterations do not monotonically improve success: the state rotates past the target. Unknown M requires an appropriate variant or schedule rather than blindly using the single-solution formula.

Plain-text equations
  • sin(theta)|G>+cos(theta)|B>
  • sin^2(theta)=M/N
  • sin^2((2k+1)theta)

Fully worked reference example

For N=4 and one marked state |11>, theta=pi/6. The initial amplitudes are all 1/2. The oracle changes the last to -1/2; their average is 1/4. Diffusion maps each amplitude a to 2(1/4)-a. The first three therefore become zero and the marked amplitude becomes one. One iteration succeeds exactly.

For N=8 and one solution, sin(theta)=1/sqrt(8). After one iteration, sin(3theta)=3/sqrt(8)-4/(8sqrt(8))=5/(2sqrt(8)), giving success 25/32. After two, sin(5theta)=11/(4sqrt(8)), giving 121/128. These exact small examples display the oscillation rather than asserting that every iteration is beneficial.

Limitations and common misconceptions

The oracle must be reversible and its workspace normally uncomputed. The quadratic speedup does not transform an exponential search space into polynomial time: sqrt(2^n)=2^(n/2) remains exponential. Noise accumulates across coherent iterations; restarting short noisy searches may change the achieved advantage.

Scientific relationships

Uniform search is a special preparation and marking instance.

Promise classification and marked-item retrieval solve different tasks.

Graph-structured search can use coherent walk dynamics rather than uniform search reflections.

Black-box lower bounds constrain improvements beyond square-root scaling.

Historical source context

The search result was presented at STOC in 1996. The arXiv record was first submitted on 29 May 1996 and revised on 19 November 1996 with a simplified explanation. These are source-version dates, not separate algorithm discoveries.

Multiple marked items with exact rational probabilities

Let N=16 and M=3, so a=M/N=3/16. Write sin(theta)=sqrt(3)/4. After one Grover iteration, the good-sector amplitude is sin(3theta)=3 sin(theta)-4 sin^3(theta)=9 sqrt(3)/16. The success probability is 243/256, approximately 0.949219. Each of the three marked basis states has amplitude 9/16 because the good component is uniform over them. The bad-sector amplitude is cos(3theta)=sqrt(13)/16, so each of the thirteen unmarked basis states has amplitude 1/16.

The individual amplitudes can also be obtained by inversion about the mean. Initially every amplitude is 1/4. After marking, three are -1/4 and thirteen are +1/4, giving mean 5/32. Diffusion maps the marked values to 2(5/32)+1/4=9/16 and the unmarked values to 2(5/32)-1/4=1/16. Squaring and summing gives 3(81/256)+13(1/256)=1.

After two iterations the good-sector amplitude is sin(5theta)=29 sqrt(3)/64, giving success 2523/4096, approximately 0.615967. The second iteration makes the answer worse. This example differs from a single-solution instance both in its optimal stopping point and in the conditional output distribution: successful measurement yields one of three valid labels, not a uniquely designated item.

Verifying a candidate and restarting

A search procedure should include verification of the measured label. If one iteration succeeds with probability p=243/256 and failures are recognized perfectly, independent repetitions have expected count 1/p=256/243. The expected number of phase-oracle iterations is likewise 256/243, but each attempt also pays for state preparation, measurement and candidate verification. If verification uses a separate value query, its expected call count is 256/243 as well.

Compare this with classical uniform sampling with replacement, whose success probability per trial is 3/16 and expected trial count is 16/3. The ratio of expected trial counts is not automatically a runtime ratio: one coherent attempt contains reflection circuits and possibly expensive reversible predicate evaluation, while a classical trial may use a simpler irreversible predicate. The appropriate comparison restores those costs.

For unknown M, a fixed iteration count can land near a trough. An algorithm that randomizes the iteration count across a growing range can avoid relying on an exact prior estimate of theta. The schedule and its stopping rule determine the expected query complexity. Claiming the best single-M stopping count while also claiming no knowledge of M would combine incompatible assumptions.

A weighted initial state preserves within-sector ratios

Suppose the prepared state has amplitudes sqrt(1/2), sqrt(1/4), sqrt(1/8), sqrt(1/8) on four labels, and the last two labels are marked. Its success probability is 1/4. Reflection about this actual prepared state, combined with the good-state reflection, amplifies the good component to success in one iteration. The resulting normalized good state is (|10>+|11>)/sqrt(2).

If instead the marked amplitudes initially had unequal magnitudes, amplification would preserve their ratio because the entire good projection is treated as one vector. For example, good probabilities 1/16 and 3/16 have total a=1/4, and one iteration produces the normalized good state |10>/2+sqrt(3)|11>/2, assuming positive initial phases. Conditional probabilities are therefore 1/4 and 3/4. Ordinary amplitude amplification does not automatically make solutions uniformly distributed.

Using the standard uniform diffusion operator with a nonuniform initial state does not implement reflection about that state. The clean two-dimensional analysis then needs to be reconsidered. The preparation unitary A and its inverse provide the correct reflection A(2|0><0|-I)A dagger. The cost of A can be comparable to or greater than the predicate cost, especially when it incorporates a classical heuristic or data-dependent distribution.

The small numerical cases can be checked by direct vector updates: negate marked amplitudes, compute the mean for uniform diffusion, and replace each amplitude by twice that mean minus itself. For a weighted preparation, use the rank-one reflection 2|psi><psi|-I instead. These calculations fully specify the reference algorithm and make the distinction between the two reflections testable.

Sources

  • Lov K. Grover · · Research paper · Publication status unspecified · arXiv
    Verification scope

    Recorded source check ·

    The version date comes from the arXiv submission record.

    Theoretical or mathematical source anchor; original definitions and worked instances are independent. No experimental or end-to-end performance claim inferred.

  • Gilles Brassard; Peter Hoyer; Michele Mosca; Alain Tapp · · Research paper · Publication status unspecified · arXiv
    Verification scope

    Selected source text checked ·

    Theoretical oracle model; independent examples do not constitute end-to-end hardware demonstrations.