Playground

Quantum Arcade

26 games, labs, and demos. Nothing here is a canned animation: every bar, dial, and verdict is computed live by the same from scratch statevector and density matrix engine that powers the VQE suite. One card runs an analytic textbook formula instead of a simulation, it says so on the card.

One qubit, no mercy

The fundamentals, every widget drives a real statevector.

Gate Mixer

lab
|0⟩: 100.0 percent, |1⟩: 0.0 percent
|0⟩
100.0%
|1⟩
0.0%

apply a gate…

Computes: one real statevector; every button multiplies it by that gate's actual 2×2 unitary

State Match

game

A hidden state is drawn. Steer yours (blue) onto the ghost (dim), fidelity ≥ 99% wins.

fidelity73.5%
Computes: |⟨target|yours⟩|² between two real single qubit states

Born Casino

game

Set the odds with θ, then call the collapse. Long streaks get exponentially unlikely, that is the Born rule doing its job.

|0⟩: 75.0 percent, |1⟩: 25.0 percent
|0⟩
75.0%
|1⟩
25.0%
streak0
best0
Computes: a fresh statevector each round; the collapse is an inverse CDF sample of |amplitude|²

π-Pulse Trainer

game

Drive the qubit with a rotation pulse. A perfect π pulse lands the whole amplitude on |1⟩, this is exactly how real qubits get flipped.

P(|1⟩)31.88%
Computes: P(|1⟩) from RY(θ) applied to a real statevector, the textbook sin²(θ/2)

Interference Lab

lab

Split one qubit onto two paths (H), twist the phase between them, recombine (H). The output probability swings from certain to impossible, with nothing removed, only phase.

Before you slide: at φ = 180°, P(|0⟩) will be

|0⟩: 100.0 percent, |1⟩: 0.0 percent
|0⟩
100.0%
|1⟩
0.0%
Computes: H · RZ(φ) · H on a real statevector, the fringe is computed, not drawn

Measurement Duel

lab

One fixed state, two questions. Ask in Z: pure coin flip. Ask in X: dead certain. The state didn't change, your question did.

Z→0: 0.0 percent, Z→1: 0.0 percent
Z→0
0.0%
Z→1
0.0%
X→+: 0.0 percent, X→−: 0.0 percent
X→+
0.0%
X→−
0.0%
Computes: 20 real sampled shots per press on the same |+⟩ state, only the measurement basis differs

Bloch Detective

game

Before and after. Which gate did it?

→
score0/0
Computes: each round applies the secret gate's real unitary; both dials are computed Bloch vectors

Entanglement & protocols

Two qubits, one wavefunction, the part with no classical story.

Entanglement Dial

lab

Turn one knob from “two separate qubits” to “one inseparable pair.” Watch qubit A's purity drop to ½, alone, it becomes a pure coin flip, because the information lives in the pair.

|00⟩: 50.0 percent, |01⟩: 0.0 percent, |10⟩: 0.0 percent, |11⟩: 50.0 percent
|00⟩
50.0%
|01⟩
0.0%
|10⟩
0.0%
|11⟩
50.0%
purity of qubit A0.500

maximally entangled territory

Computes: RY(θ)+CNOT on a real 2-qubit statevector; purity Tr(ρ²) of the actual reduced density matrix

Entangled Dice

demo

Two dice, one wavefunction. Each roll is individually 50/50 random, and they always agree. Randomness and perfect correlation, at the same time.

Computes: each roll samples a real Bell state in matching bases, agreement is computed, not scripted

CHSH. Beat the Classical Bound

game

Classical physics caps |S| at 2. A Bell pair reaches 2√2 ≈ 2.83. Collect rounds and watch your sampled S climb past what any local hidden variable story allows.

Before you run: after 100+ rounds, S will land

rounds0
Sno rounds yet
quantum max2.828
Computes: every round rotates a real Bell state's measurement bases and samples the joint outcome; S is estimated from those samples only

Teleportation Walkthrough

demo

A message qubit, an entangled pair, and two classical bits, the state moves without any qubit traveling. Step through the actual amplitudes.

Message ⊗ |00⟩
state 0: 72.7 percent, state 1: 27.3 percent, state 2: 0.0 percent, state 3: 0.0 percent, state 4: 0.0 percent, state 5: 0.0 percent, state 6: 0.0 percent, state 7: 0.0 percent
|000⟩
72.7%
|001⟩
27.3%
|010⟩
0.0%
|011⟩
0.0%
|100⟩
0.0%
|101⟩
0.0%
|110⟩
0.0%
|111⟩
0.0%
Computes: the real 3-qubit statevector at each protocol stage; bars are its live probabilities

Superdense Coding

demo

Share a Bell pair in advance, and one qubit can carry two classical bits. Pick the bits; the decoder lands on the matching basis state with certainty.

sending “00”
decode 00: 100.0 percent, decode 01: 0.0 percent, decode 10: 0.0 percent, decode 11: 0.0 percent
decode 00
100.0%
decode 01
0.0%
decode 10
0.0%
decode 11
0.0%
Computes: encode on a real Bell pair (I/X/Z/XZ), decode with CNOT+H, the bars are the decoded statevector

Phase Kickback

demo

CNOT is supposed to change the target. Put the target in |−⟩ and fire: the target shrugs, the control flips from |+⟩ to |−⟩. This backwards kick powers Deutsch, Grover, and phase estimation.

ctrl |+⟩: 100.0 percent, ctrl |−⟩: 0.0 percent
ctrl |+⟩
100.0%
ctrl |−⟩
0.0%
Computes: a real CNOT on |+⟩⊗|−⟩; the control's X basis probabilities are read from the actual state

The Cloning Button

game

One button. It copies an unknown qubit. Try it.

Computes: nothing; the linearity argument below is the whole result

Algorithms, noise & spies

Where quantum computing earns its keep, and fights for its life.

Grover Searchlight

game

Eight drawers, one prize. Classically you open ~4. Grover finds it in 2 iterations, and if you keep going past the sweet spot, the amplitude rotates away again. Try over searching.

Before you search: one press past the sweet spot, P(prize) will

prize in drawer:
iterations0 / 2 optimal
state 0: 12.5 percent, state 1: 12.5 percent, state 2: 12.5 percent, state 3: 12.5 percent, state 4: 12.5 percent, state 5: 12.5 percent, state 6: 12.5 percent, state 7: 12.5 percent
|000⟩
12.5%
|001⟩
12.5%
|010⟩
12.5%
|011⟩
12.5%
|100⟩
12.5%
|101⟩
12.5%
|110⟩
12.5%
|111⟩
12.5%
Computes: a real 3-qubit statevector; each press applies the actual oracle phase flip + inversion about the mean

Deutsch's One Question Oracle

game

A mystery coin function: constant (same answer always) or balanced (half and half). Classically you must ask twice. The Deutsch circuit asks once, and is never wrong.

Computes: the full Deutsch circuit runs on a real 2-qubit statevector; the verdict is read from its output probabilities

Born Rule Randomness

lab

Hardware quantum RNGs sell exactly this: prepare |+⟩, measure, repeat. Sample away, entropy should hug 1 bit/bit.

bits0
entropy0.0000 b/bit
Computes: each bit is an inverse CDF sample of a real H|0⟩ statevector, the randomness is Born rule sampling

Decoherence Dial

lab

This is the enemy every quantum computer fights. Turn up the noise on a crisp |+⟩ and watch its off diagonal coherence, the part that interferes, bleed away into a classical coin.

coherence 2|ρ01|1.000
purity Tr(ρ²)1.000
Computes: a real density matrix under the actual depolarizing channel; coherence is 2|ρ01| off that matrix

Repetition Rescue

game

Encode one bit into three qubits; majority vote fixes any single flip. Below ~50% noise the code beats the bare qubit, the same idea, scaled up, is how Willow class processors reach below threshold error correction.

encoded: 0.0 percent, bare: 0.0 percent
encoded
0.0%
bare
0.0%
Computes: Monte Carlo rounds of the 3-qubit bit flip code with true majority vote decoding, against an unprotected qubit at the same noise

BB84. Catch Eve

game

Alice sends key bits in random bases; Bob measures in his own. Toggle an eavesdropper: her measurements must disturb the states (no cloning, two cards up), and the error rate betrays her at ~25%.

sifted key bits0
QBER0.0%
Computes: every round draws real random bits/bases; Eve's wrong basis measurements scramble states exactly as the protocol predicts

Tunneling Odds

model

Classically, a ball below the wall's height never crosses. Quantum mechanically the odds are small, but never zero. Thinner or lower walls help exponentially.

P(tunnel)15.58%
Computes: the idealized rectangular barrier formula T ≈ e^(−2κL), an analytic textbook model, not a simulation

The frontier

Where today's research lives, variational optimization and ballistic quantum walks.

QAOA MaxCut

game

Cut a 4-node ring into two colors with as many crossing edges as possible (max = 4). QAOA doesn't search, it sculpts a superposition so the good cuts get more amplitude. Find the γ, β sweet spot.

⟨cut⟩1.325
approximation ratio0.331
P(optimal cut)10.8%

edges: 0, 1, 1, 2, 2, 3, 3, 0 · random guess averages 2.0

Computes: a real 4-qubit QAOA (p=1) circuit: H layer, ZZ(γ) on each edge via CNOT·RZ·CNOT, RX(2β) mixer; cut expectation from the output probabilities

Walk Race

lab

Same coin, same line. The classical walker wanders ~√t from home. The quantum walker interferes with itself and races out ~t, with two peaks and almost nothing in the middle. This ballistic spread is the engine behind quantum search speedups.

quantum σ10.84
classical σ4.47
ratio2.42×
q σ/t: 54.2 percent, c σ/t: 22.4 percent
q σ/t
54.2%
c σ/t
22.4%
Computes: direct amplitude evolution of the Hadamard coined quantum walk vs the exact binomial distribution of a classical random walk

The algorithm wing

Three results from the algorithm ledger, run as real amplitudes: one query secrets, the GHZ certainty, and the spectrum Shor reads.

Bernstein-Vazirani

game

The oracle hides a 5 bit string s and will only answer dot products s·x. Classically you need 5 questions, one per bit. The quantum circuit asks one question in superposition and the interference writes the whole secret into the output register.

s = 10110
read out10110
P(correct)100.0%
queries1 vs 5 classical

every run reads the secret perfectly; that certainty is interference, not luck

Computes: H^5, a real phase oracle (−1)^(s·x), H^5 on a 32 amplitude statevector; the bars are its exact output distribution

The GHZ Game

game

Three players share an entangled triple and cannot communicate. The referee hands out bits r, s, t and the answers must XOR to r OR s OR t. The best any classical team can do is win 3 of 4 cases (75%). The quantum team wins every round.

quantum wins0 / 0
classical ceiling75%
Computes: a real (|000⟩+|111⟩)/√2 statevector, X or Y basis change per player, one inverse CDF sample per round; the classical 3 of 4 bound is brute forced over all 64 strategies

QFT Period Finder

lab

Shor's algorithm never sees the factors directly. It hides a period r in a register, applies the quantum Fourier transform, and reads the period off the interference peaks, spaced 2ⁿ/r apart. Slide r and watch the spectrum answer.

peak spacing16.0
period read from spectrum4

when r divides 64 the peaks are exact; other r values smear, which is why Shor finishes with continued fractions

Computes: a uniform superposition over x ≡ 0 (mod r) pushed through the exact 64 point discrete Fourier transform; the peaks are computed amplitudes

Reality check

How far the browser engine scales on your machine, and how the ideal CHSH result compares with a real device's noise model.

Engine Scaling Benchmark

bench

The 2ⁿ wall, measured live: every extra qubit doubles the amplitudes. Grey is the readable teaching engine behind the games; blue is the typed array kernel, same physics, flat memory, in place gates, which is how the browser reaches 20+ qubits.

Computes: wall clock time on your device for 2^n amplitudes (one H layer + a CNOT chain): the readable object per amplitude engine vs the Float64Array kernel

Simulation vs. device: CHSH

CHSH Bell test on a 2-qubit Bell state, 4 measurement settings. Classical bound 2, Tsirelson bound 2.83.

ideal statevector (noiseless)S = 2.828
ibm_brisbane noise model (Aer, real calibration snapshot)S = 2.444

Simulation using the published error rates of a real 127-qubit device. Not a hardware run.

real hardwarenot run

Not run yet. Set QISKIT_IBM_TOKEN and rerun this script to execute on an IBM Quantum device.

Amber tick = classical bound. Generated 2026-08-22 by scripts/hardware/ibm_noise_model.py (Qiskit Aer + IBM calibration snapshot).