Brassard–Høyer–Tapp collision algorithm 2026-10-06
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 givesChoosing 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.
Past exam of the mathematics course of the University of Cambridge 2013 iii Paper 58 4 b iii Solution Created 2026-10-03 Updated 2026-10-07
The product of the data Pauli Z gates has computational-basis eigenvalueUse the parity circuit from part (ii), apply the target unitary gate , and then uncompute the parity with . For every basis input,This equals on the data, with the ancilla qubit returned to zero. The compute-phase-uncompute construction therefore gives an exact linear-size circuit:This is a Pauli-string phase by parity computation, an instance of simulation of a computable diagonal Hamiltonian. Part (i) also explains it by , whose exponential restricts correctly to the target- subspace. If no extra line is desired, accumulate parity into the last data qubit, apply there, and undo the CNOT gates, for gates. Both constructions implement the global phase as well as the relative phases exactly.
Past exam of the mathematics course of the University of Cambridge 2017 iii Paper 324 2 b Solution Created 2026-10-03 Updated 2026-10-06
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 predicateBuild 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 isFor 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 .
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 324 2 b iii Solution Created 2026-10-03 Updated 2026-10-05
Let the known phase gate on the answer register bewhere the comparison uses ordinary integers, not modular arithmetic. A reversible circuit computes the predicate, applies a Pauli Z gate to its flag, then performs uncomputation.
The compute-phase-uncompute construction now givesUse modular-oracle inversion by negation to realize the last operation with one further query. Exactly two oracle queries implement , returning the answer register and comparison workspace to their initial states.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 324 3 b ii Solution Created 2026-10-03 Updated 2026-10-05
Since , the spectral decomposition givesReplace the middle gate of the previous compute-phase-uncompute construction bya one-qubit rotation about the z-axis. ThenThe circuit uses the gates of , their inverses, and one fixed rotation; it returns the quantum ancilla to . The same construction implements with middle gate , an instance of simulation of a computable diagonal Hamiltonian.
Past exam of the mathematics course of the University of Cambridge 2019 iii Paper 324 3 b i Solution Created 2026-10-03 Updated 2026-10-05
Use a clean quantum ancilla and apply the quantum circuit , then the Pauli Z gate on the ancilla, then the inverse quantum circuit :This compute-phase-uncompute construction implements on every input with the ancilla initially , and by linearity on any superposition of those inputs. The action on ancilla- inputs need not coincide with ; the question only requires the clean-ancilla subspace.
Past exam of the mathematics course of the University of Cambridge 2022 ii Paper 3 10D b Solution Created 2026-09-24 Updated 2026-09-25
With the restricted operations, begin in and apply to the first register:Now applyFor every basis state this compute-phase-uncompute construction acts asThe first register is therefore the same phase state used in part (a). Apply and measure. Again, outcome occurs with probability one for a constant string and probability zero for a balanced string. The construction uses exactly two queries to and only the permitted operations.
Pauli-string phase by parity computation 2026-10-07
The Pauli Z gates give eigenvalue on . Use parity computation by CNOT gates to put the parity bit in a zero ancilla, apply to it, and uncompute. The data acquire exactly , and the ancillary line returns to zero. This compute-phase-uncompute construction needs one- and two-qubit gates. Accumulating parity into the last data line instead uses gates without an extra ancilla. Neither implementation drops the global phase.