← Atlas

Algorithms · Amplitude amplification

Grover unstructured search

The canonical search primitive, paired with the linear classical baseline it is meant to improve.

Strong empiricalUpdated

Open on the mapView frozen graph

A small worked example, computed in your browser. It is not a result from this record's papers.

Grover's algorithm finds |101⟩

3 qubits, searching for |101⟩ among 8 states, with 2 Grover iterations.

q0q1q2Step 1 of 5 · Hadamard layer(3)Hadamard layer(3)Step 2 of 5 · Phase oracle(101)Phase oracle(101)Step 3 of 5 · Grover diffuser(3)Grover diffuser(3)Step 4 of 5 · Phase oracle(101)Phase oracle(101)Step 5 of 5 · Grover diffuser(3)Grover diffuser(3)

Step 1 of 5 · Hadamard layer(3)

Probability of each outcome after this step

  • 00013%
  • 00113%
  • 01013%
  • 01113%
  • 10013%
  • 10113%
  • 11013%
  • 11113%
  1. Spreads the state into an equal superposition of all 8 three-qubit strings. Every answer is equally likely, including the right one.

    Probability spreads from 1 outcome to 8. All 8 are equally likely.

  2. The oracle marks |101⟩ by flipping its sign, and leaves the other seven states exactly as they were. Measuring now would be no better than guessing — the mark is a phase, and a phase is not an outcome.

    The outcome probabilities do not move at all. What this step changes is phase — 2 distinct relative phases across the state now — which no measurement can see until a later step turns it back into probability. This is the step that entangles the qubits: from here on no single qubit has a state of its own, only the register as a whole does.

  3. The diffuser reflects every amplitude about their average. The marked state sits below the average because its sign was flipped, so reflecting pushes it up and pulls the other seven down. This is where the phase becomes probability.

    Probability moves between the same 8 outcomes. Up: 101 12.5% → 78.1%. Down: 111 12.5% → 3.1%, 011 12.5% → 3.1%.

  4. The same oracle again, flipping the sign of |101⟩ — now the largest amplitude rather than one of eight equal ones.

    The outcome probabilities do not move at all. What this step changes is phase — 2 distinct relative phases across the state now — which no measurement can see until a later step turns it back into probability.

  5. And the same reflection again. Two iterations is close to the optimal number for 8 states: a third would overshoot and start pushing the answer back down.

    Probability moves between the same 8 outcomes. Up: 101 78.1% → 94.5%. Down: 100 3.1% → 0.8%, 010 3.1% → 0.8%.

Readout Measuring gives 101, the marked state, with high probability.

Open in Studio
  • Steps3
  • Wires2
  • Qubits2 toy
  • DepthOracle + diffusion
  • ClaimO(√N) queries
  • Papers1

Quantum vs classical

MetricClassicalQuantum
Query complexityO(N)O(√N)
Queries (1 of N marked)~N/2 avg⌊(π/4)√N⌋
Register (N = 2ⁿ)n bitsn qubits
Asymptotic speedupbaselinequadratic

Classical baseline

Linear scan or a classical indexed data structure, depending on whether the oracle is already available.

Quantum claim

Quadratic improvement in oracle queries for an unstructured search problem.

How to compare

Include oracle synthesis, state preparation, error correction, measurement repetitions, and data-loading costs before calling it an application speedup.

References

Strong empirical
  • Small-instance agreement
  • Verified by construction
  • Peer-reviewed paper
Method
Two-qubit marked-state oracle and diffusion layer checked against the ideal circuit.
Result
Pass for the toy fixture · no hardware speedup claim.
Caveat
The asymptotic advantage assumes a coherent oracle and a cost model where oracle calls dominate.
A fast quantum mechanical algorithm for database search ↗
Kind
curated reference
Reviewed by
LeonaQ literature curation pass
License
Public bibliographic link; code is an original reference implementation
searchoracleamplitude amplificationquery complexity
  • Search over a costly implicit predicate
  • Amplitude amplification inside Monte Carlo workflows
  • Constraint and satisfiability subroutines

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.