Query a known set of inputs and store its output table. If no function collision occurs there, each of its distinct outputs has exactly one partner in the complement, for a two-to-one function. A compute-phase-uncompute construction marks those partners using two function queries and reversible table comparison. Known-subset Grover search then uses such phase queries. Including table preparation and a final verification query gives
Choosing balances both terms and gives . The Grover rotation angle rounding bound gives success tending to one. This is a query bound; it does not make reversible table lookup free in a gate or physical-memory cost model.
Let , let be the marked-state phase oracle, and replace reflection about by reflection about a known computational basis vector . Define , so and . The resulting Grover iterate obeys
because the two diagonal operators commute. Thus the good and bad uniform vectors are replaced by their signed vectors , with exactly the same Grover rotation angle. Initializing in gives . Computational-basis measurement probabilities are unchanged because only multiplies amplitudes by signs.
Known-subset Grover search Created 2026-10-06 Updated 2026-10-14
For a known finite set , prepare the uniform superposition state and implement its reflection operator . If exactly basis states in are marked, the same two-dimensional Grover rotation angle argument uses phase queries. Preparation and reflection are known operations with no calls to the unknown predicate. Their gate cost must be accounted for separately. The success guarantee requires , and choosing the optimal iteration number uses a known .
For the normalized vector defining the orthogonal projection , for every . Thus
which proves the projector phase rotation identity in this case:
It changes the sign of the component along and fixes the orthogonal complement, so it is a reflection operator.
For a marked computational basis vector , is the marked-state phase oracle. With , the other reflection is
The Hadamard gates thus implement its change of basis from the known all-zero state. The usual Grover diffusion operator is . Consequently a Grover search algorithm iteration is
The minus sign is an irrelevant global phase. These two reflections rotate the search state in the span of the marked vector and the unmarked uniform vector, with the Grover rotation angle controlled by the initial marked amplitude. Iterating them approximately times gives high-probability search. The same pair of projectors appears additively in the continuous-time Hamiltonian, but the product of full reflections and evolution under their sum are distinct dynamics.
Put and define . The normalized good and bad vectors have disjoint computational basis supports, so they are orthogonal. Counting the terms in the uniform quantum superposition gives
Since , the Hadamard transform gives , the Grover diffusion operator. On the ordered orthonormal basis , the two reflection operators have matrices
Their product is
This is a plane rotation through angle in the displayed coordinate convention, with the invariant good-bad plane preserved by both operators. In particular its action sends to . Induction therefore gives the Grover rotation angle formula
For , use the orthonormal basis from the preceding part. Both reflection operators preserve , because their reflected vectors belong to it. With and , their restricted matrices are
Multiplying in the specified order, including the overall minus sign, gives
Equivalently,
In particular, sends to . This proves the Grover rotation angle description with the signs appropriate to these reflection operators.
For , induction using the Grover rotation angle gives
The quantum measurement in the computational basis therefore returns with probability . Since , the first angle interval attaining the required success is
The first successful Grover iterate is consequently
Indeed, this is the first integer at or above the lower endpoint requirement . The inequality also implies , so this iterate cannot overshoot the first success interval. Every smaller nonnegative integer lies before that interval and fails the threshold. Finally, for , so
For the singleton case , measuring the initial state already returns with certainty, and . For , the requested threshold is only , so zero iterations already suffice. These boundary cases agree with the search guarantee.
Write and . The initial Hadamard gates prepare in the search register and in the final quantum ancilla. Since the Pauli X gate satisfies , the Boolean quantum oracle acts by quantum phase kickback:
For a single marked entry this is the marked-state phase oracle on the search register. The ancilla stays separate and unchanged throughout.
The Grover diffusion operator is , because . The PDF circuit places one diffusion after each oracle call, so the state before measurement is
In the supplied amplitude amplification theorem, take and . Their overlap has modulus , so the Grover rotation angle is . A quantum measurement in the computational basis therefore gives
The inverse sine here is applied to the overlap of the two different states. The converted TeX's self-overlap in the angle definition is a transcription error; the original PDF has .
A good item must exist, so assume ; if , the requested search is impossible, while makes every output good. Put and . Normalize the good and bad components of the uniform superposition state as
The Boolean phase oracle negates and fixes . The Grover diffusion operator is . Its implementation is independent of : conjugate the reflection about by Hadamard gates. One Grover search algorithm iteration is
Hence, by the Grover rotation angle formula,
Choose the nonnegative integer nearest to . Its final angle differs from by at most , so a computational-basis measurement succeeds with probability at least . The allowed small-density regime includes , giving the requested bound. Each iteration uses one Boolean phase oracle query, and .
For , and one iteration reaches exactly. Thus one query gives a good outcome with certainty:
This is exact Grover search on four entries applied to a marked fraction of one quarter, not only to a four-element register.
Interpret a function collision as two distinct inputs with equal outputs. Without distinctness the request is vacuous, since an input paired with itself always qualifies. Set (handling small by direct queries), choose a known set of size , and query all its inputs. Store a classical table of their outputs and corresponding inputs. If this table contains a function collision, return it immediately.
Otherwise the table contains distinct outputs. Because is exactly two-to-one, each has exactly one partner in , the known complement of . None lies in , and different table outputs have different partners. Thus exactly inputs in , of size , satisfy the known-table membership predicate
Build a marked-state phase oracle for this predicate by a compute-phase-uncompute construction: use on a clean answer quantum register, reversibly compare its output against the classical table, apply the conditional minus sign, undo the comparison, and apply again. Since the answer operation is bitwise exclusive or, . All workspace returns to zero, and each phase query costs two calls to .
Perform known-subset Grover search in the span of the computational basis states labelled by , starting in their uniform superposition state. Reflection about this known state uses no queries; choosing as an initial interval makes a known interval that can also be encoded by its own labels. Its marked fraction is , so the previous Grover rotation angle analysis uses phase queries. On measuring , one further query checks the output and retrieves its partner from the table. The inputs are distinct because the two sets are disjoint.
Consequently the quantum query complexity is
For large , rounding the optimal Grover search algorithm iteration count gives success at least . An internal table function collision already gives certain success. The balance explains the cube-root choice. This is the Brassard–Høyer–Tapp collision algorithm: its table uses classical bits. The bound counts calls to , as requested; it does not charge table lookup and its reversible implementation as constant-time gates, or claim an overall polynomial time in .
Because ,
which is the reflection operator in the line spanned by . Meanwhile changes the sign of every good basis state and fixes every bad basis state; on
it is the reflection in the axis. Both reflections preserve , so their product does too.
Write
In Euclidean geometry, the composition of reflections in two lines through the origin has a rotation matrix through twice the oriented angle between the lines. Hence rotates the good-bad plane by from toward . In particular, the Grover rotation angle formula is
Use the construction in part (c) for the marked-state phase reflection in each Grover search algorithm iteration. Every such reflection costs one query to ; the identity-oracle circuit, Hadamard gates, and are independent of .
Starting from , after iterations the success probability is
by the Grover rotation angle. Choose an integer
Then differs from by at most , so
For every sufficiently large this is greater than , while
Thus measuring the search register determines the faulty input with the required constant success probability using oracle queries.