Circuit depth and gate count
Distinct measures of a circuit's sequential dependency structure and number of operations.
On this page
Definition and significance
Gate count totals selected operations. Circuit depth counts sequential layers under a specified parallelism rule. They answer different resource questions. A physically scheduled duration additionally depends on gate times, measurement latency, communication and hardware conflicts.
Mechanism and mathematical treatment
For operations with identical unit duration and no extra resource conflicts, depth is the longest path through the operation-dependency graph. Two gates sharing a qubit cannot generally occupy the same layer. Disjoint gates may be parallel in an abstract circuit but still conflict through shared control hardware.
Fully worked reference example
Apply H to each of four qubits, then CX from 0 to 1 and from 2 to 3. The gate count is six and the abstract depth is two. If the two CNOTs share a constrained control resource and must run sequentially, the physical schedule has three operation layers despite the same logical gate count.
Limitations and common misconceptions
An optimization that reduces count can increase depth by removing parallel structure. Never compare depth numbers without specifying the gate basis, connectivity, measurement treatment and scheduling convention.
Scientific relationships
These metrics describe different implementation costs.
Counts alone cannot predict interference of systematic errors.
A parity circuit that trades count for depth
The desired reversible map on eight bits preserves q0 through q6 and replaces q7 by q0 XOR q1 XOR...XOR q7. A direct construction applies seven CNOTs from each of q0 through q6 into q7. They share the target, so the straightforward abstract depth is seven. The gate count is also seven.
A tree construction first applies q0->q1, q2->q3, q4->q5 and q6->q7 in parallel. The next layer applies q1->q3 and q5->q7. The third applies q3->q7. At this point q7 has the desired full parity, but q1,q3 and q5 contain temporary parities. Restore them by applying q1->q3 in layer four, then q0->q1, q2->q3 and q4->q5 in parallel in layer five.
The complete tree uses eleven CNOTs and depth five, while preserving all seven non-target inputs. Its output on every basis string matches the direct construction, so the identity extends to arbitrary superpositions. The extra four CNOTs remove temporary correlations. Omitting that cleanup would solve a different in-place transformation, even though the final target parity would be correct.
Connectivity and edge concurrency change the comparison
The tree construction assumes the listed pairs can interact directly and that disjoint CNOTs can run simultaneously. On a physical line in numeric order, some of its pairs are nonadjacent and require routing or another synthesis. The direct construction also requires nonlocal interactions to the common target. A fair comparison compiles both under the same connectivity and counts their resulting depth and gates.
If the hardware supports only one entangling interaction at a time, the tree's eleven gates may take longer than the direct seven, despite its smaller abstract dependency depth. If qubit-disjoint interactions are available with equal durations, the tree can reduce the critical path. Shared control resources and crosstalk can produce intermediate cases.
The example shows why depth must be qualified by a parallelism model. It also shows why a compiler cannot optimize depth by leaving dirty data registers unless the task permits that changed output contract. Workspace restoration is part of semantic equivalence and can materially alter the apparent advantage of a tree schedule.
Preparation depth differs from unitary equivalence
To prepare an eight-qubit GHZ state from |0>^8, apply H to q0 and distribute its bit value through a binary CNOT tree. Seven CNOTs can create the state in three entangling layers under all-to-all connectivity. A star of seven CNOTs from q0 to every other qubit uses the same count but seven straightforward entangling layers.
These circuits agree on the specified initial state but generally differ as full unitaries on arbitrary inputs. The tree uses newly correlated target qubits as later controls, which is valid because those targets began at zero in the preparation problem. Comparing their unitary matrices would reveal the difference. State-preparation equivalence is therefore a weaker and sometimes more useful contract than arbitrary-input unitary equivalence.
A benchmark should identify which contract it measures. A shallow specialized preparation circuit may exploit known input structure that an arbitrary-input subroutine cannot. Conversely, requiring full-unitary equivalence when only a fixed preparation is needed can impose unnecessary gates. The intended scientific task determines the appropriate notion of correctness.
Weighted depth and throughput
Assigning every gate unit duration makes depth the number of dependency layers. With unequal durations, elapsed time is a weighted scheduling problem. A long measurement can dominate several short gate layers, and a classical feed-forward delay can extend the critical path even when the subsequent correction has a small gate count. Reset and initialization may also lie on that path.
Throughput is different again. Several independent circuits can be pipelined or run on disjoint resources, giving a high rate of completed samples despite a long latency for each one. A reported samples-per-second number must state whether it includes initialization, communication, compilation and measurement. A circuit-depth number cannot supply those details by itself.
For fault-tolerant analyses, logical gate depth, non-Clifford depth and physical code-cycle duration are separate quantities. A logical operation may expand into many rounds of syndrome extraction or resource-state handling. Translating a logical diagram into seconds requires an architecture and a schedule, which are intentionally not supplied by the abstract parity example.
Sources
Verification scope
Selected source text checked ·
Source anchors gate-decomposition conventions. New worked instances are independent mathematical constructions, not reported experiments.