Skip to main content
KetQat

Appearance

Topic · intermediate

Shor's Algorithm

Polynomial-time quantum factoring and discrete logarithms - the classical reduction of factoring to order finding, order finding by phase estimation and continued fractions, the circuit cost, and dated resource estimates for breaking RSA and elliptic-curve cryptography together with their hardware assumptions.

ExpositionMachine-checkedUpdated 2026-12-01 · last verified 2026-12-01

AI-assisted text, machine-checked, not yet reviewed by a person. Citations resolve and an automated pass compared the statements with the cited sources. That is not peer review; check the sources for anything you depend on.

Overview

Shor showed that a quantum computer can factor an LL-bit integer, and compute discrete logarithms, with a number of gates polynomial in LL. The best known classical algorithms for both problems take time super-polynomial in LL, and the security of RSA, Diffie–Hellman and elliptic-curve cryptography rests on that gap. No proof that classical factoring is hard exists, so the speed-up is relative to the best known classical algorithms rather than proved.

The algorithm has a classical and a quantum part. Classically, factoring NN reduces to finding the order of a random number modulo NN. Quantumly, the order is the period of the function k↦ak mod Nk \mapsto a^k \bmod N, and phase estimation of the modular multiplication operator, followed by the continued-fraction algorithm, finds it. Almost all of the cost is in the reversible modular arithmetic.

Intuition

The function k↦ak mod Nk \mapsto a^k \bmod N repeats with period rr, the order of aa. A quantum computer can evaluate it on a superposition of all kk at once; the resulting state is periodic with period rr, and the quantum Fourier transform turns that period into peaks at multiples of 2t/r2^t/r. One measurement gives a random multiple s/rs/r of 1/r1/r to high precision, and continued fractions recover the denominator.

Why does the order help? If rr is even, ar/2a^{r/2} is a square root of 1 modulo NN. The only square roots of 1 modulo a prime are ±1\pm 1, but modulo a product of two primes there are four, and a square root b≠±1b \ne \pm 1 makes NN divide (b−1)(b+1)(b-1)(b+1) without dividing either factor, so gcd⁡(b−1,N)\gcd(b - 1, N) is a proper factor.

Prerequisites

Quantum phase estimation, the quantum Fourier transform, modular arithmetic and the Chinese remainder theorem.

Theorems

TheoremFactoring reduces to order findingEstablished result

Under the assumptions,

Pr⁡[ r is even and ar/2≢−1(modN) ]  ≥  1−12m−1  ≥  12.\Pr\big[\, r \text{ is even and } a^{r/2} \not\equiv -1 \pmod N \,\big] \;\ge\; 1 - \frac{1}{2^{m-1}} \;\ge\; \frac12 .

Whenever this event occurs, b=ar/2 mod Nb = a^{r/2} \bmod N is a square root of 1 modulo NN other than ±1\pm 1, and both gcd⁡(b−1,N)\gcd(b - 1, N) and gcd⁡(b+1,N)\gcd(b + 1, N) are nontrivial factors of NN.

The remaining cases are classical: if NN is even, 2 is a factor; if N=pαN = p^{\alpha} with α≥2\alpha \ge 2, this is detected by computing integer kk-th roots for k≤log⁡2Nk \le \log_2 N; and if a random aa has gcd⁡(a,N)>1\gcd(a, N) > 1, that gcd is a factor. So any procedure that returns the order of a given aa yields a randomized polynomial-time factoring algorithm with expected O(1)O(1) calls. This reduction, standard in number theory and used by Shor, is Theorem 5.3 of Nielsen and Chuang. The book prints the bound with exponent mm; the exponent m−1m-1 is what the argument gives and is the version in the book's errata list. It is tight: for N=21N = 21 exactly half of Z21∗\Z_{21}^\ast succeeds.

Holds when
  • N=p1α1⋯pmαmN = p_1^{\alpha_1}\cdots p_m^{\alpha_m} is odd with m≥2m \ge 2 distinct prime factors.
  • aa is drawn uniformly from the multiplicative group ZN∗\Z_N^\ast of residues coprime to NN; rr is its order, the least r≥1r \ge 1 with ar≡1(modN)a^r \equiv 1 \pmod N.
Proof · Proof that factoring reduces to order finding

Two standard facts from elementary number theory are used (Appendix 4 of Nielsen and Chuang): the Chinese remainder theorem, by which a↦(a mod p1α1,…,a mod pmαm)a \mapsto (a \bmod p_1^{\alpha_1}, \dots, a \bmod p_m^{\alpha_m}) is a group isomorphism ZN∗≅Zp1α1∗×⋯×Zpmαm∗\Z_N^\ast \cong \Z_{p_1^{\alpha_1}}^\ast \times \cdots \times \Z_{p_m^{\alpha_m}}^\ast; and the fact that for an odd prime pp the group Zpα∗\Z_{p^\alpha}^\ast is cyclic, of order φ(pα)=pα−1(p−1)\varphi(p^\alpha) = p^{\alpha-1}(p-1).

The gcd step. Suppose rr is even and b=ar/2≢−1b = a^{r/2} \not\equiv -1. Also b≢1b \not\equiv 1, since r/2<rr/2 < r and rr is the least exponent with ar≡1a^r \equiv 1. Then N∣b2−1=(b−1)(b+1)N \mid b^2 - 1 = (b-1)(b+1) while N∤b−1N \nmid b - 1 and N∤b+1N \nmid b + 1. So NN shares a factor with b−1b - 1 but is not contained in it: 1<gcd⁡(b−1,N)<N1 < \gcd(b-1, N) < N, and likewise for b+1b + 1.

Failure forces equal valuations. Let rjr_j be the order of aa modulo pjαjp_j^{\alpha_j}, so that r=lcm⁡(r1,…,rm)r = \operatorname{lcm}(r_1, \dots, r_m), and let djd_j be the exponent of the largest power of 2 dividing rjr_j; let dd be that of rr, so d=max⁡jdjd = \max_j d_j. The procedure fails when rr is odd or ar/2≡−1a^{r/2} \equiv -1.

  • If rr is odd, every rjr_j is odd and d1=⋯=dm=0d_1 = \dots = d_m = 0.
  • If rr is even and ar/2≡−1(modN)a^{r/2} \equiv -1 \pmod N, then ar/2≡−1≢1a^{r/2} \equiv -1 \not\equiv 1 modulo each pjαjp_j^{\alpha_j} (as pjp_j is odd), so rj∤r/2r_j \nmid r/2. Since rj∣rr_j \mid r, this means rjr_j contains the full power 2d2^{d}, i.e. dj=dd_j = d for every jj.

In both cases all djd_j are equal.

Each valuation is spread out. By the Chinese remainder theorem, aa uniform on ZN∗\Z_N^\ast means that the components aj=a mod pjαja_j = a \bmod p_j^{\alpha_j} are independent and uniform on Zpjαj∗\Z_{p_j^{\alpha_j}}^\ast, and djd_j depends only on aja_j. Fix jj, let gg be a generator of the cyclic group Zpjαj∗\Z_{p_j^{\alpha_j}}^\ast of order φj\varphi_j, and let 2D2^{D} be the largest power of 2 dividing φj\varphi_j; D≥1D \ge 1 because pj−1p_j - 1 is even. The element gkg^{k} has order φj/gcd⁡(k,φj)\varphi_j/\gcd(k, \varphi_j), whose 2-adic exponent is DD when kk is odd and less than DD when kk is even. As kk ranges uniformly over {0,…,φj−1}\{0, \dots, \varphi_j - 1\} exactly half the values are odd, so Pr⁡[dj=D]=1/2\Pr[d_j = D] = 1/2 and consequently Pr⁡[dj=c]≤1/2\Pr[d_j = c] \le 1/2 for every value cc.

Conclusion. Conditioning on a1a_1 and using independence,

Pr⁡[failure]≤Pr⁡[d2=d1,…,dm=d1]=Ea1[∏j=2mPr⁡[dj=d1∣a1]]≤12m−1.\Pr[\text{failure}] \le \Pr[d_2 = d_1, \dots, d_m = d_1] = \mathbb{E}_{a_1}\Big[\prod_{j=2}^{m}\Pr[d_j = d_1 \mid a_1]\Big] \le \frac{1}{2^{m-1}} .

For m≥2m \ge 2 this is at most 1/21/2. The structure of the argument follows the proof of Theorem 5.3 in Nielsen and Chuang; counting the conditioning on d1d_1 explicitly gives the exponent m−1m - 1.

TheoremGood rational approximations are continued-fraction convergentsEstablished result

Write x=[c0;c1,c2,… ]x = [c_0; c_1, c_2, \dots] for its continued fraction, c0=⌊x⌋c_0 = \lfloor x \rfloor, and pk/qk=[c0;c1,…,ck]p_k/q_k = [c_0; c_1, \dots, c_k] for its convergents. If

∣sr−x∣  <  12r2,\Big\lvert \frac{s}{r} - x \Big\rvert \;<\; \frac{1}{2r^{2}},

then s/rs/r, written in lowest terms, equals pk/qkp_k/q_k for some kk. (With ≤\le in place of << the statement can fail in the trivial case r=1r = 1, x=c+12x = c + \tfrac12: then (c+1)/1(c+1)/1 is a convergent only of the expansion [c;1,1][c; 1, 1], not of [c;2][c; 2]. In order finding the inequality is strict.)

For a rational x=u/vx = u/v with 0≤u<v≤2L′0 \le u < v \le 2^{L'} the expansion has O(L′)O(L') terms and all convergents can be computed with O(L′3)O(L'^{3}) bit operations (Euclid's algorithm). In order finding, xx is the phase-estimation output with L′=O(log⁡N)L' = O(\log N) bits, and the theorem recovers s/rs/r from it. It is used in Section 5.3.1 of Nielsen and Chuang (continued fractions are treated in their Appendix 4.4); it is a classical result of number theory used for this purpose by Shor.

Holds when
  • xx is a real number, ss and r≥1r \ge 1 are integers.
TheoremPolynomial-time quantum algorithm for discrete logarithmsEstablished result

There is a bounded-error quantum algorithm that, on input (p,g,x)(p, g, x), outputs the unique ℓ∈{0,…,p−2}\ell \in \{0, \dots, p-2\} with gℓ≡x(modp)g^{\ell} \equiv x \pmod p using a number of gates polynomial in LL (dominated, as in factoring, by modular exponentiation).

The function f(α,β)=gαx−β mod pf(\alpha, \beta) = g^{\alpha} x^{-\beta} \bmod p on Zp−1×Zp−1\Z_{p-1} \times \Z_{p-1} satisfies f(α,β)=f(α′,β′)f(\alpha, \beta) = f(\alpha', \beta') exactly when (α−α′,β−β′)(\alpha - \alpha', \beta - \beta') is a multiple of (ℓ,1)(\ell, 1): it hides the subgroup generated by (ℓ,1)(\ell, 1). Evaluating ff in superposition, applying Fourier transforms to both registers and measuring yields pairs (c,d)(c, d) satisfying a linear relation with ℓ\ell, from which ℓ\ell is computed classically. This is due to Shor; Kitaev placed it, with factoring, in the abelian stabilizer (hidden subgroup) framework. The same approach works for any finite abelian group with efficiently computable, uniquely represented elements; for elliptic-curve groups over prime fields the circuits were worked out by Proos and Zalka and costed in detail by Roetteler, Naehrig, Svore and Lauter.

Holds when
  • pp is a prime of LL bits, gg generates Zp∗\Z_p^\ast, and x∈Zp∗x \in \Z_p^\ast.
  • Fault-free quantum circuits; the running time is the number of elementary gates plus classical post-processing.

Worked Examples

Factoring 15

The group Z15∗\Z_{15}^\ast has eight elements. Their orders and the outcome of the reduction:

aa 1 2 4 7 8 11 13 14
order rr 1 4 2 4 4 2 4 2
ar/2 mod 15a^{r/2} \bmod 15 – 4 4 4 4 11 4 14
factors found no 3, 5 3, 5 3, 5 3, 5 5, 3 3, 5 no

For a=7a = 7: b=72=49≡4b = 7^2 = 49 \equiv 4, gcd⁡(3,15)=3\gcd(3, 15) = 3 and gcd⁡(5,15)=5\gcd(5, 15) = 5. For a=11a = 11: b=11b = 11, gcd⁡(10,15)=5\gcd(10, 15) = 5 and gcd⁡(12,15)=3\gcd(12, 15) = 3. The two failures are a=1a = 1 (odd order) and a=14≡−1a = 14 \equiv -1. Six of eight choices succeed, consistent with the bound 1−2−(m−1)=1/21 - 2^{-(m-1)} = 1/2 for m=2m = 2 prime factors.

The quantum step for a=7a = 7: the phases are s/4s/4 with s∈{0,1,2,3}s \in \{0, 1, 2, 3\}, all exactly representable once t≥2t \ge 2, so phase estimation returns s/4s/4 exactly, each with probability 1/41/4. The outcomes 1/41/4 and 3/43/4 give denominator 4 and succeed; 1/21/2 gives denominator 2, and the test 72≡4≠17^2 \equiv 4 \ne 1 rejects it; 00 gives nothing. Half of the runs return rr directly.

Sizing a cryptographic instance

For NN of L=2048L = 2048 bits, the textbook order-finding circuit with ε=1/4\varepsilon = 1/4 uses t=2L+1+⌈log⁡24⌉=4099t = 2L + 1 + \lceil\log_2 4\rceil = 4099 control qubits and L=2048L = 2048 work qubits before arithmetic ancillas, and performs tt controlled modular multiplications of 2048-bit numbers. With schoolbook arithmetic each multiplication is of order L2≈4×106L^2 \approx 4 \times 10^6 gates, so the total is of order 101010^{10} gates. The resource estimates below replace each of these choices with much cheaper ones.

Algorithms and Implementations

AlgorithmQuantum order findingEstablished result

The unitary. On an LL-qubit register let Ua∣y⟩=∣ay mod N⟩U_a\ket{y} = \ket{a y \bmod N} for 0≤y<N0 \le y < N and Ua∣y⟩=∣y⟩U_a\ket{y} = \ket{y} for N≤y<2LN \le y < 2^L. It permutes basis states (because aa is invertible modulo NN), so it is unitary, and Ua2j=Ua2j mod NU_a^{2^j} = U_{a^{2^j} \bmod N} costs no more than UaU_a.

Its eigenvectors. For s=0,…,r−1s = 0, \dots, r-1 let

∣us⟩=1r∑k=0r−1e−2πisk/r ∣ak mod N⟩.\ket{u_s} = \frac{1}{\sqrt r}\sum_{k=0}^{r-1} e^{-2\pi i s k/r}\, \ket{a^k \bmod N} .

Since Ua∣ak⟩=∣ak+1⟩U_a\ket{a^k} = \ket{a^{k+1}} and ar≡1a^r \equiv 1, re-indexing the sum gives Ua∣us⟩=e2πis/r∣us⟩U_a\ket{u_s} = e^{2\pi i s/r}\ket{u_s}. Summing over ss, the phases cancel except at k=0k = 0: r−1/2∑s=0r−1∣us⟩=∣1⟩r^{-1/2}\sum_{s=0}^{r-1}\ket{u_s} = \ket{1}. So the easily prepared state ∣1⟩\ket{1} is a uniform superposition of eigenvectors whose phases are s/rs/r.

Procedure.

  1. Run phase estimation on UaU_a with target ∣1⟩\ket{1} and t=2L+1+⌈log⁡2(2+1/(2ε))⌉t = 2L + 1 + \lceil \log_2(2 + 1/(2\varepsilon)) \rceil control qubits; read the result as x=m/2tx = m/2^t.
  2. Compute the continued-fraction convergents of xx; for each denominator q<Nq < N in increasing order, test whether aq≡1(modN)a^{q} \equiv 1 \pmod N, and output the first such qq.

Correctness. By the superposition remark in the phase estimation record, step 1 behaves as phase estimation on ∣us⟩\ket{u_s} for an ss uniform in {0,…,r−1}\{0, \dots, r-1\}. By the accuracy theorem with n=2L+1n = 2L + 1, with probability at least 1−ε1 - \varepsilon, ∣x−s/r∣≤2−(2L+1)≤1/(2N2)<1/(2r2)\lvert x - s/r\rvert \le 2^{-(2L+1)} \le 1/(2N^2) < 1/(2r^2), using r<N≤2Lr < N \le 2^L (for s≥1s \ge 1 the distance modulo 1 coincides with the ordinary distance, as s/rs/r is at least 1/r1/r away from 0 and 1; s=0s = 0 is a failed run). The convergent theorem then puts s/rs/r in lowest terms, s′/r′s'/r', among the convergents of xx. If gcd⁡(s,r)=1\gcd(s, r) = 1 then r′=rr' = r and step 2 returns rr; otherwise r′r' is a proper divisor of rr and the test ar′≡1a^{r'} \equiv 1 fails for it. The probability that a uniform ss is coprime to rr is φ(r)/r=Ω(1/log⁡log⁡r)\varphi(r)/r = \Omega(1/\log\log r), so O(log⁡log⁡N)O(\log\log N) repetitions suffice; combining the denominators of two runs by their least common multiple reduces this to a constant expected number of runs (section 5.3.1 of Nielsen and Chuang).

Cost. The quantum part is dominated by the t=O(L)t = O(L) controlled modular multiplications. With schoolbook arithmetic each costs O(L2)O(L^2) gates, giving O(L3)O(L^3) gates per run; with fast multiplication Shor obtains O(L2log⁡Llog⁡log⁡L)O(L^2 \log L \log\log L). The inverse QFT on tt qubits costs O(L2)O(L^2) gates, or O(Llog⁡L)O(L\log L) approximately. The classical continued-fraction step costs O(L3)O(L^3) bit operations.

The algorithm is Shor's; the eigenvector formulation as phase estimation is due to Kitaev and Cleve, Ekert, Macchiavello and Mosca.

Holds when
  • N≥3N \ge 3 with L=⌈log⁡2N⌉L = \lceil \log_2 N \rceil bits, and a∈ZN∗a \in \Z_N^\ast of unknown order rr.
  • A reversible circuit for controlled modular multiplication by a2j mod Na^{2^j} \bmod N for each jj (the classical computer precomputes these constants).

Qubit-lean circuits. Beauregard (2003) gave a general circuit with 2L+32L + 3 qubits, O(L3log⁡L)O(L^3 \log L) elementary gates and depth O(L3)O(L^3).

Regev's variant. Regev (J. ACM 2025; preprint 2023) runs a multidimensional analogue of period finding: L+4\sqrt L + 4 independent runs of a circuit with O~(L3/2)\tilde O(L^{3/2}) gates each, followed by classical lattice post-processing. Its correctness rests on a number-theoretic heuristic assumption, and the paper notes that its practical benefit is unclear.

Applications

Breaking RSA (factoring) and finite-field and elliptic-curve Diffie–Hellman and DSA (discrete logarithms). The prospect drives the migration to post-quantum cryptography, and the timeline debate uses the resource estimates below. The algorithm is also the prototype of the abelian hidden subgroup framework (Kitaev); see quantum algorithms.

Computational Complexity

Per run, with L=⌈log⁡2N⌉L = \lceil\log_2 N\rceil:

Component Gates Source
Controlled modular exponentiation, schoolbook arithmetic O(L3)O(L^3) Shor
Same with fast multiplication O(L2log⁡Llog⁡log⁡L)O(L^2\log L\log\log L) Shor
Inverse QFT on 2L+O(1)2L + O(1) qubits O(L2)O(L^2), or O(Llog⁡L)O(L\log L) approximately QFT topic
Classical continued fractions O(L3)O(L^3) bit operations Nielsen and Chuang

The best known classical factoring algorithms run in time that is sub-exponential but super-polynomial in LL; no polynomial-time classical algorithm is known, and none has been ruled out.

Limitations and Common Pitfalls

  • The QFT is cheap; arithmetic is expensive. Optimising the Fourier transform changes little; resource estimates are dominated by modular multiplication.
  • Logical is not physical. Qubit counts such as 2L+32L + 3 are logical qubits on an error-free machine. Error correction multiplies them by a large factor; compare estimates only when they state the same error model.
  • "Compiled" demonstrations. Small experiments, starting with factoring 15 in NMR by Vandersypen et al. (2001), use circuits simplified with knowledge of the answer. Smolin, Smith and Vargo (2013) showed that with such simplifications any product of two distinct odd primes can be "factored" with a two-qubit circuit, so the size of the number factored is not a meaningful benchmark; the length of the period found is.
  • Not every aa works, not every run works. Failed runs (odd order, ar/2≡−1a^{r/2} \equiv -1, gcd⁡(s,r)>1\gcd(s, r) > 1, phase estimation errors) are normal and are handled by classical checks and repetition.
  • Factoring is not known to be NP-hard, and Shor's algorithm gives no evidence that quantum computers solve NP-complete problems efficiently.

State of the Art

Resource estimates for the 2048-bit RSA instance, as of 2026-11 (all on a square grid of qubits with nearest-neighbour connections, a uniform physical gate error rate of 0.1 %, a surface-code cycle time of 1 µs and a control-system reaction time of 10 µs):

Year Physical qubits Runtime Main techniques Source
2019 (journal 2021) 20 million 8 hours optimised modular arithmetic, surface code, magic-state distillation factories Gidney and Ekerå
2025 (preprint) fewer than 1 million less than a week approximate residue arithmetic, yoked surface codes for idle qubits, magic-state cultivation Gidney

For elliptic curves over nn-bit prime fields, Roetteler, Naehrig, Svore and Lauter (2017) bounded the logical cost by 9n+2⌈log⁡2n⌉+109n + 2\lceil\log_2 n\rceil + 10 qubits and 448n3log⁡2n+4090n3448 n^3\log_2 n + 4090 n^3 Toffoli gates; for the 256-bit curve P-256 the qubit bound is 2330 logical qubits, fewer than for RSA at comparable classical security. Earlier, Proos and Zalka (2003) had estimated about 1000 qubits for a 160-bit curve against about 2000 for a 1024-bit RSA modulus.

Quantum phase estimation, the quantum Fourier transform, fault-tolerant quantum computing for the overheads behind the resource estimates, and the overview of quantum algorithms. The lesson Resource estimation works through how such estimates are assembled.

Part of

Open in the knowledge graph

Contributions about this record

Nobody has published a contribution about it yet.

Publish a result, reproduction or commentPropose a correction to this page

References

  1. Peter W. Shor (1997). Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer. SIAM Journal on Computing 26(5), 1484-1509. doi:10.1137/S0097539795293172arXiv:quant-ph/9508027
  2. A. Yu. Kitaev (1995). Quantum measurements and the Abelian stabilizer problem. arXiv:quant-ph/9511026
  3. Richard Cleve, Artur Ekert, Chiara Macchiavello, Michele Mosca (1998). Quantum algorithms revisited. Proceedings of the Royal Society A 454, 339-354. doi:10.1098/rspa.1998.0164arXiv:quant-ph/9708016
  4. Michael A. Nielsen, Isaac L. Chuang (2010). Quantum Computation and Quantum Information (10th Anniversary Edition). Cambridge University Press. doi:10.1017/CBO9780511976667
  5. Stéphane Beauregard (2003). Circuit for Shor's algorithm using 2n+3 qubits. Quantum Information and Computation 3(2), 175-185. doi:10.26421/QIC3.2-8arXiv:quant-ph/0205095
  6. John Proos, Christof Zalka (2003). Shor's discrete logarithm quantum algorithm for elliptic curves. Quantum Information and Computation 3(4), 317-344. doi:10.26421/QIC3.4-3arXiv:quant-ph/0301141
  7. Martin Roetteler, Michael Naehrig, Krysta M. Svore, Kristin Lauter (2017). Quantum resource estimates for computing elliptic curve discrete logarithms. Advances in Cryptology - ASIACRYPT 2017, Lecture Notes in Computer Science, 241-270. doi:10.1007/978-3-319-70697-9_9arXiv:1706.06752
  8. Craig Gidney, Martin Ekerå (2021). How to factor 2048 bit RSA integers in 8 hours using 20 million noisy qubits. Quantum 5, 433 (arXiv preprint 2019). doi:10.22331/q-2021-04-15-433arXiv:1905.09749
  9. Craig Gidney (2025). How to factor 2048 bit RSA integers with less than a million noisy qubits. arXiv:2505.15917
  10. Oded Regev (2025). An efficient quantum factoring algorithm. Journal of the ACM 72(1), 1-13 (arXiv preprint 2023). doi:10.1145/3708471arXiv:2308.06572
  11. Lieven M. K. Vandersypen, Matthias Steffen, Gregory Breyta, … Isaac L. Chuang (2001). Experimental realization of Shor's quantum factoring algorithm using nuclear magnetic resonance. Nature 414, 883-887. doi:10.1038/414883aarXiv:quant-ph/0112176
  12. John A. Smolin, Graeme Smith, Alexander Vargo (2013). Oversimplifying quantum factoring. Nature 499, 163-165. doi:10.1038/nature12290arXiv:1301.7007

Contributors

  • KetQat maintainers · @ketqatConceptualization; Supervision (CRediT roles)
  • Claude (AI drafting assistant)Writing, original draft (CRediT roles)

Review history

  1. Automated source check · Pass · 2026-12-01 · Independent automated verification pass (AI, not the drafting session)

    Topic body only (embedded records carry their own review states). Factoring-15 table recomputed (orders, a^(r/2) mod 15, gcds, 6 of 8 successes) and the a = 7 quantum step checked; sizing example recomputed (t = 4099, about 1.7e10 gates). Compared with the arXiv abstracts of Beauregard (quant-ph/0205095: 2n+3 qubits, O(n^3 lg n) gates, depth O(n^3)), Regev (2308.06572: sqrt(n)+4 runs of O~(n^(3/2))-gate circuits, heuristic assumption, practical benefit unclear; J. ACM 72(1) 1-13 confirmed via Crossref), Gidney-Ekera (1905.09749: 20 million qubits, 8 hours, stated hardware assumptions), Gidney (2505.15917: under a million qubits, under a week, same assumptions, the three named techniques; no journal reference on arXiv), Roetteler et al. (1706.06752: 9n + 2 ceil(log2 n) + 10 qubits, 448 n^3 log2 n + 4090 n^3 Toffolis; 2330 for n = 256 recomputed), Proos-Zalka (quant-ph/0301141) and Smolin-Smith-Vargo (1301.7007); cost rows compared with Shor quant-ph/9508027 Section 3.

Revision history

  1. 2026-12-01Content release 2.1.0: 35 more topics, an independent source check of every record, intake hardening (#17)80537b7e
  2. 2026-11-30KetQat Commons: free learning paths, knowledge records, research problems, literature intake (#14)571c9b10

Current revision 27eb5c2f29abbc5f. Source file knowledge/records/topic/shor-algorithm.md in the content repository (readable there once it is public).