[Paper Review] Factoring Safe Semiprimes with a Single Quantum Query
This paper presents a modified quantum factoring algorithm that factors safe semiprimes—products of two safe primes—with a success probability of approximately 1−4/N using just one call to the quantum order finding algorithm (QOFA), significantly outperforming Shor’s original algorithm, which fails with up to 50% probability per query. The improvement stems from exploiting number-theoretic properties of safe semiprimes to extract factors directly from the order output, eliminating the need for random input selection and enabling deterministic reuse of the same quantum circuit.
Shor's factoring algorithm (SFA), by its ability to efficiently factor large numbers, has the potential to undermine contemporary encryption. At its heart is a process called order finding, which quantum mechanics lets us perform efficiently. SFA thus consists of a \emph{quantum order finding algorithm} (QOFA), bookended by classical routines which, given the order, return the factors. But, with probability up to $1/2$, these classical routines fail, and QOFA must be rerun. We modify these routines using elementary results in number theory, improving the likelihood that they return the factors. The resulting quantum factoring algorithm is better than SFA at factoring safe semiprimes, an important class of numbers used in cryptography. With just one call to QOFA, our algorithm almost always factors safe semiprimes. As well as a speed-up, improving efficiency gives our algorithm other, practical advantages: unlike SFA, it does not need a randomly picked input, making it simpler to construct in the lab; and in the (unlikely) case of failure, the same circuit can be rerun, without modification. We consider generalizing this result to other cases, although we do not find a simple extension, and conclude that SFA is still the best algorithm for general numbers (non safe semiprimes, in other words). Even so, we present some simple number theoretic tricks for improving SFA in this case.
Motivation & Objective
- To reduce the failure rate of Shor’s factoring algorithm (SFA) when factoring safe semiprimes by rethinking the classical post-processing step.
- To eliminate the need for random input selection in SFA, enabling fixed, repeatable quantum circuits for experimental implementation.
- To improve practical efficiency by allowing the same quantum circuit to be rerun without modification in case of failure.
- To explore whether number-theoretic insights can be used to enhance quantum factoring beyond the safe semiprime case.
Proposed method
- The algorithm uses the fact that for safe semiprimes N = p₁p₂ with pᵢ = 2qᵢ + 1, the order r of any a coprime to N divides 2q₁q₂, and all divisors except 1 and 2 yield the factors.
- Instead of relying on the standard SFA step that checks whether r is even and computes gcd(a^{r/2}±1, N), the new method directly tests all nontrivial divisors of 2q₁q₂ to recover p₁ and p₂.
- The algorithm fixes the base a (e.g., a=2) rather than selecting it randomly, simplifying experimental implementation.
- It leverages the high likelihood that QOFA returns a divisor d of 2q₁q₂ that is not 1 or 2, which directly enables factor extraction.
- The method avoids repeated quantum calls by ensuring that even in failure cases, the same quantum circuit can be reused.
- For general integers, the authors propose two lightweight classical checks: computing gcd(r, N) and testing if r is divisible by small primes ℓ, to avoid unnecessary QOFA re-runs.
Experimental results
Research questions
- RQ1Can the classical post-processing of Shor’s algorithm be restructured to reduce failure probability for safe semiprimes?
- RQ2Does fixing the base a in the quantum order finding step improve experimental feasibility and reduce resource overhead?
- RQ3Can the order output from QOFA be used more effectively than in SFA to extract factors without additional quantum queries?
- RQ4To what extent can number-theoretic properties of λ(N) be exploited to improve quantum factoring beyond the safe semiprime case?
- RQ5Can simple classical checks reduce the expected number of QOFA calls for general integers without altering the quantum subroutine?
Key findings
- The proposed algorithm factors safe semiprimes with success probability ≈1−4/N using only one call to QOFA, significantly outperforming Shor’s algorithm, which fails with up to 50% probability per query.
- The algorithm succeeds when the order r returned by QOFA is any nontrivial divisor of 2q₁q₂, which occurs with high probability due to the structure of the multiplicative group modulo N.
- The method eliminates the need for random input selection, allowing the use of a fixed base a (e.g., a=2), simplifying experimental implementation and enabling circuit reuse.
- In the rare case of failure, the same quantum circuit can be rerun without modification, reducing experimental overhead.
- For general integers, two simple classical checks—computing gcd(r, N) and testing divisibility of r by small primes—reduce the failure rate after a single correct QOFA call by a factor of 4, from 6% to 1.5%.
- For 60% of remaining failures, the order r is of the form 2⁻ᵏλ(N), allowing recovery of λ(N) and subsequent factorization via Miller’s algorithm, yielding an overall efficiency gain of roughly an order of magnitude over standard SFA.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.