Exact quantum factoring over a fixed finite gate set
Proves polynomial-size quantum circuits over a fixed gate set factor every integer with probability exactly one.
Shor's 1994 quantum algorithm factors whole numbers quickly, but it can fail and must sometimes be rerun. This paper builds quantum circuits that output the full prime factorization of every number with probability exactly one. They use one fixed, small set of gates and stay polynomial in size. Lean checks the main theorem; the circuits are far too large to be practical.
The explanation
Factor N = 15 the quantum way. Pick a = 7 and look at its powers modulo 15. They run 7, 4, 13, 1, so the order of 7 is r = 4. The order is the least power that gives 1. Half the order gives 7² ≡ 4, a square root of 1 that is not ±1. Then gcd(4 − 1, 15) = 3 and gcd(4 + 1, 15) = 5. So 15 = 3 × 5.
Shor's algorithm finds orders quickly with a quantum computer. It factors in polynomial time with bounded errorSource 1. Bounded error means each run can fail with some small chance. Checking a proposed answer makes reruns reliable. But a procedure that retries until success need not have a polynomial worst-case running timeSource 2. Exact versions existed only in stronger models. Mosca's exact algorithm allowed gate settings computed during the runSource 3. The obstacle with a fixed gate set is that rotations by arbitrary angles cannot be built exactly. Approximating them ever more finely does not give probability-one answersSource 4.
The paper proves a uniform family of polynomial-size quantum circuitsSource 5. Uniform means an ordinary computer can write out each circuit in polynomial time. The circuits output the complete prime factorization of every N ≥ 2 with probability oneSource 5. One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, diag(1, i), their inverses and singly controlled versionsSource 6. The gate and qubit counts are bounded by a fixed polynomial in the bit length of NSource 7.
The key trick ends with amplitude amplification, a step that boosts the chance of a good outcome. Suppose a good outcome has probability exactly 1/4. Write this as sin²θ = 1/4, so θ = 30°. One amplification step turns the probability into sin²(3θ) = sin²(90°) = 1. So the whole difficulty is making the success probability exactly 1/4Source 8. The paper does this with dyadic numbers, fractions whose denominators are powers of two. Its order trial hits the true order with an exact dyadic probabilitySource 9. Along the way, each run also factors p − 1 for its primes p, recursively. A deterministic primality test, adapted from Agrawal, Kayal and Saxena, checks the prime labelsSource 10.
The constructions are not meant to save resources. Their large polynomial sizes are not offered as practical improvementsSource 11. The paper makes no claim of a classical polynomial-time factoring algorithmSource 12.
How sure is this? Lean, a computer proof checker, has a formal proof of the main theorem. It covers the uniform polynomial-size circuit family, the fixed gate set and the exact probability one. No specialist review of the paper has been published.
What it doesn't show. This does not give a practical speed-up, a classical factoring method, or circuits small enough for any foreseeable quantum computer.
Where it came from
This result comes from an unreleased OpenAI model, published in the openai/math release on 6 October 2026.
Hype check
Solid. Lean covers the main theorem; the circuits are polynomial but very large and are not a practical improvement. No specialist review is published.
Words used
- Order
- For a modulo m, the least positive r with a^r ≡ 1 (mod m).
- Bounded error
- Each run is right with probability at least some fixed amount, such as 2/3, but may fail.
- Gate set
- The fixed list of basic operations a quantum circuit is allowed to use.
- Uniform circuit family
- One circuit for each input length, all written out by a single efficient ordinary program.
- Amplitude amplification
- A quantum step that raises the probability of a marked outcome, generalizing Grover's search.
- Dyadic rational
- A fraction whose denominator is a power of two, such as 3/8.
- Polynomial size
- The number of gates and qubits grows at most like a fixed power of the number of input digits.
The original paper
All quoted lines (12)
-
Shor's quantum algorithms established polynomial-time factorization and discrete logarithms with bounded error.
Exact quantum factoring over a fixed finite gate set Back to text -
Verifying a proposed factorization makes repetition reliable, but a procedure that retries until success need not have a polynomial worst-case running time.
Exact quantum factoring over a fixed finite gate set Back to text -
Their discussion also reports Mosca's exact factoring algorithm in a generalized model permitting gate parameters obtained during the computation; see also.
Exact quantum factoring over a fixed finite gate set Back to text -
Approximating an arbitrary-angle rotation to increasingly high precision likewise does not by itself yield probability-one correctness over a fixed finite gate set.
Exact quantum factoring over a fixed finite gate set Back to text -
There is a polynomial-time uniform family of polynomial-size quantum circuits that outputs the complete prime factorization of every input integer with probability one.
Exact quantum factoring over a fixed finite gate set Back to text -
One fixed finite gate set suffices: NOT, CNOT, Toffoli, Hadamard, , their inverses, and their singly controlled versions.
Exact quantum factoring over a fixed finite gate set Back to text -
The number of gates and qubits is bounded by a fixed polynomial in the bit length of .
Exact quantum factoring over a fixed finite gate set Back to text -
Here the preceding construction makes that probability exactly using dyadic arithmetic and the fixed gates, so the established pair of sign reflections suffices.
Exact quantum factoring over a fixed finite gate set Back to text -
First, it constructs an order trial whose mass on the true order is a prescribed dyadic rational, meaning a rational with a power-of-two denominator.
Exact quantum factoring over a fixed finite gate set Back to text -
The appendix adapts the polynomial-congruence method of Agrawal, Kayal, and Saxena, with its constants and auxiliary-prime choice established directly.
Exact quantum factoring over a fixed finite gate set Back to text -
Its large polynomial parameters are not intended as practical resource improvements.
Exact quantum factoring over a fixed finite gate set Back to text -
It makes no claim of a classical deterministic or randomized polynomial-time factoring algorithm.
Exact quantum factoring over a fixed finite gate set Back to text
Other sources
- openai/math, Lean scope note for family 279
The probability-one conclusion is exact, rather than an asymptotic or bounded-error guarantee.
- openai/math release notes (2026): model provenance and review status
manuscripts and supporting proof artifacts produced by an internal OpenAI model
Related results
- 274Parity is not in QAC 0Mathematical physics
- 276Classical capacity of generalized amplitude dampingMathematical physics
- 283Polynomial-time unitary synthesis from a Boolean oracleMathematical physics
- 284The optimal quartic separation between randomized and quantum queriesMathematical physics
- 271Bloch's law, its lattice correction, and the spherical magnetization lawMathematical physics
Browse Mathematical physics Quantum theoryOpen since the 1990sLean-checked resultsSolid results