Overview
Fault-tolerant quantum computers built from stabilizer codes implement Clifford gates cheaply and the gate expensively, through magic states. Their native instruction set is therefore Clifford+T: , , CNOT and , which is approximately universal (Boykin et al.). Synthesis is the task of expressing a desired unitary, exactly or to accuracy , as a Clifford+T circuit, and the figure of merit is the number of gates.
The field has three layers. Exact synthesis characterises the unitaries that Clifford+T circuits produce exactly: those with entries in the ring . Approximate synthesis of single-qubit rotations reaches T-count about , far below what the generic Solovay–Kitaev theorem gives. Multi-qubit optimisation reduces the T-count and T-depth of whole circuits, using phase polynomials and their connection to Reed–Muller codes. Ancillas, measurement and randomness lower the cost further.
Intuition
Clifford+T matrices have a rigid arithmetic structure: multiplying by introduces a factor , and introduces the eighth root of unity . So every entry of a Clifford+T circuit is a number of the form . The exponent measures how "deep" the matrix is, and exact synthesis peels it off one layer at a time. Approximate synthesis becomes number theory: find a ring element close to the target phase, then solve an equation so that the matrix is unitary.
At the multi-qubit level, a block of CNOTs and gates only computes parities of the input and adds phases to them. The gates that are really needed correspond to the parities whose total phase is an odd multiple of ; everything else is Clifford.
Prerequisites
The quantum circuit model, the Pauli and Clifford groups, and basic algebraic number theory (rings of integers of cyclotomic fields) for the exact-synthesis results.
Mathematical Definitions
The Clifford group on qubits is
the normalizer of the Pauli group in the unitary group, with unitaries that differ by a global phase identified. Its elements are Clifford gates, and a circuit made of them is a Clifford circuit.
Generators. With , and , the conjugation rules are
| gate | ||
|---|---|---|
| , | , |
and every element of is a product of , and gates on the qubits, up to a global phase (Gottesman; section 10.5.2 of Nielsen and Chuang). The CNOT row shows how errors spread: an error on the control is copied to the target, and a error on the target is copied to the control.
Symplectic action. A Clifford gate maps to (up to the phase convention for ), and is a linear map of that preserves the symplectic inner product, because conjugation preserves commutation. This gives a surjective homomorphism from onto the symplectic group whose kernel consists of the Pauli operators themselves; a Clifford gate is therefore specified, up to phase, by a binary symplectic matrix together with sign bits (Calderbank, Rains, Shor and Sloane; Dehaene and De Moor).
Uses. Clifford gates map stabilizer groups to stabilizer groups, so they map stabilizer codes to stabilizer codes and stabilizer states to stabilizer states; every stabilizer code has an encoding circuit made of Clifford gates (Gottesman). The Clifford group is the second level of the Clifford hierarchy, and Clifford circuits alone are classically simulable by the Gottesman–Knill theorem.
Let be the Pauli group on qubits. Define sets of -qubit unitaries recursively by
The sets are nested, . The second level is the Clifford group, the normaliser of the Pauli group. For the set is not a group, but it is closed under multiplication by Clifford gates on either side.
Examples: , and CNOT are in . The gates , controlled- and are in and not in ; for instance , which is a Clifford gate. More generally lies in .
The hierarchy was introduced by Gottesman and Chuang to classify the gates that can be applied by teleportation: a gate can be implemented by consuming a resource state prepared with and applying a correction from that depends on a Pauli measurement outcome. For the correction is a Clifford gate, which is why third-level gates are the ones supplied by magic states.
Let a circuit be written over Clifford gates, gates and Toffoli (or CCZ) gates, with Pauli measurements and classical feed-forward allowed.
- The T count is the number of and gates; the Toffoli count is the number of Toffoli or CCZ gates. Each non-Clifford gate consumes one magic state (T state or CCZ state) in a fault-tolerant implementation.
- The T depth is the smallest number of layers into which the non-Clifford gates can be partitioned so that the gates within a layer can be applied simultaneously, given the circuit's dependencies, with Clifford gates allowed anywhere in between.
The counts are linked by gate identities: a Toffoli gate costs seven gates in the standard ancilla-free circuit and four with an ancilla and a measurement (Jones); a temporary logical AND computes the AND of two qubits into a fresh ancilla with four gates and uncomputes it with none, using a measurement (Gidney). Arbitrary single-qubit rotations are approximated to precision by Clifford+T sequences with T count about (Ross and Selinger).
In architectures where Clifford operations are absorbed into Pauli measurements (Litinski), the T count sets the number of magic states and the T depth, multiplied by the time per non-Clifford layer, bounds the runtime from below. When each layer must wait for decoded measurement results before the next can start, the relevant depth is the number of such dependent steps (the reaction depth or measurement depth), and the time per step includes the reaction time of the classical control system, as in the estimate of Gidney and Ekerå.
Let be a target unitary on a data register. A repeat-until-success (RUS) circuit for is a unitary circuit on the data register and ancilla qubits, followed by a measurement of the ancillas in the computational basis, such that for every data state
where each is unitary, does not depend on , the set of success outcomes has (up to a global phase) for , and for every failure outcome the operator belongs to a class whose inverse is cheap (in the Clifford+T setting, a Clifford gate). On failure, is applied and the circuit is run again. The number of attempts is geometric with success probability , so the expected cost is the cost of one attempt divided by , and the output is exactly whenever the procedure halts.
RUS circuits over Clifford+T were introduced for single-qubit synthesis by Paetznick and Svore and synthesised efficiently for arbitrary single-qubit targets by Bocharov, Roetteler and Svore. Because the number of attempts is random, an RUS gate has a variable duration, which a fault-tolerant schedule must accommodate.
Theorems
The Clifford group maps onto the binary symplectic group with kernel the Pauli operators modulo phase, and ; multiplying by gives the formula (Koenig and Smolin, who also give an algorithm to index and sample its elements). For : , the rotation group of the cube. For : . The super-exponential growth, , is why Clifford circuits are compiled from canonical forms rather than looked up.
- Clifford unitaries are identified when they differ by a global phase.
Single qubit. A unitary can be written exactly as a product of and gates (equivalently, of single-qubit Clifford and gates) if and only if every entry of lies in . Moreover there is an efficient classical algorithm that produces a circuit for such a using the minimal possible number of and of gates (Kliuchnikov, Maslov and Mosca).
Many qubits. An -qubit unitary has an exact representation as a Clifford+T circuit using ancillas initialised to and returned in if and only if its entries lie in ; one ancilla always suffices (Giles and Selinger, proving a conjecture of Kliuchnikov, Maslov and Mosca). Giles and Selinger also characterise which such operators need no ancilla.
The key quantity in the single-qubit algorithm is the smallest denominator exponent: every element of the ring can be written as with , and multiplying by a suitably chosen factor of the form lowers this exponent by one, so a greedy reduction brings it below a small constant (4 in their analysis), where a precomputed table of the finitely many remaining unitaries finishes the circuit. Since the ring is countable and dense in , the theorem also explains why generic rotations need approximation rather than exact synthesis.
- Clifford+T means circuits over , , CNOT and with ; equality is exact (global phases allowed, which are themselves Clifford+T expressible on one qubit).
- is the smallest subring of containing and ; it also contains .
For every angle and , the probabilistic algorithm of Ross and Selinger
- with access to a factoring oracle, returns an ancilla-free Clifford+T circuit with of the smallest T-count among all such circuits;
- without the oracle, under a mild number-theoretic hypothesis, runs in expected time polynomial in and returns a circuit of T-count , where is the T-count of the second-best solution;
- in the typical case produces T-count
The method reduces approximation to two problems over the ring : a two-dimensional grid problem, enumerating ring elements close to in a thin region of the unit disc (and whose Galois conjugate lies in the unit disc), and a norm equation to complete to a unitary with entries in the ring; the result is then turned into a circuit by exact synthesis. An earlier algorithm of Selinger achieves T-count with for -rotations and proves a worst-case lower bound of the same form, , for certain -rotations.
- Target , accuracy in operator norm, single-qubit Clifford+T circuits with no ancillas or measurements.
- Optimality relies on a factoring oracle; the classical runtime bound relies on a stated number-theoretic hypothesis.
(a) Normal form. Every such circuit satisfies, for all ,
with an invertible matrix over and coefficients .
(b) Counting odd terms. If contains gates with odd, then the representation produced in (a) has at most parities with odd coefficient. Conversely, for any and any coefficients with odd coefficients, there is a circuit of this form implementing that contains exactly gates with odd.
(c) Non-uniqueness. Different coefficient vectors can define the same function ; for example . Amy and Mosca proved that minimising the number of odd coefficients over representations of the same , and hence the T-count over CNOT+T circuits, is equivalent to minimum-distance decoding of the length- vector of odd coefficients in the punctured Reed–Muller code . For that code contains only the zero word, so the number of odd coefficients is already minimal.
The representation is the basis of the T-par optimiser of Amy, Maslov and Mosca.
- The circuit acts on qubits and uses only CNOT and the diagonal gates , , (so , ); no ancillas or measurements.
- A parity is read as the integer 0 or 1 when it appears in a phase.
Proof · Proof of the phase-polynomial form
(a) Invariant. After the first gates, claim that with invertible over and . Initially , . Write for row of , so wire currently holds the parity ; the rows are linearly independent and hence nonzero.
- A CNOT with control and target replaces row by . This is an invertible row operation, so is invertible; the phase is unchanged.
- on wire multiplies by , so , i.e. ; is unchanged.
Induction over the gates gives (a), with the coefficients obtained by summing the powers applied whenever a wire carried each parity.
(b) Counting. By the construction in (a), the final coefficient is the sum of the powers of the gates applied while some wire carried parity . If is odd, at least one of those powers is odd. Distinct with odd therefore need distinct odd-power gates, so there are at most of them.
For the converse, let be the parities with , of which have odd coefficient. For each in turn: choose a wire such that has a 1 in position ; apply CNOTs from every other wire with onto , so wire holds ; apply to wire ; then undo the CNOTs in reverse order. Each block contributes exactly to the phase and leaves the wires as they were. Finally apply a CNOT circuit implementing (any invertible matrix over is a product of elementary row operations, each a CNOT, possibly after reordering wires, and a wire permutation is a product of SWAPs, each three CNOTs). The resulting circuit implements with exactly one gate for each nonzero , of which exactly have odd ; the others are , or , which are Clifford. This is the representation used by Amy, Maslov and Mosca.
Arbitrary single-qubit unitaries are handled through an Euler decomposition into three -rotations (and Cliffords), see the Z–Y–Z decomposition, which roughly triples the T-count. For the circuit-level picture in which every T gate becomes a rotation about a multi-qubit Pauli operator, see Clifford+T circuits as Pauli rotations.
Worked Examples
The T-count of CCZ and Toffoli
. Using and for bits, one checks the integer identity
Indeed , and substituting leaves . This is a phase polynomial with seven parities, all with odd coefficient: on the four parities with coefficient and on the three with . So CCZ, and Toffoli , have T-count at most 7. Because , the punctured Reed–Muller code in the phase polynomial theorem is trivial and 7 is optimal among ancilla-free CNOT+T circuits; Gosset, Kliuchnikov, Mosca and Russo showed by exhaustive search that no three-qubit Clifford+T circuit for Toffoli, without ancillas, uses fewer than 7. With an ancilla and a measurement, four suffice (Jones). For T-depth, Amy, Maslov, Mosca and Roetteler found an ancilla-free Toffoli of T-depth 3.
A rotation that is not exactly synthesisable
is exactly synthesisable. is not, even up to a global phase: if had entries in , the ratio of its diagonal entries, , would lie in the field generated by that ring. But is a primitive 16th root of unity, of degree over , while has degree . So must be approximated; by the Ross–Selinger theorem a typical target at costs about gates plus a lower-order term.
A rotation budget
An algorithm with arbitrary -rotations and a total synthesis-error budget of in operator norm can allot to each rotation, because operator-norm errors add at most linearly. The leading term is then gates per rotation, about in total. Randomly mixing between nearby approximations makes the errors add incoherently, so that, roughly, each rotation needs only rather than (Hastings); equivalently a shorter sequence reaches the same diamond-norm accuracy (Campbell).
Algorithms and Implementations
- Exact single-qubit synthesis (Kliuchnikov, Maslov and Mosca): greedy reduction of the denominator exponent, optimal in - and T-count.
- Exact multi-qubit synthesis (Giles and Selinger): column reduction to a Clifford+T circuit with at most one ancilla.
- Rotation synthesis (Ross and Selinger): grid problems plus norm equations, near-optimal T-count in expected polylogarithmic time.
- Repeat-until-success. Allowing an ancilla, measurement and retries, Paetznick and Svore report an expected T-count scaling as for -rotations, about 38 at against about 100 for ancilla-free synthesis, and Bocharov, Roetteler and Svore give a polynomial-time synthesis algorithm with numerical evidence of an expected T-count about 2.5 times below .
- Ancilla-assisted approximation. With at most two ancillas, Kliuchnikov, Maslov and Mosca reach gates, asymptotically optimal for a constant number of ancillas.
- Catalysis. A resource state can be used and returned intact. For instance Gidney and Fowler convert one CCZ magic state into two T states with the help of a T state that is returned, so CCZ factories also serve T-heavy circuits.
- Circuit-level optimisation. T-par (Amy, Maslov and Mosca) re-synthesises phase-polynomial blocks to reduce T-count and T-depth, and Amy and Mosca connect optimal T-count to Reed–Muller decoding.
Limitations and Common Pitfalls
- T-count is a proxy. It ignores the cost of Clifford operations, routing and the latency of feed-forward; in lattice-surgery architectures T-depth and reaction time can dominate runtime.
- Accuracy measures differ. Operator-norm, diamond-norm and average-fidelity errors are not interchangeable; mixing results are stated in diamond norm, deterministic synthesis in operator norm.
- Expected versus worst-case cost. RUS circuits have random duration and an expected T-count; a schedule needs a tail bound, not only the mean.
- Optimality is relative to a model. "Optimal" T-counts are optimal for a stated class of circuits (ancilla-free, single-qubit, CNOT+T); allowing ancillas, measurement or catalysts changes the answer, as the Toffoli example shows.
- Do not use Solovay–Kitaev for Clifford+T in practice. Its sequences, of length in the analysis of Dawson and Nielsen, are far longer than number-theoretic synthesis.
State of the Art
As of 2026-11, the deterministic ancilla-free benchmark for -rotations is the Ross–Selinger algorithm, with typical T-count ; measurement-assisted (RUS) and mixing methods reduce the expected or effective count by constant factors, as reported in the papers cited above. This section summarises those publications and is not a survey of compiler benchmarks.