Manuscript Offprint
arXiv:2610.25138On the Complexity of Level-Synchronized Tree Automata for Quantum Circuit Verification
Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.
Michael Blondin , Samy Chady Khoumsi-Kasmi , Guillermo A. Pérez , and Marnix Suilen
Université de Sherbrooke, Canada
University of Antwerp, Belgium
Abstract. Reliable quantum computation requires methods for verifying quantum circuits. Level-synchronized tree automata (LSTAs) were recently introduced to represent sets of quantum states for this purpose. We study LSTAs along two axes relevant to verification: the complexity of their decision problems and the size of their representations under circuit operations. We prove that acyclic LSTAs have NP-complete nonemptiness and -complete language inclusion, and that general language inclusion is EXPSPACE-complete. We further prove inherent quadratic representation growth under individual quantum gates in a fixed qubit order, and give an adjacent-qubit reordering construction that preserves level synchronization. These results clarify the scope of applicability of the automata-theoretic toolbox for quantum circuit verification.
Keywords: Tree automata, quantum computing, formal verification
1 Introduction
Verifying a quantum circuit requires reasoning about the states it can produce from its allowed inputs. An n-qubit state has amplitudes, and a specification may describe many such states at once. Figure 1 illustrates how one such quantum state can be represented as a perfect binary tree. Level-synchronized tree automata (LSTAs) represent sets of quantum states by sharing subtrees and coordinating choices across each tree level [1]. Synchronization encodes dependencies between distant branches that ordinary tree automata can represent only at an exponential cost (see, e.g., [1, Ex. 3]).

Fig. 1: The quantum state as a perfect binary tree. Dashed and solid edges encode 0 and 1 values.
These representations underlie AUTOQ, an LSTA-based tool for quantum-circuit verification, which supports single-qubit and controlled-gate transformations with at most quadratic representation growth [1].
M. Blondin et al.
Computing a specified output amplitude of a circuit, known as exact strong simulation, is a closely related problem. For example, de Colnet et al. [6] express amplitudes as weighted sums over Boolean path variables and exploit the structure of the resulting interaction graph. Instead, LSTA-based verification symbolically simulates the circuit: starting from an LSTA representing the allowed inputs, it transforms the automaton for each successive gate. It then checks whether the resulting language is included in that of an LSTA representing the postcondition. In this setting, representation size determines the cost of each gate transformation and of the final inclusion check. Tsai et al. [18] use qubit reordering to compile pre- and postconditions into LSTAs whose size is linear in the number of qubits for fixed specification parameters. The resulting smaller automata also reduce verification time. This motivates our study of representation growth under gates, the cost of reordering, and the complexity of inclusion.
The automata used for quantum verification have also developed beyond the original LSTA model. AUTOQ 2.0 uses symbolic amplitudes to handle measurement and classical control flow with supplied loop invariants [5]. More recently, synchronized weighted tree automata (SWTAs) combine level synchronization with weighted transitions and associate quantum states with sequences of colors (called choices here) [2]. Their functional-inclusion test compares the outputs associated with the same color sequence.
Contributions. Language inclusion for LSTAs is known to be PSPACE-hard and in EXPSPACE [1]. For circuit verification with a fixed number of qubits, all state trees have the same height, so acyclic LSTAs suffice to represent the relevant sets of quantum states. We settle the complexity of nonemptiness and inclusion for acyclic LSTAs and of inclusion for general LSTAs. We also establish lower bounds on representation growth under quantum gates, and give an efficient construction for swapping adjacent qubits in the qubit order. Specifically:
-
For acyclic LSTAs, nonemptiness is NP-complete (Theorem 6) and inclusion is -complete (Theorem 11). By contrast, nonemptiness for general LSTAs was already known to be PSPACE-complete [1].
-
Language inclusion for LSTAs is EXPSPACE-complete (Theorem 12). Hardness already holds with one initial state and singleton choice sets.
-
In a fixed qubit order, a Hadamard gate or a controlled-NOT gate whose control follows its target can force every LSTA accepting the output tree to have quadratically many states relative to the input representation size (Propositions 15 and 16). The latter extends to controlled-U gates, for every fixed non-diagonal one-qubit unitary U (Corollary 17).
-
We show that swapping two adjacent qubits in the qubit order of a layered LSTA is efficient, as with adjacent-variable swaps in binary decision diagrams (BDDs) [16]. The construction takes linear time in the automaton size for a fixed number of available choices (Proposition 18).
We work throughout with perfect binary trees, as required to represent fixed-length quantum state vectors. Section 2.4 also gives a self-contained nonclosure proof for this tree domain. Classical variable-order sensitivity transfers from
BDDs to LSTAs through residual counting [4,11], as explained in Section 5.2. Together with the gate lower bounds, it motivates careful selection of qubit orders and transformation sequences. In the conclusion (Section 6), we identify blocks that could be applied in linear time and discuss how a verifier may combine them with dynamic reordering and evaluation from either end of a circuit. Due to space constraints, some proofs and examples are deferred to the appendix.
2.1 Quantum states
An -qubit (pure) quantum state can be understood as a function from bitstring addresses to complex amplitudes, with . That is, the sum of the squared moduli of its amplitudes is 1. Equivalently, using bra-ket notation, a quantum state is a normalized vector , where and .
Fixing a qubit order identifies this vector with a tree of height : each internal node at depth is labeled , its two children correspond to setting that bit to 0 or 1, and the leaf at address is labeled . For example, the state has four leaves labeled (see Figure 1).
2.2 Perfect binary trees
Let be a finite ranked alphabet, i.e., a finite alphabet with a ranking function . Let for . For an address and , write for the address obtained by appending to .
Definition 1. A binary tree over is a map , where is finite, nonempty, and prefix-closed: for all , implies . For every , its children are those prescribed by its label:
The depth of a node is its length . The height of the tree is , and its th level is . A tree is perfect if all its leaves have the same depth, equivalently, if . Write for the set of all perfect binary trees over . Height 0 is allowed: such a tree is a single rank-0 root , with mapping the empty word to .
The special case where amplitudes belong to yields a binary decision tree.
M. Blondin et al.
For in the domain of a tree , the subtree is defined by
For , we write whenever as partial functions.
2.3 Level-synchronized tree automata
We use the LSTA model of Abdulla et al. [1] on finite perfect binary trees.
Definition 2. A level-synchronized tree automaton (LSTA) is a tuple consisting of a finite state set , initial states , a finite ranked alphabet , and a finite set of transitions of the forms
where and is finite. These are called internal and leaf transitions, respectively. The transitions must be choice-deterministic: distinct transitions with the same source have disjoint choice sets.
Let . For either form, let and choice . For internal transitions, let ; for leaf transitions, let . For an LSTA , we write to identify its components.
A run of A on a perfect binary tree is a map labeling its nodes by transitions, subject to the following conditions:
– At each leaf v, the transition has the form .
– At each internal node , the transition has the form , with for .
The key feature of LSTAs is that all nodes at the same depth must agree on a common choice, even though they may use different transitions. Formally, we say that a run on T is accepting if
The language of an LSTA is has an accepting run on . Fixing an initial state and one common choice per level determines at most one run and its labeled tree. A tree may nevertheless have several accepting runs. We call a singleton LSTA if contains exactly one tree.
The state-dependency graph of an LSTA is , where
The LSTA is acyclic if this graph is acyclic. It is layered if can be partitioned into levels with such that, for all , transitions from are internal and have children in . States in have only leaf transitions.
For complexity statements, size means the total length of the explicit encoding, including the transitions and every element of their choice sets. Choice identifiers may be consistently renamed to a polynomially bounded range. The choice universe contains all choices occurring on transitions, and a choice incidence is a transition paired with one of its choices:
The size of A is defined as .

Fig. 2: Two examples of LSTAs. Left: A singleton LSTA recognizing . Right: An LSTA recognizing .
Example 3. In Figure 2, the LSTA is nonminimal and admits different choices, but accepts only the tree of Figure 1. Choosing 0 at each level gives the accepting run : defined by
M. Blondin et al.
The LSTA accepts the tree representation of using choices 1, -, and 0, with the following accepting run:
2.4 Complementation
Theorem 4. LSTA languages are not closed under complement relative to perfect binary trees.
Abdulla et al. [1, Thm. 12] proved nonclosure under complement over unrestricted finite binary trees. Since we work with perfect binary trees, this does not establish nonclosure for our setting. We use the following property of LSTAs. It follows directly from the assumption of choice determinism for LSTAs (see also the proof of [1, Thm. 14]).
Lemma 5. Let be an accepting run on a perfect binary tree . If and have the same depth and , then .
We exhibit an LSTA whose complement, restricted to perfect trees, contains trees with arbitrarily many distinct subtrees at one depth. By Lemma 5, no LSTA can recognize that complement.
Proof (of Theorem 4). Let and . Consider the LSTA with sole (initial) state , and transitions and . It accepts exactly the perfect binary trees whose leaves are all labeled , including the height-0 tree . Suppose that an LSTA recognizes its complement relative to , and let . Since must accept the height-0 tree , we have . Consider the perfect binary tree of height , with all internal nodes labeled , and such that
It has a b-labeled leaf and hence must be accepted by . The subtrees rooted at depth are pairwise distinct: has its unique b-labeled leaf at relative address , i.e., if and only if . As , two of these roots have the same state in any accepting run of . Lemma 5 forces their subtrees to be equal, a contradiction.
For readability, we use arbitrary symbols for choices but these can be replaced by natural-number indices.
3 Acyclic LSTAs: nonemptiness and language inclusion
The language-inclusion problem allows to test whether all states that a quantum circuit produces from a precondition satisfy a postcondition [1]. We first study nonemptiness for acyclic LSTAs, which cover the fixed-qubit applications of that work [1, Sect. 6.3]. (Recall that for general LSTAs, it is known to be PSPACE-complete [1, Thm. 13].) Our construction also yields hardness of inclusion.
3.1 Nonemptiness for acyclic LSTAs
Theorem 6. Nonemptiness for acyclic LSTAs is NP-complete.
We prove Theorem 6 by establishing membership and hardness separately. A run certificate specifies an initial state, a height, and one common choice per level (cf. [1, Thm. 14]). A tree DAG D is a rooted directed acyclic graph representing a tree with shared subtrees. Each node is labeled by a symbol: a rank-0 node has no successors, while a rank-2 node stores an ordered pair of successor pointers, called its children. The pointers may have the same target, and a node may be the target of several pointers. Its unfolding, written unfold(D), recursively copies the subgraphs reached via these pointers to form a tree. Sharing identical subtrees can make a tree DAG exponentially smaller than its unfolding. We say that a tree DAG is layered if its nodes can be partitioned into levels with each pointer advancing one level.
Lemma 7. Nonemptiness for acyclic LSTAs is in NP. A run certificate yields, in polynomial time, a layered tree DAG whose unfolding is the accepted tree.
Proof (sketch). Acyclicity bounds the height of any accepting run by . We can thus guess a run certificate: an initial state, a height, and a common choice at each level. At each level, choice determinism gives at most one transition for each reachable state and the chosen common choice. We check that these transitions exist and have the required arity, then propagate child states at internal levels. If we succeed, the selected transitions form a layered tree DAG with at most nodes whose unfolding is accepted. Conversely, any accepting run yields such a certificate. As all choices occur explicitly in the automaton, both guessing and verification take polynomial time.
Let be a CNF formula over variables with clauses , where . Let be distinct rank-2 symbols, and a rank-0 symbol. Symbols and encode Boolean values. We encode assignments as trees exposing a chosen set of variables . We will take for non-emptiness, and will expose the universally quantified variables for inclusion. Put . For every , define to have routing levels labeled , followed by variable levels and leaves labeled . The routing levels provide branches for checking the clauses in parallel, repeating clauses if necessary. Each node at variable level has label if , and otherwise. For a full assignment , write for its restriction to .
M. Blondin et al.
Lemma 8. There exists a layered LSTA of size such that
Proof. We repeat clauses as necessary to obtain clauses . We first construct a routing gadget in the LSTA: a perfect binary tree of states of depth , rooted at the initial state, whose states at depth are for .
Each internal routing state has a single transition to its two children. Thus, the first levels of every accepted tree are labeled . For , the initial state is and no routing transitions are needed.
After the initial routing gadget, we want states to record whether the first assigned variables have already satisfied . For and , add transitions
where is 1 if either or setting to satisfies clause . Only has a leaf transition, with label and choice . An example of the construction with is illustrated in Figure 3.
At each variable level , synchronization selects one bit for all clause components. A level is visible if , in which case its label is ; otherwise its label is , but the choice still updates every component.
Note that the construction is layered and choice-deterministic, with states, transitions, and choice incidences.
For any assignment , an induction on shows that the flag of component is 1 after level exactly when the first variables satisfy . Thus, the choices prescribed by yield an accepting run exactly when , and the resulting tree is . Conversely, every accepting run determines such a satisfying assignment. This proves Equation (1).
Example 9. Consider the LSTA of Figure 3. The first level (within a rounded box) represents the sole routing level of the gadget. The subsequent second and third levels encode the truth assignments to and . The highlighted (blue) states illustrate an accepting run reached by the choice sequence 0, 0, 1, 0, which sets to false and to true, thereby satisfying the formula.
Recall that in the inclusion reduction, the visible variables will be the universally quantified ones. For nonemptiness hardness, we take .
Corollary 10. Testing nonemptiness for acyclic LSTAs is NP-hard, even with one initial state, one rank-2 symbol, and one rank-0 symbol.

Fig. 3: LSTA being non empty iff the formula is satisfiable.
Proof. Apply Lemma 8 to an arbitrary 3-SAT instance with , and discard the unused symbols .
3.2 Language inclusion for acyclic LSTAs
Making universally quantified variables visible, while leaving existentially quantified ones invisible, turns quantified satisfiability into inclusion. The upper bound uses the polynomial run certificates established earlier. Appendix D presents a worked graphical example of the reduction.
Theorem 11. Inclusion for acyclic LSTAs is -complete. Hardness holds with one initial state per automaton, two choices, and a fixed ranked alphabet.
Proof (sketch). For the upper bound, noninclusion belongs to : guess a run certificate for and construct its polynomial-size tree DAG using Lemma 7. Restrict to the tree represented by by pairing its states with nodes of and retaining only transitions matching the labels and ordered children of . The resulting acyclic LSTA has polynomial size and satisfies
An NP nonemptiness oracle can now decide whether the guessed tree is in .
For hardness, we reduce from -SAT. Given , let us order the variables with first and put . Let be a tautological CNF over the same variables, with the same number of clauses as . We apply Lemma 8 twice, obtaining and . By Equation (1),
Both automata have polynomial size and satisfy the stated restrictions. ☐
M. Blondin et al.
4 Language inclusion is EXPSPACE-complete
We now allow cycles, so accepting trees need not have bounded height. We prove EXPSPACE-hardness by reducing from finite-trace inclusion for labeled 1-safe Petri nets. This matches the upper bound of Abdulla et al. [1, Thm. 15] and closes the gap left by their PSPACE lower bound.
Theorem 12. Language inclusion for LSTAs is EXPSPACE-complete.
The reduction uses one component for each place of the net: a pair of automaton states recording whether that place contains a token, together with their outgoing transitions. After initialization, a common choice at each internal level selects a net transition, which all components check and simulate together. The tree records the resulting sequence of transition labels. To make this concrete, we need some definitions.
4.1 Labeled 1-safe Petri nets and trace inclusion
We use Petri nets with arcs of weight one, following [9, Def. 2.1.1]. A labeled net is a tuple , where is a finite set of places and is a finite set of transitions disjoint from . (We reserve for trees.) The maps pre, post: specify the input and output places. A marking gives the number of tokens at each place , and is the initial marking. Each transition emits the letter , where is a finite alphabet.
At a marking , a transition is enabled when each input place contains a token, that is, for every . Firing removes one token from each input place and adds one to each output place, giving with
The net is 1-safe if every marking reachable from takes values in . Its finite trace language is
Trace inclusion asks whether for two given such nets over a common alphabet. This problem is EXPSPACE-hard by the trace-containment construction given in Jategaonkar's proof of Theorem 6.5.3 [9, pp. 142–143]; see also [10] and more recently [3, Prop. 4.3 and Appendix A].
4.2 Reduction and proof
A simple tree encoding. For the input nets and , put
Add isolated, initially empty places to each net until both have m places. These places occur in no input or output set, so they do not change either trace language. The two automata will use this same depth d and the alphabet
For , let be the perfect tree of height with label at depths less than , label at depth for , and label at the leaves. For a fixed , the map is injective: the tree height and the labels after the initialization prefix recover . In particular, has height . For a language , write .
The automaton. We work with either net and write its places as . Choose pairwise distinct identifiers , , and for . The LSTA has states for each place , recording its token count.
Let be the length-d binary addresses in lexicographic order. For , construct a routing gadget, as in the construction of Lemma 8: routing edges form a perfect binary tree of depth , with fresh internal states and state at address . The root is the sole initial state.
Each internal state has the single transition , where are its two children in the gadget. Hence, the first levels of the accepted trees have label , and the run states at depth record the initial marking.
For every place , bit , and net transition , add the transitions
(2)
Both children update the bit for the same place. For every bit state, also add
All choice sets are singletons, and each state has at most one transition for each identifier , , for , so the automaton is choice-deterministic. Distinct net transitions use distinct choices even if their labels coincide. There are states and transitions and choice incidences. Thus, the whole construction has polynomial size in the input description of the nets. An example of this construction is shown in Figure 4.
Lemma 13. For every net N, it is the case that .
Proof. A run simulating a firing sequence represents a marking by keeping identical copies of its jth bit below the routing address . More precisely, after simulating i transitions to reach , it satisfies
Initialization establishes this invariant for i = 0.
M. Blondin et al.

Fig. 4: The LSTA (right) obtained from a labeled 1-safe Petri net (left).
Consider a transition enabled at a reachable marking . Every place satisfies the input-token condition of Equation (2), and 1-safety ensures that all updated counts belong to . Thus, every node at this level has its rule. Using these rules emits throughout the level and establishes the invariant for the successor marking. Any finite firing sequence therefore gives an accepting run on by taking after its last step.
Conversely, initialization puts every accepting run in the states encoding . At each internal level from depth onward, synchronization forces all singleton choice sets to be for one net transition . Every place has a component, so the existence of these rules implies that all input places of contain a token. Hence is enabled, and Equation (2) updates every component to the successor marking. Induction extracts a legal firing sequence . Its labels and the final stop choice give the tree .
Proof (of Theorem 12). The two automata use the same map . Its injectivity and Lemma 13 give . The preceding polynomial-time reduction and Lemma 13 establish hardness, even with one initial state per automaton, singleton choice sets, one leaf symbol, and labels that are constant at each tree level.
For membership, we use the EXPSPACE upper bound of Abdulla et al. [1, Thm. 15], which allows arbitrary binary trees. To restrict acceptance to perfect trees, in both automata we replace each choice by on internal transitions and by on leaf transitions. States, initial states, symbols, and ordered children are unchanged. Call the resulting automaton . An accepting run cannot mix leaf and internal transitions at a level, because their choices have different parity. Thus, . Moreover, this preserves choice determinism and has polynomial encoding size.
5 Inherent growth and sensitivity to qubit order
We study unavoidable representation growth under quantum-gate applications and changes of qubit order. The proofs count distinct subtrees at one level.
Amplitude trees. Fix a qubit order . For an amplitude function , write for its representation in this order, and for its perfect binary tree: internal depth is labeled , and leaf is labeled . We keep amplitudes exactly, including global phase. A block is a finite sequence of gates and acts by , where is the transformed amplitude function. A single gate is a block of length one. For a layered LSTA with order , internal transitions at depth have label .
Residuals and subtrees. Fixing a prefix leaves the residual function
where juxtaposition denotes concatenation. It gives the leaf labels of the subtree below a. For convenience, we sometimes display it as the tuple of its values, listing suffixes b in lexicographic order. At a fixed depth, the subtrees are perfect and their internal labels are fixed by , so two residuals are equal exactly when their subtrees are equal. Let
Residuals retain their exact values without normalization.
Lemma 14. If an LSTA accepts , then .
Proof. Consider an accepting run on tree . At depth , distinct residuals give distinct subtrees. Their roots carry distinct states by Lemma 5. This gives at every depth .
Note that the previous bound applies to every LSTA accepting the tree, even if it accepts other trees or has several accepting runs.
To derive an upper bound, we construct an LSTA accepting only . Create one state for each distinct residual at each depth . For , its two cofactors are , for . Use the internal and leaf transitions
with initial state . These unique transitions recursively generate exactly . The state, transition, and choice-incidence counts are equal:
Note that the general lower bound uses the maximum over depths, while this layered singleton construction uses their sum. This is the unweighted cofactor DAG of a multi-terminal ordered binary decision diagram (MTBDD), with every variable level retained, and equal residuals merged within each level [4,8]. Reduced MTBDDs may skip irrelevant variable levels. By Lemma 14, counting distinct cofactors at a fixed cut also lower-bounds the state count of every LSTA accepting the corresponding tree.
M. Blondin et al.
5.1 Quadratic growth for some quantum gates
We first give an input quantum state whose total number of residuals is linear in a parameter . The construction above therefore gives a singleton LSTA of size . For our lower bound, we argue that a gate will produce distinct residuals at one depth, forcing that many states in every output representation in the same order (see Lemma 14).
A small selector input. Fix an integer and put . A register here is a group of qubits, whose valuation is a -bit address. We use three registers with valuations . For an address , let . Its amplitude tuple is the computational basis vector . With a selector bit and , define
The selector chooses whether to compare with or with . The unselected address has no influence on that residual. These are the two root subtrees of one amplitude tree. There are nonzero amplitudes, each equal to , so the sum of their squared moduli is . The argument list in Equation (4) groups registers for readability, while the tree uses the interleaved order
Each register has k bits and m addresses; the input has qubits.
Let be the canonical singleton LSTA for . Before the register, a residual remembers the prefix of when , or of when . Before there are at most residuals, and before at most . Before there are exactly the residuals . After bits of have been read, the residual is zero or a scaled equality function on the remaining bits, giving at most possibilities. Including the root and leaf levels, these bounds yield
The distinct residuals before give the matching lower bound. Every state has one transition with choice set , so
Hadamard growth. The Hadamard gate replaces each pair of corresponding amplitudes by their normalized sum and difference:
With as above, put . Applying H to t gives
Output branch 0 adds corresponding leaves; branch 1 subtracts them. The input and output LSTAs for k = 2 are shown in Appendix E.
Proposition 15. Any LSTA accepting has states. Moreover, a singleton LSTA for this tree exists with size .
Proof. Consider the cut after and before , at depth . Prefixes with output give residuals , where . Swapping the addresses leaves this function unchanged. Two different addresses give two entries equal to 1, while a repeated address gives one entry equal to 2. Thus distinct unordered pairs, allowing repetitions, give different residuals. On the input's branch, only matters, whereas after Hadamard both and matter. Counting distinct-address pairs and then repeated addresses gives
These are the residuals from the output-0 subfamily, so . By Lemma 14 and , every accepting LSTA has states.
For the upper bound, propagate pairs of states from the two old root subtrees, together with the output sign. Each pair carries the two old residuals whose leaves must be added or subtracted and divided by . Since each old state has one transition, at most signed pairs are needed, each with one transition and choice 0. Thus, the size belongs to . This is the singleton instance of the gate construction in [1, Thm. 8].
Backward CX growth. The controlled-NOT gate flips target bit exactly when control bit is 1, leaving all other bits unchanged. Equivalently, it replaces by , where denotes exclusive OR. A controlled gate is backward in a qubit order when its control follows its target.
Add a fresh control qubit , independent of the selector input, in state . Place it after the interleaved block:
There are now qubits, with amplitudes
The amplitudes for and coincide because the two coefficients of are equal. The nonzero amplitude is now . Relative to the selector residual count, inserting before adds one level with residuals. The uniform change of nonzero scale does not change which residuals are equal. The canonical construction therefore gives a singleton LSTA with .
M. Blondin et al.
We now apply to this input. Before the gate, fixing t selects which of the two addresses the residual must remember. After the gate, this selection depends on . Since c follows t and both address registers in our qubit order, the output LSTA must distinguish residuals retaining both addresses until c is read. The output amplitudes are
Proposition 16. Any LSTA accepting needs states. Moreover, a singleton LSTA for this tree exists with size .
Proof. Consider the cut just before , with output and the addresses fixed. For , this output came from input . For , it came from input . The residual is therefore
Its subtree has root c and the two residuals shown below:
Here, concatenates the value tuples, with the half first and the half second. For , , and , this is . The first half identifies and the second identifies , so there are distinct residuals, including pairs with equal addresses. The lower bound follows from Lemma 14 and .
For the upper bound, before , a residual is determined by the output bit and the prefixes read from both addresses. After complete pairs of bits, there are at most possibilities and at most twice as many between the two bits of a pair. Their geometric sum belongs to . After , only a scaled equality function remains, with residuals over the remaining levels as counted above. The canonical construction gives a singleton representation of size , matching [1, Thms. 8–9].
Hadamard’s output- residuals determine unordered pairs with repetition. The corresponding CX residuals determine ordered pairs, giving and residuals, respectively.
For a one-qubit unitary , the controlled gate applies to when and acts as the identity when .
Corollary 17. For every fixed non-diagonal one-qubit unitary U, Proposition 16 also holds for in qubit order .
Proof. Write . At the same cut with output , the residual is
Equality of two residuals gives from their halves. Subtracting their halves then gives . A non-diagonal unitary has , so . The same residuals give the lower bound. The controlled-gate construction in [1, Thms. 8–9] gives the singleton size upper bound.
Qubit count. The selector uses qubits and size . Appending qubits fixed to zero gives qubits and input size : the two input leaf values extend to product-state suffixes of total size . Extending every residual by this fixed nonzero suffix is injective, so the Hadamard output still requires states and admits a singleton representation of size . The same padding gives qubits and input size for the controlled-gate family. The residuals used for CX and every fixed non-diagonal controlled-U remain distinct, giving output states. Their constantly many leaf values extend through the suffix with additional states, so the singleton upper bound remains .
5.2 Qubit-order sensitivity and reordering
Variable-order sensitivity is classical for ordered binary decision diagrams (OB-DDs) [4,11]. By Lemma 14, lower bounds obtained from distinct cofactors at one cut also apply to LSTAs accepting the tree, even when they accept other trees.
Our selector gives a direct illustration. Moving after the interleaved block yields residuals before . There are such residuals, while the input has size . The same prefix-pair construction as for backward CX gives a matching singleton upper bound.
For exponential growth, fix an integer and use the normalized phase version of the classical inner-product function [11]:
In interleaved order , remembering the sign and one pending bit gives a singleton LSTA of size . In grouped order , the residuals obtained by fixing are distinct. Two different prefixes are distinguished by a suffix whose only 1 is at a coordinate where they differ. Thus, every LSTA accepting this ordered tree needs at least states.
BDD packages have long supported dynamic variable reordering [16]. To reorder an LSTA language, the local exchange of cofactors must also preserve level synchronization. The following construction provides this adaptation.
Let be a layered LSTA in a fixed n-qubit order . For every , let exchange the qubits at adjacent internal levels , and put . Write for the transitions at the upper swapped level.
Proposition 18 (Adjacent reordering). An LSTA satisfying
can be constructed in time .
M. Blondin et al.
Proof. Put and for the two qubit labels. For each , create fresh states and replace the transition by . For each pair of transitions and with , add
Remove the old states at level and their transitions, which are now unreachable. All retained transitions respect the new qubit order.
In an original run, the common upper choice still selects , and the common lower choice selects a compatible pair of lower transitions. Exchanging their four ordered cofactors therefore gives a run on the reordered tree with the same choices at the same depths. Conversely, a common lower choice in a new run determines that pair uniquely by choice determinism. Both states must therefore use the same pair, reconstructing compatible original transitions. The other levels are unchanged, proving language equivalence. A lower choice selects at most one pair for each , so the new outgoing choice sets are disjoint.
Index the old transitions by source and choice. For each and each lower choice, look up the two transitions and group choices selecting the same pair to obtain its intersection set. This generates at most two choice incidences per . Writing , the state, transition, choice-incidence, and choice counts satisfy
Indexing, construction, and removal of obsolete states give the time bound. ☐
For fixed , performing at most adjacent swaps in the qubit order requires operations and produces at most that many records in the same model. A single adjacent swap takes linear time when is bounded by a constant.
6 Discussion and future work
The preceding bounds motivate applying circuit blocks with controlled representation growth.
A monomial gate maps each computational basis vector to another multiplied by a phase. Single-qubit examples have diagonal or antidiagonal matrices. Some monomial gates can be applied by scanning the qubits in order and remembering information about earlier bits. For example, a CX gate whose control precedes its target only requires remembering the control bit until the target is reached. For a block of such gates, the scan combines the information retained by its gates and tracks the accumulated phase. We propose a new measure, forward-memory width, to capture this intuition: how much memory this scan uses to distinguish its reachable configurations. The intended gate-application algorithm would then pair each state of a layered LSTA with the scan's possible memory configurations, so bounded width gives only a bounded number of copies of each state.
A verifier could apply blocks of small forward-memory width and use existing gate routines for the remaining gates. Between blocks, it could try a bounded number of adjacent swaps in the qubit order to place controls before their targets or reduce the information that later blocks must retain, accounting for the reordering cost of Proposition 18. For unitary circuits, one may apply leading blocks to the precondition or adjoints (conjugate transposes) of trailing blocks to the postcondition. The adjoint reverses the block, moving the postcondition backward and giving the verifier an alternative sequence of intermediate representations. Preliminary results indicate that this approach is sound (see Appendix C). Developing an efficient implementation that combines block application, local reordering, and evaluation from either end of the circuit remains future work, together with assessing whether it broadens the applicability of LSTA-based verification.
Open questions. Can equivalent circuits be rewritten to reduce forward-memory width? Existing quantum-simulation algorithms exploit treewidth and rank-width [13,6,12]. We ask whether finding an order and a partition minimizing the number of gates outside width-w blocks is fixed-parameter tractable in w and a suitable circuit-graph width. The acyclic inclusion bound also suggests quantified Boolean formula encodings and, ultimately, circuit synthesis.
Functional inclusion for SWTAs is PSPACE-hard and in EXPSPACE [2, Thms. 5.6–5.7]. Our reduction does not directly transfer: functional inclusion compares outputs on the same label-and-color sequence, whereas a trace may be realized using different transition-choice sequences in the two nets.
References
-
Abdulla, P.A., Chen, Y.G., Chen, Y.F., Holík, L., Lengál, O., Lin, J.A., Lo, F.Y., Tsai, W.L.: Verifying quantum circuits with level-synchronized tree automata. Proc. ACM Program. Lang. 9(POPL), 923–953 (2025). https://doi.org/10.1145/3704868
-
Abdulla, P.A., Chen, Y.F., Hečko, M., Holík, L., Lengál, O., Lin, J.A., Thinniyam, R.S.: Parameterized verification of quantum circuits. Proc. ACM Program. Lang. 10(POPL), 70:1–70:30 (2026). https://doi.org/10.1145/3776712
-
Bérard, B., Haar, S., Schmitz, S., Schwoon, S.: The complexity of diagnosability and opacity verification for Petri nets. Fundamenta Informaticae 161(4), 317–349 (2018). https://doi.org/10.3233/FI-2018-1706
-
Bryant, R.E.: Graph-based algorithms for Boolean function manipulation. IEEE Transactions on Computers C-35(8), 677–691 (1986). https://doi.org/10.1109/TC.1986.1676819
-
Chen, Y.F., Chung, K.M., Hsieh, M.H., Huang, W.J., Lengál, O., Lin, J.A., Tsai, W.L.: AutoQ 2.0: From verification of quantum circuits to verification of quantum programs. In: Proc. 31 International Conference on Tools and Algorithms for the Construction and Analysis of Systems (TACAS). pp. 87–108. Springer (2025). https://doi.org/10.1007/978-3-031-90660-2_5
M. Blondin et al.
-
de Colnet, A., Geerts, F., Hai, R., Laarman, A., Lee, J.H., Pérez, G.A.: Quadratic sums-of-powers for fixed-parameter tractable quantum-circuit simulation (2026). https://doi.org/10.48550/arXiv.2605.29944, arXiv preprint arXiv:2605.29944
-
Döcker, J., Dorn, B., Linz, S., Semple, C.: Placing quantified variants of 3-SAT and Not-All-Equal 3-SAT in the polynomial hierarchy. Theoretical Computer Science 822, 72–91 (2020). https://doi.org/10.1016/j.tcs.2020.04.003
-
Fujita, M., McGeer, P.C., Yang, J.C.: Multi-terminal binary decision diagrams: An efficient data structure for matrix representation. Formal Methods in System Design 10(2/3), 149–169 (1997). https://doi.org/10.1023/A:1008647823331
-
Jategaonkar, L.: Observing “True” Concurrency. Ph.D. thesis, Massachusetts Institute of Technology (Sep 1993), also published as MIT/LCS/TR-618
-
Jategaonkar, L., Meyer, A.R.: Deciding true concurrency equivalences on safe, finite nets. Theoretical Computer Science 154(1), 107–143 (1996). https://doi.org/10.1016/0304-3975(95)00132-8
-
Krause, M., Savicky, P., Wegener, I.: Approximations by OBDDs and the variable ordering problem. In: Proc. 26 International Colloquium on Automata, Languages and Programming (ICALP). pp. 493–502. Springer (1999). https://doi.org/10.1007/3-540-48523-6_46
-
Kuyanov, F., Kissinger, A.: Efficient classical simulation of low-rank-width quantum circuits using ZX-calculus (2026). https://doi.org/10.48550/arXiv.2603.06764, arXiv preprint arXiv:2603.06764
-
Markov, I.L., Shi, Y.: Simulating quantum computation by contracting tensor networks. SIAM Journal on Computing 38(3), 963–981 (2008). https://doi.org/10.1137/050644756
-
Ngo, H.Q., Porat, E., Ré, C., Rudra, A.: Worst-case optimal join algorithms. J. ACM 65(3), 16:1–16:40 (2018). https://doi.org/10.1145/3180143
-
Olteanu, D., Závodný, J.: Factorised representations of query results: Size bounds and readability. In: Proc. 15 International Conference on Database Theory (ICDT). pp. 285–298 (2012). https://doi.org/10.1145/2274576.2274607
-
Rudell, R.: Dynamic variable ordering for ordered binary decision diagrams. In: Proc. IEEE/ACM International Conference on Computer-Aided Design (ICCAD). pp. 42–47 (1993)
-
Selinger, P.G., Astrahan, M.M., Chamberlin, D.D., Lorie, R.A., Price, T.G.: Access path selection in a relational database management system. In: Proc. ACM SIGMOD International Conference on Management of Data. pp. 23–34 (1979). https://doi.org/10.1145/582095.582099
-
Tsai, W., Chen, Y., Lengál, O.: A practical specification language for automatic quantum program verification. In: Proc. 38 International Conference on Computer Aided Verification (CAV). pp. 302–325 (2026). https://doi.org/10.1007/978-3-032-32537-2_15
A Polynomial run certificates
Proof (of Lemma 7). Let be acyclic. No state repeats along a branch of a run, so every accepted tree has height . Guess a certificate with , , and .
Starting with , for each and , find the unique transition from whose choice set contains . Reject if none exists. For , require all selected transitions to be internal and set
At , require all selected transitions to be leaf transitions. Construct with root and one node per reached pair, labeled by the symbol of . If this transition has ordered child states , give the node the ordered children .
An accepting run supplies a certificate, and choice determinism ensures that verification recovers its transition at each reached pair . Conversely, the transitions recorded during verification of a certificate unfold to an accepting run on unfold(D): the root state is initial, witnesses synchronization at level , and the arity checks ensure a perfect tree of height . These checks also cover height 0 and reject mixed arities at a level. To conclude, note that there are at most levels and states per level, so has at most nodes. The certificate has polynomial bit length, and the verification and DAG construction take polynomial time by scanning the explicit transitions and choice sets.
B Language inclusion for acyclic LSTAs
Proof (of Theorem 11). For noninclusion, guess and verify a run certificate of and construct its tree DAG using Lemma 7. Pair each node of with a state of and retain transitions matching its label and ordered children, with the original choice sets of . Initial states pair the root with . This polynomial-size product is acyclic and satisfies . Use the acyclic-nonemptiness oracle and accept exactly when it answers empty. Thus, noninclusion is in .
For hardness, reduce from -SAT [7]. Let be an instance with clauses, on an ordered variable list with and the variables of first. Put .
Let be the conjunction of copies of , regarded as a formula on the same complete ordered variable list, including unused variables. Apply Lemma 8 to obtain and . Since both formulas have the same number of clauses and the same variable list, the two constructions use the same routing depth and the same height . Thus, their encodings agree at all routing and variable levels, including the hidden levels for .
M. Blondin et al.
Identify assignments to X with their indexed assignments in . By Equation (1),
Consequently,
Both automata have polynomial size, one initial state, two choices, and the fixed ranked alphabet of Lemma 8.
C Forward-memory blocks and scheduling
In this appendix, we use a RAM model with unit-cost complex arithmetic.
Some gates can be applied by scanning the qubits in order and remembering earlier bits. For a block of such gates, we bound LSTA growth by the number of memory configurations reachable during this scan.
Fix a qubit order . We represent -qubit vectors by height- trees with label at internal level and amplitudes at the leaves. An LSTA can be restricted to these trees by pairing states with depths and retaining matching labels, at a cost of . We use this layered form, with state levels , transitions whose sources lie in , and choice incidences . Amplitudes have finite encodings on which equality and the required gate arithmetic are computable exactly. The size bounds below count states, transitions, and choice incidences.
C.1 Gate templates and width
A unitary is monomial if it maps each computational basis vector to another basis vector multiplied by a phase. Fix a finite group of phases, with effective multiplication and conjugation. For each gate in the library below, choose a template and a paired template for its adjoint, the conjugate transpose of its matrix. A template has a finite memory set after each qubit and initial memory . At qubit (tree depth ), it reads an input bit with memory and uses a rule
The three outputs are the output bit, the next memory in , and a phase factor. Here permutes , and the product of the emitted phases multiplies the input amplitude. It describes a prefix-causal monomial gate: the output prefix depends only on the input prefix. Its inverse reads , recovers , updates to , and emits . The memory update itself may forget earlier bits.
Our library uses the following templates:
– Single-qubit monomial gates with nonzero entries in need no pending register.
– Controlled versions whose controls precede the target retain the control predicate, using one partial-AND bit for a conjunction.
– Constant-arity diagonal gates with phases in retain earlier participating bits until the final wire.
Each register is discarded after its last use. Constant-arity prefix-causal monomial gates may be added with fixed templates storing their earlier participating bits. For a positive integer , write for the th roots of unity. For , the library includes the Pauli gates and phase gates , where
It also includes their adjoints and controlled versions with controls before the target. The diagonal gates CZ, CCZ, CS, CT are supported in any qubit order. Each C adds a control that must be 1 for the gate to act. For , the library also includes whenever both diagonal entries belong to .
For a supported block , feed each scanned bit through the templates in chronological order, retain their registers, and accumulate emitted phases in one register . Here acts first, is the number of gates, and the phase register starts at 1. For , let be the configurations reachable on input prefixes in . Each tuple records the gate memories and the phase . This compilation uses the fixed templates and removes unreachable configurations. For the compiled block, we reuse , , and for its bit permutation, tuple update, and phase factor, with . Its initial memory is the tuple of the individual templates' initial memories. Write , or when the block and order are clear.
Definition 19 (Syntactic forward-memory width). The forward-memory width of B in order is
For each gate occurrence g in B, let be its register's value set, taken as a singleton when inactive. Then
Counting reachable configurations can give a smaller bound: fan-out from one control has only two reachable control tuples, and a block of single-qubit T gates
M. Blondin et al.
accumulates at most eight phases. Reachable compilation takes operations. The phase register also contributes to width. For , applying
produces distinct leaf values from with no pending controls.
C.2 Applying blocks and adjoints
Proposition 20. For a layered LSTA A and a precompiled block B of width w in the same qubit order, one can construct using operations, with
Proof. Use states . For , copy and give output child the state , where . Replace a leaf rule by . Initial states carry and phase 1. The branch permutations give a bijection of runs preserving every common level choice and applying exactly the forward phase to each recovered input amplitude. Choice determinism follows from copying outgoing choice sets. At level , each record is copied at most times. Writing , we obtain
These counts give the work bound. Leaf labels belong to .
Write for the adjoint block.
Proposition 21. Paired inverse compilation satisfies at every cut.
Proof. Each input prefix determines a unique output prefix, and conversely. Inverse execution has configuration , so reversal of the register tuple and phase conjugation give a bijection at every cut.
Thus adjoints preserve width and the product estimate . For composition, configurations are images of pairs of block configurations, with their phases multiplied. Consequently,
C.3 A scheduling heuristic
We call gates outside the template library separators, as they separate forward-memory blocks. They include Hadamards and unsupported backward permutations and are applied by exact gate routines [1, Algs. 1–3]. The planner also treats a gate as a separator when its compilation exceeds the allotted budget. The SWAP gate exchanges two qubit values, and applying it in a fixed qubit order incurs its transformation cost.
For a unitary circuit, the proposed planner maintains two automata in a common qubit order and the remaining chronological gates . The current verification obligation is
Fix nonnegative integer bounds on width and on swaps, with constant, and a positive integer shortlist size . For initial alignment, the planner compares a supplied finite set of qubit orders containing both endpoint orders and orders derived from the circuit. It ranks their greedy partitions by separator count, then block count, and then block widths, and retains several for the trials below. Each trial includes the cost of aligning both endpoints. At each subsequent boundary, it inspects the qubit orders within adjacent swaps, including the current qubit order. From each circuit end, it greedily extends a consecutive supported block while reachable compilation stays within the width cap . The cap is tested on reachable configurations, using the product estimate only as an upper bound. The ranking prefers supported blocks, then more consumed gates, lower width, and fewer swaps. It retains candidates per end together with exact single-gate trials in the current qubit order.
For each shortlisted candidate, the executor tentatively reorders both endpoints, applies language-preserving reduction [1, Sect. 6.3], and counts their states, transitions, choices, and choice incidences at each level. It ranks feasible trials by reordering work plus on the chosen endpoint , divided by the number of gates consumed. A trial is rolled back when the peak memory used by the two endpoints together exceeds the limit. Separators use their exact routine's bound, such as the quadratic product bounds for one-qubit and controlled gates [1, Thms. 8–9]. Each iteration commits the common qubit order, applies a nonempty left block to or the adjoint of a nonempty right block to , and removes those gates. When none remain, it tests LSTA inclusion. Throughout, changes in qubit order preserve physical qubit identities, and adjoints are applied in the current qubit order.
Proposition 22. Every completed schedule returns the answer to the original verification obligation.
Proof. Left application preserves Equation (6) by associativity. Right application uses . Reordering is a bijection on both languages and conjugates the same physical circuit by the coordinate permutation. Exact transformations and language-preserving reduction therefore preserve the truth
M. Blondin et al.
of the obligation. Each iteration consumes gates, so there are at most as many iterations as original gates.
The ranking is a heuristic for choosing transformations. Total verification work includes compilation, unsuccessful trials, reduction, and final inclusion, as well as the selected transformations. If all trials exceed a resource limit, verification remains unresolved.
Intermediate sizes affect this cost: applying two Hadamards separately to the same qubit can produce the quadratic intermediate of Proposition 15 before returning to the input. Taking the adjoint reverses the block widths of a fixed partition. For input size and a block of width , put . Applying the bounds and in opposite orders gives and , respectively. Greedy partitioning in the two directions can also select different blocks.
The local search follows window reordering for binary decision diagrams [16]. Retaining several orders and comparing their estimated costs follows cost-based query planning [17]. Factorized query results [15] also exploit shared structure, while worst-case optimal joins [14] avoid large intermediate products.
Forward-memory width measures the given circuit syntax: even canceling CX gates retain separate registers during compilation. Exact circuit rewriting, such as cancellation, commutation, or alternative gate decompositions, could lower this width or remove separators. Minimizing width over equivalent circuits remains a question for future work.
D Language inclusion for acyclic LSTAs: example

Fig. 5: LSTAs (left) and (right) such that if and only if it is the case that .
M. Blondin et al.
E Quadratic growth example

Fig. 6: The selector LSTA for , representing . States and remember prefixes of and , respectively, before ; barred states do so before . State represents the residual on the remaining bits, with written , and represents the zero residual with bits remaining.

Fig. 7: The LSTA representing after applying to the selector input in Figure 6. Equal residuals at each level have been merged. Only the initial state name and amplitude labels are shown: every choice set is , and successive internal levels have labels .