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 2 b ii Solution Created 2026-10-03 Updated 2026-10-05
Applying the two modular-addition quantum oracles consecutively adds to the answer register. ThusLet . Applying , then , then givesThereforeusing one query and two unitary operators independent of . This is modular-oracle inversion by negation.