Interactive · runs entirely in this tab

A qubit is not a coin. Build one and see.

A state-vector simulator with a nine-step course built into it. You place gates on graph paper, the state updates as you type, and each step only ticks off once your circuit actually does the thing.

q₀|0⟩ q₁|0⟩ H entangled from here MEASURE BOTH 50% |00⟩ 50% |11⟩ q₀ on its own: no state at all
fig 1Two gates. After the second one, neither qubit has a state of its own any more — only the pair does. Step 07 lets you watch that happen.
The bench

Build a circuit

Drag a gate from the palette onto the paper, or tap a gate then tap a square. Click a placed gate to remove it. Everything recomputes on every change — there is no run button to forget.

Course

0/9

    Gates

    Pauli — flips
    Superposition
    Phase & rotation
    Wiring

    A control dot plus a gate in the same column makes that gate controlled: ● + X is CNOT, ● + ● + X is Toffoli, ● + Z is CZ. Two × marks in one column swap those wires.

    Step through end

    Bloch sphere

    Measurement

    sampled counts exact probability

    State vector |ψ⟩

    basisamplitudeprobphase
    Take it with you

    The same circuit, in real code

    This updates as you build. Paste it into a notebook and you are running the identical circuit on a framework that can also target hardware.

    Export

    
        
    Reference

    Worked circuits

    Eight circuits worth knowing. Loading one drops it on the bench, where you can step through it column by column and take it apart.

    Where is the measurement gate?

    There isn't one, on purpose. This simulator keeps the full state vector and measures once, at the end — which is what the histogram shows. Textbook circuits like teleportation appear to need a measurement in the middle, but the deferred measurement principle says any mid-circuit measurement can be pushed to the end if you replace the classically-controlled correction with a quantum-controlled one. The teleportation circuit below is written that way, and it gives identical statistics.

    Variational algorithms

    Finding the energy of a hydrogen molecule

    The nearest-term use of a quantum computer is chemistry: prepare a trial state, measure its energy, let a classical optimiser move the knob, repeat. The curve below is computed by the simulator on this page — one energy evaluation per point, using the same gate engine you have been dragging gates into.

    Energy landscape E(θ)

    What is actually being computed

    The two-qubit Hamiltonian is H = g₀I + g₁Z₀ + g₂Z₁ + g₃Z₀Z₁ + g₄Y₀Y₁ + g₅X₀X₁, with coefficients from O'Malley et al., Phys. Rev. X 6, 031007 (2016) for H₂ at a 0.75 Å bond length in the STO-3G basis. The trial state is exp(−iθ X₀Y₁/2) applied to |01⟩. Each point on the curve is six Pauli expectation values read off the state vector, plus the nuclear repulsion term added back. The "exact" figure comes from diagonalising the same Hamiltonian by hand in the two-dimensional sector the ansatz lives in — so if those two numbers agree, the simulator is right.

    Where to go next

    Things I actually recommend

    Short list, all free, all checked. A toy simulator can show you what happens; these will tell you why.

    Start here

    1. Quantum computing for the very curious Andy Matuschak & Michael Nielsen

      An essay with spaced-repetition questions built into the page, so it tests you as you read. If you only read one thing, read this one.

    2. IBM Quantum Learning Free structured courses

      Start with John Watrous's Basics of Quantum Information — it is the rigorous treatment, and it is genuinely well taught rather than a product tour.

    3. Bell's theorem: the quantum Venn diagram paradox MinutePhysics with 3Blue1Brown · 18 min

      Why the correlations you will produce in step 07 cannot be explained by the two qubits having agreed on an answer in advance.

    Build things

    1. Quirk Craig Gidney

      The simulator this page learned from, and still the best one. Deeper, faster, and it shows a live readout on every wire at every column at once.

    2. PennyLane demos Xanadu · runnable notebooks

      The best writing anywhere on variational circuits and quantum machine learning. Start with the VQE demo, which is the section above done properly.

    3. Quantum Katas Microsoft · Q# exercises

      Test-driven exercises: every task starts as a failing unit test and you write quantum code until it passes. Hard to fool yourself with these.

    4. Qiskit guides IBM · documentation

      For when you want to run on real hardware and meet noise, transpilation and queue times for the first time.

    Go deeper

    1. Ph219 lecture notes John Preskill · Caltech

      The graduate course, free. The standard next step once Nielsen & Chuang stops being enough, especially on error correction.

    2. Shtetl-Optimized Scott Aaronson

      Worth reading as much for what he debunks as for what he proves. The best antidote to quantum-computing press releases.

    3. The School of Quantum QuTech Academy · TU Delft

      Course sequences from a group that builds the hardware, including a good one on the quantum internet that nobody else covers.

    Honesty

    What this simulator is not

    01 There is no noise

    Every gate here is perfect and qubits never decohere. Real devices lose their state in microseconds, and roughly all of the current engineering effort goes into that problem. Nothing you build here will behave this cleanly on hardware.

    02 It is exponential, and slow

    Eight qubits means tracking 256 complex amplitudes on your CPU. Fifty qubits would need more memory than exists. That gap is the entire argument for building quantum computers, and you can feel it in the qubit dropdown.

    03 No mid-circuit measurement

    The state is only measured once, at the end. Circuits that classically need a measurement in the middle are rewritten using the deferred measurement principle, which is exact but not how hardware runs them.

    04 It is a teaching tool

    For anything real, use Qiskit or PennyLane. The point of this page is that you can see the state vector, which on a real machine you fundamentally cannot.