Choose and prepare . The circuit from part (iii) returnsso a quantum measurement in the computational basis of the first register reveals the discrete logarithm exactly. More generally, any that is invertible modulo returns , from which follows by multiplication by the modular inverse of .
Past exam of the mathematics course of the University of Cambridge 2025 iii Paper 324 1 b iv Solution Created 2026-09-24 Updated 2026-09-25
Use as the target register for quantum phase estimation of . By part (iii), it is the equal superposition of eigenvectors with phases . Controlled modular multiplications implement the required powers efficiently. The phase-estimation circuit produceswhere the first register contains an -bit approximation with constant success probability. A quantum measurement in the computational basis therefore outputs an approximation to , with uniformly distributed over .