QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
HomeLearnCatalogRanksPlaygroundDocs
06 · Reading a circuit: depth, width and cost0%

You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.

Learn/QC 102Gates and Circuits·Lesson 6 of 7

Reading a circuit: depth, width and cost

Columns, layers, depth, two-qubit count: the numbers QubitLab shows and why they predict hardware results.

Beginner10 min read5 sections · 2 questions+45
By the end you will be able to
  1. 01Compute the depth of a small circuit by hand.
  2. 02Explain why two-qubit gates dominate the error budget.
  3. 03Use barriers deliberately.

Time runs left to right. Gates on different qubits that do not depend on each other can run in the same layer; the depth is the number of layers. The composer packs gates to the left for exactly this reason: what you see is the schedule a device would run.

Hands-on

Depth versus size

This GHZ circuit has 4 gates but depth 4 because each CNOT waits for the previous one. Rewire it as a tree (cx 0→1, then cx 0→2 and cx 1→3 in the same layer) to reach depth 3 with the same state. The status bar under the code shows depth and ops live.

OpenQASM 3
OPENQASM 3.0;
include "stdgates.inc";
qubit[4] q;
h q[0];
cx q[0], q[1];
cx q[1], q[2];
cx q[2], q[3];
Sign in to run (nothing is saved)
Open in the IDE Open in the Playground

01What costs on hardware

QuantityTypical error (Heron)Why it matters
Single-qubit gate≈ 0.02–0.05 %almost free
Two-qubit gate≈ 0.2–0.5 %ten times worse: count them
Readout≈ 1 %once per qubit at the end
Idle time (depth)T1 ≈ 200 µs, gate ≈ 60 nsdeep circuits decohere while waiting

A barrier is a fence: the transpiler may not move gates across it. Use it to protect a measurement order you care about, not as decoration; every barrier can stop an optimisation.

Knowledge check

2 questions · one try each counts

Question 1

A circuit applies h on q0, h on q1, then cx q0→q1, then x on q1. Its depth is…

Sign in to answer and climb the ranks; you will come back to this lesson.

Question 2

Which single number best predicts how noisy a circuit's hardware result will be?

Sign in to answer and climb the ranks; you will come back to this lesson.

Key takeaway

Depth is the number of layers, size the number of gates. On hardware, count two-qubit gates after transpilation and keep depth short; use barriers only to protect order.

Finished reading?

Knowledge check: 2 questions waiting above. Questions are optional. Mark it complete, or press Next: moving on marks it complete too.

Up next
Lesson 7 · 10 min
Two languages: OpenQASM 3 and Qiskit
How the same circuit is written in both, and how QubitLab keeps them in sync without running your code.
Further reading
  • Docs: metrics explained
More in Gates and Circuits
  • Pauli gates: X, Y, Z
  • Phase and rotation gates
  • Two-qubit gates: CNOT, CZ, SWAP
Phase Kickback: The Algorithm SecretTwo languages: OpenQASM 3 and Qiskit
In this lesson0%
  1. Introduction
  2. Try it: Depth versus size
  3. What costs on hardware
  4. Knowledge check
  5. Key takeaway
QubitLab
IDELearnPlaygroundDocsCommunity
Log in
QubitLab
IDELearnPlaygroundDocsCommunity
Log in