Shor factoring
Shor’s algorithm uses a quantum routine to find a modular period, then extracts factors by classical arithmetic.
How it works
Choose
Pick a with , or use a nontrivial gcd immediately.
Estimate the order
Quantum phase estimation on modular multiplication gives samples close to rational values with denominator r. Continued fractions and checks recover a candidate order.
Extract
For even r with a^(r/2) not congruent to −1 modulo N, try gcd(a^(r/2) ± 1,N).
Equation and quantities
- N · integer to factor
- a · coprime base
- r · least positive r with mod N
Worked example
Here , so . The gcd of 3 with 15 is 3 and the gcd of 5 with 15 is 5.
Why it matters
Efficient ideal-circuit factoring motivates migration away from cryptosystems that rely on factoring hardness.
Limits and assumptions
Some bases and samples give unusable results, so the procedure can require retries. Practical large-instance factoring requires fault-tolerant resources.
Why does help?
It makes ( − 1)( + 1) a multiple of 15, exposing factors through gcds.