// Demos

Run it yourself,
live on the BEAM.

Every chart below is computed when it comes into view, on our BEAM service, and can be repeated exactly with its seed. The full demo page has the circuits in OpenQASM.

// Run it yourself

Ten circuits,
simulated live on the BEAM.

Quantum circuit simulation on QxSim, written in Elixir and running on the Erlang virtual machine: four algorithms and protocols, one quantum ML circuit, five error-correcting codes. The charts below are not pictures: each card ran its circuit when this section came into view, and draws the outcomes it measured, shot by shot. Run any of them again, or open the full demo page for the circuits in OpenQASM and the error-correction details.

A-01 · Protocol

Bell state

Two qubits, maximally entangled: only 00 and 11 appear, half each.

Open →
A-02 · Protocol

Teleportation

A random state sent from Alice to Bob through a Bell pair and two classical bits; Bob corrects it, then undoes its preparation: his qubit (leftmost) must read 0 every time.

Open →
A-03 · Algorithm

Grover's search, 2–10 qubits

A random marked state among N = 2ⁿ. Line: its probability after each iteration, exact; dots: theory sin²((2k+1)θ). The optimum is near (π/4)√N.

Open →
M-01 · Quantum ML

Variational classifier

Rx rotations and an entangling CNOT layer — the shape of a quantum ML model.

Open →
A-04 · Algorithm

Shor's algorithm, N = 15, compiled

Compiled for a = 7: 7⁴ ≡ 1 (mod 15), so the period is built into the circuit — it shows the structure, not a speedup. k = 2, 6 give 3 × 5 directly; k = 4 after a check; k = 0 nothing.

Open →
A-05 · Algorithm

Shor's algorithm, general

N = 15 or 21, any a: 2n counting qubits, the inverse QFT, continued fractions; nothing about the period goes in. The multiplication by a^(2^j) mod N is a permutation computed classically (an oracle, not a gate circuit). Failing choices of a fail, and say why.

Open →
E-01 · Code

Bit-flip code

Logical |0⟩ on three qubits, an X error on qubit 1; two ancillas measure the parities, a majority vote of the readout corrects it. Noiseless gates.

Open →
E-02 · Code

Phase-flip code

Logical |0⟩ as |+++⟩, a Z error on qubit 1; checks X₀X₁ and X₁X₂ on one reused ancilla find it, a Z corrects it. Read out in the X basis.

Open →
E-03 · Code

Shor's 9-qubit code

A Y error (bit and phase flip) on qubit 1; six Z checks and two X checks find both, the decoder corrects both. Bars: the logical qubit, 0 or 1.

Open →
E-04 · Code

Steane [[7,1,3]] code

A Y error on qubit 1; three Z and three X checks give its position twice, in binary; X and Z correct it. Bars: the logical qubit, 0 or 1.

Open →
E-05 · Code

Surface code, distance 3

The full distance-3 code: nine data qubits, all eight stabilizers on one reused ancilla, a Y error on qubit 1; a lookup decoder corrects both flips. Bars: the logical qubit.

Open →
Reproduce this
curl "https://quanterall.com/quantum/bell?shots=1024&seed=42"
curl "https://quanterall.com/quantum/shor15?shots=1024&seed=42"
curl "https://quanterall.com/quantum/qec/steane7?shots=1024&error_qubit=3&seed=42"
curl "https://quanterall.com/quantum/entangle?shots=2000"
curl "https://quanterall.com/quantum/migrate?shots=100"

Every card is one such call: the path is the demo's name (bell, teleport, grover, qml, shor15, qec/…), the answer is JSON with the counts and the circuit in OpenQASM. Add seed (0 to 2³²−1) and the same call gives the same counts; without one, the answer reports the seed it drew, so any run can be repeated. The process models run many processes of their own and are not seeded. Limits: up to 10,000 shots a call, 5 calls a second per visitor (bursts of 20), 4 simulations at once. About the code: the demos began on qx, Craig Richards' Elixir quantum simulator (Apache-2.0; we used version 0.5.1), and we credit it. The simulators now running are separate code, and the comparison is published (tools/qx_compare.py, result): every qx release depends on Nx, our service does not depend on qx; none of 19 distinctive names of ours occurs in qx's 207 commits; and cut into 8-token sequences (comments and strings removed), at most 2 % of any of our files occurs in any qx release — while consecutive qx releases share 92 to 100 %, so the measure does find shared code where there is some. It measures textual copying only, not the same design written again in other words. Earlier labels here that read "qx_sim 0.5.1" named the starting point, not the code that runs.

// Process models on the BEAM

Entanglement as linked processes. Teleportation as a process that migrates.

Two quantum concepts modelled with what the Erlang virtual machine does best — isolated processes and nodes — for teaching and for demonstrating the concepts. Both run live below, on real BEAM processes; the numbers are measured, not drawn.

X-01 · Entanglement

Each round spawns three processes: a pair process holding the shared state |Φ⁺⟩, and Alice and Bob. They never message each other; each asks the pair to measure its own qubit at an angle. Whoever asks first collapses the shared state, and the other reads a correlated result. A classical simulation: the pair process is a central state holder, so this shows the statistics of entanglement, not nonlocality.

Alicepair |Φ⁺⟩Bob
The physical system: two photons with entangled polarization

A crystal makes the photon pair; neither photon has a polarization of its own until one meets a polarizer. A polarizer turns half as much as the qubit's measurement axis, so the settings are 0° or 45° for Alice and 22.5° or 67.5° for Bob, as in the Bell tests of Aspect (1982) and Weihs (1998). Played: this run's first 24 pairs.

running…
X-02 · Teleportation

Node A is this server's BEAM; node B is a second BEAM node, a separate operating-system process. Alice's process holds a qubit ψ, measures it against her half of a Bell pair and ends; only two classical bits go to node B, where a new process applies the correction and holds the same state. ψ is unknown to the protocol but known to the simulator, which checks the result: this shows the protocol's structure, not a physical transmission.

node Anode B OS pid —OS pid — classical Bell pair (pre-shared)
The physical system: a photon's polarization

As in the first teleportation experiment (Bouwmeester et al., Innsbruck 1997) and from the ground to the Micius satellite over 1,400 km (2017): |0⟩ is horizontal and |1⟩ vertical polarization, ψ is drawn as its polarization ellipse. A Bell-state analyser built only from beam splitters tells apart two of the four outcomes; the model, like trapped-ion experiments, uses all four.

running…