T-Count and T-Depth
In a Clifford+ circuit the Clifford gates are nearly free — transversal and classically trackable — while each gate must be supplied by costly magic-state distillation. So the right cost metrics are not total gate count or ordinary depth, but -count and -depth.
Definitions
- -count: the total number of (and ) gates in the circuit. It tracks the number of magic states consumed, hence the total distillation work and qubit-hours.
- -depth: the number of layers in the circuit that contain at least one gate, where gates acting on disjoint qubits in the same layer count as a single layer. It tracks the sequential time spent on gates, which matters because distilled magic states may need to be produced in series.
A circuit can have high -count but low -depth if many gates run in parallel, or vice versa. Both metrics are reported in resource estimates for fault-tolerant algorithms.
Why Cliffords are not counted
Recall the two reasons from earlier lessons. First, Cliffords are typically transversal, so their physical cost is a constant factor over the logical operation. Second, by Gottesman–Knill, Clifford layers can be commuted and merged classically during compilation. The asymptotic and practical cost of a fault-tolerant algorithm is therefore dominated by its non-Clifford content — the gates.
The Toffoli as a -count yardstick
The Toffoli (CCX) gate is the canonical example. It is not Clifford, so it requires gates. The standard fault-tolerant decomposition expresses one Toffoli with
using seven / gates interleaved with Hadamards and CNOTs. Since reversible classical logic (adders, comparators, modular arithmetic in Shor's algorithm) is built largely from Toffolis, the Toffoli -count is a key building block for whole-algorithm estimates.
Estimating a circuit's -count
To estimate the -count of a larger circuit:
- Replace each non-Clifford gate with its Clifford+ decomposition (e.g. every Toffoli T, every arbitrary rotation T from the previous lesson).
- Sum the gates across all of them.
- Optionally optimize: cancel adjacent and , merge rotations on the same qubit, and use -count-reduction passes (e.g. the meet-in-the-middle synthesis of Amy et al.).
For example, a reversible adder built from Toffolis has a leading -count of (before optimization), which immediately tells you how many magic states the adder will consume.
Try it
Return the -count of a single Toffoli gate in its standard Clifford+ decomposition. The grader checks the returned number.
Sign in on the full site to ask questions and join the discussion.