Grover's algorithm is a quantum search algorithm that finds a unique marked item among
candidates with bounded error using
queries to an oracle that
recognizes the marked item (Grover 1996). A classical unstructured search requires
order
queries in the worst case to achieve a fixed success probability bounded away from
zero.
Suppose
and exactly one item is marked. Denote its basis vector
by
and the normalized sum of the unmarked basis vectors
by
. The initial quantum
state is the uniform superposition
,
where
. Let
and
denote the orthogonal
projections onto the lines spanned by
and
, respectively. One iteration
applies the phase oracle
and then the diffusion operator
, where
is the identity operator.
On the real linear span of
and
, these are reflections
across the lines through
and
, respectively. Their composition
is a rotation through
toward
. After
iterations the probability
of measuring the marked item is
(Boyer et al. 1998, Brown 2020). Choosing
to be a nearest integer to
makes this probability
at least
. Verifying the measured item with the oracle
and repeating a fixed number of times raises the success probability
above
even for
. 3Blue1Brown (2025) illustrates the two reflections.
In the equivalent Galperin's billiards model (Brown 2020), the light and heavy masses start with the same velocity toward the
wall and have mass ratio . In coordinates scaled
by the square roots of the masses, the velocity components
of the heavy and light masses correspond to the components along
and
, respectively, up to a common
normalization and sign convention. The wall collision flips only the light component,
and the mutual collision reflects the scaled velocity about the direction of equal
physical velocities. These are the phase oracle and diffusion
operator, respectively.