Cutoff Theorems for the Equivalence of Parameterized Quantum Circuits
Abstract
Many promising quantum algorithms in economics, medical science, and material science rely on circuits that are parameterized by a large number of angles. To ensure that these algorithms are efficient, these parameterized circuits must be heavily optimized. However, most quantum circuit optimizers are not verified, so this procedure is known to be error-prone. For this reason, there is growing interest in the design of equivalence checking algorithms for parameterized quantum circuits. In this paper, we define a generalized class of parameterized circuits with arbitrary rotations and show that this problem is decidable for cyclotomic gate sets. We propose a cutoff-based procedure which reduces the problem of verifying the equivalence of parameterized quantum circuits to the problem of verifying the equivalence of finitely many parameter-free quantum circuits. Because the number of parameter-free circuits grows exponentially with the number of parameters, we also propose a probabilistic variant of the algorithm for cases when the number of parameters is intractably large. We show that our techniques extend to equivalence modulo global phase, and describe an efficient angle sampling procedure for cyclotomic gate sets.
Keywords and phrases:
Quantum Circuits, Parameterized Equivalence CheckingCopyright and License:
2012 ACM Subject Classification:
Hardware Quantum computation ; Hardware Equivalence checkingAcknowledgements:
We thank Mingkuan Xu for his feedback on the paper and our initial experiments, Linh Dinh for sharing their insights on the number-theoretic aspects of this paper, and Mingsheng Ying for his feedback on an early draft of the paper.Editors:
Paweł Gawrychowski, Filip Mazowiecki, and Michał SkrzypczakSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
In quantum mechanics, unitary operators describe how the probability distributions of quantum systems evolve over time. In quantum computing, primitive operators (known as quantum gates) are composed in sequence and parallel, to create quantum circuits which prepare quantum systems with desirable probability distributions. By sampling from these distributions, answers can be obtained to many high-value problems, such as those from economics [19], medical science [40, 14], and material science [29]. In these algorithms, an initial guess is made for the correct probability distribution, and then each sample is used to further refine the distribution. To make this search tractable, the probability distributions are sampled from a family of parameterized quantum circuits, known as ansatz circuits.
In practice, the structure of the ansatz circuit is static, so that the parameters only vary the operators which appear within the circuits. The parameterized operators within ansatz circuits can be understood geometrically as rotations by arbitrary angles. As a result, the gate sets used to construct ansatz circuits are necessarily infinite. In contrast, the gate sets implemented by real quantum computers are finite, due to limitations related to error-correction [15]. This means that for each parameter refinement, the ansatz circuit must be recompiled and optimized again. However, the compilation and optimization of quantum circuits are known to be highly error-prone [50, 20], so it is desirable to verify both the equivalence of the optimized circuit to the original circuit, and more generally, the correctness of each optimization. In both cases, it is necessary to reason equationally about parameterized relations between quantum circuits.
The problem of parameterized equivalence-checking has been well-studied in the context of distributed system. Given a set of parameters and two programs parameterized by , say and , the parameterized-equivalence checking problem asks whether . When is finite, this problem can be solved by simply testing the elements of . When is infinite, one approach to this problem is to find a cutoff for which checking the equivalence of and for distinct elements of implies the equivalence of and for all elements of [16]. Formally, one tries to find an such that for all , if , then implies . Typically, the choice of (and sometimes even ) will depend on both and , and therefore this technique requires domain-specific insights (see, e.g., [22, 25, 27, 2, 34, 45]). When becomes intractably large, probabilistic techniques have also been employed [13].
Cutoff-based techniques have yet to see wide application in the domain of parameterized quantum circuit equivalence-checking. In 2020, Miller-Bakewell developed a framework which adapts cutoff-based techniques to quantum circuits [32], though these techniques have yet to be applied in practice. The key insight of this work was to note that parameterized quantum circuits are analytic for realistic gate sets, and (up to a change of variable) can often be expressed as matrices over complex Laurent polynomials. The positive and negative degrees of these Laurent polynomials can be over-approximated in an inductive manner, and correspond to a cutoff for parameterized verification. The main challenge in applying the Miller-Bakewell framework is to identify an appropriate change-of-variables such that all parameterized matrices become matrices over complex Laurent polynomials. Once this change-of-variable has been identified, further steps may be taken, such as deriving a closed-form equation for the cutoff. In Miller-Bakewell’s paper, the framework was applied to ZX-, ZW-, and ZH-diagrams, though closed-form bounds were not derived.
In this paper, we propose a cutoff-based technique for quantum circuits with arbitrary rotations with linear arguments. This technique can be understood as an instantiation of the Miller-Bakewell framework, insofar as each parameterized circuit is realized as a matrix over complex Laurent polynomials. However, the circuits considered in this paper correspond to ZXW-diagrams (i.e., with matrix exponentiation) [42], which are not addressed in Miller-Bakewell’s original work. We derive closed-form equations for these cutoffs, which depend only on the coefficients of the parameters in the circuits. Furthermore, we provide an alternative proof for the correctness of the Miller-Bakewell framework, which depends on the distribution of zeros of Laurent polynomials as opposed to polynomial interpolation. This change in perspective motivates a probabilistic variant of the Miller-Bakewell framework, which is applicable for circuits with intractably large cutoffs.
In Sec. 3, we provide the syntax and semantics for our circuit language. In Sec. 4, we illustrate our technique on a simple real-world example. In Sec. 5, we prove a cutoff theorem, and propose a probabilistic variant. In Sec. 6, we identify and solve several challenges faced when implementing this technique. All appendices can be found in the full paper [39].
2 Background
We write for the set of natural numbers (including zero), for the set of integers, for the set of rational numbers, for the set of real numbers, and for the set of complex numbers. If , then denotes the complex conjugate of . If , then denotes the set so that . If , then and .
2.1 Linear Algebra
We assume familiarity with the basics of linear algebra. Otherwise, we refer the reader to an introductory text, such as [7]. Let be a complex matrix. We let denote the entry of in the -th row and the -th column. We recall the following definitions. The conjugate of is the matrix such that . The transpose of is the matrix such that . The adjoint of is the matrix , and is denoted . A matrix is called Hermitian if . A matrix is called unitary if is invertible and .
2.2 Algebraic Numbers and Computation
We assume the reader is familiar with field theory, as found in standard abstract algebra textbooks, such as [17]. Let be a subfield of . An element is algebraic over if there exists a polynomial such that . We write to denote the smallest subfield of containing both and . If , then it can be shown that the elements of form a finite-dimensional -vector space with basis vectors . Furthermore, this vector space forms an -algebra under the multiplication of . In the case where and , we say that is an algebraic number. The field of all algebraic numbers is denoted . Algebraic numbers are ideal from a computational perspective, since elements from -dimensional -vector spaces can be represented exactly using only integers (i.e., the numerators and denominators). This is in contrast to floating-point arithemtic, which is inherently inexact.
A special class of algebraic numbers are the cyclotomic numbers. These are solutions to polynomial equations of the form . In other words, each cyclotomic number is a root of unity. We let denote the primitive -th root of unity, which can be defined analytically as . For example, and . The smallest subfield of containing and all cyclotomic numbers is referred to as the universal cyclotomic field. Many algorithms exist to work efficiently with elements of the universal cyclotomic field, such as [10] and [11]. It is well-known that many quantum gate sets can be defined exactly using only finite-dimensional sub-fields of the universal cyclotomic field, such as the Clifford+ gate set [18] and its generalizations [4]. For this reason, recent work in the verification of quantum programs has advocated for the use of cyclotomic numbers as an exact representation [6].
In this paper, we also utilize analytic properties of cyclotomic numbers. It follows from Euler’s formula that . We can then think of each cyclotomic number as a point of the complex unit circle (see Figure 1(a)). It follows geometrically that whenever is odd (see Figure 1(b)). Moreover, it can be shown by simple algebraic manipulations that the following equations hold.
If is a rational multiple of , say , this means that both and are elements of . However, identifying roots of unity can be challenging, since not all elements of norm in the universal cyclotomic field are roots of unity. A well-known example is , which has norm but is not a root of unity.
2.3 Multivariate Laurent Polynomials
Let be a ring. Then denotes the ring of multivariate polynomials with coefficients in and indeterminates through . An arbitrary element is of the form for some finite with a non-zero sequence over . We write for the degree of in variable and for the total degree of , where and . When is an integral domain, the following hold for all and .
It is well known that when and is an integral domain, either or has at most zeros. A consequence is that for any , if and , then there exists an such . Moreover, if is sampled uniformly from , then . The latter two remarks generalize to multivariate polynomials. Further generalization to Laurent polynomials are possible, by clearing the denominators.
Theorem 2.1 (Combinatorial Nullstellensatz [3]).
Let be a field and a polynomial in with total degree such that the coefficient of is nonzero in . If are subsets of with for each , then there exists such that .
Theorem 2.2 (DeMillo–Lipton–Schwartz–Zippel Lemma [13, 51, 41]).
Let be an integral domain and a polynomial with total degree . For each finite subset of , if are sampled at random, both independently and uniformly from , then .
We can further generalize multivariate polynomials to multivariate Laurent polynomials, denoted . In this setting, , so that powers may be positive or negative. For example, is a Laurent polynomial from . Since the exponents in a Laurent polynomial may be both positive and negative, each Laurent polynomial has both positive and negative degrees. We write for the positive degree of in variable and for the negative degree of in variable , where and . Similarly, the total positive degree of is .
3 A Syntax and Semantics for Parameterized Circuits
This section begins by reviewing quantum states, quantum operators, and their composition, as in [35, Ch. 4]. This background material is then used to give syntax and parameterized semantics for quantum circuits with arbitrary gates, and rotations around arbitrary axes.
3.1 Quantum States
The primitive unit of information in quantum computing is the qubit. As in classical computing, a qubit can be in the states zero and one, denoted and . However, a qubit may also be in a superposition of the states and . Formally, this means that the state of a qubit can be described as for any and satisfying . To simplify calculations, we think of and as the standard basis vectors for to obtain the following vector equation: .
Of course, the quantum algorithms described in the introduction of this paper require more than a single qubit of information. Given an -qubit quantum system, there are clearly possible basis states. For example, when , these are , , , and . As before, an -qubit quantum system may also be in an arbitrary superposition of these basis states with the modulus-squared of the coefficients summing to . For example, an arbitrary -qubit quantum system has state for any satisfying . This means that the states of an -qubit quantum system correspond to the unit vectors in .
3.2 Quantum Operations
A quantum program evolves the state of a quantum system, after which all qubits are measured. Given a quantum state , the probability of observing state is . Then the paradigm of quantum computing is to construct an -qubit quantum system whose probability distribution assigns high probability to the correct output.
The evolution of a quantum system is described by a linear transformation of its state space. Since the laws of physics are reversible, then this transformation must be invertible. Moreover, the inverse of this transformation should be its conjugate transpose. This means that operations on -qubit systems correspond to unitary matrices. Given an -qubit state and an dimensional matrix , the state obtained by applying to is . For example, the following four matrices are unitary operations on a qubit.
The matrix corresponds to a no-op and the matrix corresponds to a not gate. The matrix can be understood as adjusting the coefficient of by a factor of . This has no classical analogue. The gate is equal to , and therefore, corresponds to a not gate followed by some non-classical operation.
An important construct in classical computing is the if-then statement. This can be generalized to quantum computing as follows. Let be a unitary transformation on an -qubit quantum system. Then there exists a unitary transformation on an -qubit quantum system, such that applies to the last qubits of a basis state if and only if the first qubit of the basis is in state . Formally, is the identity matrix, and is the direct sum of with . In terms of matrices, is simply the block diagonal matrix with blocks and , as shown below.
The matrix for , known as a cnot gate, is given above. This generalizes the classical conditional statement: if the first bit is in state , then apply a not gate to the second bit.
So far, all of the operations discussed are parameter-free. However, quantum algorithms also make use of rotation gates, which are parameterized by an angle of rotation. As the name suggests, a rotation gate is defined by its axis-of-rotation. Formally, each axis is a Hermitian unitary matrix. Then one can define, as a generalization of Euler’s formula, the rotation as follows.
This definition can be extended to parameters by taking any transformation . For example, given , we can define a two parameter rotation where . In this work, we consider the family of -variable rational-linear functions with affine translations by rational multiples of . That is, the set is defined to be .
The most common rotations in quantum circuits are the -, -, -, and -rotations. However, there are many single qubit rotations not of this form. For example, given any coefficients , if , the matrix is also a Hermitian unitary matrix. Note that the matrix is typically referred to as a global phase gate, rather than an -rotation.
Example 3.1 (Real Amplitude Ansatz Circuit).
In quantum machine learning, convolutional layers are often implemented using the real amplitude ansatz circuit [1, 5, 31, 26, 48]. This circuit is composed from one or more layers of -rotations, each followed by a layer of controlled-not gates. Since -rotations do not commute with the targets of controlled-not gates, then these layers can interact in non-trivial ways. The choice of parameter to each -rotation is treated as a weight in the quantum machine learning model.
3.3 Composing Quantum Operations
Just like classical operations, quantum operations can also be composed in sequence and in parallel. Of the two, sequential composition is the simplest to describe. Assume that both and are operations on an -qubit quantum system. If is applied to an -qubit system , then the state is obtained. If is then applied to this intermediate state, then the state is obtained. This is equivalent to applying to . In other words, the sequential composition of quantum operations corresponds to matrix multiplication.
Now let denote a quantum operation on an -qubit quantum system and denote a quantum operation on an -qubit quantum system. Intuitively, the parallel composition of and should act on the first -qubits by , and the last -qubits by . However, this composition must also respect superposition, through a property known an bilinearity. To compute this new operation, the Kronecker tensor product is required, which is denoted and defined as follows for matrices of any dimension.
It follows that as desired.
3.4 Quantum Circuits
Quantum circuits are constructed from primitive gates, under sequential and parallel composition. In this section, we first define what we take to be primitive gates, and then define what it means to be a circuit over this gate set. The distinction between syntax and semantics is emphasized. In both cases, we introduce inductive principles which will be used later in this paper. Formally, these circuits correspond to diagrams in a certain PROP category [8], with semantics given functorially [28], though this is only used to prove the inductive principles used throughout the paper, and to establish that our semantics and circuit transformations are well-defined (see the full paper for more details).
In what follows, is a function symbol used to denote conditional control. A gate set is a collection of basic gates, closed under conditional control. A basic gate is a complex matrix (e.g. unitary operations, state preparation, post-selection) or parameterized rotation. Formally, we take some set of complex matrices and some set of Hermitian unitary matrices. The associated gate set, denoted is defined inductively as follows.
-
If , then .
-
If , then for each parameterization .
-
If and is unitary, then .
We let and denote the input and output arities of these gates, which are defined as follows.
-
If is , then and .
-
If is and , then .
-
If , then and .
We let denote the parameterized semantics of each gate, which are defined as expected.
-
If , then .
-
If and , then .
-
If with an unitary, then .
Since this gate set is defined inductively, then to prove that every gate satisfies a predicate , it suffices to use well-founded induction (see the full paper).
Proposition 3.2.
Assume that a predicate on satisfies the following.
-
Base Case (1). .
-
Base Case (2). .
-
Control Induction. , unitary and implies .
Then holds for each .
Circuits are then constructed from the elements of through sequential and parallel composition. We let denote sequential composition and denote parallel composition, to distinguish between syntactic compositions and their semantic counterparts. Of course, sequential composition requires that the outputs of the first sub-circuit matches the inputs of the second sub-circuit. To handle this, we extend and as follows.
-
and .
-
and .
Then , the family of circuits over the gate set , is defined inductively as follows where denotes the empty wire with .
-
If , then .
-
If , then .
-
If and , then .
A graphical language for is given in Figure 2. The semantic map extends to these circuits as expected: , , and . As with quantum gates, an inductive principle also holds for quantum circuits.
Proposition 3.3.
Assume that a predicate on satisfies the following.
-
Base Case (1). .
-
Base Case (2). .
-
Parallel Induction. If such that and , then .
-
Sequential Induction. If such that with and , then .
Then holds for each .
4 A Motivating Example: Circuit Compilation
We now discuss the verification of a concrete circuit equation. The example is simple but illustrative of the techniques we will develop in the next section. Consider the equation in Figure 3. A naive approach to establishing this equation is to evaluate the right-hand side to obtain the following operator.
Then, by further simplification, we obtain the following equations.
Using the identities and , it then follows that and .
Consequently,
This establishes the equation in Figure 3 for all choices of . However, this proof depends on the parameterized equations and . In general, it is challenging to find a complete set of parameterized relations for a parameterized gate set [33]. Moreover, given an arbitrary set of complete relations, the problem of deciding if two expressions are equivalent is known to be undecidable [36]. For these reasons, we adopt a different approach.
A perhaps surprising result is that all parameterized circuit equalities can be established by checking only a finite number of rotation angles. In other words, if the equality in Figure 3 did not hold, then a counterexample could be found by checking only a fixed number of instances. To do this, we first convert the equality into a family of polynomials, such that the equality holds if and only if all of the polynomials are identically zero. We then find an integer such that each of the polynomials has degree at most . Since non-zero polynomials of degree have at most roots, then either the polynomial is zero and will evaluate to zero on angles, or the polynomial is non-zero and at least one of the angles yields a non-zero result.
To obtain the desired polynomials, we apply the change-of-variable . Under this change of variable, the following equalities hold.
Continuing in this fashion, we can find that each matrix entry on the left-hand side or the right-hand side of Figure 3 has degree at most four. Then the difference between the left-hand side and the right-hand side also has degree at most four. Note that the terms correspond to a removable singularity at , which does not fall on the complex unit circle, and can be safely ignored. Since degree four polynomials have at most four roots, then it suffices to check the equality in Figure 3 using only angles from . For example, consider the five angles for . It is easily verified that for all . Then has at least five roots. Since each entry of has degree at most four, then is identically zero and Figure 3 must hold. Note that the angles were sampled from since has period .
While this example was admittedly simplistic, we will see in the next section, that the technique generalizes to all parameterized circuits. In particular, just as in this example, we will see that computing the polynomials is inconsequential. Instead, it will suffice to find an efficient procedure which provides a reason bound on each degree.
5 Equivalence Checking Techniques
In this section, we consider parameterized quantum circuits where all coefficients are from , rather than . We denote these circuits . It is first shown that up to a change of variable, these circuits admit semantics as matrices over the ring of Laurent polynomials . This is then combined with Thm. 2.1 to establish a cutoff-based equivalence checking theorem for these circuits. Using Thm. 2.2, a probabilistic variant is also obtained. In Sec. 6, we show how these results generalize back to parameterized circuits with rational coefficients.
5.1 Polynomial Semantics
This section shows that, up to a change of variable, each circuit has semantics given by a matrix with entries corresponding to complex Laurent polynomials. Moreover, these polynomials are shown to have degrees bounded by certain sums of the coefficients which appear in the circuit. It follows that the techniques used in Sec. 4 can be generalized to all integral circuits in .
As a first step, a new semantic interpretation is provided for , which interprets each circuit in as a polynomial over .
Since parameters only appear in trigonometric terms, then a first step is to give Laurent polynomials which abstract the trigonometric terms.
Let , , and .
By substituting for each and letting , the following Laurent polynomials are obtained.
Then the following equations hold by construction.
Given these polynomials, is defined inductively on the gates as follows.
-
If , then .
-
If and , then .
-
If with an unitary, then .
The semantics extend as expected to sequential and parallel composition. This makes precise the change of variable used in Sec. 4.
Definition 5.1 (Polynomial Abstraction).
A polynomial abstraction is a function from to collection of matrices over such that for all .
Theorem 5.2.
is a polynomial abstraction.
Example 5.3 (Polynomial Semantics).
The calculations from Sec. 4 can be revisited from the perspective of polynomial semantics. Of course, the circuit in Figure 3 is somewhat uninteresting, since the circuit has only one parameter. Instead, we will consider a new circuit with two parameters and obtained through the substitution where . The sine and cosine polynomials for are as follows.
Then and . Let denote the right-hand side of the equation in Figure 3. To compute , we start by evaluating each gate. Clearly . Moreover,
It follows by calculations similar to those in Sec. 4 that,
Then as expected.
To check that , it suffices to check symbolically that . However, it is often too computationally expensive to compute the polynomials explicitly. Instead, one could first upper-bound the degree of each polynomial, and then combine these degree bounds with the theorems of Sec. 2.3. It is not hard to see that for each component of , its degrees are all bounded by the coefficients of . This property extends to all circuits in by studying their coefficient sequences. Intuitively, the coefficient sequence of a circuit is a sequence over such that is the list of coefficients for the -th rotation in . More formally, let denote the set of all finite sequences over and denote sequence concatenation. Then is defined inductively as follows.
-
If , then .
-
If and , then .
-
If , then .
-
If , then .
-
If and , then .
Then is precisely the set of circuits in such that . We define analogously. The following definition generalizes the coefficient bound of the degree of a gate to a coefficient bound on the degree of all circuits.
Definition 5.4 (Coefficient Bounded Semantics).
Let be a polynomial abstraction. A circuit with and is coefficient bounded with respect to , denoted , if for each and with ,
-
(B1). for each ,
-
(B2). for each ,
-
(B3). where .
Example 5.5 (Coefficient Bounded Semantics).
Recall from Ex. 5.3. It will be shown that holds. First, the coefficient sequence of must be computed. As illustrated in the previous example, contains only the rotations: and . The coefficient sequences of these rotations are and respectively. Then . Moreover, and . By inspecting the matrices in Ex. 5.3, it is clear that the following bounds hold for all and .
The terms can be thought of as adding together the maximum positive degrees of the two terms in each sine or cosine polynomial It turns out that these bounds compose additively under the composition of matrices, motivating properties (B1) through to (B3). In this example , , and By inspecting the final matrix in Ex. 5.3, it is clear that the following bounds hold for all where .
Then satisfies (B1) through to (B3). Therefore, holds
This rationale given in Ex. 5.5 extends to all circuits in . Since primitive gates map to constant matrices, then they trivially satisfy . By construction of and , then rotation matrices also satisfy . It is then easy to show, using Prop. 3.2, that every gate in satisfies . With a slightly more careful analysis, it can then be shown that this invariant is closed under sequential and parallel composition. Intuitively, both matrix multiplication and the Kronecker tensor product yields sums of products of polynomials, in which each term can be shown to satisfy the degree bounds. Then by Prop. 3.3, every circuit in also satisfies . Given these coefficient bounded semantics, the singularity factoring techniques of Sec. 4 can then be applied to obtain Cor. 5.7. All proof details can be found in the full paper.
Theorem 5.6.
If , then .
Corollary 5.7.
If and with and , then for each pair of indices and , there exists a polynomial such that,
-
(D1). for each ,
-
(D2). ,
-
(D3). if and only if ,
where for each .
An interesting observation is that the bounds obtained through Thm. 5.6 were tight in Ex. 5.5. A natural question is whether these bounds are always tight, with respect to the granularity of the abstraction. We answer this question in the positive, by showing that for each coefficient sequence , there exists a circuit with such that the corresponding bound is tight. Of course, it is not possible to reconstruct a circuit from its coefficient sequence, so some information must be lost. To this end, we exhibit a family of circuits in Ex. 5.9, each of degree zero, for which arbitrarily large bounds can be obtained. In this example, relations exist between the rotations that depend on the axes-of-rotation and the parameter-free gates in the circuit, both of which are not captured by the coefficient sequence. In particular, both examples rely on the relations and .
Example 5.8 (Necessary Bounds).
Let be any sequence over with . For each , define a linear function and a rotation gate . Now consider the circuit (see Figure 4(a)). It follows that . Moreover, . With regard to the polynomial semantics, . Clearly and for each . Then is tight. Since was arbitrary, then every coefficient sequence is realizable with tight bounds.
Example 5.9 (Impact of Circuit Relations).
Fix as the number of parameters and let . Consider the circuit , as illustrated in Figure 4(b). It follows that . Since is constant, its associated polynomials have degree zero. However, yields an upper bound of , which exceeds the true degree by . Since was arbitrary, this error can be made arbitrarily large.
5.2 A Cutoff Theorem for Parameterized Equivalence
This section shows that parameterized equivalence checking reduces to parameter-free equivalence checking for quantum circuits (Thm. 5.10). The proof proceeds as follows. First, Cor. 5.7 is used to characterize a family of polynomials which are identically zero if and only if the two circuits are equal. Using Thm. 2.1, a finite set of points can be constructed to determine if these polynomials are identically zero. The points in are in bijection with a set of points on the complex unit circle under the transformation . It follows that each polynomial is identically zero if and only if for all points . Note that the polynomials are never explicitly constructed. All proof details are in the full paper.
Theorem 5.10.
Let and with and . If such that for each , then for all if and only if for all .
Corollary 5.11.
If and consist of matrices over the universal cyclotomic field, then the parameterized equivalence checking problem is decidable for .
As grows large, the utility of Thm. 5.10 decreases. For example, if each is , then . That is, the number of instances grows exponentially with . However, this exponential growth can be overcome by a probabilistic algorithm. Fix a finite subset of and assume that is chosen at random from . If , then conclude that , otherwise conclude that . Clearly, this algorithm has no false negatives, since implies . A more interesting question is the false positive rate. Note that a false positive occurs when but . It is shown in the following theorem that the probability of a false positive decreases with order , as an application of Thm. 2.2.
Theorem 5.12.
Let and with , , and . For each finite subset , if are sampled at random both independently and uniformly from , then
where .
6 Extending to Rational Coefficients and Global Phase
The methods presented in Sec. 5 face several limitations. In particular, both Thm. 5.10 and Thm. 5.12 assume that the circuits are integral, and do not allow for equivalence up to global phase. In this section, we show how to extend the techniques of Sec. 5 to handle rational circuits and global phase. We also expand Thm. 5.12 into an algorithm, and consider the problem of angle sampling given a gate set over the universal cyclotomic field.
6.1 Verifying Circuits with Rational Coefficients
Most parameterized quantum circuits have fractional coefficients. For example, the equality in Figure 3 is typically stated with a parameter on the left-hand side and the parameters on the right-hand side. The circuits in Figure 3 are related to these fractional circuits by the substitution . Conceptually, reparameterizes the circuit, by inducing a bijection between the parameter space of the rational circuits and the parameter space of the integral circuits. This generalizes to all examples (see the full paper for proofs).
Lemma 6.1.
Let . If is a bijective function, then if and only if .
The goal of this section is to construct a syntactic transformation which eliminates all rational coefficients, which preserving the semantic interpretation via a bijective reparameterization. A syntactic reparameterization is a map with a bijective function such that . The simplest syntactic reparameterization is a linear rescaling of the parameters in the circuit by a non-zero rational vector. For each vector , define the map as follows.
-
If , then .
-
If and , then where .
-
If , then .
-
If , then .
-
If , then .
Theorem 6.2.
For each , defined by is bijective and is syntactic reparameterization with respect to .
Now assume that and are circuits in . For the correct choice of , both and are elements of . Intuitively, each must be chosen such that it clears the denominators of all coefficients tied to in both and . Formally, let denote the denominator of and denote the least common multiple of . Then for each , is the set of all denominators of coefficients tied to in both and . Then for each . Let denote this vector.
Theorem 6.3.
If and , then and . Moreover, if and only if .
Corollary 6.4.
If and consist of matrices over the universal cyclotomic field, then the parameterized equivalence checking problem is decidable for .
6.2 Verifying Circuits Modulo Global Phase
In Sec. 5 the circuits and where defined to be equivalence when for all . For many applications, this notion of equivalence is far too strict. This is because and will prepare the same probability distribution provided there exists some function such that for all . When such a function exists, we say that and are equivalent modulo global phase. Of course, verifying the existence of an arbitrary is infeasible. Prior work has assumed to be affine linear [21, 38, 47]. That is, . We further assume that through to are rational. In this section we show how to verify the equivalence of and modulo affine rational linear global phase, under the following assumptions.
-
1.
All matrices in are defined over the universal cyclotomic field.
-
2.
All matrices in are injective and defined over the universal cyclotomic field.
In practice, the second assumption restricts to unitary operations and state preparation.
Since the universal cyclotomic field is closed under addition and multiplication, then every global phase will be cyclotomic when evaluated at rational multiples of . In general, need not be rational, since there exists cyclotomic numbers of norm which are not roots of unity. However, the periodicity of an ensure that . Using properties of cyclotomic numbers, such as the fact that for odd , it is then possible to solve for (if it exists). In the full paper, an algorithm is described to compute these coefficients. The injectivity of ensures that all coefficients can be isolated (this condition is sufficient but not necessary). In the case where and are not equivalent up to global phase, then arbitrary coefficients are returned. Otherwise, the function returns a tuple such that and . Then the global phase can be offset by introducing a unitary gate and a global phase gate . Then equivalence modulo global phase reduces to exact equivalence as follows.
Theorem 6.5.
Assume and consist of matrices over the universal cyclotomic field, with all gates in injective. If and , then is equivalent to modulo affine rational linear global phase if and only if the equation holds.
Corollary 6.6.
If and satisfy assumptions (1–2), then the parameterized equivalence checking problem is decidable modulo affine rational linear global phase for .
6.3 A Probabilistic Equivalence Checking Procedure
Imagine applying Thm. 5.12 to a pair of quantum circuits and . In practice, an end-user would have some desired upper bound on the false positive rate. A simply way to bound the false positive rate is to require that , meaning that . Since is positive and is a natural number, then the minimum value of which satisfies this inequality is . Using this optimal solution, the following algorithm is obtained.
-
1.
Compute .
-
2.
Select a set such that .
-
3.
Sample at random both independently and uniformly from .
-
4.
Determine if .
The most crucial step of this algorithm is the second step. First, the choice of must ensure that the values of and are exact. As outlined in Sec. 2.2, the simplest way to do this is to sample from for with for which and must evaluate to cyclotomic numbers. This method is particularly effective when and consists purely of matrices over the universal cyclotomic field, in which case all computation can be carried out over the universal cyclotomic field.
Now, consider the elements of and . For each in , the elements and will be elements of . Likewise, if is the least common denominator of all fractions in , then . In the worst case, will be an -dimensional vector space. This means that the cost of addition will grow at least linearly with , and the cost of multiplication will grow at least quadratically with .
Theorem 6.7.
If , and , then .
Let be the smallest multiple of which is greater than or equal to . It follows from Thm. 6.7 that minimizes . This set is also easy to compute, and is therefore taken to be the definition of .
7 Related Work
In the introduction, we discussed the cutoff-based techniques [32], which subsumes prior work such as [23]. In this section, we compare to other approaches.
Circuit Rewriting.
It was highlighted in Ex. 5.9 that circuit rewriting intersects with parameterized equivalence checking. In [38], an incomplete equational theory is given for a family of parameterized circuits, which is shown to be effective for equivalence checking. In [44], a complete set of relations are derived, under the assumption that each parameter appears exactly once in the circuit. Relations which hold for abstract gate sets, such as , have yet to be explored.
Symbolic Techniques.
In [47], symbolic techniques are used to determine parameterized equivalence. Particularly, trigonometric relations, together with the Pythagorean relation , are used to reduce equivalence checking to a family of equations over the theory of non-linear real arithmetic. This is then solved using the Z3 [12] solver as a black box. However, the decision problem for non-linear real arithmetic is known to be double-exponential in the number of variables [24, 9], whereas our approach is exponential in the number of variables.
Probabilistic Techniques.
In [46], Thm. 2.2 was used to determine the equivalence of parameterized quantum circuits. However, our technique yields Laurent polynomials rather than ordinary polynomials, which we do not compute explicitly. In [38], Peham et al. show that if is sampled uniformly at random from , then given . However, sampling from a uniform continuous distribution is impossible on a digital computer, which can only represent a countable and non-enumerable subset of real numbers [43]. In Peham et al., floating-point is used, and presumably, the error is assumed to be uniform as well. In our work, all computation is exact, and therefore, such assumptions do not apply. Since there does not exist a uniform distribution for countable sets, we instead sample uniformly from a finite subset of , in which case Thm. 2.2 applies, rather than the analytic results of Peham et al.
8 Conclusion and Future Work
In this paper, we considered the problem of parameterized equivalence checking for quantum circuits. We show that the parameterized problem can be reduced to finitely many instances of the parameter-free problem, regardless of the gate set or axes of rotation. Consequently, the problem is decidable in the case of gate sets defined over the universal cyclotomic field. Moreover, we show that when the number of instances becomes intractable large, there exists a probabilistic variation of the algorithm where the probability of being incorrect can be made arbitrarily small. We have outlined how the techniques can be implemented in practice, taking into account rational coefficients, global phase, and angle sampling.
In future work, we would like to explore how these decision procedures can be implemented efficiently using circuit rewriting and sparse matrix representations. In particular, we would like to explore angle sampling and circuit evaluation using ZX-diagrams [37], tensor decision-diagrams [49], and model-counting [30], which have all proven effective in parameter-free equivalence checking. We would also like to explore how rewriting-based techniques and symmetry reductions might help to tighten the cutoffs obtained from . For example, the bound obtained in Ex. 5.9 could be reduced to zero by viewing each relation as a rewriting rule, and then searching for a derivation which reduces the bound.
References
- [1] Amira Abbas, David Sutter, Christa Zoufal, Aurelien Lucchi, Alessio Figalli, and Stefan Woerner. The power of quantum neural networks. Nature Computational Science, 1(6):403–409, 2021. doi:10.1038/s43588-021-00084-1.
- [2] Parosh Aziz Abdulla, Frédéric Haziza, and Lukás Holík. All for the price of few. In VMCAI, volume 7737 of LNCS, pages 476–495. Springer, 2013. doi:10.1007/978-3-642-35873-9_28.
- [3] Noga Alon. Combinatorial Nullstellensatz. Combinatorics, Probability and Computing, 8(1–2):7–29, 1999. doi:10.1017/S0963548398003411.
- [4] Matthew Amy, Andrew N. Glaudell, Shaun Kelso, William Maxwell, Samuel S. Mendelson, and Neil J. Ross. Exact synthesis of multiqubit Clifford-cyclotomic circuits. In RC, volume 14680 of LNCS, pages 238–245. Springer, 2024. doi:10.1007/978-3-031-62076-8_15.
- [5] Davis Arthur and Prasanna Date. A hybrid quantum-classical neural network architecture for binary classification, 2022. arXiv:2201.01820.
- [6] Martin Avanzini, Georg Moser, Romain Péchoux, and Simon Perdrix. On the hardness of analyzing quantum programs quantitatively. In Programming Languages and Systems, volume 14577 of LNCS, pages 31–58. Springer, 2024. doi:10.1007/978-3-031-57267-8_2.
- [7] Sheldon Axler. Linear Algebra Done Right. Springer, 3rd edition, 2014. doi:10.1007/978-3-031-41026-0.
- [8] John C. Baez, Brandon Coya, and Franciscus Rebro. Props in network theory. Theory and Applications of Categories, 33(25):727–783, 2010.
- [9] Nikolaj Bjørne, Leonardo de Moura, Lev Nachmanson, and Christoph M. Wintersteiger. Programming Z3, volume 11430 of LNPSE, pages 148–201. Springer, 2019. doi:10.1007/978-3-030-17601-3_4.
- [10] Wieb Bosma. Canonical bases for cyclotomic fields. Applicable Algebra in Engineering, Communication and Computing, 1:125–134, 1990. doi:10.1007/BF01810296.
- [11] Thomas Breuer. Integral bases for subfields of cyclotomic fields. Applicable Algebra in Engineering, Communication and Computing, 8:279–289, 1997. doi:10.1007/s002000050065.
- [12] Leonardo de Moura and Nikolaj Bjørner. Z3: An efficient SMT solver. In TACAS, volume 4963 of LNCS, pages 337–340. Springer, 2008. doi:10.1007/978-3-540-78800-3_24.
- [13] Richard A. Demillo and Richard J. Lipton. A probabilistic remark on algebraic program testing. Info. Proc. Letters, 7(4):193–195, 1978. doi:10.1016/0020-0190(78)90067-4.
- [14] Qi-Ming Ding, Yi-Ming Huang, and Xiao Yuan. Molecular docking via quantum approximate optimization algorithm. Phys. Rev. Appl., 21:034036, 2024. doi:10.1103/PhysRevApplied.21.034036.
- [15] Bryan Eastin and Emanuel Knill. Restrictions on transversal encoded quantum gate sets. Phys. Rev. Let., 102(11):110502, 2009. doi:10.1103/physrevlett.102.110502.
- [16] E. Allen Emerson and Kedar S. Namjoshi. On reasoning about rings. Int. J. Found. Comput. Sci., 14(4):527–550, 2003. doi:10.1142/S0129054103001881.
- [17] Richard M. Foote and David S. Dummit. Abstract Algebra. Wiley, 3rd edition, 2003.
- [18] Brett Giles and Peter Selinger. Exact synthesis of multiqubit Clifford+ circuits. Phys. Rev. A, 87:032332, 2013. doi:10.1103/PhysRevA.87.032332.
- [19] Dylan Herman, Cody Googin, Xiaoyuan Liu, Yue Sun, Alexey Galda, Ilya Safro, Marco Pistoia, and Yuri Alexeev. Quantum computing for finance. Nature Rev. Phys., 5(8):450–465, 2023. doi:10.1038/s42254-023-00603-1.
- [20] Kesha Hietala, Robert Rand, Liyi Li, Shih-Han Hung, Xiaodi Wu, and Michael Hicks. A verified optimizer for quantum circuits. ACM Trans. Program. Lang. Syst., 45(3), 2023. doi:10.1145/3604630.
- [21] Xin Hong, Wei-Jia Huang, Wei-Chen Chien, Yuan Feng, Min-Hsiu Hsieh, Sanjiang Li, and Mingsheng Ying. Equivalence checking of parameterised quantum circuits, 2024. arXiv:2404.18456.
- [22] C. Norris Ip and David L. Dill. Better verification through symmetry. In CHDL, volume A-32 of IFIP Transactions, pages 97–111. North-Holland, 1993. doi:10.5555/648251.752211.
- [23] Emmanuel Jeandel, Simon Perdrix, and Renaud Vilmart. Diagrammatic reasoning beyond clifford+t quantum mechanics. In LICS. ACM, 2018. doi:10.1145/3209108.3209139.
- [24] Dejan Jovanović and Leonardo de Moura. Solving non-linear arithmetic. In AR, volume 7364 of LNAI, pages 339–354. Springer, 2012. doi:10.1007/978-3-642-31365-3_27.
- [25] Alexander Kaiser, Daniel Kroening, and Thomas Wahl. Dynamic cutoff detection in parameterized concurrent programs. In CAV, volume 6174 of LNCS, pages 645–659. Springer, 2010. doi:10.1007/978-3-642-14295-6_55.
- [26] Shu Kanno, Hajime Nakamura, Takao Kobayashi, Shigeki Gocho, Miho Hatanaka, Naoki Yamamoto, and Qi Gao. Quantum computing quantum Monte Carlo with hybrid tensor network for electronic structure calculations. npj Quantum Information, 10(1), 2024. doi:10.1038/s41534-024-00851-8.
- [27] Ayrat Khalimov, Swen Jacobs, and Roderick Bloem. Towards efficient parameterized synthesis. In VMCAI, volume 7737 of LNCS, pages 108–127. Springer, 2013. doi:10.1007/978-3-642-35873-9_9.
- [28] F. William Lawvere. Functorial semantics of algebraic theories. Proc. Natl. Acad. Sci. U.S.A., 50(5):869–872, 1963. doi:10.1073/pnas.50.5.869.
- [29] He Ma, Govoni Marco, and Giulia Galli. Quantum simulations of materials on near-term quantum computers. npj Computational Materials, 6:85, 2020. doi:10.1038/s41524-020-00353-z.
- [30] Jingyi Mei, Marcello Bonsangue, and Alfons Laarman. Simulating quantum circuits by model counting. In CAV, volume 14683 of LNCS, pages 555–578. Springer, 2024. doi:10.1007/978-3-031-65633-0_25.
- [31] Dekel Meirom and Steven H. Frankel. PANSATZ: pulse-based ansatz for variational quantum algorithms. Frontiers in Quantum Science and Technology, 2, 2023. doi:10.3389/frqst.2023.1273581.
- [32] Hector Miller-Bakewell. Finite verification of infinite families of diagram equations. EPTCS, 318:27–52, 2020. doi:10.4204/eptcs.318.3.
- [33] Hector Miller-Bakewell. Graphical Calculi and their Conjecture Synthesis. PhD thesis, University of Oxford, 2020.
- [34] Kedar S. Namjoshi and Richard J. Trefler. Parameterized compositional model checking. In TACAS, volume 9636 of LNCS, pages 589–606. Springer, 2016. doi:10.1007/978-3-662-49674-9_39.
- [35] Michael A. Nielsen and Isaac L. Chuang. Quantum Computation and Quantum Information. Cambridge University Press, 2011.
- [36] Pyotr Novikov. On the algorithmic unsolvability of the word problem in group theory. Trudy Matematicheskogo Instituta imeni V.A. Steklova, 44:3–143, 1955.
- [37] Tom Peham, Lukas Burgholzer, and Robert Wille. Equivalence checking of quantum circuits with the ZX-calculus. IEEE Journal on Emerging and Selected Topics in Circuits and Systems, 12(3):662–675, 2022. doi:10.1109/jetcas.2022.3202204.
- [38] Tom Peham, Lukas Burgholzer, and Robert Wille. Equivalence checking of parameterized quantum circuits: Verifying the compilation of variational quantum algorithms. In ASPDAC, pages 702–708. ACM, 2023. doi:10.1145/3566097.3567932.
- [39] Neil J. Ross and Scott Wesley. Cutoff theorems for the equivalence of parameterized quantum circuits (extended), 2025. arXiv:2506.20985.
- [40] Raffaele Santagati, Alan Aspuru-Guzik, Ryan Babbush, Matthias Degroote, Leticia González, Elica Kyoseva, Nikolaj Moll, Markus Oppel, Robert M. Parrish, Nicholas C. Rubin, Michael Streif, Christofer S. Tautermann, Horst Weiss, Nathan Wiebe, and Clemens Utschig-Utschig. Drug design on quantum computers. Nature Phys., 20:549–557, 2024. doi:10.1038/s41567-024-02411-5.
- [41] J. T. Schwartz. Fast probabilistic algorithms for verification of polynomial identities. J. ACM, 27(4):701–717, October 1980. doi:10.1145/322217.322225.
- [42] Razin A. Shaikh, Quanlong Wang, and Richie Yeung. How to sum and exponentiate Hamiltonians in ZXW calculus. EPTCS, 394:236–261, 2023. doi:10.4204/eptcs.394.14.
- [43] A. M. Turing. On computable numbers, with an application to the entscheidungsproblem. Proc. of the London Math. Soc., s2-42(1):230–265, 1937. doi:10.1112/plms/s2-42.1.230.
- [44] John van de Wetering, Richie Yeung, Tuomas Laakkonen, and Aleks Kissinger. Optimal compilation of parametrised quantum circuits, 2024. doi:10.48550/arXiv.2401.12877.
- [45] Scott Wesley, Maria Christakis, Jorge A. Navas, Richard Trefler, Valentin Wüstholz, and Arie Gurfinkel. Verifying Solidity smart contracts via communication abstraction in SmartACE. In VMCAI, pages 425–449. Springer, 2022. doi:10.1007/978-3-030-94583-1_21.
- [46] Amanda Xu, Abtin Molavi, Lauren Pick, Swamit Tannu, and Aws Albarghouthi. Synthesizing quantum-circuit optimizers. Proc. ACM Program. Lang., 7(PLDI), 2023. doi:10.1145/3591254.
- [47] Mingkuan Xu, Zikun Li, Oded Padon, Sina Lin, Jessica Pointing, Auguste Hirth, Henry Ma, Jens Palsberg, Alex Aiken, Umut A. Acar, and Zhihao Jia. Quartz: superoptimization of quantum circuits. In PLDI, pages 625–640. ACM, 2022. doi:10.1145/3519939.3523433.
- [48] Daniel Yoffe, Noga Entin, Amir Natan, and Adi Makmal. A qubit-efficient variational selected configuration-interaction method. Quantum Science and Technology, 10(1):015020, 2024. doi:10.1088/2058-9565/ad7d32.
- [49] Qirui Zhang, Mehdi Saligane, Hun-Seok Kim, David Blaauw, Georgios Tzimpragos, and Dennis Sylvester. Quantum circuit simulation with fast tensor decision diagram. In ISQED, pages 1–8. IEEE, 2024. doi:10.1109/isqed60706.2024.10528748.
- [50] Pengzhan Zhao, Zhongtao Miao, Shuhan Lan, and Jianjun Zhao. Bugs4Q: A benchmark of existing bugs to enable controlled testing and debugging studies for quantum programs. J. of Systems and Software, 205:111805, 2023. doi:10.1016/j.jss.2023.111805.
- [51] Richard Zippel. Probabilistic algorithms for sparse polynomials. In EUROSAM, volume 72 of LNCS, pages 216–226. Springer, 1979. doi:10.1007/3-540-09519-5_73.
