arXiv:2609.35239quant-phSep 2026

Manuscript Offprint

arXiv:2609.35239

Computational Complexity of Clifford Template Compilation: Are Quantum Computers Useful for Compiling Quantum Circuits?

Keisuke Fujii

Keisuke Fujii 1,2,3,4^{1,2,3,4}

1^{1}Graduate School of Informatics, Kyoto University, Sakyo-ku, Kyoto, 606-8501, Japan

2^{2}Graduate School of Engineering Science, Osaka University, Toyonaka, Osaka 560-8531, Japan

3^{3}Center for Quantum Information and Quantum Biology, Osaka University, Toyonaka, Osaka 560-8531, Japan

4^{4}RIKEN Center for Quantum Computing (RQC), Hirosawa 2-1, Wako, Saitama 351-0198, Japan (Dated: September 27, 2026)

A Clifford template is a finite ordered family of repeatable Clifford operations, and an instantiation specifies how many times each operation is applied. The Clifford template compilation problem asks how to choose these repetition numbers so that the template realizes a target transformation of Pauli operators. This problem arises, for example, when searching for logical operations in quantum error correction using only Clifford operations permitted by physical or fault-tolerance constraints. Although forward Clifford dynamics is efficiently classically simulable, this inverse problem has sharp complexity transitions. For commuting templates with unrestricted integer exponents, feasibility lies in NP ∩ BQP and a constructive quantum algorithm returns a particular solution together with the full exponent-relation lattice; already at k = 1, recovering the repetition number contains finite-field discrete logarithm over F2r×F_{2^r}^\times. In general, restricting every exponent to {0,1}\{0,1\} removes the Abelian-group closure and makes feasibility NP-complete for variable k, even for exactly commuting CNOT-only operations and X-type Paulis. For commuting self-inverse Clifford actions, both binary feasibility and recovery of one solution are classically polynomial-time solvable, but imposing a bound on the total repetition count is NP-complete, even for CNOT-only operations. These results reveal a rich complexity landscape within Clifford template compilation, spanning classically tractable cases, problems admitting quantum polynomial-time algorithms, and NP-complete variants.

I. INTRODUCTION

Determining whether a desired quantum operation can be synthesized from a prescribed set of elementary operations is a basic problem of quantum gate synthesis and compilation. For a generic n-qubit target, however, the worst-case circuit size grows exponentially with n [1]. Important applications nevertheless contain structured Clifford-compilation subproblems. Clifford operations are central to quantum error correction with the stabilizer codes [2], where they implement logical transformations, including addressable operations on selected logical qubits [3, 4]. Furthermore, in product-formula Hamiltonian simulation, many-body Pauli rotations are commonly implemented using Clifford basis changes around single-qubit rotations [5].

In practice, the available Clifford operations are often restricted by hardware or fault-tolerance constraints. Superconducting processors typically provide entangling gates between neighboring qubits, neutral-atom arrays allow structured shuttling of atoms, and fault-tolerant constructions favor protected logical operations such as transversal, fold-transversal, or code-automorphism gates [3, 4, 6, 7]. These settings naturally supply finite families of structured Clifford operations that can be reused. We call such a prescribed finite family a Clifford template. A natural inverse problem is to choose repetition counts that realize a desired physical or logical Clifford action.

At first sight this problem may appear classically easy. Clifford circuits admit efficient tableau simulation by the Gottesman-Knill theorem, and the action of an n-qubit Clifford on Pauli operators is a binary symplectic linear map [2, 8]. Thus, for any fixed repetition pattern one can propagate Paulis and verify the answer efficiently. The subtlety has two sources. First, a repetition count specified using polynomially many bits may have exponentially large numerical value, so that it can represent exponentially many applications of a single operation. Second, when the number of available operations scales with the input, the number of possible repetition patterns can itself be exponential; even choosing only whether to apply each operation once or not at all gives exponentially many patterns. The compilation problem asks us to invert these compressed families of classically simulable dynamics.

In this work, we study the Clifford Template Compilation (CTC) problem in a restricted but fundamental setting. Given an ordered template T=(U1,…,Uk)\mathcal{T} = (U_1, \ldots, U_k), its instantiation is specified by repetition counts e1,…,eke_1, \ldots, e_k and acts as UT(e)=Ukek⋯U1e1U_{\mathcal{T}}(\boldsymbol{e}) = U_k^{e_k} \cdots U_1^{e_1}. The desired Clifford behavior is specified only by the image of a single Pauli operator PP,

UT(e)PUT(e)†=P′,(1)U_{\mathcal{T}}(\boldsymbol{e})P U_{\mathcal{T}}(\boldsymbol{e})^{\dagger}=P^{\prime}, \tag{1}

We refer to this restricted task as Pauli reachability. It specifies only the image of P, rather than the full action of UT(e)U_{\mathcal{T}}(\boldsymbol{e}). We analyze both general ordered templates and the important restriction in which the induced phase-free Pauli actions commute. We also distinguish unrestricted integer repetition counts from the binary-exponent variant in which every operation may

Clifford Template Compilation (CTC) problem

complexity landscape

UT(e)PUT(e)†=±P′U_{\mathcal{T}}(\boldsymbol{e})P U_{\mathcal{T}}(\boldsymbol{e})^{\dagger}=\pm P^{\prime}

repetition counts

Figure

template circuits:

T=(U1,...,Uk)\mathcal{T}=(U_{1},...,U_{k})

FIG. 1. Clifford template compilation and its complexity landscape. Left: repetition counts instantiate an ordered Clifford template to map an input Pauli operator P to a target P′P', up to phase. Right: commuting integer-exponent decision CTC lies in NP ∩\cap BQP, whereas its binary-exponent variant is NP-complete for variable k. For commuting self-inverse actions, feasibility is in P, but imposing a bound on the number of template-operation applications is NP-complete. Noncommuting integer-exponent decision CTC is NP-complete already at k = 3. The k = 1 discrete-logarithm annotation refers to exponent recovery (search). Commutativity is defined for the induced phase-free Pauli actions; the displayed condition Ui2=IU_i^2 = I is a sufficient self-inverse restriction.

be selected at most once. As a subproblem of full Clifford template compilation, Pauli reachability yields lower bounds that apply to more expressive template-compilation tasks. Figure 1 gives an overview of the task and the complexity regimes studied here.

The problem exhibits a rich complexity landscape as we vary three simple features: whether the template operations commute, whether the exponents are binary or unrestricted integers, and whether the task is to decide existence or to find an explicit instantiation. Across these closely related regimes, decision CTC ranges from NP-complete cases to a commuting integer-exponent case in NP∩BQP, while the unrestricted integer search problem already contains finite-field discrete logarithm for a one-operation template. Thus small changes in the formulation produce sharp complexity transitions within the same Clifford–Pauli reachability framework.

Our results are summarized as follows.

  • If the template size k is part of the input, binary-exponent commuting decision CTC is NP-complete even for CNOT-only operations and X-type Paulis. Its search version is polynomial-time Turing reducible to the decision version using at most k decision queries.

  • For commuting templates with unrestricted integer exponents, decision CTC is in NP ∩ BQP for arbitrary template size k. Standard quantum algorithms for finite Abelian groups also solve search CTC directly in polynomial time and produce the full relation lattice [9–12].

  • For commuting self-inverse Clifford actions, binary and integer reachability coincide, and one binary solution can be found in deterministic classical polynomial time. In contrast, deciding whether a solution uses at most m template-operation applications is NP-complete, even for exactly commuting CNOT-only self-inverse operations (Sec. V B).

  • For a one-operation template (k=1)(k = 1), search CTC over qubits contains discrete logarithm in F2r×\mathbb{F}_{2^r}^\times. The same construction for prime-dimensional qudits gives DLP in Fpr×\mathbb{F}_{p^r}^\times, including Fp×\mathbb{F}_p^\times.

  • Without the commutativity restriction, integer-exponent decision CTC is NP-complete already for k = 3. The hardness holds for wire-permutation Clifford operations, hence for SWAP-only circuits, and follows by embedding membership in a product of three cyclic permutation groups. The general noncommuting case k = 2 remains open.

The main message is, of course, not that an NP-complete language is efficiently solved by a quantum computer. Rather, CTC gives a single natural problem family in which Shor-type structured witness recovery and NP-complete Boolean selection occur in neighboring regimes. The two hardness embeddings use different template-size and output regimes—integer search at k = 1 for DLP, and binary decision at variable k for NP-completeness—but they are expressed by the same Clifford–Pauli reachability relation rather than by unrelated encodings. The distinctive point is therefore not either ingredient in isolation, but their realization as adjacent slices of one CNOT-only, phase-free Clifford framework. In the binary-linear subfamily, moreover, the unitaries appearing in phase estimation are CNOT-only. Coherently controlling them introduces Toffoli gates, but with substantially less non-Clifford overhead than modular-arithmetic tasks such as integer factoring, making this subfamily a promising candidate for an efficiently verifiable workload on early fault-tolerant quantum computers.