Manuscript Offprint
arXiv:2610.40886Clifford synthesis is NP-complete
SØREN FUGLEDE JØRGENSEN
ABSTRACT. We show that the problem of synthesizing a quantum circuit for a given Clifford operator using at most a specified amount of resources is NP-complete for several resource models of practical interest.
Specifically, we study synthesis of a given Clifford operator using single-qubit Clifford gates and two-qubit Clifford gates, with full qubit connectivity and no additional ancilla qubits. With single-qubit gates free and CNOT as the only two-qubit gate, we show that deciding whether a given target admits an implementation using at most a specified number of CNOT gates is NP-complete, and we show that the problem remains NP-complete when any two-qubit Clifford gate is allowed and the budget counts all such gates. Moreover, we show that both results continue to hold when SWAP gates may be inserted for free, and when single-qubit gates are also considered part of the budget.
In each case, we build on recent work by Li and Guan and show that there are polynomial-time reductions from Hamiltonian path in grid graphs to these decision problems, using a number of qubits quadratic in the number of grid vertices.
1. INTRODUCTION
Clifford operators play a central role in quantum error correction [1] and magic state distillation [2,3], making efficient Clifford circuit synthesis an important task in quantum computing. It is also useful in quantum circuit optimization in which peephole methods replace Clifford subcircuits by equivalent circuits with fewer gates or smaller depth, reducing the resource requirements of the larger circuit [4].
As such, a significant amount of work has been devoted to developing algorithms for Clifford circuit synthesis. These range from efficient algorithms that can synthesize instances with large qubit count [5] but may produce circuits with high gate counts or depths, to methods for producing lookup tables giving optimal circuits for small numbers of qubits [6], and exact and heuristic synthesis algorithms covering intermediate regimes aiming to minimize computational requirements of the resulting circuits, generally measured in terms of circuit gate count and circuit depth [4,7–21]. A similar body of literature exists for the closely related problem of minimizing circuits that do not allow general Clifford gates, but only CNOT gates, and for variations such as those that allow CNOT and T gates [22–36]. Indeed, our work follows a line of earlier work on the complexity of circuit optimization [25,35–38], and builds on the recent work of Li and Guan [36] which showed NP-completeness of CNOT circuit synthesis.
For contemporary quantum hardware, it is generally the case that single-qubit gates are available at lower cost and with higher fidelity compared to two-qubit entangling gates. This motivates the study of Clifford circuit synthesis under cost models that are aimed at minimizing the use of two-qubit gates, and our focus is on minimizing the use of CNOT gates. By the stabilizer formalism, any Clifford operator defines a symplectic matrix acting on the -dimensional symplectic vector space over , and the goal is to write as a product of single-qubit Clifford gates and CNOT gates using as few CNOT gates as possible.
Our main result is that deciding whether a given Clifford operator can be synthesized using at most a specified number of CNOT gates, with single-qubit gates being free, is NP-complete. Throughout, we will allow full connectivity of the qubits, and we will not consider additional ancilla qubits. Specifically, assume that is the symplectic matrix of a Clifford operator. If is a circuit composed of single-qubit Clifford gates and CNOT gates which implements , let cost() be the number of CNOT gates in this circuit, and let cost() denote the minimal cost among all circuits that implement . Of particular interest will also be linear reversible operators, which are Clifford operators that can be
KVANTIFY, ROSENVÆNGETS ALLÉ 25, DK-2100 COPENHAGEN, DENMARK E-mail address: sfj@kvantify.dk. Date: November 2, 2026.
implemented using only CNOT gates. Any such operator may be represented by an invertible binary matrix and defines a Clifford operator with symplectic matrix
acting on the same number of qubits.
Theorem 1.1. Deciding whether cost(F) ≤ k is NP-complete. NP-completeness holds already for targets with A lower unitriangular and .
Amy et al. [25] studied parity networks, namely CNOT circuits that generate a prescribed set of parities, possibly at different stages of the computation. They proved that deciding whether such a network exists within a given gate budget is NP-complete when all CNOT gates share a common target qubit. Their reduction encodes a hypercube walk visiting a prescribed set of vertices. Li and Guan [36] show NP-completeness for CNOT-minimization of linear reversible operators by using a tight gate budget to force a Hamiltonian path in the induced subgraph on a prescribed set of vertices: the reduction is from Hamiltonian path in induced subgraphs of the hypercube, closely related to the Hamiltonian path problem in grid graphs for which NP-completeness is known [39]. Any path through such a subgraph has the property that two consecutive vertices differ by a single bit flip, corresponding to a CNOT operation. In turn, the composition of these operations defines a linear operator. To ensure that any circuit for such an operator has the desired structure, they further introduce recorder qubits; whenever a new parity is encountered, its value is copied to a number of recorder qubits, helping ensure that the circuit uses the intended sequence of CNOT operations, and that no shortcuts are taken. They show that m recorder qubits per parity suffice to enforce the intended structure, where m is the number of vertices in the subgraph. The final linear operator is one acting on qubits. See Figure 1 for an example.
In our case, we have the further obstacle that shortcuts through the use of single-qubit Clifford gates must also be prevented. We find that if we build on the construction of Li and Guan and extend the number of recorder qubits for each parity from to , the resulting linear operator has the property that single-qubit Clifford gates cannot be used to bypass the intended sequence of CNOT operations. That is, any circuit implementing the operator with a CNOT gate count below some carefully chosen threshold can be transformed into a CNOT-only circuit without increasing the CNOT gate count. As such, we also end up with a polynomial-time reduction from the Hamiltonian path problem in a grid graph with specified endpoints.
While preparing this manuscript, we became aware of the recent work of Keller and Kueng [40] which shows NP-completeness of deciding whether Clifford circuits can be implemented below a given depth for a given gate set. The work at hand is concerned with cost functions that involve gate count, and not depth, and is therefore complementary to the work in [40].
In Section 2, we introduce the necessary background on Clifford synthesis and the symplectic representation of Clifford operators.
In Sections 3 and 4, we provide a characterization of CNOT gates in Clifford circuits into separate types, based on their action on the symplectic vector space. In a CNOT-only circuit, all gates correspond to gates of one type (called T below), and we introduce a series of bounds that ultimately allow us to ensure that any circuit implementing within the specific CNOT budget the Clifford synthesis instance defined by a hypercube Hamiltonian path instance as above uses CNOT gates only of that one type.
In Section 5, we describe and prove the reduction from grid Hamiltonian path to Clifford synthesis. Readers interested primarily in the main ideas of the reduction may wish to start there.
In Section 6, we provide generalizations to other cost models of practical relevance. We show that NP-completeness extends to the case where the resource cost includes arbitrary two-qubit Clifford gates, rather than just CNOT gates, and to the case where single-qubit Clifford gates are also counted with a given fixed cost per gate. And we show that NP-completeness still holds in the model where SWAP gates are considered free; a cost model that is commonly used when optimizing quantum circuits for architectures with complete qubit connectivity.
(a) Grid instance

(b) Hypercube embedding

(c) Circuit from path

(d) Full CNOT circuit with recorder qubits

FIGURE 1. Overview of the reduction on an example grid graph with vertices and endpoints and . (a) A Hamiltonian path visits , and in that order. (b) The encoding maps this path to in the three-dimensional hypercube; the other cube vertices and edges are shown in grey. (c) Three CNOTs, controlled by coordinate qubits , and in that order, update the path qubit; the parities on its successive wire segments identify the Hamiltonian path. (d) The full circuit shows the coordinate wires and recorder qubits for each vertex. Only the first two and last recorder wires and their CNOTs are drawn in each group. Blue CNOTs move the path qubit along the hypercube edges, and green CNOTs add its current parity to each recorder . Here, , so and the circuit uses CNOT gates. The main goal of the paper is to show that any other Clifford circuit implementing the same operator as this circuit, using no more than CNOT gates must still be such that the Hamiltonian path can be read off from the parities on the path qubit .
Let and denote the 2N Pauli operators in which or acts on qubit , i.e., the tensor products whose th factor is or and all other factors are . Conjugation by an -qubit Clifford operator maps and to a signed tensor product of the matrices and . Discarding this sign, an -qubit Clifford operator is represented by a symplectic matrix , also often referred to as a symplectic tableau. Recording the signs gives an additional phase vector , and the full signed tableau determines the Clifford unitary up to overall scalar phase. The phase vector can be modified arbitrarily without changing using only single-qubit Clifford gates, so when such gates are considered free, we may ignore the phase vector entirely and treat a Clifford synthesis instance as an element . For the more general results in Section 6, we allow single-qubit Clifford gates to have positive cost but in this case, we find that our lower-bound arguments nevertheless only depend on the symplectic part.
The vector space on which the operators act will be indexed by , and the symplectic form is defined such that and for all .
For a given symplectic matrix , we will write
for the rows belonging to qubit . Appending a gate to a circuit corresponds to the left-action, so the corresponding matrices transform as . Thus, for instance, a CNOT gate with control and target acts by
In particular, a CNOT-only circuit implementing a linear transformation has symplectic matrix
For a given and a given qubit , we write
These planes are nondegenerate and pairwise symplectically orthogonal, and their direct sum is the full space . A single-qubit Clifford gate changes the basis of but preserves itself; it will be convenient to work with the planes rather than the individual basis vectors. Here, a subspace is nondegenerate if , where
A subspace is isotropic if and Lagrangian if . Recall also that an isotropic and a Lagrangian subspace have dimensions at most and exactly , respectively.
Much of our work amounts to tracking how the symplectically orthogonal planes intersect with the Lagrangian subspace , and how these intersections evolve under the action of Clifford gates. That is, for a given circuit, we really have a sequence of tableaux, thus also a sequence of planes , but to avoid cluttering the notation, we will avoid explicitly indexing the sequence.
One example of a Lagrangian subspace is the subspace spanned by the first (or last ) standard basis vectors of , but in what follows, many of our results will be independent of the specific choice of .
3. CHARACTERIZING CNOT GATE ACTIONS
Let be the symplectic vector space defined above, and let denote a general Lagrangian subspace of . Let be a symplectic tableau, and let and for denote its rows, and let .
Note immediately that since any single-qubit Clifford gate leaves all invariant, it in particular does not change .
Definition 3.1. We say that qubit represents a vector if . An appearance of such a vector on qubit is an occurrence in which the qubit represents the vector immediately after a CNOT gate when the same vector was not represented by qubit immediately before the gate.
Since is isotropic and is nondegenerate, for all , and thus each qubit can represent at most one nonzero vector from at any given time.
We will group the action of CNOT gates into six distinct types based on how they affect the intersections . For a CNOT with control and target and at some point in the circuit, let count how many of these two qubits represent a nonzero vector of immediately before and immediately after the gate, respectively, and let be the number of appearances caused by the gate. The six types are then characterized by the values of the triple , and we name them as follows:
• Type T (top): .
• Type D (down): .
• Type U (up): .
• Type P (plus): .
• Type M (minus): .
• Type Z (zero): .
Lemma 3.2. The six types of CNOT gate actions described above exhaust all possible changes to the intersections . For type T, the represented vectors change from to either or .
Proof. Suppose that the CNOT gate acts on qubits and , and write the planes before the application of the gate as and . After application of the gate, these planes become
The four-dimensional space is left unchanged. Let . Recall that we have and that the symplectic form vanishes on pairs of vectors from different qubits, so is a symplectic basis of , and the form restricted to is nondegenerate. Since is Lagrangian, is isotropic and therefore has dimension at most 2.
If , none of the vectors belong to , and therefore the intersections and are trivial both before and after the application of the gate. Thus the gate has type .
Suppose that , and let be its nonzero vector. At most one qubit can represent both before and after the gate, so . Moreover, it is impossible for to be represented by one qubit before the gate, and the other qubit after, as
which rules out the case . Thus, the CNOT is of type P, M, or Z.
Now suppose that . First, note that , i.e. that if one qubit represents a vector, then the other does too, and this is the case both before and after the gate. To see this, suppose one qubit represents a vector . Since its plane lies in , we have . Choose independent of and decompose over the two qubit planes where lies in the plane containing . Since is isotropic and the two qubit planes are symplectically orthogonal,
so is a multiple of , and therefore is represented by the other qubit.
If both qubits represent vectors before the gate, write those as and . Then . To find the type of the CNOT gate, it suffices to check which of belong to and . Comparing coefficients in gives the following four cases:
• If u = a and v = d, both vectors remain represented by their respective qubits.
• If and , the represented vectors after the gate are and , and is an appearance.
• If and v = d, the represented vectors are and v.
• If and , neither of the two qubits represents a vector after the gate.
The four cases correspond to gates of type respectively. In particular, this rules out the case , showing that the six types cover all possibilities.
Next, we will bound the total number of appearances that can occur in a given circuit in terms of the number of gates of the above types, the goal being to show that for the circuits relevant for the hardness construction, only gates of type can occur.
Consider a given Clifford circuit consisting of only single-qubit Clifford gates and CNOT gates. Each CNOT gate can cause up to 2 appearances. Let denote the sum of the number of appearances over all CNOT gates.
In a slight abuse of notation, let denote the number of CNOT gates of the corresponding types as defined above.
Lemma 3.3. Suppose that the number of qubits representing a vector of is the same initially and after the circuit. Then
Proof. By Lemma 3.2,
As the number of qubits representing a vector of is assumed to be unchanged by the circuit,
and therefore
and
Next, we will bound the number of appearances that can occur outside type and type gates. First, recall a general fact about symplectic vector spaces.
Lemma 3.4. Let be a nondegenerate symplectic subspace. If is Lagrangian in , then
Suppose a type gate acts on qubits , which represent vectors and before the gate. As in the proof of Lemma 3.2, the space is unchanged by the gate. The vectors and are independent, so
(1)
After the gate, neither of the two qubits represents a vector in until the next CNOT gate that involves either or and the decomposition above remains valid. In the following, we track the history of such unrepresented qubits.
To track appearances coming from different types of gates, maintain a list of pairs of qubits, and a set . Each pair consists of two qubits that represent no vector and have not participated in a CNOT since the type gate creating the pair, while the set contains all other qubits that represent no vector.
Concretely, assume that every qubit initially represents a vector of (which is the case, for instance, if ). Start with an empty list of pairs and an empty set . Then, update them as follows:
-
At a type gate, add its two qubits as a pair.
-
At a gate of type , or , remove every listed pair containing a qubit involved in the gate. Remove from any participating qubit that represents a vector after the gate. For each participating qubit, and each partner from a removed pair, add it to if it represents no vector after the gate.
-
At a type gate, remove the two participating qubits from the list of pairs, or from . The following lemma shows that they are either one listed pair or both in . Let and be the two subcases corresponding to these possibilities.
-
Type gates do not affect the list of pairs or the set .
Lemma 3.5. Suppose that every qubit initially represents a vector of W. Every type U gate acts either on one listed pair (type ) or on two members of A (type ), and every type P gate acts on two members of A.
Writing also for the number of gates of the corresponding type, the number of appearances at gates other than those of types T and is
If every qubit also finally represents a vector of W, then
Proof. Suppose that is a listed pair and that is another qubit that represents no vector. We claim that
Indeed, let and write with , . By (1), and , but since the qubits represent no vectors so . The space is preserved by a CNOT acting on and ; if and are the planes after such a gate, we therefore also have and , so the qubits continue to represent no vectors. In particular, such a CNOT gate must have type .
With this, we can track the behavior of listed pairs and the set A through the circuit:
-
A type U gate involving a member of a listed pair must also involve its partner in that pair.
-
A type gate cannot involve both members of a listed pair at all since, as we have seen in the proof of Lemma 3.2, when , if one qubit represents a vector, then the other does too. Therefore, a type gate can only act by removing a single qubit from .
-
A type T or type D gate cannot involve a listed qubit since both participating qubits represent vectors before such a gate.
-
A type Z gate can add at most four qubits to the set A: its control and target as well as possibly one partner from a listed pair for each.
-
A type M gate can add at most three qubits to the set A: its two participating qubits and, if the previously unrepresented participant belonged to a listed pair, its former partner as well.
Let be the total number of additions to the set A throughout the circuit, allowing multiple additions of the same qubit, let count the number of type U gates acting on two members of A, and let count all other removals. Then
and
If, moreover, every qubit also finally represents a vector of W, then by Lemma 3.3, we have
4. DATA AND RECORDER VARIABLES
Suppose now that the qubits are split into two sets: “data” qubits, followed by “recorder” qubits. Denote the first rows of the initial tableau by . These are the first standard basis vectors in . We call data variables and recorder variables, and we say that a data vector is an element of . Let
be the Lagrangian subspace associated with these variables.
Let , , be nonzero data vectors. Assume that all final qubits represent vectors of and that, moreover, recorder qubit , which initially represents , is required to represent at the end of a given circuit. Note that the are pairwise distinct, and they are neither initial basis vectors nor data vectors.
Recorder qubit does not initially represent , so there must be one or more CNOT gates that cause it to appear. Let the marked appearance be the final such appearance.
There are R marked appearances, one for each recorder qubit. Let
be the number of appearances that are not marked.
Next, we will bound how many outputs of the form can possibly be realized by the recorder qubits if f itself is never represented on any qubit.
Lemma 4.1. Let f be a nonzero data vector. If no qubit ever represents f, then the number of recorder qubits with satisfies
Proof. By Lemma 3.5, at most appearances, and hence at most marked appearances, can occur outside type T gates and type gates. We will count how many recorder qubits r can have and a marked appearance of one of those two types.
First, consider those recorder qubits r for which there was an earlier appearance of any nonzero vector in W on the same recorder qubit before the marked appearance. Each such earlier appearance is not marked, so there are at most E such recorder qubits.
For every remaining recorder qubit r, the only vector represented on its qubit before the marked appearance is the initial vector .
Suppose its marked appearance occurs at a type gate. Then, by Lemma 3.2, the appearance of at this gate requires that was also represented before the type gate, contradicting the assumption that is never represented on any qubit.
Suppose instead that the marked appearance occurs at a type gate on a listed pair. At the type gate that created this pair, the represented vectors were on the recorder qubit and some nonzero vector on the other qubit of the pair. Call this qubit . By (1),
Since , either or ; the latter contradicts the assumption that is never represented on any qubit, so . In particular, qubit represents immediately before the type gate. Since the are pairwise distinct, the appearance of on qubit is not a marked appearance. Associating this appearance to qubit , as above, this case contributes at most another recorder qubits. The associations may overlap but provide an overall bound of , proving the first inequality.
Since all qubits represent vectors initially and finally, Lemma 3.5 and the fact that imply that
By Lemma 3.3, if , there can be no gates of types , or . The following lemma gives a condition for also excluding gates of type and type .
Lemma 4.2. Suppose that every qubit represents a vector of W initially and finally, and that . Suppose also that every appearance is of a vector that has not previously been represented on any qubit, including initially. Then every CNOT gate has type .
Proof. As noted above, Lemma 3.3 rules out gates of type , , and , so we have to consider only gates of type , , and . Recall the construction, preceding Lemma 3.5, of the set of certain qubits representing no vectors. This set is initially empty, and no gates of types , , or add elements to . Therefore, every type gate creates a listed pair of qubits representing no vectors; as gates of type require both participating qubits to represent vectors immediately before the gate, the next gate acting on the qubits in a listed pair must be of type . Such a later gate must exist since both qubits must represent vectors at the end of the circuit.
Let be the vectors before a gate of type . The later type gate produces two independent vectors in span . Both count as appearances since neither qubit represents a vector immediately before the gate. But the only nonzero vectors in this span are , and , and both and have previously been represented. Thus at most one of the two output vectors can be a vector that has not been represented before, contradicting the assumption. Thus there are no gates of type .
Since all qubits initially represent vectors and there are no gates that make them cease to do so, there are also no type U gates.
5. THE REDUCTION
Recall that we aim to reduce the problem of finding a minimum CNOT circuit for a given Clifford operation from Hamiltonian path in a grid graph with specified endpoints for which NP-completeness is known [39]. Here, a grid graph G is the subgraph of the integer square lattice in which vertices correspond to points with integer coordinates and edges connect any pair of vertices at unit distance.
First, suppose the graph is connected, has vertices, and has distinct specified endpoints . A Hamiltonian path in is a path that visits each vertex exactly once, and we require that it starts at and ends at . Let
and
Following Li and Guan [36], define an injection by
where the numbers of 1s and 0s in each block are , , , and , respectively. Note that two vertices are adjacent in if and only if their encodings differ in exactly one position. Define
Then , and we have and . The subgraph of the -dimensional hypercube whose vertices are , and whose edges connect pairs of vertices that differ in exactly one position, is isomorphic to with endpoints 0 and . Recall also from [36] that .
5.1. The target operator. Let , , and . As in Section 4, introduce data variables , and for each introduce recorder variables , . For each , define by
We will require that our target operator maps to , that it maps to itself for , and that it maps the variable to , for all and . We refer to the qubit corresponding to as the path qubit.
Let be the matrix of this operator in the basis , where and . That is,
where X contains r copies of each vertex row, in recorder order. Note that A is lower unitriangular, that A - I is strictly lower triangular and .
The output instance of the reduction is the matrix and the gate count threshold . Since , the number of qubits satisfies . The dense binary tableau therefore has entries. Both and are computable in polynomial time; the quadratic bound refers to the number of qubits.
Note that compared to [36], we have used copies of each recorder qubit instead of only m. For the CNOT-only case, the exact choice does not affect the reduction, and by replicating the argument, one finds that any number of copies at least m would work.
Lemma 5.1. Let be an integer and let and . Let contain copies of each vertex of , in any fixed order, and define
Then admits a circuit consisting only of CNOTs, on exactly labelled qubits with unrestricted connectivity, using at most gates, if and only if has a Hamiltonian path from 0 to .
Proof. As in [36], a Hamiltonian path gives a CNOT circuit by updating the path qubit along its edges and, at each vertex, adding its parity to the corresponding recorder qubits; see also Figure 1. This uses CNOT gates.
Conversely, suppose a CNOT circuit implements using gates. Every recorder qubit must be targeted at least once, since its prescribed output differs from its input. If some vertex parity is never represented, each of the recorder qubits corresponding to must be targeted at least twice. Thus, for this vertex, the recorder qubits require at least 2s CNOT gates, and the remaining recorder qubits require at least one CNOT each, so
which is a contradiction. Thus every vertex parity is represented. The remaining argument of [36] applies unchanged.
Proposition 5.2. If has a Hamiltonian path from 0 to , then .
Proof. By Lemma 5.1, there exists a CNOT circuit implementing with at most gates. The same circuit, viewed as a Clifford circuit, implements , so .
Proposition 5.3. If a Clifford circuit implements with CNOT gates, then has a Hamiltonian path from 0 to .
Proof. Let be the span of all initial first rows. Since the target is , each final plane meets in the span of the corresponding row of . In particular, all qubits represent vectors initially and finally, and Lemma 4.1 applies.
Suppose that there exists a such that is not represented at any point of the circuit. Then Lemma 4.1, applied to the recorders corresponding to , would give
so each must be represented at some point in the circuit.
There are recorder qubits and hence marked appearances. Each of the vectors , also requires an appearance; these vertex parities are pairwise distinct and differ from all recorder outputs, so
It follows that the only appearances are the marked recorder appearances and one appearance of each for . None of the vectors is an initial vector and no vector appears twice, so by Lemma 4.2, every CNOT has type .
At every stage, take the unique represented vector from each qubit. These are linearly independent because they belong to distinct summands . As they are vectors in the -dimensional space , they form a basis of . By Lemma 3.2, relative to the initial basis, the corresponding row matrix starts at the identity, changes by one elementary row addition at each CNOT, and ends at . We have therefore obtained a CNOT-only circuit for with exactly gates.
By Lemma 5.1, this implies that has a Hamiltonian path from 0 to .
Proof of Theorem 1.1. The construction of the Clifford synthesis instance is polynomial in the size of the Hamiltonian path instance, and the two preceding propositions show that a grid graph has a Hamiltonian path with specific endpoints if and only if . This proves NP-hardness and by the form of the target operator, we see that it holds already for instances with unitriangular and .
For membership in NP, combine consecutive single-qubit gates into one layer between each pair of CNOT gates, and into layers at the input and output. A circuit with CNOT gates then has at most single-qubit layers, and each layer consists of at most elements of the fixed finite group , so it has a description of size .
There is a polynomial upper bound on the number of CNOT gates needed to synthesize an arbitrary Clifford operator [5]. For a yes-instance with , a circuit with at most CNOT gates is a polynomial-size certificate. If , use a synthesis with at most CNOT gates instead.
Multiplying the gate tableaux and comparing the result with verifies the certificate in polynomial time.
In the construction, we have assumed that , that the grid graph is connected, and that the endpoints are distinct. An instance with a disconnected graph, or one with equal endpoints and , has no Hamiltonian path and can be sent to a fixed no-instance. The case with both endpoints at that single vertex is a yes-instance and can be sent to the one-qubit identity with threshold zero.
6. ARBITRARY TWO-QUBIT CLIFFORD GATES
To prove that NP-completeness extends to the case in which not only CNOT gates but arbitrary two-qubit Clifford gates are considered as part of the cost, we will express a circuit of arbitrary two-qubit Clifford gates as a circuit of CNOT gates and single-qubit Clifford gates followed by a permutation. We then extend the reduction to allow this output permutation.
Lemma 6.1. Every two-qubit Clifford gate is a product of single-qubit Clifford gates, at most one CNOT, and at most one SWAP. Consequently, a circuit with arbitrary two-qubit Clifford gates and free single-qubit Clifford gates has a symplectic representation of the form
where is a permutation matrix and is a circuit with at most CNOT gates and any number of single-qubit Clifford gates.
Proof. It is known (see e.g. [41], [42, Thm. 26]) that every two-qubit Clifford gate is equivalent, up to single-qubit Clifford gates, to an empty circuit, to a single CNOT gate, to an iSWAP gate (which, in turn, is equivalent to the composition of a CNOT gate and a SWAP gate), or to a SWAP gate. In particular, we can choose a decomposition using at most one CNOT gate for every two-qubit gate. Moreover, any SWAP gate can be moved past a later gate by relabelling the qubits, which gives the desired decomposition.
The permutation may cause recorder outputs to be moved to different qubits; to account for this, we need a new version of Lemma 4.1. Recall the setup of Section 4 and the split of the qubits into data and recorder qubits denoted and respectively and let , , be nonzero data vectors. Let be the span of the initial first rows, and suppose that at the end of a circuit with CNOT gates, every qubit represents a vector of , with the vectors , being represented on distinct qubits. This time, we take a marked appearance of to be the appearance that begins its final uninterrupted occurrence on its final qubit and as before, let be the number of appearances that are not marked.
Lemma 6.2. If a nonzero data vector is never represented, then
Proof. Repeat the partition in the proof of Lemma 4.1, using the final qubit of in place of the original recorder qubit . As before, by Lemma 3.5, at most marked appearances occur outside type and type gates, and the association with earlier appearances on the same qubit still accounts for at most further outputs, since the final qubits are distinct. As such, we need only modify the proof for the remaining gate types for qubits for which there are no appearances preceding the marked ones.
As such, fix an with , and let be the initial basis vector on the final qubit representing , so unlike before, is not necessarily , and assume that that qubit has represented only before the marked appearance. Denote by the other qubit involved in the gate causing the marked appearance. The same type and arguments show that another qubit earlier represented a vector satisfying
If , then as in Lemma 4.1, the appearance of on qubit is not a marked appearance.
Suppose that . If , then , contradicting the assumption that is never represented. If is a data basis vector, the projections of in the data basis and recorder basis are and , respectively. Here, is nonzero because otherwise would be equal to , contradicting the assumption that is never represented. If , then has two nonzero coordinates in the recorder basis. Thus in either case, is neither an initial vector, nor any recorder output, so its earlier appearance is not a marked appearance.
Associate one such unmarked appearance to each output not covered by the first associations. The associations with are distinct and do not coincide with those of the form since the latter are not recorder outputs. If distinct in the latter case give the same vector, , then . Since and are basis vectors, this gives , and since , we have and , so , so has two nonzero coordinates in the recorder basis. Thus, each unmarked appearance is associated to at most two outputs, contributing at most 2E outputs.
The total number is at most , and as in Lemma 4.1,
Recall the constructions of the target operator A and gate count threshold k from Section 5.1. We now generalize Proposition 5.3 by showing that allowing an output permutation does not change the circuit structure forced by the budget k.
Proposition 6.3. If a circuit with at most k CNOT gates implements for a permutation matrix , then has a Hamiltonian path from 0 to t.
Proof. Every final plane represents a vector, and the final represented vectors are the rows of in some order. By Lemma 6.2 with , every is represented. As in Proposition 5.3, the only appearances are the marked appearances and one appearance of each for . By Lemma 4.2 every CNOT gate has type .
Consider the row matrix formed by the unique nonzero vectors in . Every row belongs to the list consisting of initial basis vectors, the vertex parities , and the recorder outputs . Each vector in this list that is not initial is produced by a row addition exactly once. In particular, once a vector is no longer represented, it cannot be produced later.
We will show that each coordinate and recorder output remains on its prescribed row, i.e., is the trivial permutation. A coordinate vector , occurs initially and is required among the final rows. No row addition can produce it, so its original row is never updated.
Next, consider the row addition that produces . Its two operands must be and . To see this, note again that at every stage of the circuit, every row is either an initial basis vector, a vertex parity, or a prescribed recorder output; and in particular, every row has at most one nonzero coordinate in the recorder basis. Since has recorder part , exactly one operand has this recorder part, and the other has recorder part 0. The only possible rows with recorder part are itself and . Since this is the first appearance of , that operand must be , and the other must be .
Consider the first update of the row initially equal to . There must be such an update, because is not a final row. This update produces either a recorder output or a vertex parity . If it produces , by the argument above, . If it produces , the control of the gate must have recorder part to cancel the recorder part of . The control cannot be itself because the rows are independent, so it must be . Thus, the new row is , but by the above, producing requires that is already available as an operand, so this operation would produce a previously represented vector, which is impossible.
Thus, the first update of the original recorder row must give . Since is required finally and cannot be produced again, this row is never updated afterwards. It follows that all coordinate and recorder rows finish in their original positions with their prescribed values.
The only remaining row is the path row. This row must finish at , the circuit implements A itself, and hence is trivial. The result now follows from Lemma 5.1.
We say that two two-qubit gates are locally Clifford-equivalent if they are equal up to single-qubit Clifford gates.
Theorem 6.4. Fix a set of two-qubit Clifford gates containing at least one gate locally Clifford-equivalent to the CNOT gate. Deciding whether a target Clifford operator can be implemented using at most gates from and free single-qubit Clifford gates is NP-complete.
This result holds for the targets with A lower unitriangular and .
In particular, this result applies to the case where consists of all two-qubit Clifford gates.
Proof. Given an instance of Hamiltonian path in grid graphs, construct the target and let as in Section 5.1.
If a Hamiltonian path exists, there is a CNOT circuit for with CNOT gates. Replace each gate with a gate from that is locally Clifford-equivalent to it. This gives a circuit for with gates from .
Conversely, suppose a circuit for uses gates from . By Lemma 6.1, this gives a circuit with at most CNOTs implementing , and Proposition 6.3 gives a Hamiltonian path.
The certificate and tableau verification argument from Theorem 1.1 applies here as well, ensuring membership in NP.
The above also proves NP-completeness of CNOT count (and the more general count) when SWAP gates are free: move all SWAP gates to the end of the circuit and apply Proposition 6.3.
The above machinery is also sufficient to prove NP-completeness in a cost model where single-qubit Clifford gates are available at some more general cost. Fix integers and . Assign cost to each single-qubit Clifford gate and cost to each gate from a fixed set of two-qubit Clifford gates containing CNOT. With respect to these fixed costs, for a Clifford operator , let denote the minimal cost of any circuit implementing . In this case, we can no longer ignore the phase vector of the Clifford operator: for example, if , an operator like the single-qubit NOT gate whose symplectic part is trivial can no longer be implemented at cost zero; nevertheless, we find that we may take the phase vector to be zero in the reduction.
Theorem 6.5. Let and be integers, and let be a set of two-qubit Clifford gates containing CNOT. Given a Clifford operator , specified by its full signed tableau, deciding whether is NP-complete. The result holds both with and without additional free SWAP gates, and NP-completeness holds already for targets with lower unitriangular and .
Proof. Use the symplectic matrix and as in the previous reductions, and let the threshold be , but take now the target to be the Clifford operator whose full signed tableau is . A Hamiltonian path gives a CNOT-only circuit with gates. This circuit has cost and uses no single-qubit gates.
Conversely, consider any circuit implementing with single-qubit gates and gates from with total cost . Passing to its symplectic representation gives a circuit implementing , and if the cost is at most , then , so we may ignore the single-qubit costs and apply Lemma 6.1. The resulting circuit has at most CNOT gates and possibly an output permutation, so Proposition 6.3 gives the required Hamiltonian path. If free SWAP gates are allowed, first move them to the output by relabelling subsequent gates; then the same argument applies.
For membership in NP, there is a polynomial upper bound on the total cost of synthesizing any signed Clifford tableau since contains CNOT. If , then that synthesis supplies a polynomial-size certificate. Otherwise, the circuit has two-qubit gates from . Combining local gates between them leaves at most single-qubit gates without increasing the cost. Note also that the full signed tableau may still be verified in polynomial time. Free SWAP gates can be moved to a final permutation represented by at most SWAP gates.
In the above, we assumed that and were integers; by multiplying both costs and the budget by a common denominator, the result extends to rational costs as well.
Acknowledgements. This work was funded by the Innovation Fund Denmark (Grand Solutions) – grant no. 5366-00005B.
Use of large language models. Large language models were used during the preparation of the paper, in particular to prepare drafts of some of the proofs. We found that current frontier models did not reach the main results without further context but that given the construction of Li and Guan [36], they were able to identify the characterization of CNOT gate actions in Clifford circuits, as well as the counting arguments used to ensure that single-qubit Clifford gates would not lead to shortcuts for the instances constructed from the Hamiltonian path problem. The resulting proof drafts required substantial digestion and verification, and the proofs presented here were rewritten from scratch by the author. Models were also used to provide preliminary auto-formalization, proofreading, and review.
REFERENCES
[1] Daniel Eric Gottesman. Stabilizer Codes and Quantum Error Correction. PhD thesis, California Institute of Technology, 1997. doi:10.7907/rzr7-dt72.
[2] Sergey Bravyi and Alexei Kitaev. Universal quantum computation with ideal Clifford gates and noisy ancillas. Phys. Rev. A, 71(2):022316, February 2005. doi:10.1103/PhysRevA.71.022316.
[3] Emanuel Knill. Quantum computing with realistically noisy devices. Nature, 434(7029):39–44, March 2005. doi:10.1038/nature03350.
[4] Vadym Kliuchnikov and Dmitri Maslov. Optimization of Clifford circuits. Phys. Rev. A, 88(5):052307, November 2013. doi:10.1103/PhysRevA.88.052307.
[5] Scott Aaronson and Daniel Gottesman. Improved simulation of stabilizer circuits. Phys. Rev. A, 70(5):052328, November 2004. doi:10.1103/PhysRevA.70.052328.
[6] Sergey Bravyi, Joseph A. Latone, and Dmitri Maslov. 6-qubit optimal Clifford circuits. npj Quantum Inf., 8(1):79, July 2022. doi:10.1038/s41534-022-00583-7.
[7] Jeroen Dehaene and Bart De Moor. Clifford group, stabilizer states, and linear and quadratic operations over GF(2). Phys. Rev. A, 68(4):042318, October 2003. doi:10.1103/PhysRevA.68.042318.
[8] Matthew Amy, Dmitri Maslov, Michele Mosca, and Martin Roetteler. A Meet-in-the-Middle Algorithm for Fast Synthesis of Depth-Optimal Quantum Circuits. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 32(6):818–830, 2013. doi:10.1109/TCAD.2013.2244643.
[9] Ben Schaeffer and Marek Perkowski. A Cost Minimization Approach to Synthesis of Linear Reversible Circuits, June 2014. doi:10.48550/arXiv.1407.0070.
[10] Dmitri Maslov and Martin Roetteler. Shorter Stabilizer Circuits via Bruhat Decomposition and Quantum Circuit Transformations. IEEE Trans. Inf. Theory, 64(7):4729–4738, July 2018. doi:10.1109/TIT.2018.2825602.
[11] Sergey Bravyi and Dmitri Maslov. Hadamard-free circuits expose the structure of the Clifford group. IEEE Trans. Inf. Theory, 67(7):4546–4563, July 2021. doi:10.1109/TIT.2021.3081415.
[12] Sergey Bravyi, Ruslan Shaydulin, Shaohan Hu, and Dmitri Maslov. Clifford circuit optimization with templates and symbolic Pauli gates. Quantum, 5:580, November 2021. doi:10.22331/q-2021-11-16-580.
[13] Sarah Schneider, Lukas Burgholzer, and Robert Wille. A SAT Encoding for Optimal Clifford Circuit Synthesis. In Proceedings of the 28th Asia and South Pacific Design Automation Conference (ASP-DAC 2023), pages 190–195. Association for Computing Machinery, 2023. doi:10.1145/3566097.3567929.
[14] Dmitri Maslov and Ben Zindorf. Depth optimization of CZ, CNOT, and Clifford circuits. IEEE Trans. Quantum Eng., 3:1–8, 2022. doi:10.1109/TQE.2022.3180900.
[15] Dmitri Maslov and Willers Yang. CNOT circuits need little help to implement arbitrary Hadamard-free Clifford transformations they generate. npj Quantum Inf., 9(1):96, September 2023. doi:10.1038/s41534-023-00760-2.
[16] Tom Peham, Nina Brandl, Richard Kueng, Robert Wille, and Lukas Burgholzer. Depth-optimal synthesis of Clifford circuits with SAT solvers. In 2023 IEEE International Conference on Quantum Computing and Engineering (QCE), volume 1, pages 802–813. IEEE, September 2023. doi:10.1109/QCE57702.2023.00095.
[17] Ning Bao and Gavin S. Hartnett. Twisty-puzzle-inspired approach to Clifford synthesis. Phys. Rev. A, 109(3):032409, March 2024. doi:10.1103/PhysRevA.109.032409.
[18] Irfansha Shaik and Jaco van de Pol. CNOT-Optimal Clifford Synthesis as SAT. In 28th International Conference on Theory and Applications of Satisfiability Testing (SAT 2025), volume 341, pages 28:1–28:21. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. doi:10.4230/LIPIcs.SAT.2025.28.
[19] Mark Webster, Stergios Koutsioumpas, and Dan E. Browne. Heuristic and optimal synthesis of CNOT and Clifford circuits, March 2025. doi:10.48550/arXiv.2503.14660.
[20] Timothée Goubault de Brugière, Simon Martiel, and Christophe Vuillot. A graph-state based synthesis framework for Clifford isometries. Quantum, 9:1589, January 2025. doi:10.22331/q-2025-01-14-1589.
[21] Søren Fuglede Jørgensen. Link-middle-cut lower bounds for Clifford circuit synthesis, September 2026. doi:10.48550/arXiv.2609.16208.
[22] Kazuo Iwama, Yahiko Kambayashi, and Shigeru Yamashita. Transformation rules for designing CNOT-based quantum circuits. In Proceedings of the 39th Annual Design Automation Conference, DAC '02, pages 419–424, New York, NY, USA, 2002. Association for Computing Machinery. doi:10.1145/513918.514026.
[23] Ketan N. Patel, Igor L. Markov, and John P. Hayes. Optimal synthesis of linear reversible circuits. Quantum Info. Comput., 8(3):282–294, 2008. doi:10.26421/qic8.3-4-4.
[24] Giulia Meuli, Mathias Soeken, and Giovanni De Micheli. SAT-based {CNOT, T} Quantum Circuit Synthesis. In Reversible Computation - 10th International Conference, RC 2018, Leicester, UK, September 12-14, 2018, Proceedings, volume 11106 of Lecture Notes in Computer Science, pages 175–188. Springer, 2018. doi:10.1007/978-3-319-99498-7_12.
[25] Matthew Amy, Parsiad Azimzadeh, and Michele Mosca. On the controlled-NOT complexity of controlled-NOT-phase circuits. Quantum Science and Technology, 4(1):015002, 2018. doi:10.1088/2058-9565/aad8ca.
[26] Timothée Goubault de Brugière, Marc Baboulin, Benoît Valiron, Simon Martiel, and Cyril Allouche. Quantum CNOT Circuits Synthesis for NISQ Architectures Using the Syndrome Decoding Problem. In Reversible Computation - 12th International Conference, RC 2020, Oslo, Norway, July 9-10, 2020, Proceedings, volume 12227 of Lecture Notes in Computer Science, pages 189–205. Springer, 2020. doi:10.1007/978-3-030-52482-1_11.
[27] Timothée Goubault de Brugière, Marc Baboulin, Benoît Valiron, Simon Martiel, and Cyril Allouche. Gaussian Elimination versus Greedy Methods for the Synthesis of Linear Reversible Circuits. ACM Transactions on Quantum Computing, 2(3):1–26, September 2021. doi:10.1145/3474226.
[28] Marc Bataille. Quantum Circuits of CNOT gates: Optimization and Entanglement. Quantum Information Processing, 21(7):269, July 2022. doi:10.1007/s11128-022-03577-8.
[29] Vlad Gheorghiu, Jiaxin Huang, Sarah Meng Li, Michele Mosca, and Priyanka Mukhopadhyay. Reducing the CNOT Count for Clifford+T Circuits on NISQ Architectures. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, 42(6):1873–1884, 2023. doi:10.1109/TCAD.2022.3213210.
[30] Irfansha Shaik and Jaco van de Pol. Optimal Layout-Aware CNOT Circuit Synthesis with Qubit Permutation. In ECAI, volume 392 of Frontiers in Artificial Intelligence and Applications, pages 4207–4215. IOS Press, 2024. doi:10.3233/FAIA240993.
[31] Alan Bu, Evan Fan, and Robert Joo. Minimum synthesis cost of CNOT circuits. Quantum Information Processing, 24(7):208, July 2025. doi:10.1007/s11128-025-04831-5.
[32] Jens Emil Christensen, Søren Fuglede Jørgensen, Andreas Pavlogiannis, and Jaco van de Pol. On exact sizes of minimal CNOT circuits. In 17th International Conference, RC 2025, Odense, Denmark, July 3–4, 2025, Proceedings, volume 15716 of Lecture Notes in Computer Science, pages 71–88. Springer, Cham, 2025. doi:10.1007/978-3-031-97063-4_6.
[33] Søren Fuglede Jørgensen. Lower bounds for the CNOT-complexity of linear reversible operators, July 2026. doi:10.48550/arXiv.2607.22248.
[34] Sherry Gong and Andrew Yu. Explicit matrices over with CNOT and row complexity and local logic gates, July 2026. doi:10.48550/arXiv.2607.28598.
[35] Antonio Acuaviva, Arturo Acuaviva, and Pablo Acuaviva. CNOT-Distance is NP-complete under all-to-all connectivity, August 2026. doi:10.48550/arXiv.2608.03825.
[36] Chenjian Li and Ji Guan. Vanilla exact synthesis of CNOT circuits is NP-hard, September 2026. doi:10.48550/arXiv.2609.04160.
[37] Yifan Kang. CNOT-Optimal Circuit Synthesis. Technical report, Research Science Institute, Massachusetts Institute of Technology, 2023. Under the direction of Henry Ma. URL: https://math.mit.edu/research/highschool/rsi/documents/2023KangY.pdf.
[38] Adam Husted Kjelstrom, Andreas Pavlogiannis, and Jaco van de Pol. Exact quantum circuit optimization is co-NQP-hard, October 2025. doi:10.48550/arXiv.2510.16420.
[39] Alon Itai, Christos H. Papadimitriou, and Jayme Luiz Szwarcfiter. Hamilton paths in grid graphs. SIAM J. Comput., 11(4):676–686, November 1982. doi:10.1137/0211056.
[40] Luna Lima Keller and Richard Kueng. (A Variant of) Clifford Circuit Synthesis is NP-Complete, October 2026. doi:10.48550/arXiv.2610.02029.
[41] Antonio D. Córcoles, Jay M. Gambetta, Jerry M. Chow, John A. Smolin, Matthew Ware, Joel Strand, Britton L. T. Plourde, and Matthias Steffen. Process verification of two-qubit quantum gates by randomized benchmarking. Phys. Rev. A, 87(3), March 2013. doi:10.1103/PhysRevA.87.030301.
[42] Daniel Grier and Luke Schaeffer. The classification of Clifford gates over qubits. Quantum, 6:734, June 2022. doi:10.22331/q-2022-06-13-734.