MachineFlow · executable example

Shor quantum circuit

Follow a factorization from problem selection through quantum period finding and classical recovery.

deterministic simulation
N = 153 × 5

Circuit

Period-finding pipeline

12 logical qubits
  1. 01
    Initialize

    Prepare counting qubits in superposition and the work register in |1⟩.

  2. 02
    Modular power

    Apply controlled multiplication by powers of the selected base modulo N.

  3. 03
    Inverse QFT

    Convert periodic phase information into measurable counting-register peaks.

  4. 04
    Measure

    Sample a phase candidate and infer the modular period with classical arithmetic.

  5. 05
    Recover factors

    Evaluate gcd(a^(r/2) − 1, N) and gcd(a^(r/2) + 1, N).

Hilbert space · finite timeline

Bounded input

state 1 / 6
Classical preflight · paused

N = 15 and a = 2 select one deterministic educational experiment. No quantum process has run.

productBoth toy qubits begin in the |0⟩ basis state.

Σ probability = 1.000000

q0q1
|00
Re
1.000
Im
0.000
phase
0.000 rad
P
100.0%
|01
Re
0.000
Im
0.000
phase
0.000 rad
P
0.0%
|10
Re
0.000
Im
0.000
phase
0.000 rad
P
0.0%
|11
Re
0.000
Im
0.000
phase
0.000 rad
P
0.0%
|0⟩|1⟩
q0x 0.00 · y 0.00 · z 1.00purity radius 1.00
|0⟩|1⟩
q1x 0.00 · y 0.00 · z 1.00purity radius 1.00
Relative phaseAngle represents complex phase; radius separates basis labels and is not spatial position.

A normalized two-qubit teaching projection alongside deterministic Shor arithmetic; not quantum hardware or a gate-accurate emulator.

Measurement

Period evidence

4 peaks

Modular orbit

a0 mod N1
a1 mod N2
a2 mod N4
a3 mod N8
a4 mod N1

Counting-register peaks

|025%
|6425%
|12825%
|19225%