← Atlas

Algorithms · Hidden-period / factoring

Shor period finding

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

Strong empiricalUpdated

Open on the mapView frozen graph

A small worked example, computed in your browser. It is not a result from this record's papers.

Order-finding for 7 mod 15

3 counting qubits, 4 work qubits, finding the order of 7 modulo 15 (the order is 4: 7⁴ mod 15 = 1).

q0q1q2q3q4q5q6Step 1 of 5 · XXStep 2 of 5 · Hadamard layer(3)Hadamard layer(3)Step 3 of 5 · Controlled x7 mod 15Controlled x7 mod 15Step 4 of 5 · Controlled x4 mod 15Controlled x4 mod 15Step 5 of 5 · QFT inverse(3)QFT inverse(3)

Step 1 of 5 · X

Probability of each outcome after this step

  • 0001000100%
  1. Prepares the work register as |0001⟩ = 1.

    The whole state moves from 0000000 to 0001000 — one certain outcome before, one certain outcome after, no superposition either side.

  2. Spreads the 3 counting qubits into an equal superposition of all 8 values.

    Probability spreads from 1 outcome to 8. All 8 are equally likely.

  3. Multiplies the work register by 7 mod 15, controlled by the first counting qubit: the k=0 controlled power of the order-finding unitary.

    Probability moves: 4 outcomes appear that had none, 4 drop to zero, 8 carry probability now. Down: 0001001 12.5% → 0.0%, 0001011 12.5% → 0.0%. This is the step that entangles the qubits: from here on no single qubit has a state of its own, only the register as a whole does.

  4. Multiplies the work register by 4 mod 15 (7 squared, mod 15), controlled by the second counting qubit: the k=1 controlled power. The k=2 power would multiply by 7⁴ mod 15 = 1, so it is the identity and is left out entirely.

    Probability moves: 4 outcomes appear that had none, 4 drop to zero, 8 carry probability now. Up: 0100010 0.0% → 12.5%. Down: 0001010 12.5% → 0.0%, 0001110 12.5% → 0.0%.

  5. An inverse QFT on the counting register reads the phase found by the controlled multiplications into a 3-bit estimate.

    Probability moves: 12 outcomes appear that had none, 4 drop to zero, 16 carry probability now. Down: 0111001 12.5% → 0.0%, 0111101 12.5% → 0.0%.

Readout The counting register reads 000, 010, 100 or 110, each equally likely, corresponding to the four powers k = 0, 1, 2, 3 of the order r = 4; the work register ends entangled with the counting outcome, holding one of 1, 7, 4 or 13. Repeating this and applying the continued-fractions step of the full algorithm to a nonzero outcome recovers the order r = 4 exactly.

Open in Studio
  • Steps3
  • Wires3
  • Quantum coreOrder finding
  • Classical postContinued fractions
  • ReadinessFTQC required
  • Papers1

A part this method uses, worked through

This page says Quantum phase estimation — here is a concrete, runnable instance of it.

Phase estimation of P(3*pi/4)

3 counting qubits estimating the phase of P(3π/4), which is 2π·3/8 exactly: a phase 3-bit QPE can represent exactly.

q0q1q2q3XHadamard layer(3)Controlled phase powers(3)QFT inverse(3)

Where it ends up

  • 1011100%

The counting register reads 011 = 3 with probability 1: angle/(2π) = 3/8, recovered exactly.

One of its steps changes only phase: the outcome probabilities stay put while the state does not.

Open this part in Studio
Quantum core
Order finding
Classical post
Continued fractions
Readiness
FTQC required
Threatened
RSA / finite-field DLP
Quantum output
Period samples
Deployment
Migration planning

References

Strong empirical
  • Community submission
  • Verified by construction
  • Peer-reviewed paper
Method
The order-finding and inverse-QFT structure is represented as a literature-oriented reference record.
Result
Reviewable reference · not a claim of practical cryptanalysis.
Caveat
A useful implementation requires large, fault-tolerant resources and careful classical post-processing.
Polynomial-Time Algorithms for Prime Factorization and Discrete Logarithms on a Quantum Computer ↗
Kind
curated reference
Reviewed by
LeonaQ literature curation pass
License
Public bibliographic link; code is an original reference sketch
cryptographyfactoringperiod findingfault tolerant
  • Post-quantum cryptography migration planning
  • PKI and long-lived secret inventory
  • Quantum-safe protocol testing

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