Quantum Circuit Builder
Drag gates onto up to five qubits, step through the circuit one column at a time, and watch the state vector, per-qubit Bloch vectors and measurement statistics update live. When you are done, export the circuit to Qiskit or OpenQASM, or send a link to a friend. It runs entirely in your browser.
Single-qubit
Rotations
Multi-qubit
Readout
Tools
Click a cell to place H.
All the probability sits on |000⟩. The register is in a definite classical state.
No qubit is entangled with the rest: the state is a product of single-qubit states.
Most likely: |000⟩ at 100.0%.
How to use it
- Pick a gate from the palette. Rotations and controlled-phase use the angle menu that appears.
- Click a cell to place a one-qubit gate. For CNOT, CZ, CP, SWAP and CCX, click the qubits one after another in the same column: control first, target last.
- Click the |0⟩ or |1⟩ box at the left of a wire to change that qubit’s starting value.
- Use the step slider to see the state part-way through. A dashed line marks where you are.
- Right-click a gate, or use the Erase tool, to remove it. Undo and Redo keep your last 50 changes.
- Open the Shots tab to sample the circuit many times, with optional gate and readout error.
Reading the results
- Probabilities are the squared sizes of the amplitudes. They are what a measurement would return on average.
- State vector lists each amplitude and its phase. Phase is invisible in probabilities, but it drives interference.
- Qubits shows one Bloch vector per qubit. A vector shorter than length 1 means that qubit is entangled with others.
- Shots mimics running the circuit many times on a device. With few shots the bars look uneven, as they would on real hardware.
- Code gives matching Qiskit and OpenQASM 2.0 source.
Qubit order: read this once
This page writes basis states as |q0 q1 q2⟩, so q0 is the leftmost bit and the top wire. Qiskit writes the same state as |q2 q1 q0⟩ and prints q0 on the right. If you copy a circuit into Qiskit and the counts look reversed, the circuit is right and only the printing order differs. Reverse each bitstring to compare.
What the simulator does and does not do
- It is exact for ideal gates: it multiplies the full state by each gate’s matrix.
- Noise in the Shots tab is a simple model: after each gate, each touched qubit has a chance of a random X, Y or Z error, and each read bit has a chance of flipping. Real devices have more complicated noise, such as crosstalk, leakage and drift.
- Measurement gates choose which qubits are read at the end. The simulator does not do mid-circuit measurement with classical control, so teleportation is written with the deferred-measurement form.
- It is limited to 5 qubits and 16 steps. It is a teaching tool and not a replacement for Qiskit Aer, Cirq or similar packages.
Where to go next
- 13 worked examples from a single Hadamard to teleportation and the QFT.
- Gate reference with matrices, identities and code for all 17 gates.
- Your first Qiskit circuit
- From simulator to real hardware
- Dictionary: quantum circuit · Bell state
- Grover’s algorithm builder
Start from an example
Superposition with one Hadamard gate
Beginner · 1 qubit
The smallest interesting circuit: one qubit, one gate, and a perfectly fair quantum coin.
Interference: why H, Z, H flips a bit
Beginner · 1 qubit
Two Hadamards with a phase flip between them turn |0⟩ into |1⟩. Probabilities cannot explain this, but amplitudes can.
Bell state: your first entangled pair
Beginner · 2 qubits
H on one qubit then CNOT creates two qubits whose measurement results always agree.
GHZ state: three-qubit entanglement
Beginner · 3 qubits
Chain CNOTs after a Hadamard to entangle three qubits so they all agree.
SWAP built from three CNOT gates
Intermediate · 2 qubits
Three alternating CNOTs exchange two qubits’ states. Many chips have no native SWAP, so compilers do this constantly.
Toffoli gate as a reversible AND
Intermediate · 3 qubits
A gate with two controls computes the AND of two bits while keeping the inputs, which is what makes it reversible.
Superdense coding: two bits in one qubit
Intermediate · 2 qubits
With a shared Bell pair, sending one qubit can carry two classical bits.
Quantum teleportation (deferred measurement)
Advanced · 3 qubits
Move an unknown qubit state from q0 to q2 using entanglement and two controlled corrections.
Deutsch–Jozsa: constant or balanced in one query
Intermediate · 3 qubits
A small instance of the first algorithm with a proven quantum advantage in query count.
Bernstein–Vazirani: finding a hidden string
Intermediate · 4 qubits
A single quantum query recovers a hidden three-bit string that classical methods find one bit at a time.
Grover search on two qubits
Intermediate · 2 qubits
Find the marked item among four with a single Grover iteration, which is exact for N = 4.
Quantum Fourier transform on three qubits
Advanced · 3 qubits
The subroutine inside Shor’s algorithm and phase estimation, built from H and controlled-phase gates.
A quantum random bit generator
Beginner · 3 qubits
Three Hadamards and three measurements give a random number from 0 to 7.
Frequently asked questions
Is this a real quantum computer?
No. It is an ideal classical simulator that stores the full state of up to 5 qubits and applies each gate exactly. The optional noise slider adds a simple random-error model for teaching, not a model of any specific device.
Why only 5 qubits?
A simulator stores 2^n amplitudes, so memory doubles with every qubit. Five qubits keeps the page fast on any phone and keeps the circuit readable. The same idea explains why classical simulation of 50 or more qubits becomes very hard.
Why does my Qiskit output look reversed?
This builder writes qubit 0 as the leftmost bit, for example |q0 q1 q2⟩. Qiskit prints qubit 0 as the rightmost bit. The circuit is the same; reverse the bitstring to compare.
Why does my circuit give 100% on one state when I expected a mix?
An ideal simulator shows the exact result. A circuit that creates a single definite outcome, such as Grover on four items, really does give one answer with certainty. Use the noise sliders to see how real hardware would blur it.
Can I share a circuit?
Yes. The Copy share link button stores the circuit inside the URL. Nothing is sent to a server, and anyone opening the link sees the same circuit.
Is my circuit saved anywhere?
No. Circuits live only in the page. Your solved-challenge marks are kept in your browser’s local storage if it allows that, and are never uploaded.
Can I run it on real hardware?
Export the Qiskit or OpenQASM code, then run it on a provider’s free tier. Real devices add noise and require a compile step. See the guide on moving from simulator to real hardware.