Manuscript Offprint
arXiv:2610.29053Symmetry-Oriented Testing Framework for Variational Quantum Algorithms
Masaomi Yamaguchi
Fujitsu Limited
Kawasaki, Kanagawa, Japan
The University of Electro-Communications
Chofu, Tokyo, Japan
Fuyuki Ishikawa
National Institute of Informatics
Chiyoda-ku, Tokyo, Japan
Abstract—Testing quantum software is challenging because quantum states cannot be directly inspected. Variational quantum algorithms (VQAs) are a particularly important target as they are among the most promising approaches for near-term noisy quantum hardware. Many testing methods rely on classically computed results, which conflicts with the regime where quantum advantage is expected. Although prior studies mitigate this oracle problem, the core difficulty remains that existing approaches do not verify whether the execution deviates from the intended problem or whether the obtained solution is physically plausible.
We propose a symmetry-oriented testing framework for VQAs that addresses this gap by using operators commuting with the target Hamiltonian as test specifications. The framework provides two complementary diagnostics: a commutator-based health check that monitors whether each execution step during optimization remains consistent with the symmetry of the target Hamiltonian, and a variance-based acceptance check that assesses the converged solution by examining whether the state is an eigenstate of the symmetry operators. Both diagnostics derive from the problem structure and do not require the exact solution.
We evaluate the framework on representative user- and system-side faults, across multiple target systems, and under injected noise. Results show that the two diagnostics detect faulty behavior, provide informative signals of solution quality, and remain useful under noisy execution.
Index Terms—Quantum computing, Variational quantum algorithms, Software testing, Fault detection, Symmetry
I. INTRODUCTION
Quantum computing is expected to support important applications such as database search, optimization, chemistry simulation, and machine learning . As these applications move toward regimes where quantum computers are expected to outperform classical computers, an increasingly important question is how to validate the plausibility of the obtained solution. Among the available validation techniques, testing remains attractive because of its comparatively low cost and its compatibility with practical development workflows. However, testing quantum software is inherently difficult because the expected behavior of a program is encoded in a quantum state that cannot be directly inspected.
Variational quantum algorithms (VQAs) are a particularly important target for testing methods because they are among the most promising approaches for current noisy quantum hardware and may also serve as a route toward practical quantum advantage [4]. At the same time, a VQA can produce an incorrect result for many reasons, including noise, compiler defects, user-side implementation mistakes, insufficient ansatz expressiveness, and convergence to poor local optima.
The central challenge is the test oracle [5]. Many existing approaches assume that the correct output is already available, for example through an analytical solution or a classical simulator. This assumption breaks down in the regime where quantum advantage is expected, because the correct solution cannot be obtained classically. Alternative approaches reduce this dependence by, for example, checking selected state properties through assertions [6], [7], generating tests based on coverage criteria [8] or verifying user-specified invariants [9], [10], or comparing related executions to detect platform-level defects [11], [12]. These methods are effective for their respective purposes, but assessing the behavior at each execution step during optimization and the converged solution still requires detailed knowledge of the expected states at the relevant program points.
To address this challenge, we propose a symmetry-oriented testing framework (abbreviated as SOT Framework) for VQAs. The key idea is to use symmetries of the target Hamiltonian as test specifications, represented by operators that commute with the target Hamiltonian. The framework provides two complementary diagnostics: a commutator-based health check that monitors whether each execution step during optimization remains consistent with the symmetry of the target Hamiltonian, and a variance-based acceptance check that assesses the converged solution by examining whether the state is an eigenstate of the symmetry operators. Both diagnostics derive from the problem structure and do not require the exact solution.
To evaluate the proposed framework, we study the following research questions:
• RQ1: Can the proposed framework provide useful fault-detection signals for concrete fault scenarios in VQA workflows without relying on the exact solution as a test oracle?
• RQ2: Does the proposed acceptance check show a meaningful correlation with solution quality across diverse target systems?
© 2026 IEEE. Personal use of this material is permitted. Permission from IEEE must be obtained for all other uses, in any current or future media, including reprinting/republishing this material for advertising or promotional purposes, creating new collective works, for resale or redistribution to servers or lists, or reuse of any copyrighted component of this work in other works.
• RQ3: Can the proposed acceptance check serve as a practical filter for low-quality VQA outcomes?
• RQ4: Can the proposed framework provide useful diagnostic signals under noisy execution conditions?
The main contributions of this paper are as follows:
• We propose a symmetry-oriented testing framework for VQAs that uses symmetry of the target Hamiltonian as test specifications, enabling oracle-free testing of VQA workflows.
• We instantiate the framework as two complementary diagnostics: a commutator-based health check for each execution step during optimization and a variance-based acceptance check for the converged solution.
• We provide a comprehensive empirical evaluation of the proposed framework across multiple fault scenarios, correlation analyses between the acceptance check and solution quality, diverse target systems, and noisy execution conditions.
A. Basics of quantum computing
The basic unit of quantum computation is the qubit, whose pure state is a unit vector up to a global phase in . With computational-basis states and , any pure state can be written as with and . We write for the Hermitian conjugate of . The state of qubits is a unit vector up to a global phase in , and is omitted when clear.
A quantum circuit is a sequence of unitary operators (quantum gates) acting on quantum states; applying a gate to yields . The single-qubit Pauli operators are
Fig. 1 shows an example circuit. Here, and , where is the identity operator. We also use , , , , and .
The state produced by a circuit is not observed directly. Instead, information is obtained by projective measurement of a Hermitian observable . Writing its spectral decomposition as , outcome occurs with probability , and the post-measurement state is . Because measurement is probabilistic, the circuit is executed repeatedly to estimate the expectation value:
As is common in quantum computing, we assume that only Z can be measured directly on each qubit. A general observable M is estimated through its Pauli decomposition , where each is a Pauli string: a tensor product of I, X, Y, and Z. By linearity, it suffices to estimate each separately. For , we apply H to qubit j when and when , so that

Fig. 1. An example circuit consisting of and CX layers.
the product of the resulting Z-measurement outcomes over the non-identity factors has expectation value .
For an observable M, the variance on is
(3)
and is estimated from the Pauli decompositions of M and .
B. Variational Quantum Algorithms
Variational quantum algorithms are hybrid quantum-classical procedures that optimize the parameters of a quantum circuit according to an objective function [4], [13]. In this paper, we consider the common setting in which the objective is the expectation value of a Hamiltonian H.
The goal is to obtain the lowest eigenvalue of , called the ground-state energy, and its corresponding ground state. An eigenvalue is nondegenerate when the corresponding eigenstate is unique up to a global phase. The variational principle guarantees for any normalized state , so minimizing approximates .
Let be a parameterized circuit with parameter vector , and let be an initial state. The state is the variational state, and is often called an ansatz. Figure 1 shows an example. A VQA alternates between estimating on a quantum device and updating with a classical optimizer to approximate .
III. RELATED WORK
In quantum software testing, it is common to test programs on instances small enough for the expected output to be computed classically and used as a test oracle. This strategy becomes less practical in the regime where quantum computers are expected to provide an advantage and exact classical solutions become intractable as test oracles.
One direction is to check selected properties of the quantum state rather than the full output. Statistical assertions test whether the quantum state at a given program point satisfies a tester-specified property via statistical tests on measurement outcomes [6]. To avoid destroying the state by measurement, subsequent work introduced non-destructive runtime assertions using auxiliary qubits [14], [15]. Li et al. formulated assertions as projection operators whose eigenstates correspond to the expected state [7]. Property-based testing methods [9], [16] let the tester declare expected output properties and verify them statistically over random inputs. QOPS reduces the specification burden by asking for the expected measurement-outcome distribution of one Pauli string per commuting family, deriving test oracles for all other strings in the family [10]. Applying any of these methods to assess VQA solution quality or to verify whether the execution remains consistent with the intended problem during optimization would require detailed knowledge of the expected states at the relevant program points. In VQA workflows, however, no such specification is available: the expected states during optimization are not known in advance, and the converged solution is precisely what the algorithm is trying to find.
A separate line of work reduces oracle dependence through automated test generation. Coverage-guided methods such as Quito [8] generate test inputs that maximize structural coverage of the quantum circuit, while search-based methods such as QuSBT [17], [18] use metaheuristic search to find inputs likely to expose failures. These methods are valuable for revealing faults without a complete reference output, but they target general quantum programs rather than VQA workflows specifically and do not provide a mechanism for assessing the quality of a converged VQA solution.
Another direction is to avoid specifying expected outputs altogether by comparing related executions. QDiff generates semantically equivalent circuit variants and compares their measurement-outcome distributions [11], while MorphQ and MorphQ++ apply metamorphic transformations such as qubit reordering and null-effect insertions to check whether software stacks preserve circuit semantics [12], [19]. Because these methods require no knowledge of the correct answer, they are effective for detecting platform-level defects without a classical reference. However, their diagnostic target is infrastructure correctness: related executions can remain mutually consistent even when the execution deviates from the intended problem or the obtained solution is not physically plausible.
IV. MOTIVATING EXAMPLE
As a motivating example, we consider a variational quantum eigensolver (VQE) workflow for estimating the ground-state energy of the molecule. The molecular geometry is with the STO-3G basis, and we consider an active-space reduction with two electrons in two spatial orbitals. The resulting electronic-structure problem is mapped to a four-qubit Hamiltonian by the Jordan-Wigner transformation. Let denote the mapped molecular Hamiltonian and let be the parameterized trial state prepared by the hardware-efficient ansatz shown in Fig. 1. The VQE task is to minimize the energy expectation value through repeated quantum measurements and classical parameter updates. The target Hamiltonian is:
Now suppose that, due to a user mistake or an implementation bug, an additional term is introduced into the Hamiltonian,

Fig. 2. VQE convergence traces for the clean and buggy Hamiltonians in the motivating example. The clean run optimizes the intended Hamiltonian H, while the buggy run optimizes .
and the VQE is executed with a buggy Hamiltonian . As shown in Fig. 2, the optimization can still appear to converge normally. Nevertheless, the obtained solution is no longer physically plausible for the intended problem. This kind of failure is difficult to detect from the objective value alone, because apparent numerical convergence does not ensure that the obtained solution remains valid for the intended problem.
This example also clarifies why existing approaches are insufficient in this setting. If the correct solution were readily available, the bug could be detected by direct comparison, but such a reference cannot be obtained or verified classically in the regime where quantum advantage is expected. Assertion-based and property-based approaches would require detailed knowledge of the expected states, but the expected states during optimization are not known in advance, and the converged state is precisely what the algorithm is trying to find, so such knowledge cannot be specified in advance. Moreover, the execution infrastructure itself is functioning correctly, so approaches that compare related executions would not flag this apparently successful run. The core difficulty is that existing approaches do not verify whether the execution deviates from the intended problem or whether the obtained solution is physically plausible, which motivates a testing approach based on the problem structure itself.
V. PROPOSED METHOD
We describe the proposed method using the buggy-Hamiltonian case in Section IV as a running example.
A. Overview
The proposed method uses one or more operators A satisfying as test specifications for the intended Hamiltonian H, where and are expressed as linear combinations of Pauli strings with real coefficients and . In quantum chemistry, particle number and total spin are natural choices because they are conserved in molecular systems: the corresponding operators commute with the molecular Hamiltonian, and their operator
Fig. 3. Four-qubit Pauli decompositions of the particle-number operator N and the total-spin operator used in the example.
Require: Hamiltonian H; operator A with ; parameterized circuit ; initial parameters ; optimizer ; thresholds
Ensure: converged parameters ; converged objective value ; health-check record ; acceptance result
1: Initialize and
2: repeat
3: Prepare
4: Estimate the objective value
5: Evaluate
6:
7: Update using
8: until the optimizer converges
9:
10: Let
11: Evaluate and
Fig. 4. Overall workflow of the proposed symmetry-oriented testing method for a VQA. When multiple symmetry operators are available, the health and acceptance checks are applied independently to each operator.
representations are known from the problem formulation. In the example of Section IV, we use the particle-number operator N and the total-spin operator , shown in Fig. 3.
Using such operators, the proposed method validates a VQA through two complementary checks. The first is a health check (HC), which monitors whether each execution step during optimization remains consistent with the symmetry of the intended Hamiltonian. The second is an acceptance check (AC), which assesses the converged solution by examining whether the state is an eigenstate of the symmetry operators. Each check provides a necessary condition for consistency with the intended problem.
Figure 4 summarizes the overall workflow. At each optimization step, the health check is evaluated on the current state and the result is recorded (lines 5–6). After the optimizer converges, the acceptance check is evaluated on the converged state (line 11). When multiple symmetry operators are available, both checks are applied independently to each operator. We explain the two checks in turn below.
B. Health Check During Optimization
Let be the parameterized quantum circuit used in the VQA, and let

Fig. 5. values for the clean and buggy runs in the motivating example across optimization iterations.
where is the initial state. If the intended Hamiltonian commutes with the chosen operator , then for any state ,
When the executed workflow deviates from the intended problem, the estimated value can depart from zero. We therefore define the health check at parameter by
where the two terms are estimated separately through their Pauli decompositions:
In an ideal execution, vanishes for every parameter visited during optimization. In practice, however, finite-shot estimation and hardware noise can make this quantity nonzero, so the optimization is judged acceptable at parameter when for a small threshold . Here, is chosen either as a statistically reasonable tolerance or by the user.
The motivating example illustrates this role. Since the intended Hamiltonian H commutes with both N and , the check can be applied to both operators. Figure 5 shows that, under the buggy Hamiltonian , the trace clearly departs from the clean-run behavior, reaching values above 0.2. Since this example is evaluated on a simulator without hardware noise, this departure is too large to be plausibly explained by sampling noise alone. This indicates that the health check provides a practical basis for judging that the run is buggy, even when the objective alone appears well behaved.
C. Acceptance Check for the Converged Solution
The health check does not by itself guarantee that the converged solution is acceptable, so we also examine it directly through the variance of the symmetry operator.
We apply this check when the converged state is expected to also be an eigenstate of A. One sufficient condition is that the target eigenvalue of H be nondegenerate. Let be an eigenstate of H with a nondegenerate eigenvalue E, so that
Because A commutes with H, we have
Hence is also an eigenvector of with the same eigenvalue. By nondegeneracy, it must be proportional to :
for some real scalar a, so the target state is also an eigenstate of A.
In quantum chemistry, nondegeneracy of the target eigenvalue is often known in advance from theory. For example, the ground state of a closed-shell molecule is commonly known to be nondegenerate.
If is an eigenstate of A, repeated measurements of A always return the same value, so the variance is zero. Conversely, a nonzero variance indicates that the state is not an eigenstate of A. We therefore use the variance of A as the acceptance quantity for the converged state, defined as
Using the Pauli decomposition of A, the two terms can be expanded as
In an ideal case, vanishes when the converged state is an eigenstate of A. In practice, finite-shot estimation and hardware noise can make this quantity nonzero, so we accept the converged solution when for a small threshold . Here, is chosen either as a statistically reasonable tolerance or by the user. When hardware noise is absent, a practical way to set is from the standard error:
where and are the standard errors due to sampling noise in the estimates of and , respectively. A simple practical choice is , which covers about 99.7% of the sampling fluctuations under the usual Gaussian approximation.
Returning to the motivating example, because is a closed-shell molecule, its ground-state energy is nondegenerate. The target state is therefore expected to be an eigenstate of both and , so the acceptance check is applicable to both operators. On a simulator without hardware noise and with 10,000 shots, the clean run remains within the acceptable range, with for and for . By contrast, the buggy run gives for , far beyond the threshold ( ). Thus, even though the buggy run appears to converge, the acceptance check reveals that the converged solution is no longer physically plausible for the intended Hamiltonian.
VI. EVALUATION
We evaluate the proposed framework through four experiment groups corresponding to the research questions in Section I. Across these experiments, we apply the two diagnostics introduced in Section V, the health check and the acceptance check, to VQA workflows. When the exact ground-state energy is reported, it is obtained by exact diagonalization of the target Hamiltonian and is used only for post hoc analysis, not as a test oracle in the proposed framework. Energy values and energy differences are reported in Hartree. All experiments are conducted on a simulator using Qiskit 2.3.0 and qiskit-aer 0.17.2 [20]. Experimental code development supporting this section used Anthropic's Claude [21] and OpenAI's Codex [22].
A. RQ1: Can the Proposed Framework Provide Useful Fault-Detection Signals for Concrete Fault Scenarios in VQA Workflows Without Relying on the Exact Solution as a Test Oracle?
This experiment applies the proposed framework to the instance in Section IV and several other injected faults without access to the correct answer as a test oracle. The results also help clarify how the proposed framework differs from relation-based testing [11], [12], [19], which also do not require the correct answer. We do not include assertion-based or property-based testing, because using them to assess solution quality or to verify whether each execution step during optimization remains consistent with the intended problem would require detailed knowledge of the expected states at the relevant program points.
- Setup: The RQ1 experiments use the same instance as in Section IV, with the four-qubit Hamiltonian H in Eq. (4) and the operators N and shown in Fig. 3.
For both the clean run and the buggy runs, we use the same hardware-efficient ansatz as in Fig. 1. Following standard VQA practice, each configuration is optimized from 50 initial points drawn uniformly from with COBYLA for at most 200 iterations, and we report only the run with the lowest final energy. Expectation values are estimated by Pauliterm decomposition with 10,000 shots. To better approximate practical execution, the variational circuit and the measurement circuits are transpiled to the native gate set .
For the health check, we report the maximum across all execution steps during optimization; for the acceptance check, we evaluate at convergence using the threshold from Section V-C.
Under this common setup, the only difference lies in the injected fault. Table I summarizes the six faults used in RQ1, which span a broad range of levels, together with possible sources of each fault.
TABLE I INJECTED FAULTS USED IN RQ1.
| Fault | Possible Source(s) | Description |
|---|---|---|
| Stuck-zero readout | Hardware / Middleware | All measurement outcomes are fixed to the all-zero bitstring. |
| Shifted wiring | Compiler / Middleware | Each non-identity Pauli factor is cyclically shifted to the next qubit before basis-change insertion and measurement. |
| Randomized basis | Compiler / Middleware | When constructing the measurement circuit for a Pauli term, the basis for each non-identity factor is chosen randomly from . |
| Wrong term weights | Compiler / Middleware | In the Pauli decomposition , all coefficients are replaced with 1. |
| Wrong Hamiltonian | Compiler / User | Optimization is performed on YYII instead of the intended Hamiltonian (same fault as in Section IV). |
| Underexpressive ansatz | User | The ansatz is restricted to two parameterized gates on and , followed by CZ gates from to each of the remaining qubits. |
- Results and Answer to RQ1: Table II summarizes the results. The clean run provides the reference point: its exact-energy gap meets the criterion for chemical accuracy, its health-check values during optimization are small, and its acceptance-check values at convergence remain within the threshold. This is the expected behavior.
Platform-level faults, including Stuck-zero readout, Shifted wiring, Randomized basis, and Wrong term weights, exhibit different combinations of health-check and acceptance-check responses. Randomized basis is the clearest case: rises from in the clean run to 1.18, and from to , values far too large to be explained by finite-shot fluctuations, and the converged state also exceeds the acceptance threshold for both N and . Wrong term weights also shows health-check values exceeding 0.1, too large to be attributed to finite-shot fluctuations, and both converged acceptance checks exceed the threshold. Shifted wiring shows milder health-check values during optimization but the converged still exceeds the threshold. Stuck-zero readout is distinctive in a different way. Both and collapse to and 0, values too close to zero to be plausible under finite-shot sampling. The converged AC values are also clearly abnormal: because every shot returns the all-zero bitstring, the estimated standard errors collapse to zero, yielding formally infinite z-scores. Taken together, these platform-level cases show that the two diagnostics respond differently across fault types, and are also natural targets for existing relation-based tests because they disturb the behavior of related executions.
Wrong Hamiltonian is especially important because it is not a platform-level fault. As shown in Table II, the obtained energy falls well below the exact ground-state energy; nonetheless, the convergence of the objective function alone does not reveal this fault (Fig. 2). The proposed framework, however, shows that the resulting run is clearly abnormal for the intended problem: exceeds 0.2, too large to be attributed to finite-shot fluctuations, and the converged exceeds the threshold decisively. Existing relation-based tests would not necessarily detect this mismatch, because these tests diagnose infrastructure correctness by comparing related executions, and the execution infrastructure itself functions correctly here.
Underexpressive ansatz highlights a related but distinct issue. As shown in Table II, the converged energy remains far above the exact ground-state energy since the ansatz is too restrictive to represent a plausible solution. Because this is not a fault in the execution flow itself, the health-check values during optimization remain close to zero. The acceptance check, however, reveals the problem: both and exceed the threshold at convergence, indicating that the converged solution is not physically plausible for the intended problem. Existing relation-based tests would also not expose this issue for the same reason: the execution infrastructure itself functions correctly.
Answer to RQ1: Yes. The proposed framework provides useful fault-detection signals across a broad range of concrete fault scenarios without using the exact solution as a test oracle. Across the platform-level faults, problematic runs are exposed through the health check, the acceptance check, or both, depending on the fault type. Compared with relation-based tests, the clearest advantage appears in the last two cases, which are not platform-level faults. When optimization is carried out for the wrong Hamiltonian, related executions may remain mutually consistent, yet both checks still expose the mismatch. When the ansatz design is overly restrictive, the acceptance check still reveals the problem.
B. RQ2: Does the Proposed Acceptance Check Show a Meaningful Correlation With Solution Quality Across Diverse Target Systems?
This experiment evaluates whether the proposed acceptance check correlates with solution quality across diverse target systems. For each target system, we first search for a solution as close as possible to the optimum, then perturb it to generate many nearby states and examine how the acceptance-check values change as the energy error increases.
- Setup: The targets in this experiment are , LiH, , , and a 7-qubit Z2 lattice gauge theory model. uses the same 4-qubit active-space Hamiltonian as in RQ1. LiH is treated in the same way, with a 2-electron, 2-spatial-orbital active space that also maps to 4 qubits. uses a 4-electron, 3-spatial-orbital active space (6 qubits), and uses a 4-electron, 5-spatial-orbital active space in the 6-31G basis (10 qubits). In all four molecular cases, we use the same acceptance operators N and .
As the non-molecular benchmark, we use a 7-qubit Z2 lattice gauge model on two adjacent plaquettes with open boundaries. Unlike the molecular cases, where the relevant structure is given by global symmetries, this model is char-
Chemical accuracy refers to an absolute energy error of approximately 1 kcal/mol, or about Hartree. It is a standard quality criterion in computational chemistry: energy differences computed within this tolerance are generally considered reliable for chemical predictions.
TABLE II RQ1 RESULTS FOR THE CLEAN RUN AND THE INJECTED FAULTS IN TABLE I.
| Case | Max | Max | (z value) | (z value) | |
|---|---|---|---|---|---|
| Clean run | |||||
| Stuck-zero readout | |||||
| Shifted wiring | |||||
| Randomized basis | |||||
| Wrong term weights | |||||
| Wrong Hamiltonian | |||||
| Underexpressive ansatz |
: gap from the exact energy. An entry of indicates division by zero in the corresponding -value calculation.
acterized by local gauge generators at the lattice vertices. Concretely, the six generators are
With plaquette operators
the Hamiltonian used in this experiment is
For every target system, we use the same hardware-efficient ansatz, consisting of three repeated blocks of and rotations on all qubits followed by CX gates between every pair of qubits, and a final layer of and rotations on all qubits. This yields 32, 32, 48, 80, and 56 variational parameters for , LiH, , , and Z2 LGT, respectively. This ansatz is slightly richer than the one used for in RQ1, reflecting the larger systems considered here. Optimization is performed with COBYLA for up to 3,000 iterations. For each target, we first run 1,000 optimizations from independent initial parameters and select the run with the best final energy. We then restart the optimization 1,000 times from nearby parameter settings around that run to search for reference parameters with better final energy. From those reference parameters, we generate 1,000 perturbed parameters by moving in random directions in parameter space, with distances sampled uniformly from 0.01 to 1.0. Expectation values are estimated with 10,000 shots.
For each perturbed state, we record the absolute energy error in Hartree, that is, the absolute difference from the exact ground-state energy, together with the corresponding acceptance-check values. In the molecular cases, these are and , and in the lattice gauge model they are ; in both settings, we also take their maximum.
- Results and Answer to RQ2: Table III shows the results. On , both and are positively correlated with , with Pearson correlations of 0.811 and 0.797, respectively. When they are combined as , the correlation increases to 0.857. Fig. 6 visualizes this trend.
The other molecular systems support the same overall conclusion. Both operators carry useful information about solution quality: in each system, at least one achieves a Pearson correlation above 0.78, and which one is stronger varies. Combining them is advantageous; in particular, gives the strongest correlation in , , and while remaining strongly correlated in LiH.
TABLE III RQ2 CORRELATIONS BETWEEN THE ACCEPTANCE CHECK AND SOLUTION QUALITY ACROSS TARGET SYSTEMS.
| System | Corr. with | Corr. with | Corr. with max |
|---|---|---|---|
| 0.811 | 0.797 | 0.857 | |
| LiH | 0.874 | 0.668 | 0.831 |
| 0.797 | 0.877 | 0.891 | |
| 0.783 | 0.835 | 0.837 | |
| Z2 LGT | — | — | 0.982 |
max: for the molecular cases and for the lattice gauge model.
The Z2 lattice gauge model supports the same conclusion in a different physical setting. There, has a correlation of 0.982 with . The relationship between the acceptance check and solution quality is therefore not limited to molecular Hamiltonians or to the particular symmetries N and .
Answer to RQ2: Yes. The proposed acceptance check shows a meaningful correlation with solution quality across diverse target systems. On , both and are positively correlated with , and their maximum gives the strongest correlation. The same broad tendency persists across LiH, , , and a Z2 lattice gauge model. These results show that the acceptance check provides informative signals about solution quality beyond a single benchmark or symmetry choice.
C. RQ3: Can the Proposed Acceptance Check Serve as a Practical Filter for Low-Quality VQA Outcomes?
RQ2 established that the proposed acceptance check is meaningfully correlated with solution quality. This experiment examines whether that relationship can be turned into a practical filter for low-quality outcomes in ordinary VQA runs without using the exact solution during execution. As a representative case, we study whether the converged acceptance-check values can identify poorer local optima.
- Setup: We use the same instance and the same acceptance operators N and as in RQ1. We run the VQA 1,000 times from independent initial parameters drawn uniformly from , producing a pool of converged runs with varying quality. To make poorer local optima more likely, we intentionally use a simpler hardware-efficient ansatz.


Fig. 6. Perturbation-scan results on . Each point represents one perturbed parameter set near the reference solution.
Concretely, it is the ansatz in Fig. 1 with one layer and one CX layer removed. On this 4-qubit problem, this gives 8 variational parameters, and each run is optimized with COBYLA for at most 300 iterations. Expectation values are estimated with 100,000 shots because this experiment evaluates filtering at the chemical-accuracy scale.
For each converged run, we record the absolute energy error together with . We then evaluate a two-threshold rule: defines which runs count as low quality, while is applied to to decide which runs the filter rejects. Over a grid of and values, we measure recall, that is, the fraction of low-quality runs that are correctly rejected, and false-positive rate, that is, the fraction of runs satisfying the energy criterion that are incorrectly rejected. Here ranges from to Hartree and ranges from to .
- Results and Answer to RQ3: Fig. 7 shows the results. The upper and lower panels report recall and false-positive rate, respectively, as functions of and . The row corresponding to Hartree is the chemical-accuracy setting of main interest here. Setting successfully rejects 73.7% of these runs while rejecting none of the runs that do satisfy the criterion. Lowering to makes the filter more aggressive, so recall rises to 78.2%, but a 21.4% false-positive rate also appears. Raising it to or makes the filter more conservative, keeping the false-positive rate at zero but reducing recall to 69.5% and 64.8%, respectively.
The same pattern holds at other values of . As increases, fewer runs are classified as low quality, and the acceptance threshold that gives a favorable balance between recall and false-positive rate shifts to larger values of .
Answer to RQ3: Yes. The proposed acceptance check can serve as a practical filter for low-quality VQA outcomes. On the multi-start dataset at 100,000 shots, an appropriate acceptance threshold on successfully rejects 73.7% of the runs that do not satisfy chemical accuracy while producing no false positives. These results show that the correlation established in RQ2 can be turned into a practical rule for filtering lower-quality converged solutions, including local optima.

Fig. 7. RQ3 screening heatmaps on 1,000 converged runs at 100,000 shots. The upper panel shows recall, and the lower panel shows the false-positive rate.
D. RQ4: Can the Proposed Framework Provide Useful Diagnostic Signals Under Noisy Execution Conditions?
This experiment evaluates whether the proposed framework remains informative under noisy execution conditions. Specifically, we increase the noise level and examine how the health check and the acceptance check change as the objective value degrades under noise.
-
Setup: We use the same problem instance, ansatz, and symmetry operators as in RQ1. We first identify a noiseless reference run that achieves chemical accuracy, and then replay that run under different noise levels. For each replay, we reconstruct the objective value, the health-check values, and the acceptance-check values under the given noise level using the same sequence of variational parameters as in the reference run. Each Pauli term is estimated with 10,000 shots, and we keep the same transpilation policy as in RQ1. The inserted-noise model combines depolarizing gate noise on the SX and CX gates in the transpiled circuit with readout error; to reflect the usual implementation on superconducting devices, no inserted gate noise is applied to RZ gates. The noise level is scaled from to . In the reference profile, the single-qubit gate error rate is 0.0001 on SX gates, the two-qubit gate error rate is 0.001 on CX gates, and the readout error rates are and . Note that the case still differs from the noiseless baseline because it includes sampling noise from finite shots.
-
Results and Answer to RQ4: Fig. 8 shows the results of this experiment. The left panel shows that the objective value deteriorates steadily as the inserted-noise level is increased. The gap from the exact ground-state energy grows from at to at , so the replayed run becomes progressively less accurate under stronger noise.
The acceptance check tracks this loss of accuracy clearly. As the energy error increases under noise, rises quickly and continues to grow across the higher-noise runs, with its z-score exceeding 3 from noise onward. also steadily increases. These trends show that the acceptance check is sensitive to the noise-induced increase in energy error and can therefore serve as an indicator of noise-induced degradation.
The health check remains close to zero across the noise-scaling study, consistent with its commutator-based definition: the inserted noise degrades the objective value but does not alter the Hamiltonian or its symmetry relations, and therefore does not lead to large violations of in this setting.
Answer to RQ4: Yes. The proposed framework still provides useful diagnostic signals under noisy execution. In the noise-scaling study, the energy error grows steadily as inserted noise is increased, and the acceptance check tracks this trend. This suggests that the acceptance check can serve as an indicator of noise-induced degradation of solution quality. In addition, the health check remains close to zero, indicating that noise alone does not spuriously indicate a consistency violation when the noise does not alter the underlying symmetry relations.
VII. Discussion
A. Relation to Prior Uses of Symmetry
The proposed framework uses symmetry to construct test oracles for VQAs. Prior work has used symmetry in a different role. Symmetry-preserving ansatz [23] encodes symmetry directly into the circuit so that the generated states remain within the target symmetry sector, thereby reducing the search space. The trade-off is that enforcing more symmetries often requires additional entangling gates, which can increase circuit depth and noise sensitivity on noisy intermediate-scale quantum (NISQ) hardware. The two approaches are therefore complementary: some symmetries can be built into the ansatz when the circuit cost is acceptable, whereas others can be checked through testing. Embedding symmetry into the circuit is also not itself a means of diagnosing faults.
Symmetry-adapted VQE [24] modifies the energy functional so that the optimizer minimizes the energy of the trial state projected onto the target symmetry sector rather than the energy of the full trial state; because the projection is not unitary, it is handled classically. This guides the optimization toward variational states with larger overlap with the desired symmetry subspace. Symmetry verification [25] takes a different approach: the VQE runs without modification, and after convergence the measurement results are classically postprocessed to project the converged state onto the target symmetry sector, removing symmetry-violating components and yielding an error-mitigated energy estimate.
These approaches use symmetry to recover or improve the outcome of a run, whereas the proposed framework uses symmetry to diagnose whether the run should be trusted.
B. Scope and Limitations
- Diagnostic Meaning: The proposed framework provides necessary rather than sufficient conditions for reliable VQA behavior: passing the health and acceptance checks does not guarantee that a VQA has reached the exact target state. For example, in the screening experiment in RQ3, some runs that do not satisfy chemical accuracy pass the acceptance threshold.
In practice, however, the evaluation shows that both checks are effective. In RQ1, the health check and the acceptance check together detect all six injected faults, which span diverse fault types from platform-level errors to user-side design issues. In RQ2, the acceptance check is positively correlated with energy error across several molecular systems and a Z2 lattice gauge model, and in RQ3 it rejects 73.7% of low-quality converged runs on with no false positives. In RQ4, the acceptance check tracks noise-induced loss of accuracy.
- Operator Choice and Applicability: The framework depends on choosing symmetry operators that are appropriate for the target problem. In domains such as quantum chemistry, symmetry information is already part of the physical problem description and is routinely used in algorithm design (Section VII-A). In lattice gauge theories, local gauge generators commute with the Hamiltonian by construction (Section VI-B). For other problem domains, identifying appropriate commuting operators may require domain-specific analysis.
For the acceptance check, additional care is needed only in the degenerate case. As discussed in Section V-C, when the target eigenvalue is nondegenerate, any operator commuting with the Hamiltonian can be used, because the target state is then automatically an eigenstate of it. In the degenerate case, by contrast, one must identify commuting operators for which the target state is still expected to be an eigenstate. Identifying such operators across a wider range of applications is an important research direction.
-
Validation of the Commutation Assumption: When the diagnostics report an anomaly, the framework cannot distinguish whether the cause lies in the test specification A or in the executed workflow. This is a general limitation of specification-based testing. In practice, this can be mitigated by checking algebraically before execution.
-
Measurement Cost: The main practical issue is the additional Pauli terms whose expectation values must be estimated for the health and acceptance checks. For the Hamiltonian used in this study, which consists of 15 Pauli
Objective value

Health-check values

Acceptance-check values

Fig. 8. RQ4 noisy-execution results on the H₂ VQA. The three panels show the objective value, the health-check values, and the acceptance-check values as the inserted-noise level is increased from 0× to 10×. Here, the reference 1× profile uses single-qubit gate error 0.0001 on SX gates, two-qubit gate error 0.001 on CX gates, and readout error rates and .
terms, the health and acceptance checks for N and require 9 additional terms in total. This overhead can be mitigated in several standard ways. Because commuting Pauli operators can be estimated together, Pauli grouping reduces the measurement overhead associated with these additional terms [26]. Classical-shadow methods likewise provide a way to predict many Pauli observables, with a number of measurements that grows only logarithmically with the number of Pauli observables [27]. In addition, the health check need not be applied at each execution step during optimization and can instead be monitored periodically.
C. Threats to Validity
The main validity concern is whether the reported effects depend too strongly on the particular experimental choices.
For RQ1, the main threat is that the evaluation uses artificially injected faults and therefore does not cover all faults that arise in practice. However, the injected faults were chosen to span distinct levels, from platform-level errors such as wiring and readout faults to user-side issues such as Hamiltonian specification and ansatz design, and include cases where the execution infrastructure itself functions correctly. In addition, RQ3 shows that the acceptance check is useful beyond injected-fault scenarios, serving as a practical filter for low-quality converged runs.
For the acceptance check, the main concern is how far the correlation observed in RQ2 extends beyond the target systems studied here. RQ2 provides empirical support on this point by showing that the acceptance check is useful across multiple molecular systems with different target Hamiltonians and qubit counts. The same correlation is observed in a Z2 lattice gauge model, indicating that its usefulness is not tied to a particular application domain or symmetry class. A further limitation is that the perturbation scan in RQ2 probes only the neighborhood of a single reference solution for each target system. RQ3 provides complementary evidence by showing that the acceptance check serves as a practical filter on independently converged runs at different local optima.
For noisy execution, the main threat is that RQ4 is not an ordinary noisy optimization experiment. Instead, it replays a fixed sequence of variational parameters obtained in the noiseless setting. However, this does not pose a major limitation for the proposed diagnostics themselves, because the health check verifies symmetry consistency at each execution step regardless of how the parameters were chosen, and the acceptance check depends only on the converged state. By holding the parameter sequence fixed, the experiment isolates the effect of noise from differences in the optimization path. Another threat is that RQ4 does not evaluate the effect of error-mitigation techniques [28], although the proposed diagnostics are compatible with such techniques because they are defined through expectation values.
VIII. Conclusion
In this paper, we addressed the oracle problem in testing variational quantum algorithms by proposing a symmetry-oriented testing framework. The framework uses operators that commute with the target Hamiltonian as test specifications and combines two diagnostics: a health check that verifies symmetry consistency at each execution step during optimization, and an acceptance check that examines whether the converged state is an eigenstate of the symmetry operators. This enables testing of VQA runs without requiring the exact solution as a test oracle.
The evaluation demonstrated that the two checks together detect diverse faults, from platform-level errors to user-side design issues. The acceptance check is positively correlated with solution quality across multiple molecular systems and a Z2 lattice gauge model, and can be turned into a practical filter for low-quality converged runs. Under noisy execution conditions, the acceptance check tracks noise-induced degradation of solution quality. This work takes a first step toward testing quantum software in regimes where quantum computers provide a computational advantage and exact classical solutions are unavailable as test oracles.
DATA AVAILABILITY
The implementation and experimental artifacts are available at https://doi.org/10.5281/zenodo.21405151 or https://github.com/FujitsuResearch/SOT-Framework.
ACKNOWLEDGMENT
The authors used Anthropic’s Claude [21] and OpenAI’s Codex [22] for drafting and language refinement in all sections, and for experimental code development supporting Section VI. The authors reviewed all AI-generated content and take full responsibility for the final manuscript.
REFERENCES
[1] L. K. Grover, “A fast quantum mechanical algorithm for database search,” in Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing, ser. STOC '96. New York, NY, USA: Association for Computing Machinery, 1996, p. 212–219. [Online]. Available: https://doi.org/10.1145/237814.237866
[2] P. W. Shor, “Polynomial-time algorithms for prime factorization and discrete logarithms on a quantum computer,” SIAM J. Comput., vol. 26, no. 5, p. 1484–1509, oct 1997.
[3] A. Aspuru-Guzik, A. D. Dutoi, P. J. Love, and M. Head-Gordon, "Simulated quantum computation of molecular energies," Science, vol. 309, no. 5741, p. 1704–1707, Sep. 2005. [Online]. Available: http://dx.doi.org/10.1126/science.1113479
[4] A. Peruzzo, J. McClean, P. Shadbolt, M.-H. Yung, X.-Q. Zhou, P. J. Love, A. Aspuru-Guzik, and J. L. O'Brien, "A variational eigenvalue solver on a photonic quantum processor," Nature Communications, vol. 5, no. 1, Jul. 2014. [Online]. Available: http://dx.doi.org/10.1038/ncomms5213
[5] E. T. Barr, M. Harman, P. McMinn, M. Shahbaz, and S. Yoo, “The oracle problem in software testing: A survey,” IEEE Transactions on Software Engineering, vol. 41, no. 5, pp. 507–525, 2015.
[6] Y. Huang and M. Martonosi, “Statistical assertions for validating patterns and finding bugs in quantum programs,” in Proceedings of the 46th International Symposium on Computer Architecture, ser. ISCA '19. New York, NY, USA: Association for Computing Machinery, 2019, p. 541–553. [Online]. Available: https://doi.org/10.1145/3307650.3322213
[7] G. Li, L. Zhou, N. Yu, Y. Ding, M. Ying, and Y. Xie, “Projection-based runtime assertions for testing and debugging quantum programs,” Proc. ACM Program. Lang., vol. 4, no. OOPSLA, Nov. 2020. [Online]. Available: https://doi.org/10.1145/3428218
[8] X. Wang, P. Arcaini, T. Yue, and S. Ali, “Quito: a coverage-guided test generator for quantum programs,” in Proceedings of the 36th IEEE/ACM International Conference on Automated Software Engineering, ser. ASE '21. IEEE Press, 2022, p. 1237–1241. [Online]. Available: https://doi.org/10.1109/ASE51524.2021.9678798
[9] S. Honarvar, M. R. Mousavi, and R. Nagarajan, “Property-based testing of quantum programs in Q#,” in Proceedings of the IEEE/ACM 42nd International Conference on Software Engineering Workshops, ser. IC-SEW'20. New York, NY, USA: Association for Computing Machinery, 2020, p. 430–435.
[10] A. Muqeet, S. Ali, and P. Arcaini, “Quantum program testing through commuting pauli strings on ibm’s quantum computers,” in Proceedings of the 39th IEEE/ACM International Conference on Automated Software Engineering, ser. ASE '24. New York, NY, USA: Association for Computing Machinery, 2024, p. 2130–2141. [Online]. Available: https://doi.org/10.1145/3691620.3695275
[11] J. Wang, Q. Zhang, G. H. Xu, and M. Kim, “Qdiff: differential testing of quantum software stacks,” in Proceedings of the 36th IEEE/ACM International Conference on Automated Software Engineering, ser. ASE '21. IEEE Press, 2022, p. 692–704. [Online]. Available: https://doi.org/10.1109/ASE51524.2021.9678792
[12] M. Paltenghi and M. Pradel, “Morphq: Metamorphic testing of the qiskit quantum computing platform,” in 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE), 2023, pp. 2413–2424.
[13] E. Farhi, J. Goldstone, and S. Gutmann, “A quantum approximate optimization algorithm,” 2014. [Online]. Available: https://arxiv.org/abs/1411.4028
[14] J. Liu, G. T. Byrd, and H. Zhou, “Quantum circuits for dynamic runtime assertions in quantum computation,” in Proceedings of the Twenty-Fifth
International Conference on Architectural Support for Programming Languages and Operating Systems, ser. ASPLOS '20. New York, NY, USA: Association for Computing Machinery, 2020, p. 1017–1030. [Online]. Available: https://doi.org/10.1145/3373376.3378488
[15] J. Liu and H. Zhou, “Systematic approaches for precise and approximate quantum state runtime assertion,” in 2021 IEEE International Symposium on High-Performance Computer Architecture (HPCA), 2021, pp. 179–193.
[16] G. Pontolillo, M. R. Mousavi, and M. Grzesiuk, “Qucheck: A property-based testing framework for quantum programs in qiskit,” 2025. [Online]. Available: https://arxiv.org/abs/2503.22641
[17] X. Wang, P. Arcaini, T. Yue, and S. Ali, “Generating failing test suites for quantum programs with search,” in Search-Based Software Engineering, U.-M. O’Reilly and X. Devroey, Eds. Cham: Springer International Publishing, 2021, pp. 9–25.
[18] —, “QuSBT: Search-based testing of quantum programs,” in Proceedings of the ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings, ser. ICSE '22. New York, NY, USA: Association for Computing Machinery, 2022, p. 173–177.
[19] L. Kitt and M. B. Cohen, “Morphq++: A reproducibility study of metamorphic testing on quantum compilers,” in Proceedings of the 2024 Workshop on Replications and Negative Results, ser. RENE '24. New York, NY, USA: Association for Computing Machinery, 2024, p. 15–21. [Online]. Available: https://doi.org/10.1145/3695750.3695823
[20] A. Javadi-Abhari, M. Treinish, K. Krsulich, C. J. Wood, J. Lishman, J. Gacon, S. Martiel, P. D. Nation, L. S. Bishop, A. W. Cross, B. R. Johnson, and J. M. Gambetta, “Quantum computing with qiskit,” 2024. [Online]. Available: https://arxiv.org/abs/2405.08810
[21] Anthropic, “Claude,” 2026, generative AI system. Accessed: 2026-04-15. [Online]. Available: https://claude.com/product/overview
[22] OpenAI, “Codex,” 2026, generative AI system. [Online]. Available: https://openai.com/codex/
[23] B. T. Gard, L. Zhu, G. S. Barron, N. J. Mayhall, S. E. Economou, and E. Barnes, “Efficient symmetry-preserving state preparation circuits for the variational quantum eigensolver algorithm,” npj Quantum Information, vol. 6, no. 1, Jan. 2020. [Online]. Available: http://dx.doi.org/10.1038/s41534-019-0240-1
[24] K. Seki, T. Shirakawa, and S. Yunoki, “Symmetry-adapted variational quantum eigensolver,” Phys. Rev. A, vol. 101, p. 052340, May 2020. [Online]. Available: https://link.aps.org/doi/10.1103/PhysRevA.101.052340
[25] R. Sagastizabal, X. Bonet-Monroig, M. Singh, M. A. Rol, C. C. Bultink, X. Fu, C. H. Price, V. P. Ostroukh, N. Muthusubramanian, A. Bruno, M. Beekman, N. Haider, T. E. O'Brien, and L. DiCarlo, "Experimental error mitigation via symmetry verification in a variational quantum eigensolver," Physical Review A, vol. 100, no. 1, Jul. 2019. [Online]. Available: http://dx.doi.org/10.1103/PhysRevA.100.010302
[26] V. Verteletskyi, T.-C. Yen, and A. F. Izmaylov, “Measurement optimization in the variational quantum eigensolver using a minimum clique cover,” The Journal of Chemical Physics, vol. 152, no. 12, Mar. 2020. [Online]. Available: http://dx.doi.org/10.1063/1.5141458
[27] H.-Y. Huang, R. Kueng, and J. Preskill, “Predicting many properties of a quantum system from very few measurements,” Nature Physics, vol. 16, no. 10, p. 1050–1057, Jun. 2020. [Online]. Available: http://dx.doi.org/10.1038/s41567-020-0932-7
[28] K. Temme, S. Bravyi, and J. M. Gambetta, “Error mitigation for short-depth quantum circuits,” Phys. Rev. Lett., vol. 119, p. 180509, Nov 2017. [Online]. Available: https://link.aps.org/doi/10.1103/PhysRevLett.119.180509