DeepPractise
DeepPractise

What is a Quantum Circuit?

Track: Quantum Gates & Circuits · Difficulty: Beginner · Est: 12 min

What is a Quantum Circuit?

Overview

A quantum gate is a single state transformation. A quantum circuit is how we turn gates into a computation:

  • a sequence of gates applied over time,
  • followed by measurement that produces classical outputs.

This page is essential because it formalizes “doing computation” without jumping into any particular algorithm. Once you understand circuits as structured composition, you can reason about any quantum program.

Intuition

Think of the computation as happening in stages:

  1. Initialize qubits in a known state (often 0|0\rangle for each qubit).
  2. Evolve the joint state using gates (single- and multi-qubit).
  3. Measure some qubits to obtain classical results.

A circuit is just a clear way to describe step (2).

The most important intuition is that a circuit is not “many little measurements.” It is one coherent evolution made of smaller pieces. Until you measure, the state stays quantum and can include superposition and entanglement.

You can think of the state as a vector ψ|\psi\rangle that changes step-by-step:

ψ0  U1  ψ1  U2  ψ2    ψk.|\psi_0\rangle \xrightarrow{\;U_1\;} |\psi_1\rangle \xrightarrow{\;U_2\;} |\psi_2\rangle \xrightarrow{\;\cdots\;} |\psi_k\rangle.

Each UjU_j is a gate (more precisely, a unitary operator) acting on one or more qubits.

Formal Description

A quantum circuit on nn qubits is a finite list of gates

U1,U2,,Uk,U_1, U_2, \dots, U_k,

where each UjU_j is a unitary operator acting on the 2n2^n-dimensional state space (often by acting non-trivially on only a few qubits and as identity on the rest).

Composition order (what changes to the state)

If the initial state is ψ0|\psi_0\rangle, then applying the circuit produces

ψfinal=UkU2U1ψ0.|\psi_{\text{final}}\rangle = U_k\cdots U_2 U_1 |\psi_0\rangle.

Explanation of the notation:

  • ψ0|\psi_0\rangle is the starting joint state of all qubits.
  • U1U_1 acts first, producing ψ1|\psi_1\rangle.
  • U2U_2 acts next, and so on.
  • The gate written closest to the state acts first.

This “rightmost gate acts first” convention is standard in linear algebra.

Circuit vs gate

  • A gate is one operator (UU).
  • A circuit is a composition of many operators (UkU1U_k\cdots U_1).

So a circuit itself corresponds to one overall operator:

Ucircuit=UkU2U1.U_{\text{circuit}} = U_k\cdots U_2 U_1.

Measurement is then applied to ψfinal|\psi_{\text{final}}\rangle to produce classical outcomes.

Worked Example

Consider a 2-qubit computation:

  1. Start with
ψ0=00.|\psi_0\rangle = |00\rangle.
  1. Apply H to the first qubit:
00  HI  12(00+10).|00\rangle \xrightarrow{\;H\otimes I\;} \tfrac{1}{\sqrt{2}}(|00\rangle + |10\rangle).
  1. Apply CNOT with the first qubit as control and second as target:
12(00+10)  CNOT  12(00+11).\tfrac{1}{\sqrt{2}}(|00\rangle + |10\rangle) \xrightarrow{\;\text{CNOT}\;} \tfrac{1}{\sqrt{2}}(|00\rangle + |11\rangle).

Interpretation:

  • The circuit took a simple initial product state and produced an entangled Bell state.
  • Nothing was measured yet; the whole process is coherent evolution.

If you measure both qubits in the computational basis at the end, you see correlated outcomes (00 or 11 with probability 1/2 each).

Turtle Tip

Turtle Tip

When reading a circuit, don’t try to “guess the final answer” immediately. Track the state step-by-step: apply one gate, simplify, then move on.

Common Pitfalls

Common Pitfalls
  • Don’t confuse the order of gates in algebra vs diagrams: algebra often reads right-to-left, while diagrams are usually drawn left-to-right in time.
  • Don’t assume a circuit “does something classical” before measurement. Intermediate steps are quantum state evolution.

Quick Check

Quick Check
  1. In the expression ψfinal=UkU1ψ0|\psi_{\text{final}}\rangle = U_k\cdots U_1|\psi_0\rangle, which gate acts first?
  2. In one sentence: what is the difference between a gate and a circuit?

What’s Next

Now that you know what a circuit is, we need a visual language to draw them. Next we introduce circuit diagrams and notation: wires, gate symbols, controlled gates, and measurement symbols (conceptually).