Overview
In the circuit model a computation prepares a register of qubits in , applies a sequence of gates (unitaries on one or two qubits drawn from a fixed set) and measures some qubits in the computational basis. The model was formulated by Deutsch as "quantum computational networks"; Yao showed that uniform families of polynomial-size circuits are as powerful as quantum Turing machines, which is why circuits became the default language for quantum algorithms, error correction and complexity theory.
Three questions organise the subject. Which gate sets can build every unitary (universality)? How many gates does it take, as a function of the target accuracy (Solovay–Kitaev and its successors)? And which cost measure matters: total size, depth, width, or the count of one expensive gate type? This page answers the first two precisely and sets up the third; synthesis over the Clifford+T set is the subject of Clifford+T synthesis, and what polynomial-size circuits can compute is the subject of quantum complexity theory.
Intuition
A gate set is like an alphabet and a circuit like a word. With a continuous family of single-qubit rotations and one entangling gate, every unitary can be spelled exactly. With a finite alphabet only countably many words exist, so exact spelling of arbitrary rotations is impossible, but words can come arbitrarily close: if one gate rotates by an angle that is an irrational fraction of a full turn, its powers wind densely around the circle. The surprise of the Solovay–Kitaev theorem is that closeness is cheap. Doubling the number of correct digits costs only a constant factor more gates, not exponentially more, because errors can be cancelled recursively with group commutators.
Universality is, however, almost free and says nothing about efficiency. Almost every -qubit unitary needs a number of gates exponential in ; algorithms are the rare unitaries with short circuits.
The lessons Gates and unitaries and Circuits and simulation build and simulate small circuits by hand.
Prerequisites
Unitary matrices and the tensor product, the Pauli matrices and the Bloch sphere (quantum states), and projective measurement in the computational basis (quantum measurements).
Mathematical Definitions
Fix a finite or infinite set of unitaries, each acting on a fixed number of qubits (in practice one or two): the gate set. A quantum circuit over on qubits is a finite sequence where each is a -qubit gate and is an ordered list of distinct qubits from on which it acts. The circuit implements the unitary
A run of the circuit prepares , applies and measures a designated set of qubits in the computational basis; by the Born rule the outcome string occurs with probability .
- The size of the circuit is , the number of gates.
- The width is , the number of qubits, ancillas included.
- The depth is the smallest such that the gates can be assigned to successive layers in each of which the sets are pairwise disjoint, with any two gates that share a qubit kept in their original order (equivalently, the length of the longest chain of gates linked by shared qubits). Gates in one layer commute and can be applied simultaneously.
- Restricted counts are defined the same way for a subset of , for instance the T-count (number of and gates) and the T-depth (number of layers that contain at least one of them, for a layering that minimises it).
A circuit family assigns a circuit to every input string (or to every input length). It is uniform if a deterministic classical Turing machine outputs a description of from in time polynomial in . Complexity classes such as BQP are defined with uniform families; without uniformity a family can encode the answers to an undecidable problem in its gate choices.
The network formulation goes back to Deutsch; Yao showed that uniform circuit families of polynomial size simulate quantum Turing machines with polynomial overhead. Section 4.6 of Nielsen and Chuang gives a textbook account.
Let be a set of gates, each a unitary on a fixed number of qubits, and let denote the set of -qubit unitaries implemented by circuits over (on any choice of qubits, in any order). Two unitaries are identified when they differ by a global phase , since no measurement distinguishes them.
- is exactly universal if for every (with the largest number of qubits a gate in acts on) and every there is a circuit and a phase with . An exactly universal set is necessarily infinite, because a finite set yields only countably many circuits.
- is approximately universal if for every such , every and every there are and with
where is the operator norm. Equivalently, the image of in the projective unitary group is dense.
Variants restrict the target: a set may be universal on a subgroup (for instance real orthogonal matrices) or computationally universal, meaning it simulates every circuit with polynomial overhead using an encoding into more qubits, which is weaker than density in . The operator-norm error is the natural one because errors add along a circuit: replacing each gate by with changes the product by at most in operator norm (section 4.5.3 of Nielsen and Chuang). How many gates an approximation needs is the subject of the Solovay–Kitaev theorem.
Standard gates
With the conventions of the notation guide: , , , for a Pauli , and the controlled-NOT. Frequently used gate sets are:
| Gate set | Universality | Role |
|---|---|---|
| CNOT + all single-qubit gates | exact | textbook decompositions, hardware with continuous rotations |
| , or Clifford+T | approximate | fault-tolerant computation |
| (Clifford) | not universal | efficiently simulable classically |
The Clifford group is generated by , and CNOT; by the Gottesman–Knill theorem Clifford circuits acting on computational basis states and followed by Pauli measurements can be simulated efficiently on a classical computer, so the non-Clifford gate is what supplies computational power. lies in the third level of the Clifford hierarchy.
Theorems
For every there are real numbers such that
One may take . Moreover, with
one has and . The second form shows that a controlled- gate needs only two CNOTs, the single-qubit gates on the target and a phase gate on the control.
Any two distinct orthogonal rotation axes may replace and . This is Theorem 4.1 and Corollary 4.2 of Nielsen and Chuang; the controlled-gate construction is from Barenco et al.
- for , as in the notation conventions.
Proof · Proof of the Z–Y–Z decomposition
Step 1: reduce to determinant one. Since is unitary, , so for some real . Put and . Then , so .
Step 2: the form of a special unitary. Let the first column of be . It has unit norm, . The second column is a unit vector orthogonal to the first. In the orthogonal complement of is spanned by , which is itself a unit vector, so the second column is with . Then , and forces :
Step 3: the product of three rotations. With and , and . Multiplying out,
This has the form of Step 2 with and .
Step 4: matching. Choose with ; then , and both are non-negative. Write and (if or is zero, its phase is arbitrary). The two linear equations and have the solution , . With these values the product in Step 3 equals , hence .
Step 5: the form. Rotations about the same axis add their angles, so . Since and , conjugation by reverses the angle of a - or -rotation: and . Hence and
Multiplying by gives .
Controlled-. Apply to the target, a CNOT from control to target, to the target, a second CNOT and to the target, then to the control. If the control is , the target receives ; if it is , the target receives and the control picks up , giving . The argument follows section 4.2 and 4.3 of Nielsen and Chuang.
The set consisting of CNOT and all single-qubit unitaries is exactly universal: for every and every there is a finite circuit of CNOT gates and single-qubit gates that implements .
The standard constructive proof writes as a product of at most two-level unitaries (each acting nontrivially on a two-dimensional subspace spanned by two computational basis states), then implements each two-level unitary with a Gray-code sequence of multiply-controlled NOT gates around one multiply-controlled single-qubit gate, and finally expands the controlled gates into CNOTs and single-qubit gates using the Z–Y–Z decomposition. This yields gates (section 4.5 of Nielsen and Chuang). The reduction of controlled gates to CNOT and single-qubit gates is due to Barenco et al.; that two-qubit gates suffice was shown by DiVincenzo.
Sharper counts are known. Every two-qubit unitary can be implemented with three CNOTs and single-qubit gates (Vidal and Dawson). For qubits, Shende, Bullock and Markov give a construction whose CNOT count grows as and is within a factor of about two of a lower bound that holds for generic unitaries.
- Arbitrary single-qubit unitaries are available exactly, so the gate set is infinite.
- Equality is up to a global phase.
The set is approximately universal: for every , every and every there is a circuit over these three gates and a phase with .
The single-qubit part is the heart of the matter. Up to global phases, is the rotation and is , and their product is, up to phase, a rotation about the axis by an angle defined by
This is an irrational multiple of , so the powers of are dense in the rotations about . Conjugating by gives a dense set of rotations about a second, non-parallel axis, and rotations about two non-parallel axes generate all of (an Euler decomposition, as in the Z–Y–Z decomposition). Combined with the exact universality of CNOT and single-qubit gates and the fact that operator-norm errors add along a circuit, this gives the theorem.
The result and the irrationality of are due to Boykin, Mor, Pulver, Roychowdhury and Vatan; a textbook account is section 4.5.3 of Nielsen and Chuang. The same statement holds with , the usual Clifford+T set, since .
- , , CNOT on any ordered pair of qubits.
- Approximation in operator norm up to a global phase.
Let satisfy the assumptions. There is a constant such that for every and every there is a sequence with
where the implied constant depends on but not on or . The sequence is produced by a classical algorithm whose running time is also polylogarithmic in .
The recursive construction analysed by Dawson and Nielsen gives and running time with ; see the exponent equation. Refined versions reach for every , and a 2023 preprint of Kuperberg, which summarises that earlier state, lowers the exponent to (as of 2026-11 this improvement is known from the preprint). A volume-counting argument shows that no finite gate set can do better than .
The theorem is due to R. Solovay (an unpublished 1995 manuscript) and, independently, to Kitaev; textbook proofs are in Kitaev, Shen and Vyalyi and in Appendix 3 of Nielsen and Chuang. Its practical meaning is that the choice of a universal gate set changes circuit sizes by at most a polylogarithmic factor: a circuit of gates from one set, each approximated to , becomes a circuit of gates from another with total error at most .
- The gate set is finite and closed under inverses ().
- The group generated by is dense in ; is fixed while .
- Accuracy is measured in operator norm.
Level of the recursion approximates a target by the level- approximation followed by a group commutator of two level- approximations, so the length obeys while the error obeys . Eliminating gives the length above; the same recursion gives a classical running time with , because each level makes three recursive calls. Both exponents are from Dawson and Nielsen. The ratio of logarithms does not depend on the base. It is used to bound the overhead of translating a circuit from one universal gate set into another.
- Finite inverse-closed gate set generating a dense subgroup of (or , fixed).
- The basic recursion in which each level calls the previous level five times and the error obeys .
Counting lower bounds
Universality does not mean efficiency. Knill showed that approximating most -qubit unitaries to a fixed accuracy requires a number of gates exponential in , and section 4.5.4 of Nielsen and Chuang gives the corresponding counting argument for states. The same counting idea in a single qubit gives the lower bound in the next section.
Detailed Derivations and Proofs
Where the Solovay–Kitaev exponent comes from
The recursion assumes a balanced commutator fact: if satisfies , then with , and replacing by approximations within changes the commutator by . Both facts are proved in Dawson and Nielsen; the second holds because to first order the commutator of near-identity elements depends on the Lie-algebra commutator, so an error of size in a factor of size contributes only .
Given these, suppose level produces words of length approximating every element of to . For a target , take its level- approximation , set , write , and approximate and at level . The level- word is , so
The base case comes from a finite lookup table of short words, chosen so that . Writing , the error recursion becomes , so . To reach it suffices that , and then
The algorithm makes three recursive calls per level (for , and ; the inverses are free because is inverse-closed), giving the running time exponent .
No finite gate set beats
Let have elements. There are at most words of length at most . An operator-norm ball of radius in , a three-dimensional manifold, has Haar volume at most for a constant . If every element of lies within of some word, the balls around the words cover the group, so , i.e.
So the Solovay–Kitaev length is polynomially, not exponentially, far from optimal. Number-theoretic synthesis for Clifford+T attains the linear form of this bound: Ross and Selinger approximate a typical -rotation with T-count .
Worked Examples
Euler angles of the Hadamard gate
Use and . Then
so : the Z–Y–Z angles are . Similarly , since .
The irrational rotation inside
Up to phase, . With and , and using ,
The identity component gives , so and rad, about . The axis is normalised, i.e. proportional to . Since is irrational, for never repeats and fills the circle of rotations about densely.
Size, depth and width of a GHZ preparation
Size 3, width 3. The two CNOTs share qubit , so they cannot be in one layer and the depth is 3. Replacing the second CNOT by gives the same state (after the first CNOT, equals in each branch) but still depth 3; for qubits, a fan-out tree reaches depth instead of .
Three circuit identities
- Hadamard conjugation. , , . Hence : Hadamards on both wires reverse a CNOT. Check on -type states: in the basis the roles of control and target exchange.
- SWAP from three CNOTs. maps .
- Controlled- is symmetric. , and is unchanged by swapping qubits.
Applications
Every quantum algorithm on this site is stated as a circuit family, and its cost is a statement about size, depth or T-count. Fault-tolerant architectures expose Clifford+T as the logical gate set (fault-tolerant quantum computing), so compilers translate arbitrary rotations into it; that translation is Clifford+T synthesis. Other models of computation, measurement-based and topological, are compared with the circuit model by mutual simulation with polynomial overhead.
Limitations and Common Pitfalls
- Universality is not efficiency. Density of a gate set says every unitary is reachable; it says nothing about how many gates are needed. An algorithmic claim needs an explicit polynomial-size circuit family.
- Uniformity matters. Non-uniform families can hard-code non-computable information; complexity statements always assume a classical polynomial-time description of the circuits.
- Global phases are invisible, controlled phases are not. and differ by a phase and are interchangeable as standalone gates, but their controlled versions differ by a relative phase on the control.
- Solovay–Kitaev is rarely the method of choice. Its constants and exponent make it a statement about asymptotic overhead; for Clifford+T, number-theoretic methods (Ross and Selinger) give much shorter sequences.
- Different counts for different stages. On physical hardware the two-qubit gate count and depth dominate errors; inside a fault-tolerant computation non-Clifford gates dominate the cost. Optimising the wrong measure is a common mistake.
- Inverse-closure is an assumption. The standard Solovay–Kitaev proof uses the inverses of the gates, which are free for Clifford+T () but not for an arbitrary hardware gate set.
State of the Art
As of 2026-11: the lowest exponent we found for the general Solovay–Kitaev algorithm in fixed dimension is in Kuperberg, a preprint; for two-qubit unitaries three CNOTs suffice (Vidal and Dawson); and generic -qubit synthesis of Shende, Bullock and Markov uses CNOTs, within a factor of about two of their lower bound. These statements summarise the cited papers, not a survey of circuit synthesis.