Circuit Diagrams & Notation
Track: Quantum Gates & Circuits · Difficulty: Beginner · Est: 13 min
Circuit Diagrams & Notation
Overview
Quantum circuits are easiest to understand visually. A circuit diagram is a picture of:
- which qubits exist,
- which gates act on which qubits,
- and in what time order.
This notation is essential because it becomes the everyday language of quantum computation. Even before algorithms, it lets you reason about composition, entanglement, and measurement.
Intuition
A circuit diagram is like a timeline.
- Each wire is one qubit.
- Time flows from left to right.
- When a gate symbol appears on a wire, that gate is applied to that qubit at that time.
The diagram doesn’t “show the state” explicitly. Instead, it tells you how to update the state step-by-step.
A useful habit:
- Treat the diagram as instructions for transforming .
Formal Description
Wires as qubits
If you have wires, you have an -qubit state:
The ordering of wires matters. For two qubits, the top wire is typically the “first” qubit and the bottom wire the “second,” corresponding to basis states .
Time flows left to right
A diagram like
q0: ──H───
q1: ──────means “apply H to qubit 0, do nothing to qubit 1.”
In algebra, that is
Single-qubit gate symbols
Common single-qubit gates are drawn as boxes on a wire:
q: ──[H]──meaning (for that qubit).
Controlled gate notation
Controlled operations connect two wires. The control is drawn as a filled dot, and the target shows the operation.
A CNOT is drawn as a dot connected to a plus sign:
control: ──●──
│
target : ──⊕──Meaning:
- if control is , target is unchanged,
- if control is , apply X to the target.
A controlled-Z (CZ) is often drawn as a dot connected to a Z box:
control: ──●──
│
target : ──[Z]─Meaning:
- apply Z to the target only when the control is .
Measurement symbols (conceptual)
Measurement is usually drawn as a meter-like symbol, often with a classical output line. Conceptually, it means:
- a quantum state is converted into a classical outcome (like 0 or 1),
- and the post-measurement quantum state is updated accordingly.
In text form you might see something like:
q: ──[M]── → cwhere is a classical bit storing the measurement result.
We are keeping this conceptual here. The important idea is that measurement is not just another unitary gate.
Worked Example
Consider this 2-qubit diagram:
q0: ──[H]──●──
│
q1: ───────⊕──Step-by-step interpretation:
-
Start from .
-
Apply H on the first qubit:
- Apply CNOT (control = first wire, target = second wire):
So the diagram describes entanglement creation via conditional evolution.
Turtle Tip
When you see a controlled gate, pause and say out loud: “Control on 1, apply ___ to the target.” That one sentence prevents most confusion.
Common Pitfalls
- Don’t read a circuit left-to-right and apply algebra right-to-left without noticing. Pick one method and be consistent.
- Don’t treat measurement as reversible. Measurement produces a classical outcome and generally cannot be undone.
Quick Check
- In a circuit diagram, what do wires represent and which direction does time flow?
- What is the meaning of the dot-and-connector in a controlled operation?
What’s Next
Now that we can read circuit diagrams, we can talk about how “big” a circuit is. Next we introduce circuit width and depth: simple structural metrics that help you reason about parallelism and execution cost without needing algorithms or heavy theory.
