Candidate-denominator gcd post-processing Created 2026-10-06 Updated 2026-10-14
After continued-fraction recovery in quantum order finding, an even candidate denominator can be used to try the displayed greatest common divisors. Return only a divisor strictly between one and . If is the true even multiplicative order with a nontrivial halfway power, success follows from factor extraction from an even modular order. A candidate that is not a period can occasionally still yield a factor; testing before the gcds therefore changes single-run success probabilities. The output-factor check guarantees correctness in either convention.
Past exam of the mathematics course of the University of Cambridge 2016 iii Paper 324 1 i Solution Created 2026-10-03 Updated 2026-10-06
For coprime integers , the multiplicative order is the smallest positive exponentIt exists because multiplication by is an element of the finite group of units modulo an integer. For the example, the successive residues areNone of the first three is one, so the order is four.
The factor extraction from an even modular order uses the factorization . If the multiplicative order is even, put . Minimality of the multiplicative order excludes ; we also require . Thus is a nontrivial square root of one. Neither nor is divisible by all of . If either were coprime to , its inverse modulo , applied to , would make the other divisible by , a contradiction. Hence the greatest common divisorsare proper nontrivial factors. For odd , and have no common prime divisor of , so these two divisors are complementary. If the initial is not coprime to , a proper already supplies a factor without quantum order finding.
For and , and , which is neither nor . The factors areThe necessary conditions for this order-based reduction are a unit , even true multiplicative order, and .
Past exam of the mathematics course of the University of Cambridge 2019 ii Paper 4 10D a Solution Created 2026-09-24 Updated 2026-10-03
The multiplicative order of modulo is the least positive integer such thatIt exists because and are coprime integers.
Past exam of the mathematics course of the University of Cambridge 2023 ii Paper 3 10D c Solution Created 2026-09-24 Updated 2026-09-25
Past exam of the quantum information course of the University of Cambridge 2014 Paper 1 2 Solution 2026-10-20
The input size of an integer factorization problem is its number of bits . Trial division up to is exponential in ; advanced classical algorithms do substantially better, but no general polynomial-time classical factoring algorithm is known. The heuristic general-purpose general number field sieve has subexponential rather than polynomial scaling, roughly . This describes known algorithmic performance, not a proof that efficient classical factoring is impossible or that every large integer is difficult.
Choose with . A nontrivial greatest common divisor already supplies a factor; otherwise find the multiplicative order of modulo . If is even and , thenMinimality of the order also excludes , so factor extraction from an even modular order gives nontrivial factors through . Unhelpful choices of or odd orders require another trial. For , has successive residues and order four, givingComputing the powers is easy by repeated squaring; discovering a large order is the step accelerated by Shor's algorithm.[ref]
Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer by Peter W. Shor. Quantum reduction to order finding and classical factor extraction
Put and suppose . For each residue class , letThese are normalized uniform superpositions of the arguments with the same modular-exponentiation value. Their amplitudes repeat at separation within the finite register window. Exact cyclic periodicity requires . The correctly normalized entangled register state isThe equal prefactor in the displayed algorithm is exact when , for then every . It is not generally exact for an arbitrary unknown order. A physical implementation uses quantum modular exponentiation as a reversible map; its specified action on second-register input zero is extended to a unitary operator on the whole register space.
For the illustrative , and , the four first-register states areApplying the positive-sign quantum Fourier transform to the general state givesThe bracket is a finite geometric Fourier amplitude. If , it vanishes unless for , when it equals . HenceThe second-register states are orthogonal, so their different phases do not change the marginal first-register probabilities. Measurement givesIn the example the possible outcomes are . A nonzero observed ratio estimates , not a prime factor directly. Reducing it gives denominator ; repeating avoids uninformative outcomes or recovers missing order factors. For example, or gives denominator four, whereas alone gives only two.
When , the Fourier probabilities have narrow peaks near instead of support only on an exact reciprocal grid. The general marginal distribution isChoosing supplies the usual precision for continued-fraction recovery in quantum order finding: a nearest grid sample differs from the target rational by at most . Candidate denominators and extracted divisors are checked classically, and repetitions provide useful samples. The small example works exactly because its order divides the register size; it is not a general precision guarantee for factoring every four-bit integer.
Exact reciprocal-period sampling for order four and broadened peaks when the order does not divide the register
. Details. A sufficiently large reliable quantum computer would undermine RSA by efficient factorization. The related discrete-logarithm algorithm also threatens Diffie-Hellman key exchange and elliptic-curve public-key schemes. This does not imply that every communication scheme or symmetric cipher is broken by the same algorithm; post-quantum cryptography studies alternatives based on other problems. The mathematical speedup assumes a scalable quantum computation with enough precision and error control, not merely a small demonstration of factoring fifteen.
For an odd integer having at least two distinct prime divisors, choose a uniform unit . The Chinese remainder theorem for unit groups makes its odd-prime-power components independent cyclic groups. Failure of factor extraction from an even modular order requires all components to have equal 2-primary order exponents. For any component each possible exponent has probability at most , so conditioning on another component bounds failure by . Excluding the identity unit only improves the success proportion.
