! Educational demonstration only. Keys, moduli, and RSA sizes here are intentionally tiny so classical/quantum attacks finish in seconds — today's classical hardware cannot run Shor's algorithm against real production RSA keys. See Security & Limitations.
Shor's Lab

$ The central demonstration

Factor N using a real simulated quantum period-finding circuit, then recover the factors with the classical continued-fractions post-processing -- run the full pipeline, not a hardcoded answer.

three orbits, three speeds -- periodically they land in the same place at the same time. that's the signal a period-finding measurement is built to catch.

N here is deliberately tiny (15–65), so the entire pipeline -- simulation, measurement, and classical post-processing -- runs end to end in real time. See Resource Estimation for what a real RSA-2048 key would actually require.

0. Watch it work, step by step

try your own N and a — the whole diagram below recomputes for real

Step 1 of 5: Superposition. Put the counting register into every value 0–15 at once, instead of picking just one.
controltargetHH2ˣ mod 15QFT⁻¹
Hsuperposition●–●controlled opQFT⁻¹inverse Fourier⌒↗measurement
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15

every one of the 16 states carries the same amplitude — 0.250

ψ=116x=015x|\psi\rangle = \frac{1}{\sqrt{16}}\sum_{x=0}^{15}|x\rangle

01Put the counting register into every value 0–15 at once, instead of picking just one.

The actual code behind this step

quantum/shor.py:121-122
for q in control_qubits:
register.apply_gate(H, q)

1. Pick a starting point

Failure-mode gallery

Four real, curated (N, a) pairs -- one for each outcome this algorithm can actually produce. Click one to load it above, then run it yourself.

Loading available backends…

2. Configure and run it for real

Go deeper: Shor's Algorithm: The Math