Section 01
Circuit Builder
Gate palette โ drag a gate onto the circuit below
Section 02
Results
Theory โ exact probabilities (Born rule)
Measure โ simulate wavefunction collapse
No shots yet.
Section 03
Preset Circuits
Single qubit
Two qubits
Three qubits
Section 04
How to Use the Circuit Editor
The circuit editor is powered by Q.js, a free open-source quantum circuit simulator by Stewart Smith. Each horizontal wire is one qubit starting in |0โฉ. Each column is one moment (a clock tick). Below is everything you need to build and analyze any circuit.
1
Place a single gate.
Drag any gate from the Gate Palette (the blue strip above the circuit) and drop it
onto any cell. Each cell is a register (row) ร moment (column) combination.
The circuit re-evaluates automatically after every change.
Palette: [ H ] [ X ] [ Y ] [ Z ] [ S ] [ T ] [ * ] [ M ] โฆ
r1 โโโโ [ H ] โโโโโโโโโโโโโโโโโโโโโโ
r2 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
m1 m2 m3 m4
To remove a gate, drag it off the circuit board into empty space outside the grid and release โ it disappears with a brief animation.
2
Create a CNOT (controlled-X) gate.
A CNOT links two qubits: a control (filled dot) and a target (โ).
In Q.js you build it by first placing the two components and then joining them:
- Drag the โ Identity cursor (
*in the palette) onto the control qubit at the desired moment. - Drag an X gate onto the target qubit at the same moment.
- Click the โ cursor cell to select it, then Shift-click the X cell to add it to the selection.
- Click the C button in the circuit's own toolbar (the dark bar above the wire labels). The two operations merge into a single CNOT gate connected by a vertical line.
Step A โ place * on r1,m2 and X on r2,m2:
r1 โโโ [ H ] โโโ [ * ] โโโ
r2 โโโโโโโโโโโโโ [ X ] โโโ
Step B โ select both โ click C:
r1 โโโ [ H ] โโโ [ โ ] โโโ โ control dot
โ
r2 โโโโโโโโโโโโโ [ โ ] โโโ โ target (X gate)
Try it now: this is the Bell state circuit.
H on r1 at m1, then CNOT (control r1, target r2) at m2.
Click โถ Evaluate โ you get 50% |00โฉ and 50% |11โฉ, a maximally entangled state.
Then click โ ร100 and watch the measured histogram converge to the theory bars.
3
Create a SWAP gate.
Place the โ Identity cursor (
*) on both wires at the same moment.
Select both cells, then click the S button in the toolbar.
The two cursors become a SWAP gate (shown as โ on each wire with a connecting line).
Place * on both wires at the same moment โ select both โ click S:
r1 โโโ [ * ] โโโ โ r1 โโโ [ โ ] โโโ
r2 โโโ [ * ] โโโ โ
r2 โโโ [ โ ] โโโ
4
Select, move and delete.
- Move a gate: drag it to a new cell โ it snaps to the grid.
- Select a column: click the moment number at the top of the circuit.
- Select a row: click the register number on the left.
- Select all: click the โ icon in the top-left corner of the circuit.
- Undo / Redo: use the โฒ / โณ buttons in the circuit toolbar.
- Delete a gate: drag it outside the circuit board area and drop.
The circuit toolbar also has a ๐ lock toggle. When locked, no gates can be moved or added โ handy when you want to measure without accidentally editing the circuit.
5
Reading the Theory panel.
After clicking โถ Evaluate (or after any gate change), the Theory panel shows:
- Probability bars โ the exact Born-rule probability |ฮฑ|ยฒ for each basis state.
- Amplitude table โ the full complex amplitude re + imยทj for each state. The probability is |re|ยฒ + |im|ยฒ.
- Bloch sphere โ for single-qubit circuits, the state vector on the Bloch sphere.
The Theory panel shows the quantum state before any measurement โ a superposition of all outcomes simultaneously. No single run of the circuit produces all these numbers at once; they describe the distribution of outcomes over many runs.
6
Reading the Measure panel.
Each click on โ ร1 simulates a single wavefunction collapse โ a random draw weighted by the Born probabilities.
โ ร100 and ร1000 accumulate many shots rapidly.
The histogram shows two bars per state:
- Outlined bar (theory) โ what quantum mechanics predicts.
- Solid bar (measured) โ what your simulated shots have produced.
Quantum randomness is fundamental, not due to ignorance. Even with a perfect circuit and perfect detector, the outcome of a single measurement on a superposed qubit is genuinely unpredictable. The Born rule only tells you the probability distribution.