Sign in
← Atlas
Strong empiricalAlgorithmsHidden-period / factoring

Shor period finding

The cryptography-facing quantum algorithm record, with the assumptions that make its security relevance precise.

cryptographyfactoringperiod findingfault tolerant

Atlas stars stay in the public catalog. Saving this entry to your workspace starts an unstarred private copy.

Shor's algorithm reduces factoring and discrete logarithms to period finding. It is industry-relevant primarily as a migration and risk-planning reference today, not as a near-term production attack.

Circuit & simulation
Period r50%
What this takes and returns
TakesNothingWhat joins here

No input port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.

Nothing in the Atlas meets this end.

ReturnsNothingWhat joins here

No output port at this edge: the record publishes no gate sequence and no register, so there is nothing here to read one off — and unlike a declared hole, nothing has been recorded about what belongs here.

Nothing in the Atlas meets this end.

This record publishes no gate sequence and no register, so there is nothing here to read an interface off. Absent rather than empty. See all 152 →

Where this sits

This record is named by the layer graph at:

  • Period finding in a finite cyclic group Method

    Takes A circuit evaluating f on a superposition of inputs, the promise that f is periodic, the kind of object its period is (an integer in a finite cyclic group, an irrational real, a lattice of rank r), and — where the period is not an integer — the precision wanted. Returns The period: an exact integer where the group is finite, or an approximation to the requested precision together with the classical post-processing that turned the measured samples into it.

How it works

Shor's algorithm reduces factoring NN to finding the period rr of f(x)=axmodNf(x)=a^x \bmod N for a random aa coprime to NN: once rr is known, gcd(ar/2±1,N)\gcd(a^{r/2}\pm1, N) yields a nontrivial factor with good probability (when rr is even and ar/2≢1a^{r/2}\not\equiv -1). The quantum step estimates rr via phase estimation: preparing a superposition over the exponent register, applying controlled modular exponentiation Ua2jU_a^{2^j}, and reading out with an inverse QFT gives a phase close to s/rs/r for random integer ss; a classical continued-fraction expansion then recovers rr. This record documents that circuit motif — controlled-UU powers feeding an inverse QFT — and keeps the quantum (period-extraction) and classical (continued-fraction) halves visible as separate steps, consistent with its own status: a reviewable reference, not a resource-estimated fault-tolerant implementation, since a cryptographically relevant instance needs thousands of logical qubits and deep modular-arithmetic circuits.

Implementation
Native
shor_period_finding.py
from qiskit import QuantumCircuit

# Reference skeleton: modular multiplication is problem-specific.
qc = QuantumCircuit(6)
qc.h(range(3))
# controlled-U^(2^j) blocks feed inverse QFT.
qc.barrier()

FINAL_CIRCUIT = qc

This is a conceptual skeleton, not a production factoring implementation or security benchmark.

Quantum vs classical
MetricClassicalQuantum
Time complexitysub-exponentialpolynomial in log N
Scaling (b = log₂N)exp(Õ(b^⅓))Õ(b³)
Logical qubits (2048-bit)~few thousand
ImpactRSA / ECC assumed hardbreaks RSA / ECC

Classical baseline

General number-field sieve for factoring and classical discrete-logarithm algorithms under the same security parameter.

Quantum claim

Polynomial-time asymptotic factoring and discrete logarithms in the fault-tolerant query/gate model.

How to compare

Compare logical qubits, T gates, error-correction overhead, runtime, and key sizes; never collapse a mathematical threat into a current hardware claim.

Declared gaps

Nobody has reviewed this record for gaps yet.

Literature & references
Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer1995 · Peter W. Shor

Original factoring and discrete-logarithm algorithm based on quantum period finding.

arxiv.org/abs/quant-ph/9508027