Curriculum / Quantum Hardware & NISQ / Circuit Depth Analysis
Circuit Depth Analysis
Analyze and minimize circuit depth to reduce noise on real hardware.
Circuit Depth Analysis
Circuit depth, the number of sequential gate layers, directly determines noise accumulation on NISQ hardware. Every extra layer costs both gate error and idle decoherence: with typical two-qubit gate error rates near 1%, a few dozen entangling layers are already enough to push a circuit's total error toward failure.
Parallelizing gates (applying them to different qubits in the same time step) reduces depth without reducing the number of gates.
Why Depth Matters
Total circuit time = (depth) x (gate time). Crucially, depth is set by the longest chain of gates that depend on each other (gates sharing a qubit), not by how many lines you write or the order you write them in. A compiler schedules gates on independent qubits into the same layer automatically.
Take H then X on each of 4 qubits. Whether you write it qubit-by-qubit:
- •H(0), X(0), H(1), X(1), H(2), X(2), H(3), X(3)
or layer-by-layer:
- •[H(0), H(1), H(2), H(3)] then [X(0), X(1), X(2), X(3)]
both compile to depth 2. The four qubits are independent, so a scheduler runs all four H gates in one layer and all four X gates in the next, regardless of source order; qc.depth() returns 2 either way. The only dependency is H then X on each qubit (a chain of length 2).
To actually build a deep circuit you need real data dependencies. Eight gates that all act on the same qubit cannot be parallelized:
- •H(0), X(0), H(0), X(0), H(0), X(0), H(0), X(0) on q0 alone = depth 8.
Parallelization Opportunities
Gates on different qubits can always run in parallel (they don't interfere). Gates on the same qubit must be sequential.
Two rules:
- 1.Same qubit gates are sequential. H(0) then X(0) requires 2 steps.
- 2.Different qubit gates can be parallel. H(0) and H(1) can execute in 1 step.
This is the opening of the lesson. The full walkthrough, the interactive circuit, and the graded challenge continue inside myqubit.
How this lesson works
A hands-on coding challenge. You write Qiskit-compatible Python in the browser editor, run it instantly via WebAssembly, watch the circuit and Bloch sphere react, and pass automatic output checks. The AI tutor Qubitus gives Socratic hints if you get stuck.
Part of: Quantum Hardware & NISQ
Explore the physics of real quantum computers, understand noise, and learn near-term algorithms designed for today's noisy hardware.
This lesson is part of Pro
Unlock Quantum Hardware & NISQ and all 10 tracks with Pro: $12.99/month, $79/year, or $97 lifetime. Start with the free track first if you are new.