Manuscript Offprint
arXiv:2610.39491Automated Verification of Hamiltonian Simulation by Quantum Signal Processing
MIN LAI, National Taiwan University, Taiwan
YU-FANG CHEN, Academia Sinica, Taiwan
SHIH-HAN HUNG, National Taiwan University, Taiwan
We present, to the best of our knowledge, the first fully automated verification framework for QSP-based Hamiltonian simulation. Our framework exploits the structure of the simulation algorithm: Hamiltonians are given as weighted sums of Pauli strings, embedded into larger unitaries through block encodings, and transformed into time-evolution operators by quantum signal processing (QSP). Using a symbolic Pauli-sum semantics for ancilla-indexed circuit blocks, our verifier proves that the distinguished all-zero ancilla block is proportional to the target Hamiltonian and infers the subnormalization factor automatically. It then verifies the QSP layer by extracting the implemented polynomial transformation and certifying its approximation error. This structure-aware abstraction is essential for scalability. Composing our verified block encoding and QSP wrapper yields an estimated macro-expanded size of about 1.52 million gates. The verifier certifies the block encoding once and checks the QSP layer through its abstract interface, without expanding the oracle calls. Our implementation verifies block encodings of structured Pauli-sum Hamiltonians with up to 256 system qubits and verifies QSP Hamiltonian-simulation instances by extracting their implemented polynomials and checking the resulting approximation bounds. These results show that fully automated verification can handle common Hamiltonian-simulation circuits at substantial scale when it exploits their algorithmic structure.
1 Introduction
Hamiltonian simulation is one of the central algorithmic tasks in quantum computing and a leading application area where quantum computers may provide computational advantage. It underlies applications in quantum chemistry, condensed-matter physics, and quantum algorithms more broadly. The task is defined as follows: given a Hamiltonian H and time t, the goal is to approximate the time-evolution operator to within error [Lloyd 1996].
Since Feynman [1982] proposed the idea of simulating quantum systems using a quantum computer and Lloyd [1996] gave the first explicit algorithm, many quantum algorithms have been given to tackle the problem. In particular, three families of quantum algorithms dominate. Product formulas approximate by interleaving the evolutions under the individual terms of , and their correctness rests on nested commutator bounds [Childs et al. 2021]. Linear combination of unitaries (LCU) approximates as a weighted sum of easy unitaries via an ancilla-controlled selection circuit [Childs and Wiebe 2012]. Quantum signal processing (QSP) achieves nearly optimal complexity by encoding a polynomial approximation of into the eigenphases of a block-encoding walk operator [Low and Chuang 2017, 2019].
The last two families share a common primitive: a block encoding of matrix H, a unitary that embeds the subnormalized operator as a submatrix (in standard form, its top-left block) for some subnormalization factor . This allows non-unitary H to be accessed coherently on an enlarged quantum state. A defining feature of these algorithms is that no implementation ever equals the target : the algorithms are deliberate truncations governed by a tunable accuracy parameter, and a finite universal gate set can in any case only approximate the required rotations, as analyzed by Dawson and Nielsen [2006]. The obligation of the verification task is therefore not just exact equivalence checking, but an approximate generalization of it, i.e., deciding whether two quantum processes agree to within error in a suitable metric.
Authors' Contact Information: Min Lai, National Taiwan University, Taiwan, mimi.lai.cat@gmail.com; Yu-Fang Chen, Academia Sinica, Taiwan, yfc@iis.sinica.edu.tw; Shih-Han Hung, National Taiwan University, Taiwan, shihhanh@ntu.edu.tw.
Min Lai, Yu-Fang Chen, and Shih-Han Hung
This is substantially harder than, and poorly served by the tools built for, its exact counterpart. The difficulty is not merely numerical. The operators are -dimensional and given only implicitly by a circuit, so approximate checking must certify a quantitative norm bound on an object it cannot represent explicitly. Furthermore, the existing techniques that make exact equivalence tractable—decision diagrams [Burgholzer and Wille 2020], stabilizer formalism [Thanos et al. 2023], path-sums [Amy 2018], weighted model-counting [Huang et al. 2026], tree automata [Chen et al. 2023a,b, 2025], and ZX-calculus rewriting [Coecke and Duncan 2011]—primarily target circuit-to-circuit comparisons or state-based properties, rather than directly certifying a spectral-norm bound against an operator-level specification without a reference circuit.
Automated verification of Hamiltonian simulation. Our main contribution is a novel solution to automatically verifying Hamiltonian simulation based on quantum signal processing. Here, Hamiltonian simulation verification means proving that a quantum circuit generated from a Hamiltonian H correctly approximates the intended time-evolution operator .
This gap is especially visible in block-encoding-based Hamiltonian simulation. In these algorithms, correctness is not a statement that the whole circuit unitary equals another circuit. The Hamiltonian is typically given symbolically as a weighted sum of Pauli strings, and the verifier must first show that an ancilla-selected block of a larger unitary is proportional to this Hamiltonian, while also recovering the subnormalization factor.
A second semantic obligation arises from the simulation layer built around the certified block encoding. In QSP-based Hamiltonian simulation, the circuit repeatedly invokes the block encoding and its adjoint, interleaved with phase transformations, so that the overall circuit block-encodes a polynomial transformation of the encoded Hamiltonian. The final check is therefore an approximation guarantee: after accounting for the block-encoding subnormalization, the implemented polynomial must approximate within the prescribed error bound. Thus, verification naturally decomposes into certifying the block encoding and certifying the QSP transformation.
Fully automated verification of this kind remains largely out of reach for existing general-purpose quantum verification techniques. The difficulty is not merely circuit size, but the semantic gap between the generated circuit and the high-level specification it is meant to satisfy. A verifier must connect low-level gates to the high-level specification . This requires certifying the block encoding of the symbolic Pauli-sum Hamiltonian, reasoning about ancilla-selected blocks rather than entire unitaries, and verifying that the surrounding QSP layer implements the intended polynomial approximation of time evolution.
We present, to the best of our knowledge, the first fully automated verification framework for block-encoding-based Hamiltonian simulation circuits. Our verifier combines two complementary symbolic techniques. For block encodings, it constructs a branch-indexed symbolic model of the circuit by symbolic execution, where each branch operator is represented as a weighted sum of Pauli strings. This allows the verifier to inspect the induced all-zero ancilla block, prove that it is proportional to the target Hamiltonian, and infer the subnormalization factor automatically.
The resulting block-encoding certificate is then used as an abstract interface for verifying the simulation layer. In this paper, we focus on QSP-based Hamiltonian simulation. For the QSP component, the verifier replaces each invocation of the certified block encoding by a four-block symbolic abstraction, symbolically executes the QSP circuit, and uses sound rewrite rules derived from unitarity to extract the implemented polynomial transformation. The extracted polynomial is then checked against the desired time-evolution function after accounting for the block-encoding subnormalization. Together, these two symbolic components validate the two main obligations in QSP-based Hamiltonian simulation: certifying the input block encoding and certifying the surrounding QSP transformation. Although QSP is our main target, the same decomposition also suggests a path toward verifying other block-encoding-based simulation methods, including LCU-based algorithms derived from truncated Taylor-series approximations.
Our evaluation shows that this structure-aware approach scales to substantial Hamiltonian-simulation instances. The verifier checks block encodings of structured Pauli-sum Hamiltonians with up to 256 system qubits and hundreds of Pauli terms, without constructing the exponentially large system matrix. It also verifies QSP-based Hamiltonian-simulation circuits by extracting the implemented polynomial and certifying its approximation error. Composing the verified block encodings and QSP wrappers yields large Hamiltonian-simulation circuits whose correctness can be established without expanding the oracle calls. Our evaluation illustrates this composition and reports the resulting error bound and macro-expanded circuit size. These results demonstrate fully automated verification of common block-encoding-based Hamiltonian-simulation circuits at substantial scale.
2.1 Quantum Computing
Here we give a very brief introduction to quantum computing and fix notation. For a full treatment, we refer the readers to Nielsen and Chuang [2010].
States. The state of a single qubit is a unit vector in the Hilbert space , written in the computational basis as a superposition with . While a single-qubit state is represented using two complex numbers, only the magnitudes and the relative phase of the coefficients and matter in algorithmic settings, since the global phase is physically irrelevant. An -qubit state lives in the tensor product . The exponential dimension is the source of quantum states' expressive power and of the difficulty of classical simulation algorithms.
Evolution. Elementary operations that describe the dynamics of quantum systems are unitaries: a computation transforms to for some unitary , satisfying . Algorithms are expressed as quantum circuits built from a universal gate set, which uniformly approximates any unitary to arbitrary accuracy. A unitary may be written as the time evolution in the form for some Hamiltonian—a Hermitian matrix of the same size. As we will be discussing in this paper, we can implement a unitary when the corresponding can be written as a linear combination of unitaries with few terms.
We will be frequently talking about the Pauli matrices, which form a set of unitary matrices closed under matrix multiplication up to a phase in . A single-qubit Pauli matrices include four operators, in standard basis written as:
It is straightforward to check the multiplication of any two matrices yields another up to a phase. An -qubit Pauli matrix is the tensor product of single-qubit Pauli matrices, i.e., they form a set . The Pauli matrices are orthogonal to one another with respect to the Hilbert-Schmidt inner product—that is, for , if and only if . Furthermore, they form a complete basis for matrices of the same size. As a result, we can uniquely decompose any matrix into a linear combination of Pauli matrices. Moreover, the coefficients are real when the matrix is Hermitian.
Measurement. Information is extracted by measurement. A projective measurement of a state in the computational basis yields an outcome with probability (Born’s rule). Upon measurement, the quantum state collapses to the outcome state . Measurement is thus probabilistic.
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Norms and spectra. For a complex number , we write for its modulus. For a vector , we write for the Euclidean norm, and for vectors we write for the standard complex inner product, where is the complex conjugate of . For a matrix , we write for its spectral norm, defined by
Equivalently, is the largest singular value of ; when is normal, it is the largest absolute value of its eigenvalues. We write for the Frobenius norm,
Equivalently, if are the singular values of , then . For a Hermitian matrix , we write for the set of eigenvalues of . Since Hermitian matrices have real eigenvalues, implies .
2.2 Block Encoding in Quantum Computational Linear Algebra
Block encoding of an exponentially large linear operator is an essential subroutine for the design of a wide range of quantum algorithms [Martyn et al. 2021]. A unitary operator U block encodes a linear operator A if the topleft diagonal submatrix is a scalar multiple of A. While the matrix A to be block encoded may be a non-square matrix in general, we restrict our discussion to square matrices, since we will be focusing on Hamiltonian simulation.
Definition 2.1 (Block encoding). A unitary block encodes a matrix using ancilla qubits if
where is an identity matrix. The fact that the topleft submatrix scaled by a real number follows from the fact that is a unitary matrix. A quantum circuit block encodes if it produces a unitary operator that block encodes . A block encoding of will often be denoted as , when the implementation detail is irrelevant in context.
Linear Combination of Unitaries. A standard way to construct block encodings is the Linear Combination of Unitaries (LCU) method. Suppose is a linear combination of unitaries. Let , and set after padding the list to length if necessary. The unitary PREPARE maps to , and the SELECT unitary applies the phase-weighted operation when the ancilla is in state , with an arbitrary phase convention when . Then
Thus (PREPARE I)SELECT(PREPARE I) block encodes A with subnormalization factor . The same construction also applies when the controlled operations are themselves block encodings, yielding a block encoding of the corresponding weighted sum. We next illustrate LCU with a simple block encoding of a sum of two single-qubit Pauli operators.
Example 2.2. We can use the quantum circuit from Fig. 1 to block encode the operator : Upon measurement with outcome 0, the state of the remaining wire is . Therefore, this circuit block encodes with subnormalization factor 2 using one ancilla qubit, i.e., we have

Fig. 1. A block encoding of X - Z with a subnormalization factor 2.
To emphasize the roles of the qubits, we will denote the qubit that starts with a zero state and ends with a zero outcome as the ancilla qubits, and the qubits whose state is unrestricted are called the system qubits.
Pauli Decomposition. Recall that the Pauli matrices form an orthogonal basis with respect to the Hilbert–Schmidt inner product. We can uniquely decompose a matrix of the same size into a linear combination of the Pauli matrices. Therefore given any matrix , we can compute a block encoding by its decomposition into Pauli matrices of the same dimension, and apply LCU to implement a block encoding. While this method applies generally to any matrix, we should note that it does not produce an efficient block encoding, unless the number of terms in the summation is polynomially bounded.
2.3 Quantum Signal Processing
With the ability to perform matrix arithmetic using block encodings, we can further construct functions of encoded matrices. Quantum Singular Value Transformation (QSVT), formally established by Gilyén et al. [2019], provides a systematic way of producing block encodings of a polynomial p applied to the singular values of an encoded matrix A. When A is Hermitian, as in the Hamiltonian simulation setting discussed below, this framework effectively evaluates .
Given a block encoding of Hermitian and some target degree- polynomial , an ancilla-efficient method to evaluate is provided by the framework of Quantum Signal Processing (QSP). For a polynomial function satisfying the standard QSP admissibility conditions, including the required parity and boundedness constraints, there is a sequence of angles such that the following sequence of unitaries produces a block encoding whose real part is :
where is a reflection associated with the projector , i.e., [Gilyén et al. 2019]. Furthermore, given the coefficients of , the corresponding angles can be efficiently found using a classical computer [Gilyén et al. 2019].
Although QSP directly implements polynomial transformations, it can also be used to approximate non-polynomial functions that admit accurate polynomial approximations on the relevant spectral interval. More precisely, if a non-polynomial function can be uniformly approximated by a polynomial of sufficiently large degree over the singular values of interest, then QSP can be used to implement the corresponding approximate transformation. In the context of Hamiltonian simulation, to approximate a block encoding of the time evolution operator for a Hamiltonian -a Hermitian matrix describing a physical system—one can approximate the scalar function by a polynomial of sufficiently high degree, and then apply the QSP framework to obtain an approximation of [Low and Chuang 2017].
Example 2.3 (Implementation of QSP circuits). For Hamiltonian H satisfying , we can approximate the real part of , i.e., , by applying a truncation to the Jacobi-Anger expansion: , where and
Min Lai, Yu-Fang Chen, and Shih-Han Hung
are Chebyshev polynomials, and is the -th Bessel function of the first kind. For a small evolution time , we can numerically compute the coefficients:
We may compute the angles
such that (4) is satisfied.
3 Overview of the Verification Framework
We now give an overview of our verification framework for block-encoding-based Hamiltonian simulation. The goal is to verify that a circuit generated from a symbolic Hamiltonian and simulation time implements an approximation of the time-evolution operator within a prescribed error bound . Rather than treating the whole circuit as an unstructured unitary, the verifier follows the algorithmic structure of the construction: it first certifies the block encoding, then symbolically analyzes the QSP layer, and finally checks the extracted polynomial approximation.
Given a Hamiltonian written as a sum of Pauli operators, the verification task proceeds in the following four steps.
Verification of block encoding. The input to this step is a symbolic Hamiltonian , given as Pauli strings with weights , together with a circuit alleged to block encode . The verifier checks whether implements a block encoding of up to an unknown subnormalization factor. Rather than constructing the full unitary matrix of , it symbolically executes the circuit and tracks the system operator induced on each ancilla branch.
Example 3.1. Consider the single-qubit Hamiltonian and the LCU-style block-encoding circuit from Example 2.2, using one ancilla qubit and one system qubit . Since there is one ancilla qubit, symbolic execution maintains two branch operators and , representing
| op | ||
|---|---|---|
| Initial | I | 0 |
| 0 | I | |
| open-CX() | ||
Table 1. Symbolic execution of the block-encoding circuit in Example 2.2. Here open-CX is activated on ancilla value 0.
Initially and . The verifier then updates these symbolic operators gate by gate, as shown in Table 1. For example, swaps the two branches, so , while open-CX() applies only on the branch where the ancilla value is 0, updating and leaving unchanged. After the final gate, the all-zero branch is . Therefore, the verifier accepts as a valid block encoding of . More generally, if the final all-zero branch operator is , then the circuit block-encodes with subnormalization factor .
Symbolic execution of QSP. The input to this procedure is the Hamiltonian-simulation QSP circuit , together with the verified block-encoding gate . After the block-encoding circuit has been verified, the verifier no longer expands its internal gate-level implementation. Instead, the verified block-encoding circuit is treated as a symbolic unitary
where the top-left block H is the verified encoded Hamiltonian, while G, A, C are kept as symbolic blocks. In general, after the circuit is certified, is a block encoding of a multiple of the target Hamiltonian. To simulate the target Hamiltonian at evolution time t, effectively we can simulate H—the top-left block of —at time . Therefore, for ease of notation, in the remaining three stages, we will follow the convention. Namely, we simulate a Hamiltonian H satisfying that at evolution time , when H is the top-left block of , and after is obtained from the previous stage. The verifier symbolically executes over this abstract block-encoding gate. Since the verifier reasons only about the principal block and the aggregate non-principal block, it supports only QSP circuits whose operations preserve this abstraction. In particular, the block-encoding ancilla may only be accessed through operations that distinguish the all-zero ancilla state from all remaining ancilla states collectively, while the system register is modified only through invocations of the certified block encoding. The output of this procedure is the operator encoded in the all-zero ancilla branch.
Example 3.2. Consider a Hamiltonian-simulation QSP circuit together with a verified block encoding . Unlike the block-encoding verifier, which explicitly tracks every block-encoding ancilla branch, the QSP verifier reasons only about whether the block-encoding ancilla is in the all-zero state or not. Consequently, the internal implementation of the certified block encoding is no longer expanded. Every invocation of is replaced by the symbolic four-block abstraction.
The QSP verifier assumes a restricted circuit language. Between two consecutive calls to or , no gate modifies the system register. Moreover, operations on the block-encoding ancilla may depend only on whether the ancilla is in the all-zero state, and do not distinguish individual nonzero ancilla states. Consequently, every symbolic operator generated during execution is constructed solely from the symbolic blocks H, A, G, and C, together with scalar phase factors.
On each call to the certified block encoding, the verifier applies the symbolic update
where denotes the symbolic operator associated with the principal (all-zero) block-encoding branch, and collectively represents all remaining block-encoding branches, rather than tracking them individually. Thus the symbolic expressions produced during execution may contain the auxiliary symbolic blocks A, G, and C in addition to H.
Polynomial Extraction by Unitary Simplification. After symbolic execution finishes, the principal branch is an expression over H, A, G, and C. The verifier then applies a fixed set of oriented rewrite rules, derived from the unitarity identities of the four-block abstraction, to normalize this expression. These rewrite rules eliminate the auxiliary symbolic blocks whenever possible, and the verifier accepts only when the final expression reduces to a polynomial in H.
Example 3.3. Suppose symbolic execution produces . Using the unitarity identities and , the verifier rewrites
In the Hamiltonian simulation setting, the encoded Hamiltonian is Hermitian, so , and hence . Thus the auxiliary blocks have been eliminated, and the verifier reads the result as the polynomial .
Verification of approximate polynomial. In the last step, the verifier checks whether the extracted polynomial approximates the desired time-evolution function. If the verified block encoding has principal block , then the QSP circuit applies the extracted polynomial p to the normalized
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Hamiltonian . Therefore, to simulate the original Hamiltonian H for time t, it suffices to check the scalar approximation
for some complex subnormalization factor . Thus, the block-encoding subnormalization is compensated by simulating at an effective evolution time .
The new subnormalization factor may differ from 1 if the implementation chooses the QSP angles to compute a polynomial that approximates a scalar multiple of the exponential function. In known implementations, e.g., Gilyén et al. [2019], the QSP step yields some subnormalization factors and compensates it by applying an oblivious amplitude amplification on top. Therefore, to offer flexibility, our verification allows for and computes it in the runtime. More specifically, the verification computes , and aims to check if the following condition holds:
Of course, our verification cannot enumerate every element in , but since the exponential function can be well-approximated by a polynomial, we can check numerically whether they satisfy (7) on the Chebyshev nodes for and . The verification then checks at every grid point , . This requires at most evaluations of the functions, and can be done efficiently with a classical computer. Although the pointwise threshold is stricter than the desired uniform error bound, Theorem 7.1 shows that, with sufficiently many Chebyshev nodes, the conditions for all suffice to guarantee (7).
4 Symbolic Verification of Block Encoding Circuits
Let the target Hamiltonian be given as a weighted sum of Pauli strings , where and . We assume that the block-encoding circuit acts on ancilla qubits and system qubits. Our symbolic verifier checks whether the all-zero ancilla block of is proportional to the target Hamiltonian:
for some subnormalization factor .
Our verification algorithm symbolically executes the input circuit gate by gate. Instead of tracking amplitudes over the full Hilbert space, it tracks the system operation induced on each ancilla branch. Concretely, after every circuit prefix, the verifier maintains one symbolic system operator for each ancilla bit string. At the end of the symbolic execution, the operator associated with the all-zero ancilla branch is compared with the target Hamiltonian, up to an unknown subnormalization factor.
4.1 Symbolic states
Our symbolic verifier maintains a branch-indexed symbolic state
Here b is an ancilla bit string and is a symbolic system operator. The state represents
For ancilla bit strings , the -block of is the system operator . Thus, the all-zero ancilla block is .
4.2 Gate updates
We now describe how quantum gates update symbolic states. The update rules depend only on how a gate interacts with the ancilla register and the system register. For the Pauli-LCU block-encoding circuits considered here, it suffices to handle gates of the following forms: (1) Ancilla-only gates, (2) System-only gates, and (3) Ancilla-controlled system gates. These forms cover the standard LCU structure: PREPARE and PREPARE act only on the ancilla register, while SELECT consists of ancilla-controlled Pauli operations on the system register. We therefore do not describe system-controlled ancilla gates or other gate patterns. Their occurrence in this setting is likely either redundant or indicative of a bug in the circuit construction. When such a gate is encountered, the verifier reports it directly instead of attempting to absorb it into the Pauli-LCU abstraction.
Ancilla-only gates. An ancilla-only gate only changes how symbolic branches are combined. Suppose it acts on ancilla qubits and is represented by . For every fixed assignment of the remaining ancilla bits and affected-bit values , the verifier updates
For , this gives and . In particular,
System-only gates. A system-only gate acts only on the system register and leaves the ancilla branch unchanged. Suppose is represented as a Pauli polynomial. Then for every . If , then . In the special case where is a Pauli string, each product satisfies for some and . Hence a system-only Pauli gate only changes Pauli labels and coefficients, and does not increase the number of Pauli terms. For example, sys[i] updates for every .
Ancilla-controlled system gates. An ancilla-controlled system gate applies a system operation depending on the ancilla control bits. Suppose a set of ancilla qubits controls a system gate , and let . For every fixed assignment of the remaining ancilla bits and every control value , the verifier updates
If , then , with the phase from Pauli multiplication absorbed into the coefficient. For , the common controlled-Pauli updates are
When G is a Pauli string, the update does not increase the number of Pauli terms.
4.3 Final Proportionality Check
After symbolically executing the whole circuit, the verifier obtains a family of symbolic operators . By construction, the all-zero branch satisfies
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Therefore, the verifier accepts if the all-zero branch is equal to the target Hamiltonian up to a subnormalization factor: for some nonzero scalar . Equivalently, write
Since the Pauli strings in form a basis for the vector space of linear operators on qubits, these Pauli expansions are unique. Hence checking is equivalent to checking whether the coefficient vector is proportional to the coefficient vector :
In the implementation of PROPORTIONAL(B, H, ), coefficients are represented numerically. The verifier therefore checks approximate proportionality by finding a positive real scalar such that is close to H. More precisely, . Since the Pauli strings are orthogonal under the Hilbert–Schmidt inner product and satisfy , we have . Hence . It therefore suffices to check . The verifier infers the subnormalization factor by solving . To this end, the following lemma is useful.
LEMMA 4.1. For integer , let be two vectors of entries, with , and let . Then is minimized at . If is restricted to be in the set of real numbers, then is minimized at .
PROOF. The lemma can be proved by a geometric argument. Let for some vector orthogonal to . This decomposition is always possible since we can choose in the span of . By taking an inner product with on both sides, we have the coefficient . Since the two components are orthogonal,
The second term is independent of . Hence the minimum over is attained at , while the minimum over is attained at .
In both normalization checks, we return (REJECT, ) if the denominator cannot be confirmed to be positive before division. Geometrically, this projects onto the ray spanned by . If the lower bound of is not positive, PROPORTIONAL returns (REJECT, ). By Lemma 4.1, the best real subnormalization factor is
If , PROPORTIONAL returns (REJECT, ). Otherwise, it accepts when
where Re takes the real part of a complex number. PROPORTIONAL(B, H, ) returns a pair (ACCEPT, ) iff and (10) holds. Otherwise, it returns (REJECT, ).
4.4 Algorithm
We summarize the symbolic execution procedure above as Algorithm 1. The algorithm initializes one symbolic branch for each ancilla bit string, processes the input circuit gate by gate using the symbolic update rules, and finally checks whether the all-zero branch is proportional to the target Hamiltonian. Because the subnormalization factor is not fixed a priori, the final check
Algorithm 1: VERIFYBLOCKENCODING(H, C, )
Input: Target Hamiltonian ; QASM circuit C acting on r ancilla qubits and n system qubits; tolerance
Output: (ACCEPT, ) if is a Hermitian satisfying ; otherwise (REJECT, ).
1 Initialize for all , and set
2 foreach instruction g in C do
3 Update according to the symbolic update rule for g
4 Write , .
5 if then Return (REJECT, )
6 return PROPORTIONAL( )
infers the factor from the Pauli coefficients. Here PROPORTIONAL( ) denotes the numerical proportionality check on Pauli expansions. First, write the two matrices as a linear combination of Pauli matrices, as in (8). The check treats and as coefficient vectors and infers the positive real subnormalization factor that best fits . Equivalently, as analyzed in Section 4.3, it computes the inferred value as in (9). The verifier rejects if or the principal block is not Hermitian, and otherwise checks if (10) holds. When this check succeeds, the verifier accepts as a block encoding of with the subnormalization factor .
Branch complexity. If the block-encoding circuit uses ancilla qubits, symbolic execution tracks one Pauli-polynomial system operator for each branch , hence symbolic branches. For a standard Pauli-LCU block encoding of Pauli terms, , so the number of branches is . The size of each branch expression is circuit-dependent. In the worst case, symbolic multiplication can make a branch expression grow exponentially, and we do not claim a polynomial worst-case bound for arbitrary circuits. However, the verifier avoids constructing the exponentially large system matrix: it tracks Pauli-polynomial expressions attached to ancilla branches. In our evaluation, this representation is sufficient to verify block encodings of structured Pauli-sum Hamiltonians, including Ising, MaxCut, and Heisenberg instances, with hundreds of Pauli terms and up to 256 system qubits.
THEOREM 4.2 (SOUNDNESS OF THE BLOCK-ENCODING VERIFIER). Let be the unitary implemented by the input circuit . Assume that uses only the gate forms supported by the symbolic semantics in Section 4. If Algorithm 1 returns (ACCEPT, ) on input , then , the principal block is Hermitian, and .
PROOF. The symbolic execution rules maintain the invariant that after any circuit prefix with denotation , the symbolic branches satisfy for every system state . This holds initially by and for , and each update rule is obtained by applying the corresponding gate to this branch decomposition. Hence, after processing the whole circuit, .
It remains to use the final proportionality check. Write and , and let and . When the algorithm accepts, PROPORTIONAL returns a positive real such that . Let . By orthogonality of the -qubit Pauli basis, . Since , we get . Substituting the expression for proves the claim. Moreover, Algorithm 1 accepts only if , which establishes the Hermiticity claim.
Min Lai, Yu-Fang Chen, and Shih-Han Hung
5 Symbolic Execution of Quantum Signal Processing
This section describes the symbolic execution of quantum signal processing (QSP) circuits built from a certified block encoding. A QSP circuit repeatedly invokes a block-encoding unitary and its adjoint . Rather than expanding the gate-level implementation of at every invocation, the verifier reuses the block-encoding certificate as an abstract interface and symbolically executes the surrounding QSP circuit. Throughout this section, we follow the notation of Section 4: the system register contains qubits, and the certified block encoding uses block-encoding ancilla qubits. In addition, the QSP layer uses phase ancilla qubits. Thus the circuit has three disjoint registers: phase-ancilla qubits, block-encoding ancilla qubits, and system qubits. We index phase-ancilla branches by , and block-encoding ancilla branches by .
The purpose of this phase is to compute the symbolic expression implemented by the principal QSP branch. The verifier tracks the phase-ancilla branches explicitly. For the internal block-encoding ancilla, however, it distinguishes only the all-zero branch from the aggregate of all nonzero branches . Each invocation of or updates the current symbolic expressions according to this two-component abstraction. After all QSP gates have been processed, the principal component of the all-zero phase branch contains the expression produced by symbolic execution. This expression is then passed to the polynomial-extraction phase.
5.1 Four-Block Matrix Abstraction of Block Encodings
Once a block-encoding circuit has been certified, the verifier no longer expands its internal gate structure. Instead, it replaces by a typed four-block matrix abstraction. Since the system register has qubits, the principal all-zero block-encoding branch has dimension . The aggregate of all nonzero block-encoding branches has dimension .
With respect to the decomposition into the all-zero branch and the aggregate nonzero branch, we write
Here the four matrix variables have dimensions
The principal block H is the block certified by the block-encoding verifier:
In the first verification phase, this block is proved to equal the target Hamiltonian up to a subnormalization factor. In the Hamiltonian-simulation phase, this subnormalization factor is absorbed into the effective simulation time. Therefore, in the QSP symbolic execution below, we use H to denote the normalized encoded Hamiltonian block.
The remaining blocks A, G, and C summarize the behavior of involving the aggregate nonzero block-encoding branches. They are treated as formal matrix variables with the dimensions above and are not expanded into the internal gates of the certified block encoding.
This abstraction is used only after the block encoding has been verified. It therefore separates the verification of the QSP layer from the gate-level verification of the block-encoding circuit: the QSP verifier sees only the certified principal block H, the formal garbage blocks A, G, C, and the fact that these blocks arise from a unitary matrix.
5.2 Symbolic Execution over the Four-Block Abstraction
We now describe how the verifier symbolically executes a QSP circuit after replacing each call to by its four-block matrix abstraction. The symbolic executor treats the three registers differently.
The phase ancilla register is tracked explicitly: each branch carries its own symbolic pair. The block-encoding ancilla register is tracked only through the two-component abstraction introduced above: the all-zero branch and the aggregate of all nonzero branches. Finally, the system register is represented symbolically through the matrix expressions attached to these components.
The four-block abstraction is valid only for QSP circuits that preserve this two-component view of the block-encoding ancilla. Between two consecutive invocations of the certified block encoding, no gate may modify the system register directly. Moreover, operations on the block-encoding ancilla are restricted to those whose behavior depends only on whether the ancilla is in the all-zero state. For example, multi-controlled gates conditioned on the all-zero block-encoding ancilla state are supported, whereas operations that distinguish individual nonzero block-encoding ancilla states are not. Under these restrictions, the verifier never needs to distinguish individual nonzero block-encoding ancilla branches during QSP symbolic execution. For each phase-ancilla branch, it maintains only two symbolic components: the principal component corresponding to the all-zero block-encoding branch, and the aggregate non-principal component representing all remaining block-encoding branches.
5.3 Symbolic States
For each phase-ancilla branch , the verifier maintains a pair . The expression represents the component in the all-zero block-encoding branch, while represents the aggregate component over all nonzero block-encoding branches. Their dimensions are
Thus and have the same input dimension but different output dimensions. The symbolic state is , initialized by
The verifier then symbolically executes the QSP circuit gate by gate.
5.4 Aggregate-Compatible Gate Updates
We now describe the gate updates used by the QSP symbolic executor. The updates are restricted to gates that preserve the aggregate abstraction introduced above. The verifier may explicitly distinguish computational-basis branches of the phase ancilla register, but it may not distinguish individual nonzero branches of the block-encoding ancilla register.
Phase-ancilla gates. Gates acting only on the phase ancilla register are handled branch-wise. Since the phase branches are tracked explicitly, an ancilla-only gate on the phase register mixes the symbolic pairs across different branches according to the usual matrix action of the gate. The same branch mixing is applied simultaneously to the principal components and to the aggregate non-principal components.
For example, under the convention , applying to a phase-ancilla qubit multiplies the symbolic pair in each branch with that qubit equal to 0 by , and the symbolic pair in each branch with that qubit equal to 1 by .
Operations controlled by the phase ancilla. Some QSP circuits contain operations controlled by one or more phase-ancilla qubits. Since phase-ancilla branches are tracked explicitly, such operations are handled branch by branch. For a fixed phase branch , if the control condition is not satisfied, the pair is left unchanged. If the control condition is satisfied, the corresponding operation is applied to that pair. In particular, a controlled call to or applies the four-block update only
Min Lai, Yu-Fang Chen, and Shih-Han Hung
on the phase branches where the controls are enabled. The explicit update rules for calls to and are given in Section 5.5.
Operations on the block-encoding ancilla. Operations that access the internal block-encoding ancilla are allowed only if they preserve the distinction between the all-zero branch and the aggregate nonzero component. Such operations may test whether the block-encoding ancilla is in the all-zero state, but they may not distinguish among different nonzero block-encoding ancilla states. For example, a phase operation conditioned on the block-encoding ancilla being in the all-zero state is represented by and , where is the corresponding phase factor. Similarly, an operation that applies the same scalar factor to every nonzero block-encoding ancilla branch is represented by and . Both updates are well typed because scalar multiplication preserves the dimensions of blocks.
Operations that distinguish two different nonzero block-encoding ancilla branches are not supported by this abstraction. Supporting such gates would require returning to the finer branch representation used by the block-encoding verifier, where each ancilla branch is tracked separately.
System-side operations. Between two consecutive invocations of the certified block encoding, the QSP gate language does not allow gates that modify the system register directly. All system-side transformations in the QSP layer are introduced through calls to and , which are handled by the four-block abstraction in Section 5.5. This restriction ensures that the aggregate non-principal component can be treated as a single symbolic component without expanding the individual nonzero block-encoding ancilla branches.
5.5 Calls to the Block Encoding
A call to the certified block encoding or its adjoint acts on the block-encoding ancilla and the system register. In the QSP verifier, this call is not expanded into the gate-level implementation of ; instead, it is executed using the four-block abstraction.
For each fixed phase-ancilla branch , the symbolic state contains a pair . A call to updates this pair by , or equivalently, and . These products are well typed: both and are matrices, while both and are matrices.
A call to is handled similarly: . Equivalently, and . Again, both terms in the first sum are matrices, and both terms in the second sum are matrices.
If the call is controlled by one or more phase-ancilla qubits, then the update is applied only to the phase branches on which the controls are enabled. For all other phase branches, the pair is left unchanged. For example, if a call to is controlled on a phase-ancilla qubit being 1, then every branch with that qubit equal to 1 receives the update above, while all branches with that qubit equal to 0 are unchanged.
THEOREM 5.1 (CORRECTNESS OF SYMBOLIC EXECUTION). Let be a QSP circuit supported by the symbolic semantics, and let be its unitary. If , then . Hence, Algorithm 2 returns exactly the principal block of the QSP circuit.
PROOF. We induct on the number of executed instructions. For each phase branch , the interpreted pair equals the principal and non-principal components of the circuit prefix applied to . The initialization satisfies this property. Phase-ancilla gates mix these
Algorithm 2: SYMBOLICEXECUTE(C)
Input: QSP circuit C, number of phase ancilla s Output: Symbolic expression E
1 Initialize and for
2 foreach instruction g in C do
3 Update according to the symbolic update rule for g
4 Normalize each with the rewrite rules of Section 6.
5 return
components according to their matrix entries. Phase operations conditioned on the zero or nonzero block-encoding branch multiply the corresponding components by the specified scalars. Calls to and apply their exact four-block matrix action. Phase-controlled operations apply the relevant update only on enabled phase branches. Thus every supported instruction preserves the property. After the last instruction, is exactly the principal block stated in the theorem.
6 Polynomial Extraction by Unitarity Simplification
After symbolic execution, the verifier obtains a symbolic state . The operator implemented by the QSP circuit is represented by the principal component of the all-zero phase branch, namely . The goal of this stage is to extract the polynomial transformation implemented by the QSP circuit. The raw expression may contain the auxiliary blocks A, G, C and their adjoints, corresponding to intermediate transitions through the aggregate non-principal component. The verifier applies a fixed oriented rewrite system derived from the unitarity of the four-block abstraction. If the normalized expression contains only H, scalar coefficients, and identities, the verifier reads it as a polynomial in H. Otherwise, the verifier rejects.
Dimension compatibility. The block variables H, G, A, C have the matrix dimensions specified in Section 5.1. Symbolic execution generates expressions by dimension-compatible block-matrix multiplication through calls to and : products such as GA, HG, and AH may arise, whereas dimension-incompatible products such as HA are not generated. The polynomial extractor applies rewrite rules only to dimension-compatible subexpressions.
Rewrite rules from unitarity. Recall that is unitary. Hence the block identities induced by and are valid. The verifier orients these identities into rewrite rules:
Each rule is a dimension-compatible matrix identity. For example, and have the same dimensions, as do and . Rules R1–R6 reduce the number of non-principal block occurrences. Rules R7 and R8 preserve the total number of non-principal block occurrences, but reduce the number of occurrences of A and G. The rewrite system is sound but intentionally incomplete: if the deterministic simplifier does not reduce the expression to a polynomial in H, the verifier rejects.
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Algorithm 3: EXTRACTPOLYNOMIAL(E)
Input: Dimension-compatible symbolic expression Output: (ACCEPT, ) if rewrites to a polynomial ; (REJECT, ) otherwise 1 while some rewrite or algebraic normalization rule applies to do 2 Update using the first applicable rule in the fixed priority order 3 if contains any symbol in then return (REJECT, ) 4 else collect the coefficients of the powers of in and return (ACCEPT, )
Algebraic normalization. In addition to the unitarity rules, the verifier applies the following algebraic normalization rules:
D1: , D2: , S1: , , S2: , , , S3: , S4: , , H: .
Here , and rule is used only in the Hamiltonian simulation setting, where the certified principal block is Hermitian. The implementation also flattens associative sums and products before applying these rules. These algebraic rules are ordinary matrix-algebra simplifications and do not use any additional property of the block encoding. Rules and S1–S4 are applied after flattening associative sums and products, so they should be read as part of the canonicalization procedure rather than as a complete rewrite system.
Canonicalization and termination. Rules H and S1–S4 are implemented as a deterministic canonicalization pass: the verifier flattens sums/products, moves scalars to the front, combines identical monomials, collects powers of , and removes zero terms. The simplifier applies rules in the fixed order R1–R8, then D1–D2, interleaved with this canonicalization. To see why this process terminates, imagine fully expanding the expression into a sum of monomials, without collecting coefficients. Distribution does not change these expanded terms. Each R step replaces affected terms by finitely many simpler terms: each new term has fewer non-principal blocks, or the same number but fewer occurrences of . These counts cannot decrease indefinitely. Since each replacement produces only finitely many terms, only finitely many R steps are possible. Between R steps and after the last one, distribution finishes expanding a finite expression; it never factors sums back into products. Canonicalization also terminates and only simplifies or combines terms. Hence the whole process terminates.
6.1 Example: Symbolic Execution and Polynomial Extraction
To better explain how our abstraction works, consider the following example for symbolic execution of a QSP circuit. For demonstrating the usage of QSP and our verification, we simplify our example so the resulting polynomial is not particularly attached to a Hamiltonian simulation.
Consider the following implementation of quantum singular value transform based on quantum signal processing: We invoke our verification scheme to prove that it produces a block encoding of , where is block-encoded by with
| rule | expression |
|---|---|
| R1 | |
| R5 | |
| D1 | |
| R2 | |
| D1 | |
| D2 | |
| H |
Table 2. Simplifying the symbolic expression.

Fig. 2. An abstraction of the circuit in Figure 3 for symbolic execution.
subnormalization factor . This effectively re-
duces each application of or its Hermitian conjugate as a single-qubit abstract gate, illustrated as the following quantum circuit.
We perform symbolic execution on the circuit in Fig. 2: starting from input block of the form representing the state on (with that of initialized to ) and recalling that , we proceed the symbolic execution and summarize the steps in Table 3.
| op | 00 | 01 | 10 | 11 |
|---|---|---|---|---|
| I | 0 | 0 | 0 | |
| H | A | 0 | 0 | |
| CX | 0 | A | H | 0 |
| 0 | -iA | iH | 0 | |
| CX | iH | -iA | 0 | 0 |
| 0 | 0 | |||
| CX | 0 | 0 | ||
| 0 | 0 | |||
| CX | 0 | 0 | ||
| 0 | 0 |
Table 3. The symbolic execution of the abstract circuit in Fig. 2.
We will only simplify the expression in the first branch at the end, i.e., the “00” entry in the last row of Table 3. We then apply rewrite rules to simplify the symbolic expression, as in Table 2. Here we omit detailed simplifications of symbolic expressions, and only show crucial steps using the rules from Section 6.

Fig. 3. An example QSP circuit.
The above symbolic execution treats the quantum state in each step of the execution as a vector of four symbols, starting from . The is abstracted into a four-block matrix acting on the abstract wire , and thus in the joint space of and , each application of is an application of the unitary
Similarly, each application of acts as a multiplication of the matrix diag(), which is equivalent to a phase multiplication to each branch. The open controlled NOT acts as a swap of the 00 and 10 branches, since it corresponds to a Pauli-X gate when is in the zero state.
Note that in this example, we have shown that the symbolic execution of QSP corresponds to application of one- and two-qubit gates to a symbolic expression of a two-qubit state, and therefore
Min Lai, Yu-Fang Chen, and Shih-Han Hung
can be simulated efficiently. To conclude that the circuit results in a block encoding of a polynomial in H, we develop a tool to automatically simplify the symbolic expression in the 00 branch using the rules that reflect the unitary structure.
THEOREM 6.1. The rewrite rules form a sound system.
Proof. We prove the soundness using the fact that is a symbolic expression of a unitary.
This justifies the soundness of R2, R4, R6, and R8. Similarly, since
This justifies the soundness of R1, R3, R5, and R7. The soundness of rule H follows from the fact that H represents a Hermitian matrix. The soundness of D1 and D2 follows from the fact that the symbols represent matrices and from standard matrix arithmetic.
COROLLARY 6.2. Algorithm 3 is sound, i.e., if Algorithm 3 accepts, then the expression p is proved to be equivalent to the symbolic expression E using the rewrite rules in the logic.
Proof. If Algorithm 3 accepts, then there must be a polynomial deduced from the rewrite rules. The theorem follows from the soundness of the logic, proved in Theorem 6.1.
6.2 Completeness of Rewrite Rules for Standard QSP Circuits
In this section, we show that when the quantum program has a standard QSP form, it is always possible to apply our rewrite rules to extract a polynomial in the topleft block H. First, we give the grammar of a standard QSP circuit.
Definition 6.3 (Standard QSP circuits). A quantum program is a standard QSP circuit if it has the following patterns:
(1) The program alternates its queries to U and .
(2) Between two adjacent queries to U or , an arbitrary number of CX gates (as shown in Fig. 3) can be applied to and that of single-qubit gates can to .
Formally, the expression E of the quantum program is a standard QSP circuit, if it follows the grammar:
Here W denotes any single-qubit gate.
The standard QSP circuit defined in Definition 6.3 can be easily checked by parsing the program expression. Given the definition, we show that when the quantum program is a standard QSP circuit, there is always a composition of the rewrite rules that simplifies the resulting symbolic expression of the abstract state to a polynomial. To show this, we define equivalence classes of expressions to make our argument concrete.
Definition 6.4 (Equivalent class of expressions). We define an equivalence class I of symbolic expressions as those which can be simplified to a polynomial in H using the rewrite rules. We use the notation to denote the class of expressions that are simplified to for some polynomial for , where is an empty expression. We say that a tuple of symbolic expressions if each component .
THEOREM 6.5 (COMPLETENESS OF REWRITE RULES FOR STANDARD QSP PROGRAMS). For every standard QSP circuit (as defined in Definition 6.3), in each step of symbolic execution, there exists a composition of rewrite rules that deduces the resulting state to expressions in the class for some . In particular, the first element of the abstract state is a polynomial in .
Proof. Using the convention provided by Definition 6.4, we show that after each application of , the resulting state is in and after each application of , the resulting state is by applying the rewrite rules. Namely, both classes can be written as for .
We prove the theorem by induction on the symbolic execution of each abstract gate:
(1) Base case: The initial state is .
(2) : the action literally swaps the first and the third component, so it acts trivially on .
(3) : this gate acts as
The last equality holds since each entry is a complex number, which may be absorbed into the equivalent class. The transition is not directly used in our implementation; the merge in (18) is only included to simplify the presentation.
(4) : applying rewrite rules to the symbolic execution gives
By definition, .
(5) : similarly as in Item 4, applying rewrite rules to the symbolic execution gives
Min Lai, Yu-Fang Chen, and Shih-Han Hung
To save space, we have omitted the application of the rules S4, and R4 because they are straightforward.
Since rewriting is applied after each gate, every monomial in (17)–(20) contains at most one adjacent pair of non-principal blocks, so at most one of R1–R8 applies and the derivation shown is the one Algorithm 3 performs.
Definition 6.3 describes the standard single-phase-ancilla QSP sequence. The proof extends unchanged to multiple phase ancillas with arbitrary gates on the phase register , and to phases conditioned on the block-encoding ancilla being all-zero, because both act on each (principal, non-principal) pair by scalar coefficients, which is all that Item 3 uses.
7 Verification of Polynomial Approximation
Following the symbolic execution of QSP, when the circuit is programmed correctly, we obtain a block encoding of for some polynomial . To conclude that it block encodes a polynomial approximation of for the given time , we check the worst-case closeness between the two functions in the interval , i.e., if there exists a complex subnormalization factor such that
In standard algorithm designs, this subnormalization parameter may be further eliminated by applying an oblivious amplitude amplification. In this work, we focus on the approximation of a subnormalized approximation of .
To see why it suffices to show that two complex-valued functions are close, we note that and are diagonalized simultaneously in the eigenbasis of , whose spectrum is contained in . Therefore the spectral norm of is bounded by the maximum pointwise error between the two functions in the same interval [Gilyén et al. 2019].
To obtain a correct Hamiltonian simulation algorithm, Gilyén et al. [2019] and subsequent works take a truncation of or , both expanded using the Jacobi-Anger expansion, and then use an algorithm to find the corresponding angles. While this particular choice of polynomial offer an optimal low-degree approximation of the exponential function, it is not the only polynomial that satisfies (21). Therefore, for verification purposes, we offer flexibility on the choices of the polynomials by directly checking that the sufficient condition in (21) is satisfied.
To verify the polynomial satisfies (21), we take Chebyshev nodes
and sample the functions at these points. The verifier chooses a candidate normalization factor by least-squares fitting at these nodes, then checks its approximation error.
For defined in (22), let and be the sampling of these functions at the grid points. For , Lemma 4.1 gives the least-squares choice . This minimizes , not the maximum error over . The guarantee comes from the residual checks below and the subsequent grid-to-continuum bound, not from optimality of the chosen factor. Then the verifier checks whether at each , the evaluation of both functions are -close, i.e., for every . where the parameter can be found via an inner product between the two discretizations: by invoking Lemma 4.1. The following theorem shows that it suffices to evaluate the function at points for and .
Algorithm 4: VERIFYPOLYNOMIALAPPROXIMATION(p, f, t, )
Input: Polynomial ; target function ; time ; tolerance
Output: (ACCEPT, ) if approximates to error within ; otherwise (REJECT, ).
1 Initialize ; Set to be the degree of ; Set ;
2 Initialize ; ; ;
3 foreach in do
4 Set ; Set ; Set ;
5 if then return (REJECT, )
6 ; Set ;
7 foreach in do
8 if then return (REJECT, )
9 return (ACCEPT, )
THEOREM 7.1. For , let be a function that can be approximated by a degree-D polynomial to error within on , and be a degree-d polynomial, and for . For , if for all , then on .
PROOF. Let be the degree- polynomial that approximates to error within . Since is a degree-max polynomial, by the Ehlich-Zeller theorem (see Ehlich and Zeller [1964] and Bos and Vianello [2012, Theorem 2]),
By triangle inequality,
Recall that in the previous stage, the verifier performs a symbolic execution to obtain a polynomial . Then it evaluates both the target function and the polynomial at every . By Theorem 7.1, if they are at most -close at these points, we can guarantee that the functions must be -close in . We then summarize the verifier's action in Algorithm 5, and conclude its soundness.
COROLLARY 7.2. For , Algorithm 4 is sound.
PROOF. We know that the acceptance of the algorithm implies that for every , . Since for , the degree-D truncation of the Jacobi-Anger expansion approximates to error within . Then by Theorem 7.1, this implies that .
7.1 Example: Verifying the Cosine Component of Hamiltonian Simulation by QSP
The following example proves the correctness of the cosine component of Hamiltonian simulation based on QSP.
Example 7.3. For simplicity and demonstration purposes in this section, we choose a large and a small evolution time for , and only use a degree-4 approximation of the cosine function by applying a truncation to the Jacobi-Anger expansion, as in Example 2.3. Since
Min Lai, Yu-Fang Chen, and Shih-Han Hung

Fig. 4. Deviation of from for , where is defined in (23).
the circuit complexity may be reduced if the angles are represented in low precision, we truncate the angles in (6) to two decimal places, yielding . We then run a symbolic execution to obtain the polynomial from these truncated angles, listed in Table 4. Here to make the symbolic execution easier to follow, we keep the phase factors of the form until the end of the execution.
The next step is to simplify the symbolic expression to a polynomial in :
where and . Applying the rules and take the real part of the resulting polynomial, we have
Taking the real part may be implemented by applying a linear combination of unitary, but here for exposition, we omit the detail for implementing this particular operation. We observe that the polynomial (23) has coefficients close to those of (5), since the former is obtained by applying a truncation to the angles for the latter.
We then can numerically evaluate both functions at the grid points based on Theorem 7.1. To meet the specification , we evaluate the function at the Chebyshev nodes defined in (22). The deviation is visualized in Fig. 4.
8 Overall Verification Algorithm
We now summarize the full verification procedure. The verifier takes as input a target Hamiltonian H, an alleged block-encoding circuit , a QSP circuit , an evolution time t, and an error tolerance . It proceeds by invoking the four verification stages described above as subroutines.
8.1 Soundness
In this section, we prove the soundness of Algorithm 5, i.e., when the algorithm outputs ACCEPT, the resulting quantum circuit is an -approximation of up to a subnormalization factor.
THEOREM 8.1 (SOUNDNESS OF ALGORITHM 5). If Algorithm 5 returns (ACCEPT, ), then the principal block of the QSP circuit satisfies .
PROOF. When the algorithm accepts, it must be true that are all ACCEPT. By the soundness statement in Theorem 4.2, Theorem 5.1, Corollary 6.2, and Corollary 7.2, it remains to show that
| 00 | 01 | 10 | 11 | |
|---|---|---|---|---|
Table 4. Symbolic execution of the degree-4 QSP circuit with phases . Shorthands: and .
Algorithm 5: VERIFYHAMILTONIANSIMULATION
Input: Target Hamiltonian ; block-encoding circuit ; QSP circuit ; evolution time ; tolerance
Output: if the QSP circuit implements a subnormalized -approximation of with scaling factor ; otherwise output REJECT.
1 ;
2 if then return REJECT
3 ;
4 ;
5 if then return REJECT
6 ;
7 return
the total error is within . By the soundness of Algorithm 1, we know that the all-zero branch has matrix satisfying . This implies that is -close to . By the Lipschitz continuity of the exponential function, .
Then by Corollary 6.2, the QSP circuit is certified to produce a polynomial . Furthermore, by Corollary 7.2, the polynomial satisfies . Finally, applying triangle inequality, we have
This means that when Algorithm 5 accepts, the entire circuit meets the specification, i.e., it simulates the given Hamiltonian at time to error within .
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Composition of the QSP Wrapper and Block Encoding. To compose the QSP wrapper with the concrete block-encoding circuit, we identify the ancilla qubits and system qubits of the block-encoding circuit with the corresponding block-encoding ancilla and system qubits of the wrapper. The qubits within each register may be matched in any order, provided that the same mapping is used consistently throughout the composed circuit. Each occurrence of or is then replaced by the block-encoding circuit or its adjoint , respectively. If an occurrence is controlled by a phase-ancilla qubit, the same control is added to every gate in the corresponding block-encoding circuit. If a gate in the QSP wrapper acts on a phase ancilla and is open-controlled by the abstract block-encoding ancilla, the abstract control is replaced by open controls on all concrete block-encoding ancilla qubits, while the target remains the same phase ancilla.
COROLLARY 8.2 (CORRECTNESS OF THE COMPOSED CIRCUIT). Let be the circuit obtained by composing the QSP wrapper with the verified block-encoding circuit as described above. If Algorithm 5 returns (ACCEPT, ), then .
9 Evaluation
We evaluate the scalability of the verifier on two verification tasks.
TASK1 We measure the size of structured Pauli-sum LCU block encodings that the verifier can handle, reporting runtime and memory as the number of system qubits, Pauli terms, and selector ancillas increase.
TASK2 We measure the size of QSP Hamiltonian-simulation circuits that the verifier can certify after abstracting the block encoding as an opaque operation. For each circuit, the verifier extracts the all-zero branch and checks the approximation error against on .
9.1 Benchmarks and Circuit Generation
For TASK1, we use three standard families of 2-local Hamiltonians:
For a Hamiltonian , the benchmark generator constructs the standard LCU block encoding . Here , PREPARE prepares amplitudes proportional to , and SELECT applies the corresponding signed Pauli string. In each of our three benchmark families, the LCU terms have equal absolute coefficients. The generator therefore prepares equal amplitudes on the term labels and zero amplitude on unused selector states. It synthesizes PREPARE with rotations controlled by prefixes of the selector register, and constructs PREPARE by reversing the gate sequence and negating the rotation angles.
For TASK2, all benchmarks use a fixed opaque block encoding with one system qubit and one block-encoding ancilla. The verifier does not expand the implementation of or ; it treats them as symbolic block-encoding operations. If the principal block of is , then simulating for physical time corresponds to approximating , where . Thus TASK2 is parameterized by the effective simulation time .
The TASK2 circuits are generated using an optimized QSP construction. The goal is to exercise the verifier on circuits produced by a nontrivial circuit-generation workflow, rather than only on a direct textbook construction. A straightforward generator would synthesize two independent QSP circuits for the cosine and sine components of .
Our generator instead shares one QSP skeleton between the two components: a selector qubit multiplexes the cosine and sine phase sequences, and the two branches share the same positions of and calls. The extracted cosine and sine responses are then combined by a two-term LCU.
This optimized construction is not trusted by the verifier. The verifier is given only the generated QASM circuit; it symbolically executes the circuit, extracts the all-zero branch, and checks the polynomial implemented by that branch. Thus the benchmark demonstrates a separation between circuit generation and verification: the generator may use circuit-level QSP optimizations, while correctness is established by independently checking the generated circuit.
The generator uses PYQSP only as an untrusted source of benchmark phase sequences and polynomial data. For each value of , PYQSP produces bounded Chebyshev approximations
The cosine approximation is an even polynomial and the sine approximation is an odd polynomial, matching the parity structure of standard QSP responses. The Chebyshev coefficients are converted to monomial coefficients before verification. Further details of the shared-skeleton construction, the PYQSP-to-QASM phase conversion, and the LCU normalization are given in Appendix A.
The all-zero branch extracted by the verifier has the form . Since the QSP polynomials produced by the bounded synthesis are themselves half-scaled, this branch approximates .
For approximation checking, the verifier infers a scalar normalization factor from the sampled values: , with entries and . It then checks
In our full Hamiltonian-simulation benchmarks, the inferred is typically close to 4, matching the expected inverse normalization from the two-term LCU and the half-scaled QSP polynomials.
9.2 Experimental Setup
All experiments were run on a single workstation with 8 CPU cores and 16 GiB of RAM, running macOS 13.2 (Darwin 22.3.0, arm64). We use Python 3.11. Each benchmark is executed with a timeout of 1800 seconds. We report wall-clock verification time and maximum resident set size (RSS).
Numerical accuracy. We use the Arb/Acb ball arithmetic provided by Python-FLINT at 60 decimal digits of working precision for all arithmetic computations, including coefficient propagation, polynomial manipulation, residual evaluation, and error-bound comparison. To check an inequality , the implementation requires the upper bound of the ball enclosing LHS to be strictly smaller than the lower bound of the ball enclosing RHS.
Zero tests are exact. Numerical roundoff may therefore leave terms whose coefficients would be zero in exact arithmetic. During simplification, these powers of H are retained rather than removed on the basis of their small coefficients.
We report PASS when verification establishes the requested guarantee: the block-encoding error bound for TASK1, as in Theorem 4.2, or the full-interval QSP approximation for TASK2, as in Corollary 7.2. A FAIL means that the verifier could not establish the guarantee. A TIMEOUT means that verification did not finish within 1800 seconds.
Min Lai, Yu-Fang Chen, and Shih-Han Hung
| Family | n | Terms | Sel. anc. | Gates | Time (s) | RSS (MiB) | Result |
|---|---|---|---|---|---|---|---|
| Ising | 2 | 4 | 2 | 44 | 0.08 | 58.47 | PASS |
| Ising | 32 | 64 | 6 | 1,862 | 3.69 | 62.88 | PASS |
| Ising | 128 | 256 | 8 | 9,062 | 155.96 | 101.36 | PASS |
| Ising | 256 | 512 | 9 | 19,686 | 807.87 | 257.84 | PASS |
| MaxCut | 2 | 4 | 2 | 34 | 0.09 | 58.34 | PASS |
| MaxCut | 32 | 64 | 6 | 1,574 | 3.58 | 61.31 | PASS |
| MaxCut | 128 | 256 | 8 | 7,654 | 97.92 | 86.39 | PASS |
| MaxCut | 256 | 512 | 9 | 16,614 | 575.73 | 169.61 | PASS |
| Heisenberg | 2 | 3 | 2 | 38 | 0.08 | 58.12 | PASS |
| Heisenberg | 32 | 93 | 7 | 3,384 | 15.43 | 67.75 | PASS |
| Heisenberg | 128 | 381 | 9 | 16,152 | 470.81 | 171.19 | PASS |
| Heisenberg | 256 | 765 | 10 | 34,712 | 1801.03 | - | TIMEOUT |
Table 5. Representative block-encoding verification results. All instances use a tolerance of .
The implementation applies rewriting after each QSP gate application.
9.3 TASK1: Block-Encoding Verification
We evaluate 51 block-encoding benchmarks: 17 periodic Ising instances, 17 cycle MaxCut instances, and 17 open-chain Heisenberg instances. The system sizes are
Table 5 summarizes the block-encoding verification results. The verifier proves 50 of the 51 instances within the timeout. The only timeout is the largest Heisenberg instance, with and 765 Pauli terms. With an extended timeout, the verifier also completes this instance, taking 4976.42 seconds.
These results show that the verifier scales with the symbolic branch structure rather than the Hilbert-space dimension. The largest successful instance has 256 system qubits and 512 Pauli terms, far beyond the range where constructing the system matrix is possible. The timeout on the largest Heisenberg instance is consistent with the verifier's cost model: increasing the number of LCU terms increases the number of symbolic branches and Pauli expressions that must be simplified.
In addition, we used our verifier to examine block encodings generated by Cobble (version 0.1.0, commit 6a6b56c) [Yuan 2026] and identified a correctness bug when the number of equally weighted Pauli terms is not a power of two. Cobble's state-preparation routine applies Hadamard gates to the selector ancillas, resulting in nonzero amplitudes for unused selector states. For example, for the two-qubit Heisenberg Hamiltonian , the generated circuit encodes instead of the expected . This demonstrates that our verifier can detect semantic errors in automatically generated block-encoding circuits.
9.4 TASK2: Hamiltonian-Simulation QSP Verification
For each Hamiltonian-simulation benchmark, the verifier symbolically executes the generated circuit and extracts the all-zero branch polynomial . It then applies the polynomial approximation checker from Section 7: the checker infers the normalization factor on the Chebyshev-root grid and accepts only if at every grid point. By Theorem 7.1, this finite check certifies .
| τ | εQSP | d | Gates | Grid pts. | Time (s) | RSS (MiB) | Result |
|---|---|---|---|---|---|---|---|
| 0.1 | 3 | 113 | 52 | 0.40 | 64.28 | PASS | |
| 1.0 | 7 | 233 | 60 | 0.59 | 62.94 | PASS | |
| 4.0 | 11 | 353 | 76 | 0.43 | 64.23 | PASS | |
| 10.0 | 21 | 653 | 108 | 0.62 | 64.67 | PASS | |
| 20.0 | 35 | 1,073 | 160 | 1.01 | 65.34 | PASS | |
| 50.0 | 77 | 2,333 | 324 | 3.07 | 66.55 | PASS | |
| 0.5 | 3 | 113 | 28 | 0.35 | 63.61 | PASS | |
| 0.5 | 5 | 173 | 56 | 0.36 | 63.66 | PASS | |
| 0.5 | 7 | 233 | 92 | 0.44 | 63.95 | PASS | |
| 0.5 | 11 | 353 | 128 | 0.44 | 64.59 | PASS |
Table 6. Representative TASK2 results. The upper group varies effective simulation time at fixed ; the lower group varies the standalone QSP tolerance at fixed .
Table 6 summarizes both TASK2 sweeps. All 38 time-sweep circuits and all 12 tolerance-sweep circuits pass the approximation checker, certifying the corresponding full-interval bounds from Section 7. At fixed , the QSP degree increases from 3 to 77 as increases from 0.1 to 50, while verification time increases from 0.40 to 3.07 seconds. At fixed , all circuits pass as the requested tolerance decreases from to . The largest degree-77 case spends 3.04 seconds in symbolic execution and polynomial extraction, compared with approximately 0.025 seconds in the final approximation check. Symbolic processing therefore accounts for most of its runtime. Peak RSS across the 50 runs is 67.02 MiB.
Composition of verified circuits. The block encodings verified in TASK1 can be composed with the QSP wrappers verified in TASK2 following Section 8.1. Although TASK2 uses a single block-encoding ancilla, its four-block abstraction extends to multiple ancillas by lifting the all-zero projector controls.
More precisely, suppose TASK1 certifies and TASK2 certifies a polynomial satisfying . By the same triangle-inequality argument as in the proof of Theorem 8.1, the principal block of the composed circuit satisfies
For illustration, we combine the verified Ising block encoding in TASK1 with the largest-degree QSP wrapper evaluated in TASK2 (, ). With , , and , the composed circuit has an error bound below . Its nominal macro-expanded size is
gates, excluding the additional decomposition overhead for controlled oracle calls and multi-controlled projector gadgets. The verifier establishes this guarantee compositionally, without expanding the block-encoding oracle calls during QSP verification.
9.5 Sensitivity to Injected Circuit Faults
We inject representative circuit-construction faults into otherwise accepted benchmarks. For the Ising, MaxCut, and Heisenberg block encodings, replacing a SELECT CZ gate with CX or altering selector normalization produces FAIL in all 24 runs across four requested tolerances; all 12 corresponding clean runs PASS. For four QSP wrappers with , moving an oracle call or omitting the final Hadamard produces FAIL in all eight cases, while all four clean wrappers
Min Lai, Yu-Fang Chen, and Shih-Han Hung
PASS. Thus the verifier catches every injected gate, normalization, and oracle-order fault in these tests.
We also perturb PREPARE angles and QSP phases. As tightens from to , the number of rejected block-encoding mutations rises from 6/15 to 15/15. At , all four phase perturbations PASS, whereas all eight larger perturbations FAIL. These results show that fault detection is sensitive to the requested accuracy. As elsewhere in this section, FAIL means that the checker could not certify the bound.
10 Related Works
Hamiltonian-simulation and block-encoding compilers. Several recent systems provide high-level abstractions for constructing or optimizing Hamiltonian-simulation and block-encoding circuits. QBlue [Li et al. 2025] develops a verified compiler for Hamiltonian simulation, with a circuit-generation pipeline centered on Trotterization-based simulation and backend-specific synthesis. In contrast, our work targets block-encoding and QSP-based simulation, and verifies an independently given circuit rather than a particular compiler pipeline. Cobble [Yuan 2026] targets quantum computational linear algebra and provides a high-level language for programming with block-encoded matrices. It compiles mathematical expressions over block encodings into optimized quantum circuits. SimuQ [Peng et al. 2024] provides a framework for programming Hamiltonian simulation with analog compilation. Paulihedral [Li et al. 2022], 2QAN [Lao and Browne 2022], and MarQSim [Cao et al. 2025] develop compilation and optimization techniques for Hamiltonian-simulation workloads, often targeting Pauli-string-level representations and hardware-efficient implementations. These systems are complementary to ours. They focus on generating correct or efficient circuits from high-level descriptions. Our work instead addresses compiler-independent verification: given a Hamiltonian specification and an independently provided circuit, possibly produced by a compiler, optimizer, or manual construction, our verifier checks whether the circuit satisfies the intended block-encoding and QSP-level specification.
General-purpose quantum program verification. Quantum Hoare logic and its variants provide expressive proof systems for reasoning about quantum programs [Feng and Ying 2021; Liu et al. 2019; Unruh 2019; Ying 2012; Zhou et al. 2019]. These approaches can specify rich semantic properties using quantum predicates, often represented by Hermitian operators or projections. Approximate correctness has also been studied in Hoare-style frameworks, such as [Yan et al. 2024], which reasons about approximate relational properties between two quantum programs. However, they usually require substantial user guidance and are commonly implemented in interactive theorem provers such as Coq or Isabelle, or in deductive frameworks that still require manual proof effort.
Existing automated circuit-analysis tools include symbolic verifiers based on automata or SMT [Abdulla et al. 2026; Chen et al. 2023a,b, 2025, 2023c] and equivalence checkers based on ZX-calculus, path-sums, decision diagrams, or stabilizer methods [Amy 2018; Burgholzer and Wille 2020; Chen et al. 2022; Coecke and Duncan 2011; Thanos et al. 2023; Wei et al. 2022; Xu et al. 2022]. These tools typically verify state-based input-output properties or compare the implementation against another circuit. Our setting is different: the specification is an operator-level Hamiltonian, and the verifier checks that the given circuit satisfies the required block-encoding and QSP correctness conditions and approximates the target evolution within a prescribed error bound, without requiring a reference circuit for .
References
Parosh Aziz Abdulla, Yu-Fang Chen, Michal Hečko, Lukáš Holík, Ondřej Lengál, Jyun-Ao Lin, and Ramanathan S. Thinniyam. 2026. Parameterized Verification of Quantum Circuits. Proc. ACM Program. Lang. 10, POPL, Article 70 (Jan. 2026), 30 pages. https://doi.org/10.1145/3776712
Matthew Amy. 2018. Towards Large-scale Functional Verification of Universal Quantum Circuits. In Proceedings 15th International Conference on Quantum Physics and Logic, QPL 2018, Halifax, Canada, 3-7th June 2018 (EPTCS, Vol. 287), Peter Selinger and Giulio Chiribella (Eds.). 1–21. https://doi.org/10.4204/EPTCS.287.1
Len Bos and Marco Vianello. 2012. Low cardinality admissible meshes on quadrangles, triangles and disks. Math. Inequal. Appl 15, 1 (2012), 229–235. https://doi.org/10.7153/mia-15-19
Lukas Burgholzer and Robert Wille. 2020. Advanced equivalence checking for quantum circuits. IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems 40, 9 (2020), 1810–1824. https://doi.org/10.1109/TCAD.2020.3032630
Xiuqi Cao, Junyu Zhou, Yuhao Liu, Yunong Shi, and Gushu Li. 2025. Marqsim: Reconciling determinism and randomness in compiler optimization for quantum simulation. Proceedings of the ACM on Programming Languages 9, PLDI (2025), 576–600.
Tian-Fu Chen, Jie-Hong R. Jiang, and Min-Hsiu Hsieh. 2022. Partial Equivalence Checking of Quantum Circuits. In IEEE International Conference on Quantum Computing and Engineering, QCE 2022, Broomfield, CO, USA, September 18-23, 2022. IEEE, 594–604. https://doi.org/10.1109/QCE53715.2022.00082
Yu-Fang Chen, Kai-Min Chung, Ondrej Lengál, Jyun-Ao Lin, and Wei-Lun Tsai. 2023a. AutoQ: An Automata-Based Quantum Circuit Verifier. In Computer Aided Verification - 35th International Conference, CAV 2023, Paris, France, July 17-22, 2023, Proceedings, Part III (Lecture Notes in Computer Science, Vol. 13966), Constantin Enea and Akash Lal (Eds.). Springer, 139–153. https://doi.org/10.1007/978-3-031-37709-9_7
Yu-Fang Chen, Kai-Min Chung, Ondrej Lengál, Jyun-Ao Lin, Wei-Lun Tsai, and Di-De Yen. 2023b. An Automata-Based Framework for Verification and Bug Hunting in Quantum Circuits. Proc. ACM Program. Lang. 7, PLDI (2023), 1218–1243. https://doi.org/10.1145/3591270
Yu-Fang Chen, Kai-Min Chung, Min-Hsiu Hsieh, Wei-Jia Huang, Ondrej Lengál, Jyun-Ao Lin, and Wei-Lun Tsai. 2025. AutoQ 2.0: From Verification of Quantum Circuits to Verification of Quantum Programs. In TACAS 2025. Springer, 87–108.
Yu-Fang Chen, Philipp Rümmer, and Wei-Lun Tsai. 2023c. A Theory of Cartesian Arrays (with Applications in Quantum Circuit Verification). In International Conference on Automated Deduction. Springer, 170–189.
Andrew M. Childs, Yuan Su, Minh C. Tran, Nathan Wiebe, and Shuchen Zhu. 2021. Theory of Trotter Error with Commutator Scaling. Phys. Rev. X 11 (Feb 2021), 011020. Issue 1. https://doi.org/10.1103/PhysRevX.11.011020
Andrew M. Childs and Nathan Wiebe. 2012. Hamiltonian Simulation Using Linear Combinations of Unitary Operations. 12 (2012), 901–924. Issue 11&12. https://doi.org/10.26421/QIC12.11-12-1
Bob Coecke and Ross Duncan. 2011. Interacting quantum observables: categorical algebra and diagrammatics. New Journal of Physics 13, 4 (apr 2011), 043016. https://doi.org/10.1088/1367-2630/13/4/043016
Christopher M. Dawson and Michael A. Nielsen. 2006. The Solovay-Kitaev algorithm. Quantum Info. Comput. 6, 1 (Jan. 2006), 81–95.
H. Ehlich and K. Zeller. 1964. Schwankung von Polynomen Zwischen Gitterpunkten. Mathematische Zeitschrift 86, 1 (Feb. 1964), 41–44. https://doi.org/10.1007/BF01111276
Yuan Feng and Mingsheng Ying. 2021. Quantum Hoare logic with classical variables. ACM Transactions on Quantum Computing 2, 4 (2021), 1–43. https://doi.org/10.1145/3456877
Richard P. Feynman. 1982. Simulating Physics with Computers. International Journal of Theoretical Physics 21, 6 (June 1982), 467–488. https://doi.org/10.1007/BF02650179
András Gilyén, Yuan Su, Guang Hao Low, and Nathan Wiebe. 2019. Quantum singular value transformation and beyond: exponential improvements for quantum matrix arithmetics. In Proceedings of the 51st Annual ACM SIGACT Symposium on Theory of Computing (Phoenix, AZ, USA) (STOC 2019). Association for Computing Machinery, New York, NY, USA, 193–204. https://doi.org/10.1145/3313276.3316366
Wei-Jia Huang, Christophe Chareton, Yu-Fang Chen, Kai-Min Chung, Min-Hsiu Hsieh, Alfons Laarman, and Jingyi Mei. 2026. Equivalence Checking of Quantum Circuits via Path-Sum and Weighted Model Counting. arXiv e-prints (2026), arXiv-2604.
Lingling Lao and Dan E Browne. 2022. 2qan: A quantum compiler for 2-local qubit hamiltonian simulation algorithms. In Proceedings of the 49th Annual International Symposium on Computer Architecture. 351–365.
Gushu Li, Anbang Wu, Yunong Shi, Ali Javadi-Abhari, Yufei Ding, and Yuan Xie. 2022. Paulihedral: a generalized block-wise compiler optimization framework for quantum simulation kernels. In Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems. 554–569.
Liyi Li, Fenfen An, Federico Zahariev, Zhi Xiang Chong, Amr Sabry, and Mark S Gordon. 2025. A Verified Compiler for Quantum Simulation. arXiv preprint arXiv:2509.18583 (2025).
Junyi Liu, Bohua Zhan, Shuling Wang, Shenggang Ying, Tao Liu, Yangjia Li, Mingsheng Ying, and Naijun Zhan. 2019. Formal verification of quantum algorithms using quantum Hoare logic. In International conference on computer aided verification. Springer, 187–207. https://doi.org/10.1007/978-3-030-25543-5_12
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Seth Lloyd. 1996. Universal Quantum Simulators. Science 273, 5278 (1996), 1073–1078. https://doi.org/10.1126/science.273.5278.1073 arXiv:https://www.science.org/doi/pdf/10.1126/science.273.5278.1073
Guang Hao Low and Isaac L. Chuang. 2017. Optimal Hamiltonian Simulation by Quantum Signal Processing. Phys. Rev. Lett. 118 (Jan 2017), 010501. Issue 1. https://doi.org/10.1103/PhysRevLett.118.010501
Guang Hao Low and Isaac L. Chuang. 2019. Hamiltonian Simulation by Qubitization. Quantum 3 (July 2019), 163. https://doi.org/10.22331/q-2019-07-12-163
John M. Martyn, Zane M. Rossi, Andrew K. Tan, and Isaac L. Chuang. 2021. Grand Unification of Quantum Algorithms. PRX Quantum 2 (Dec 2021), 040203. Issue 4. https://doi.org/10.1103/PRXQuantum.2.040203
Michael A. Nielsen and Isaac L. Chuang. 2010. Quantum Computation and Quantum Information: 10th Anniversary Edition. Cambridge University Press.
Yuxiang Peng, Jacob Young, Pengyu Liu, and Xiaodi Wu. 2024. SimuQ: A framework for programming quantum Hamiltonian simulation with analog compilation. Proceedings of the ACM on Programming Languages 8, POPL (2024), 2425–2455.
Dimitrios Thanos, Tim Coopmans, and Alfons Laarman. 2023. Fast Equivalence Checking of Quantum Circuits of Clifford Gates. In Automated Technology for Verification and Analysis - 21st International Symposium, ATVA 2023, Singapore, October 24-27, 2023, Proceedings, Part II (Lecture Notes in Computer Science, Vol. 14216), Étienne André and Jun Sun (Eds.). Springer, 199–216. https://doi.org/10.1007/978-3-031-45332-8_10
Dominique Unruh. 2019. Quantum Hoare logic with ghost variables. In 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). IEEE, 1–13. https://doi.org/10.1109/LICS.2019.8785779
Chun-Yu Wei, Yuan-Hung Tsai, Chiao-Shan Jhang, and Jie-Hong R. Jiang. 2022. Accurate BDD-based unitary operator manipulation for scalable and robust quantum circuit verification. In DAC '22: 59th ACM/IEEE Design Automation Conference, San Francisco, California, USA, July 10 - 14, 2022, Rob Oshana (Ed.). ACM, 523–528. https://doi.org/10.1145/3489517.3530481
Mingkuan Xu, Zikun Li, Oded Padon, Sina Lin, Jessica Pointing, Auguste Hirth, Henry Ma, Jens Palsberg, Alex Aiken, Umut A Acar, et al. 2022. Quartz: superoptimization of Quantum circuits. In Proceedings of the 43rd ACM SIGPLAN International Conference on Programming Language Design and Implementation. 625–640. https://doi.org/10.1145/3519939.3523433
Peng Yan, Hanru Jiang, and Nengkun Yu. 2024. Approximate relational reasoning for quantum programs. In International Conference on Computer Aided Verification. Springer, 495–519.
Mingsheng Ying. 2012. Floyd-Hoare logic for quantum programs. ACM Transactions on Programming Languages and Systems (TOPLAS) 33, 6 (2012), 1–49. https://doi.org/10.1145/2049706.2049708
Charles Yuan. 2026. Cobble: Compiling block encodings for quantum computational linear algebra. Proceedings of the ACM on Programming Languages 10, PLDI (2026), 200–225.
Li Zhou, Nengkun Yu, and Mingsheng Ying. 2019. An applied quantum Hoare logic. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation. 1149–1162. https://doi.org/10.1145/3314221.3314584
A Optimized QSP Circuit Construction for Hamiltonian Simulation
This appendix describes the optimized QSP circuit construction used to generate the TASK2 Hamiltonian-simulation benchmarks. The purpose of this construction is to produce a nontrivial optimized circuit-generation workflow whose output can be independently checked by the verifier. The construction itself is not trusted: the verifier symbolically executes the emitted QASM circuit and checks the polynomial implemented by the all-zero branch.
Cosine-sine decomposition. The Hamiltonian-simulation target on the normalized signal variable is
The generator synthesizes the cosine and sine components separately. This matches the parity structure of standard QSP responses: an even-degree response contains only even powers of x, while an odd-degree response contains only odd powers of x. Thus the cosine component is synthesized as an even polynomial, and the sine component is synthesized as an odd polynomial.
For each effective simulation time , PYQSP is used only as an untrusted source of benchmark phase sequences and polynomial data. It produces bounded Chebyshev approximations
The factor 1/2 is the bounded-synthesis scaling used in the generated benchmark data. It is accounted for in the final normalization step.
Sharing one QSP skeleton. A direct implementation would emit two independent QSP circuits: one for and one for . This is simple but duplicates the alternating sequence of and calls. The optimized construction avoids this duplication by using a selector qubit to multiplex the two phase sequences over a shared QSP skeleton.
Let and denote the projector phases used at layer for the cosine and sine QSP sequences, respectively. The circuit applies the cosine projector phase by default. On the sine branch, it applies the controlled phase difference
Therefore the effective phase is on the cosine branch and on the sine branch. Hence the two selector branches implement the cosine and sine QSP sequences while sharing the same positions of and calls. If the sine degree is one larger than the cosine degree, the generator appends one final sine-only block on the sine branch.
Phase-convention conversion. The phase sequence returned by PYQSP cannot be inserted directly as QASM rotations, because PYQSP and our block-encoding QSVT circuit use different scalar signal conventions. In the PYQSP convention, the scalar signal unitary is
Our block-encoding QSVT circuit instead corresponds to
These conventions differ only by fixed Z-axis phase shifts. The generator absorbs these fixed shifts into the neighboring projector phases before emitting QASM.
Min Lai, Yu-Fang Chen, and Shih-Han Hung
Given PYQSP phases , the generator converts them to projector phases by setting and for . The final phase depends on the component:
for the even cosine component, for the odd sine component.
A projector phase is emitted in QASM as . This conversion is part of the benchmark generator only; the verifier does not assume that it is correct.
Extracting the polynomial response. Under the above convention, the selected raw QSP response contains the desired polynomial in its imaginary part. For , the raw selected branch has the form
where denotes the remaining real component. The polynomial that should be combined by the outer LCU is , not the whole raw response. The generator therefore inserts a constant-size signed phase gadget that forms
After this step, the cosine branch exposes , and the sine branch exposes .
LCU combination and normalization. The extracted cosine and sine polynomials are combined by a two-term LCU. The outer selector prepares an equal superposition of the cosine and sine branches, assigns the coefficient -i to the sine branch, and then unprepares the selector. Projecting back to the all-zero selector branch yields
The prefactor 1/2 is the success amplitude of the two-term LCU: one factor comes from preparing the selector superposition, and another factor comes from unpreparing it.
Since the synthesized QSP polynomials are themselves half-scaled,
the all-zero branch satisfies
Thus the generated circuit implements the desired Hamiltonian-simulation function up to the known scaling factor 1/4. The verifier infers a scaling factor from the extracted branch. For these benchmarks, the inferred value is close to 4, as expected from the construction, and the verifier checks