arXiv(opens in a new tab)quant-phSep 2026Cited by 2 papers on PaperVantage

Manuscript Offprint

arXiv:2609.04160

Vanilla Exact Synthesis of CNOT Circuits is NP-hard

Chenjian Li, Ji Guan

CHENJIAN LI, Institute of Software, Chinese Academy of Sciences and University of Chinese Academy of Sciences, China

JI GUAN, Institute of Software, Chinese Academy of Sciences, China

Exact CNOT synthesis asks for a minimum-size CNOT circuit implementing an invertible linear transformation. Although several related synthesis models have been shown to be computationally hard, their hardness proofs rely on additional structure such as restricted qubit connectivity, encoded inputs, or unrestricted intermediate variables. The complexity of the most basic setting—identity input, a fixed number of labelled qubits, no ancillas, and all-to-all CNOT connectivity—had remained unresolved. In this work, we prove that the decision version of this vanilla exact CNOT synthesis problem is NP-complete, and consequently that its optimization version is NP-hard. Our proof gives a polynomial-time reduction from the Hamiltonian-path problem on grid graphs in two steps. First, we isometrically embed the grid graph into a hypercube via a unary encoding map. We then encode this hypercube Hamiltonian path problem into vanilla exact CNOT synthesis. The main challenge is that CNOT synthesis specifies only the final parity matrix and cannot directly enforce the intermediate vertex visits required by a Hamiltonian path. To overcome this difficulty, we introduce extra recorder qubits that encode the required intermediate vertex visits into the final transformation, forcing any CNOT circuit implementation to realize the intended path structure. Beyond CNOT synthesis, our result directly implies hardness for several related problems, including the shortest word problem over GL(n,2)(n,2), distance computation on Cayley graphs over GL(n,2)(n,2), minimization of sequential XOR programs, and exact synthesis of phase polynomial circuits.

CCS Concepts: • Theory of computation → Quantum computation theory; • Hardware → Quantum computation; Logic synthesis.

Additional Key Words and Phrases: CNOT synthesis, exact synthesis, linear reversible circuits, NP-completeness, parity networks, Hamiltonian path

ACM Reference Format:

Chenjian Li and Ji Guan. 2026. Vanilla Exact Synthesis of CNOT Circuits is NP-hard. ACM Trans. Quantum Comput. 1, 1 (September 2026), 19 pages. https://doi.org/10.1145/nnnnnnn.nnnnnnn

1 Introduction

The Controlled-NOT (CNOT) gate is one of the central primitives of quantum computation. Together with arbitrary single-qubit gates, CNOT forms a standard universal gate set. Its optimization is particularly important on current quantum hardware in the NISQ era, as two-qubit gates typically have substantially higher error rates than single-qubit operations [1, 12, 14, 27]. Reducing the number of CNOT gates is therefore a fundamental objective in quantum circuit compilation.

Fortunately, CNOT circuits possess an unusually clean algebraic structure. An nn-qubit CNOT circuit implements an invertible linear transformation over F2\mathbb{F}_2, and each CNOT gate corresponds exactly to an elementary row addition. This correspondence makes CNOT circuits amenable to a broad range of classical mathematical and EDA techniques, and places CNOT synthesis at a natural intersection of classical logic synthesis, reversible computation, and quantum circuit optimization. A substantial body of work has exploited this structure. Patel, Markov, and Hayes [25] first developed

*Dated: September 4, 2026

Authors' Contact Information: Chenjian Li, Institute of Software, Chinese Academy of Sciences and University of Chinese Academy of Sciences, Beijing, China; Ji Guan, Institute of Software, Chinese Academy of Sciences, Beijing, China.

  1. Manuscript submitted to ACM

Chenjian Li and Ji Guan

a block Gaussian elimination method (block GEM) achieving the asymptotically optimal worst-case CNOT count O(n2/log⁡n)O(n^2/\log n). Subsequent work further improved practical synthesis through greedy algorithms [9], A* search [7, 30], and database-based search [8].

Asymptotic optimality, however, is fundamentally different from optimality for an individual target matrix, or instance-wise optimality. PMH's block GEM guarantees an asymptotically optimal worst-case gate count while remaining a polynomial-time algorithm, but it does not in general return a minimum-size circuit for a given instance. Following the terminology of the logic synthesis community, we will also refer to the latter task as exact synthesis of CNOT circuits: given a target linear transformation, find a circuit with the minimum possible number of CNOT gates that realizes it.

Algorithms capable of providing such instance-level optimality appeared only much more recently, and their behavior suggests a sharp contrast with Gaussian-elimination-based synthesis. Shaik and van de Pol encoded topology-aware optimal CNOT synthesis into SAT instances and solved them using general-purpose SAT solvers [28]. More recently, Lin-search and the semi-tensor-product (STP) solver have attacked unrestricted exact synthesis using specialized search procedures, pruning rules, algebraic structure, and parallelization [21, 22]. Despite these substantial domain-specific optimizations, the synthesis cost of these exact methods grows exponentially with the problem size and the optimal circuit length. This empirical behavior strongly suggests that exact CNOT synthesis is computationally intractable, but it does not by itself establish a complexity-theoretic lower bound.

Existing complexity results provide further evidence that exact CNOT synthesis is computationally difficult, but only for related models with additional structure. Kang showed that exact CNOT synthesis under restricted qubit connectivity is NP-hard via a reduction from VertexCover [20]. Amy, Azizmadeh, and Mosca proved NP-hardness for fixed-target parity networks and for parity networks with linearly encoded inputs, the latter via a reduction from maximum-likelihood syndrome decoding [3]. A closely related problem, XOR minimization, has also been studied in the context of cryptography: Boyar, Matthews, and Peralta showed that the XOR minimization problem (Shortest Linear Program) is NP-hard [5]; but such XOR programs may introduce arbitrary intermediate variables, whereas a CNOT circuit is a fixed-width, reversible computation in which the number of live variables remains unchanged. Hence, this hardness result does not directly apply to exact CNOT synthesis.

Taken together, these results provide substantial evidence that exact CNOT synthesis is intrinsically difficult, but they leave an important conceptual gap. Existing hardness proofs rely on additional structure—restricted connectivity, encoded inputs, or extra intermediate XOR variables—that is absent from the most elementary CNOT model. They therefore cannot rule out the possibility that the observed hardness originates from these auxiliary restrictions or resources rather than from the combinatorial complexity of CNOT synthesis itself. The most basic formulation asks for a minimum-size circuit on a fixed number of qubits (or variables), starting from the identity, using no ancillary qubits, and allowing a CNOT between every pair of qubits. The complexity of this unrestricted in-place exact-synthesis problem remained unresolved for many years after the question was raised by Amy et al. [3].

In this work, we show that this unconditioned (thus “vanilla”) problem, which we denote by MinCNOTvanillaopt\text{MinCNOT}_{\text{vanilla}}^{opt}, is indeed NP-hard, and that its bounded decision version MinCNOTvanilla\text{MinCNOT}_{\text{vanilla}} is NP-complete. Our proof gives a polynomial-time reduction from the Hamiltonian path problem on grid graphs, which has been shown to be NP-complete by Itai et al. [16]. Table 1 summarizes our result together with previous hardness results for related CNOT and XOR synthesis models, and our result is shown as follows:

Table 1. Hardness results related to optimal CNOT and XOR synthesis.

WorkAdditional structure/assumptionReduced from
Kang and Ma [20](Topology-Constrained CNOT Synthesis)Restricted qubitconnectivityVertex Cover
Amy et al. [3](Fixed-Target Parity Network)Fixed CNOT targetHamming Salesman
Amy et al. [3](Encoded-Input Parity Network)Encoded inputsMaximum-LikelihoodSyndrome Decoding
Boyar et al. [5](Shortest Linear Program)Arbitrary intermediateXOR variablesVertex Cover
Ours(Vanilla Exact CNOT Synthesis)NoneGrid-GraphHamiltonian Path

PROBLEM: Vanilla CNOT minimization of CNOT circuits (MinCNOTvanilla_{\text{vanilla}})

INSTANCE: A number of qubits nn, a target parity matrix A∈GL(n,2)A \in \text{GL}(n, 2), and a nonnegative integer kk.

QUESTION: Provided that CNOT gates are available between any pair of qubits, does there exist an nn-qubit CNOT circuit CC with length at most kk that realizes the linear transformation AA?

THEOREM 1. MinCNOTvanilla_{\text{vanilla}} is NP-complete.

Our proof proceeds in two stages. We first embed the input grid graph into a subset of vertices of a hypercube {0,1}d\{0, 1\}^d in a way that preserves adjacency. This representation naturally matches the algebra of CNOT circuits: a hypercube vertex v=(v1,…,vd)v = (v_1, \ldots, v_d) is represented by the parity

χ‾υ(x)=x0⊕⨁j=1dvjxj,(1)\overline{\chi}_{\upsilon}(x) = x_0 \oplus \bigoplus_{j=1}^{d} v_j x_j, \tag{1}

where x=(x0,x1,…,xd)x = (x_0, x_1, \ldots, x_d) denotes formal input variables.

We then reduce the Hamiltonian path problem on the hypercube to an exact CNOT synthesis problem instance. Note that traversing one hypercube edge flips one coordinate of vv, which corresponds to adding one variable xjx_j to χ‾υ(x)\overline{\chi}_{\upsilon}(x) and hence to a single CNOT gate. Thus, a walk in the hypercube can be represented by a gate in the CNOT circuit. The main obstacle is that a Hamiltonian path requires every vertex to be visited, whereas exact CNOT synthesis constrains only the final matrix and cannot directly prescribe intermediate parities. We overcome this challenge by introducing a group of recorder qubits, whose final outputs are required to record the intermediate parities (namely vertices in the hypercube) that the circuit must reach. A candidate circuit could nevertheless try to cheat and circumvent this requirement by mixing data and recorder qubits or by introducing temporary intermediate parities on the recorder qubits; to rule out such shortcuts, we require multiple replicas of the recorder qubits and impose a tight gate budget so that there is no room for such auxiliary computation. As a result, every sufficiently short circuit that meets the requirement would visit all required vertex parities, thereby inducing a Hamiltonian path.

Until very recently, the complexity of unrestricted, all-to-all CNOT exact synthesis remained open. While preparing this manuscript, we noted the concurrent independent work by Acuaviva et al. [2], which established NP-completeness for the same setting via a reduction from VertexCover. Our result provides an independent and complementary proof based on a structurally different reduction from Grid-HP, revealing a direct correspondence between CNOT parity trajectories and Hamiltonian paths in induced hypercube subgraphs.

Chenjian Li and Ji Guan

The remaining part of the manuscript is organized as follows. In Sec. 2, we give a brief introduction to CNOT circuits, exact CNOT synthesis, and the grid-graph Hamiltonian path problem. In Sec. 3, we present the reduction from GridGraphHamilton to MinCNOT vanilla_{\text{vanilla}}, proving the hardness of MinCNOT vanilla_{\text{vanilla}} and MinCNOT vanillaopt_{\text{vanilla}}^{opt}, and further strengthen the hardness result under several structural restrictions on the target matrix and gate budget. Finally, in Sec. 4 we discuss the broader complexity implications of our result, including shortest word problem over GL (n,2)(n,2) and the realted Cayley-graph distance problem, minimization of s-XOR programs, and exact synthesis of phase polynomial circuits.

References (21)