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.
Assume first . Define the orthonormal quantum states
and by . The relevant invariant subspace is the two-dimensional span of these quantum states, not the entire Hilbert space. The uniform quantum superposition is .
In the ordered orthonormal basis , the marked-state phase oracle is the reflection operator . Since , conjugation by the Walsh-Hadamard transform gives the Grover diffusion operator
It is the reflection in the line through . The product of these two reflection operators is a rotation matrix by toward the marked quantum state:
Thus the Born rule gives . Choose a nonnegative integer nearest to . Rounding changes the angle from by at most , so
Each Grover search algorithm iteration uses one marked-state phase oracle query; all other gates are known. A final quantum measurement in the computational basis therefore produces a uniformly chosen marked item, conditional on success, with probability better than one half when . This uses the supplied marked count to select the stopping time; an unknown needs an additional search schedule or counting procedure. If , no oracle query is needed; if , no marked item exists, so a successful search is impossible.
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 .
When ,
One Grover search algorithm iteration therefore gives
The selective sign change is implemented with one application of the Boolean quantum oracle: prepare its answer qubit in and use quantum phase kickback, obtaining on each . The remaining operations , , and the final computational-basis measurement are independent of . Measurement of returns some with probability one, so exactly one query to suffices.
Choose to prepare the uniform superposition, so the marked-state probability is . Apply the marked-state phase oracle , followed by the reflection about the prepared state. Part (iii) shows that this single Grover iteration produces . A projective measurement in the four-item basis therefore returns the marked element with probability one. This is exact Grover search on four entries.
Write
where is the normalized component orthogonal to . On this real plane, is reflection in the line perpendicular to , while
is reflection in the line spanned by . Their product is a rotation through toward . This is the geometric core of Grover search.
Let
where is the Hadamard gate. For a computational-basis string , define the phase reflection
Thus changes the sign of , while changes the sign of the marked state.
Conjugating by reflects in the hyperplane perpendicular to , so
is the Grover diffusion operator, the reflection about . The Grover iteration operator
is the product of two reflections. It acts as a rotation through in the plane spanned by the marked state and the normalized uniform superposition of unmarked states, where
It is the identity up to sign on the orthogonal complement of that plane.
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.
Quantum collision finding Created 2026-10-06 Updated 2026-10-07
Given a function with an -bit output, accessed through the unitary operator , quantum collision finding asks for distinct inputs with equal outputs. Here is bitwise exclusive or on the -bit answer quantum register. The distinctness requirement excludes the uninformative pair . For a two-to-one function on inputs, Grover search algorithm methods yield a cube-root quantum query complexity, despite a square-root cost for finding a partner of just one preselected input.