You are reading without signing in. Sign in or continue as guest to take quizzes and climb the ranks.
Reading a circuit: depth, width and cost
Columns, layers, depth, two-qubit count: the numbers QubitLab shows and why they predict hardware results.
- 01Compute the depth of a small circuit by hand.
- 02Explain why two-qubit gates dominate the error budget.
- 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.
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.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];
01What costs on hardware
| Quantity | Typical 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 ns | deep 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.
2 questions · one try each counts
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.
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.