Reading a Quantum Circuit
A circuit diagram is a schedule: each horizontal wire is one qubit's timeline, boxes are operations applied left to right, and vertically linked symbols act on several qubits at once. Left-to-right fixes the order only where operations share a qubit — gates on different wires in the same column can run together.
What does a circuit diagram actually show?
A quantum circuit diagram is the standard picture for a quantum program. Read it like a musical score: time flows left to right, and each horizontal line is one performer.
A qubit is the basic unit of quantum data — a physical system that always gives 0 or 1 when read out, but that between operations can hold a weighted blend of both possibilities.
Each horizontal line is a wire: the timeline of one qubit. It is not a physical cable, and nothing travels along it. The qubit sits in one place inside the machine; the wire simply tracks what happens to it, in order.
A gate is a single operation applied to one or more qubits, drawn as a box or symbol on the wires it touches.
The ordering rule is precise: on a single wire, further left means earlier. Gates sitting on different wires in the same column touch different qubits, so they can happen at the same time. The diagram promises an order only where two operations share a qubit.
How do I read the common symbols?
A box labelled H is the Hadamard gate. Applied to a qubit that is definitely 0, it produces an even blend of 0 and 1 — a superposition, meaning the state holds both outcomes at once, each with a number attached.
That attached number is the amplitude: a value whose square gives the probability of seeing that outcome when you measure. Amplitudes, unlike probabilities, can be negative — which matters later, when they cancel.
A filled dot on one wire joined by a vertical line to a circled plus on another wire is the controlled-NOT, written CX. The dot marks the control — the qubit that decides — and the circled plus marks the target — the qubit that gets flipped, but only in the part of the state where the control is 1.
A small meter symbol at the right-hand end of a wire is a measurement: it reads the qubit and produces one classical bit, 0 or 1. In the Lab, every qubit is measured automatically at the end of the circuit.
Run it: the two-gate Bell circuit
Worked example: predicting the Bell histogram
Before running, predict the result by hand. Both qubits start at 0, so the outcome "both read 0" has amplitude 1 and everything else has amplitude 0.
- After
Hon q0: two possibilities remain — q0 reads 0, or q0 reads 1 — each with amplitude 0.7071 (that is 1/√2). Check the squares: 0.7071 × 0.7071 = 0.5, so each is a 50% outcome. q1 is still 0 in both. - After
CX(control q0, target q1): in the part of the state where q0 is 1, q1 flips to 1. The amplitudes just move — 0.7071 now sits on "both 0" and 0.7071 on "both 1".
So the prediction: in 1000 repeats (called shots), roughly 500 read 00 and 500 read 11, and the mismatched outcomes 01 and 10 never appear. Expect a small wobble around 500 — that scatter is sampling noise, the ordinary randomness of a finite number of repeats, not a hardware fault.
Worked example: two gates on the same wire
Order matters on a shared wire. Take one qubit and apply H twice. The rule for H is: new amplitude of 0 = (old amp of 0 + old amp of 1) ÷ 1.4142, and new amplitude of 1 = (old amp of 0 − old amp of 1) ÷ 1.4142.
- Start: amplitudes (1, 0).
- First
H: ((1+0)÷1.4142, (1−0)÷1.4142) = (0.7071, 0.7071). - Second
H: ((0.7071+0.7071)÷1.4142, (0.7071−0.7071)÷1.4142) = (1.4142÷1.4142, 0) = (1, 0).
Back to certainty: every shot reads 0. The second H only undoes the first because it acts on the first one's output — which is exactly what left-to-right on one wire means.
What the diagram does not tell you
Horizontal spacing is not time in nanoseconds. The diagram records dependencies — what must happen before what. Turning that into physical pulse timing is a later compilation step, and it differs for every device: each machine has its own native gates, wiring layout, and calibration. You can browse real devices at /hardware/qpus.
Takeaway: read a circuit as ordered operations per qubit, identify control and target roles on multi-qubit symbols, and remember that measurement is where quantum amplitudes become classical bits. Build the Bell circuit yourself in the Lab and point at each symbol as it acts.