Source-linked AI summary
Symmetry-Oriented Testing Framework for Variational Quantum Algorithms
Masaomi Yamaguchi, Fuyuki Ishikawa
TL;DR
Quantum software testing lacks a straightforward oracle when states cannot be inspected and exact solutions are unavailable. This paper uses target-Hamiltonian symmetries to test VQA runs, and reports detection across diverse faults, systems, and noisy execution, with acceptance checks also filtering low-quality outcomes.
Problem
Testing VQAs is difficult because quantum states cannot be directly inspected and exact solutions may be unavailable as test oracles.
Source: §I · p. 1Method
The framework uses operators commuting with the target Hamiltonian for a health check during optimization and an acceptance check on the converged state.
Source: §I · p. 1, §VIII · p. 10Results
The checks detect diverse platform- and user-side faults, and on the H2 multi-start dataset at 100,000 shots the acceptance threshold rejects 73.7% of runs outside chemical accuracy with no false positives.
Source: 2) Results and Answer to RQ3 · p. 8, §VIII · p. 10Takeaways & Limitations
The acceptance check provides a practical filter for low-quality converged runs, while tracking noise-induced degradation of solution quality.
Source: §VIII · p. 10The perturbation scan probes only the neighborhood of a single reference solution for each target system.
Source: C. Threats to Validity · p. 10
Abstract
from arXiv · showhide
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.
I. INTRODUCTION
VQA testing faces an oracle problem: quantum states cannot be directly inspected, and exact solutions may be unavailable where quantum advantage is expected. The proposed SOT Framework uses target-Hamiltonian symmetries for two complementary checks and is evaluated across faults, systems, and noisy execution.
I. INTRODUCTION
- Testing is attractive for quantum software, but quantum states cannot be directly inspected and expected outputs may be unavailable in the regime of anticipated quantum advantage.The introduction frames validation of solution plausibility as an important question as applications approach that regime.Source: §I · p. 1
- The SOT Framework uses operators commuting with the target Hamiltonian as test specifications, without requiring the exact solution.Its commutator-based health check monitors optimization steps, while its variance-based acceptance check assesses the converged state.Source: §I · p. 1
- The framework pairs a commutator-based health check during optimization with a variance-based acceptance check for the converged solution.The checks respectively test symmetry consistency at each execution step and whether the final state is an eigenstate of symmetry operators.Source: §I · p. 1, • RQ2: Does the proposed acceptance… · p. 2
• RQ2: Does the proposed acceptance check show a meaningful correlation with solution quality across diverse target systems?
- The evaluation covers fault scenarios, acceptance-check correlations with solution quality across target systems, and noisy execution conditions.These are identified among the paper’s main empirical contributions.Source: • RQ2: Does the proposed acceptance… · p. 2
A. Basics of quantum computing
The section introduces quantum states, circuits, and measurement as the basis for estimating observables. It also describes Pauli-based measurement for general observables.
A. Basics of quantum computing
- A qubit’s pure state is a unit vector up to global phase in C2, and an n-qubit state lies in (C2)^⊗n.The single-qubit state is expressed as α|0⟩ + β|1⟩ with |α|^2 + |β|^2 = 1.Source: A. Basics of quantum computing · p. 2
- A quantum circuit applies a sequence of unitary gates, while measurement of a Hermitian observable yields eigenvalue λ_i with probability p_i.The measured state is projected onto the corresponding eigenspace.Source: A. Basics of quantum computing · p. 2
- General observables are estimated through Pauli decompositions, with basis changes enabling estimation from Z-measurement outcomes.For X factors, apply H; for Y factors, apply HS†, then take the product of outcomes over non-identity factors.Source: A. Basics of quantum computing · p. 2
B. Variational Quantum Algorithms
VQAs optimize parameterized circuits to approximate a Hamiltonian’s ground state, but existing oracle-reduction approaches leave gaps in assessing VQA execution and solution plausibility. The H2 example shows how a buggy Hamiltonian can yield apparent convergence without a physically plausible solution.
B. Variational Quantum Algorithms
- VQAs optimize a parameterized circuit’s Hamiltonian expectation to approximate the ground-state energy and state.The workflow alternates quantum-device expectation estimates with classical parameter updates.Source: B. Variational Quantum Algorithms · p. 2
III. RELATED WORK
- State assertions and property-based tests require expected-state or output-property specifications that are unavailable during VQA optimization.The expected intermediate states are unknown in advance, and finding the converged solution is the algorithm’s objective.Source: §III · pp. 2–3
- Automated test-generation methods target general quantum programs, while related-execution comparisons can miss deviations from the intended problem and implausible solutions.Coverage-guided and search-based methods do not assess converged VQA solution quality; metamorphic comparisons can remain consistent despite such problems.Source: §III · p. 3
IV. MOTIVATING EXAMPLE
- In the H2 motivating example, optimizing Hbug = H + 3.0 Y Y II can appear to converge while producing a solution that is not physically plausible for the intended problem.Objective convergence alone does not ensure validity for the intended problem.Source: §IV · p. 3, Figure 2 · p. 3
- Assertions and related-execution comparisons do not resolve the example’s oracle gap because expected states are unknown and the execution infrastructure functions correctly.A correct classical reference is unavailable in the regime where quantum advantage is expected.Source: §IV · p. 3
V. PROPOSED METHOD
The SOT Framework uses operators commuting with the target Hamiltonian as test specifications, with a health check during optimization and an eigenstate-based acceptance check after convergence.
A. Overview
- Operators that commute with the target Hamiltonian serve as test specifications; particle number and total spin are natural choices in quantum chemistry.For the H2 example, the selected operators are N and S2, whose four-qubit Pauli decompositions appear in Fig. 3.Source: A. Overview · pp. 3–4, Figure 3 · p. 4
- The health check monitors each optimization step, while the acceptance check tests whether the converged state is an eigenstate of the symmetry operators.Both checks are applied independently to each available operator.Source: A. Overview · p. 4, Figure 4 · p. 4
- The workflow records the health-check result at every optimization step and evaluates acceptance only after the optimizer converges.The method is illustrated using the buggy-Hamiltonian case as a running example.Source: §V · p. 3, A. Overview · p. 4
B. Health Check During Optimization
The health check tracks symmetry consistency during optimization, and the acceptance check evaluates whether the converged state is an eigenstate of a symmetry operator; the H2 examples distinguish clean and buggy runs on both checks.
B. Health Check During Optimization
- For a Hamiltonian commuting with A, the expected commutator is zero for any state, so departure from zero can signal deviation from the intended workflow.In ideal execution, the health-check quantity vanishes at every optimization parameter; finite-shot estimation and hardware noise can make it nonzero, motivating a threshold.Source: B. Health Check During Optimization · p. 4
- HCN in the buggy H2 run departs from the clean trace, exceeds 0.2, and is too large to attribute plausibly to sampling noise alone.The example uses a simulator without hardware noise, and the objective alone appears well behaved.Source: B. Health Check During Optimization · p. 4, Figure 5 · p. 4
C. Acceptance Check for the Converged Solution
- The acceptance quantity is the variance of A: it vanishes for an eigenstate, and a nonzero variance indicates the state is not an eigenstate.The check is applicable when the converged state is expected to be an eigenstate of A; a nondegenerate target eigenvalue is one sufficient condition.Source: C. Acceptance Check for the Converged… · pp. 4–5
- With 10,000 shots, clean-run z values were 1.1 for N and 1.4 for S2, while buggy-run S2 reached z = 50 beyond z = 3.The acceptance check reveals that the apparently converged buggy solution is no longer physically plausible for the intended Hamiltonian.Source: C. Acceptance Check for the Converged… · p. 5
VI. EVALUATION
The evaluation uses four experiment groups and runs them on a simulator; exact ground-state energies, when reported, are reserved for post hoc analysis.
VI. EVALUATION
- The evaluation comprises four experiment groups that apply the health and acceptance checks to VQA workflows.Experiments use a simulator with Qiskit 2.3.0 and qiskit-aer 0.17.2.Source: §VI · p. 5
- Exact diagonalization supplies reported ground-state energies only for post hoc analysis, not as a test oracle in the framework.Energy values and energy differences are reported in Hartree.Source: §VI · p. 5
- Experimental code development supporting the section used Anthropic’s Claude and OpenAI’s Codex.The passage identifies the tools as Claude and Codex.Source: §VI · p. 5
A. RQ1: Can the Proposed Framework Provide Useful Fault-
RQ1 tests whether the framework detects concrete VQA faults without an exact-solution oracle. Across six injected faults, its health and acceptance checks provide useful signals, with responses varying by fault type.
1) Setup:
- The setup uses H2 with operators N and S2, the same hardware-efficient ansatz for clean and buggy runs, and reports the lowest-energy run from 50 initial points.The health check is summarized by its maximum over optimization steps, while acceptance is assessed at convergence using a 3σ threshold.Source: 1) Setup · p. 5, A. RQ1: Can the Proposed Framework… · p. 5
2) Results and Answer to RQ1:
- Randomized basis and wrong term weights produce large health-check values and exceed the 3σ acceptance threshold, while shifted wiring exceeds the converged S2 threshold.For randomized basis, max HCN rises from 3.13×10−2 in the clean run to 1.18, and max HCS2 rises from 1.90 × 10−2 to 7.52 × 10−1.Source: 2) Results and Answer to RQ1 · p. 6
- Stuck-zero readout collapses health-check values toward zero and produces formally infinite acceptance-check z-scores because estimated standard errors collapse to zero.Every shot returns the all-zero bitstring.Source: 2) Results and Answer to RQ1 · p. 6
- For a wrong Hamiltonian, the energy falls below the exact ground-state energy, yet the framework flags abnormality while relation-based tests may miss the mismatch.The health check exceeds 0.2 and the converged ACS2 exceeds the 3σ threshold; the execution infrastructure itself functions correctly.Source: 2) Results and Answer to RQ1 · p. 6
- An underexpressive ansatz leaves energy far above the exact ground-state energy; the health check stays near zero, but both converged acceptance checks exceed 3σ.Relation-based tests would also not expose this issue because the execution infrastructure functions correctly.Source: 2) Results and Answer to RQ1 · p. 6
- The framework detects all six injected faults without an exact-solution oracle, using the health check, acceptance check, or both depending on the fault.The clearest advantage over relation-based tests occurs for wrong-Hamiltonian and underexpressive-ansatz faults.Source: 2) Results and Answer to RQ1 · p. 6
B. RQ2: Does the Proposed Acceptance Check Show a Mean-
RQ2 assesses whether acceptance-check values track solution quality across molecular systems and a lattice gauge model. The experiment perturbs reference solutions and compares acceptance values with energy error.
1) Setup:
- The experiment evaluates H2, LiH, BeH2, H2O, and a 7-qubit Z2 lattice gauge model, using N and S2 for molecules and local gauge generators for the lattice model.The molecular systems range from 4 to 10 qubits; the lattice model uses six generators.Source: 1) Setup · pp. 6–7
- For each target, the authors select a best-energy reference and generate 1,000 nearby perturbed parameter sets with distances sampled uniformly from 0.01 to 1.0.The common hardware-efficient ansatz has 32, 32, 48, 80, and 56 parameters for H2, LiH, BeH2, H2O, and Z2 LGT, respectively.Source: 1) Setup · p. 7
- Each perturbed state is assessed by absolute energy error and acceptance-check values, including the maximum across the relevant symmetry operators.The table reports correlations between acceptance checks and solution quality across target systems.Source: 1) Setup · p. 7
2) Results and Answer to RQ2:
Acceptance-check values are positively correlated with energy error in the reported H2 results, and the experiment extends the analysis to other molecular systems. A separate H2 experiment sets up a threshold filter for low-quality converged outcomes.
2) Results and Answer to RQ2:
- On H2, Pearson correlations with |∆E| are 0.811 for ACN, 0.797 for ACS2, and 0.857 for max(ACN, ACS2).Fig. 6 visualizes the H2 perturbation-scan trend.Source: 2) Results and Answer to RQ2 · p. 7, Table III · p. 7, Figure 6 · p. 8
- Across the other molecular systems, at least one of the two symmetry operators achieves a Pearson correlation supporting the same overall conclusion that both carry useful solution-quality information.Table III summarizes correlations across target systems.Source: 2) Results and Answer to RQ2 · p. 7, Table III · p. 7
1) Setup:
- The filter experiment uses 1,000 H2 runs from independent initial parameters and a simpler ansatz to make poorer local optima more likely.The runs use eight variational parameters, up to 300 COBYLA iterations, and 100,000 shots.Source: 1) Setup · pp. 7–8
Practical Filter for Low-Quality VQA Outcomes?
- A two-threshold rule treats τE as the low-quality criterion and rejects runs when max(ACN, ACS2) crosses τAC, with recall and false-positive rate measured across threshold pairs.The tested τE range is 1.60 × 10−3 to 1.84 × 10−2 Hartree, and τAC ranges from 6.0 × 10−3 to 1.0 × 10−2.Source: 1) Setup · p. 8
2) Results and Answer to RQ3:
On H2, the acceptance check filters low-quality runs at a selected threshold and tracks accuracy degradation as inserted noise increases. In the noise study, the health check remains near zero when the underlying Hamiltonian symmetries are unchanged.
2) Results and Answer to RQ3:
- As τE increases, fewer runs are classified as low quality, and the acceptance threshold giving a favorable recall/false-positive balance shifts to larger τAC values.Fig. 7 presents recall in the upper panel and false-positive rate in the lower panel.Source: 2) Results and Answer to RQ3 · p. 8, Figure 7 · p. 8
- At τE = 1.60 × 10−3 Hartree, τAC = 8.0 × 10−3 rejects 73.7% of low-quality runs with no false positives.At τAC = 7.0 × 10−3, recall rises to 78.2% while false-positive rate is 21.4%; higher thresholds retain zero false positives but lower recall.Source: Figure 7 · p. 8, 2) Results and Answer to RQ3 · p. 8
1) Setup:
- The noise study replays a noiseless, chemically accurate H2 reference using the same variational parameters under noise scaled from 0× to 10×.The inserted model combines depolarizing SX and CX gate noise with readout error, while RZ gates receive no inserted gate noise.Source: 1) Setup · pp. 8–9
2) Results and Answer to RQ4:
- The energy gap from the exact ground-state energy grows from 8.42× 10−4 at 0× to 9.71×10−2 at 10× noise.The replayed run becomes progressively less accurate under stronger noise.Source: 2) Results and Answer to RQ4 · p. 9
- ACS2 rises with noise and its z-score exceeds 3 from 3× noise onward, while ACN also increases; the health check remains near zero because the noise does not alter the Hamiltonian or its symmetry relations.The acceptance check tracks the increase in energy error, whereas the health check does not indicate a consistency violation in this setting.Source: 2) Results and Answer to RQ4 · p. 9
VII. DISCUSSION
The discussion distinguishes symmetry used to diagnose a VQA run from approaches that constrain or postprocess it, and explains the checks’ demonstrated utility and applicability boundaries.
A. Relation to Prior Uses of Symmetry
- Unlike symmetry-preserving ansätze, symmetry-adapted VQE, and symmetry verification, SOT uses symmetry to diagnose whether a run should be trusted.The prior approaches constrain the circuit, guide optimization, or postprocess results; they do not themselves diagnose faults.Source: A. Relation to Prior Uses of Symmetry · p. 9
1) Diagnostic Meaning:
- The checks provide necessary, not sufficient, conditions: passing them does not guarantee the exact target state, and some chemically inaccurate H2 runs pass acceptance.Source: 1) Diagnostic Meaning · p. 9
- Together, the checks detect all six injected faults, while acceptance correlates with energy error and rejects 73.7% of low-quality H2 runs with no false positives.The correlation spans multiple molecular systems and a Z2 lattice gauge model.Source: 1) Diagnostic Meaning · p. 9
2) Operator Choice and Applicability:
- Appropriate commuting operators may require domain-specific analysis, though symmetry information is already used in quantum chemistry and local gauge generators commute by construction in lattice gauge theories.Source: 2) Operator Choice and Applicability · p. 9
- For acceptance, any commuting operator suffices when the target eigenvalue is nondegenerate; degenerate targets require operators for which the target state remains an eigenstate.Identifying such operators across more applications remains an open research direction.Source: 2) Operator Choice and Applicability · p. 9
3) Validation of the Commutation Assumption:
The evaluation finds broad diagnostic utility, while the discussion qualifies the commutation assumption, measurement overhead, and scope of the fault and noise studies.
3) Validation of the Commutation Assumption:
- An anomaly cannot distinguish an incorrect test specification from a faulty workflow; algebraically checking [H, A] = 0 before execution can mitigate this ambiguity.Source: 3) Validation of the Commutation… · p. 9
4) Measurement Cost:
- For H2, checks on N and S2 require 9 additional Pauli terms in total; grouping, classical shadows, and periodic health checks can mitigate measurement overhead.Source: 4) Measurement Cost · pp. 9–10
C. Threats to Validity
- The RQ1 evaluation uses artificially injected faults, so it does not cover every fault arising in practice, despite spanning platform- and user-side cases.Source: C. Threats to Validity · p. 10
- RQ2 probes only perturbations near one reference solution per system, while RQ3 adds evidence from independently converged runs at different local optima.Source: C. Threats to Validity · p. 10
- RQ4 replays a fixed noiseless parameter sequence rather than optimizing under noise, and does not evaluate error mitigation; its figure compares objective and check values across noise levels.Source: C. Threats to Validity · p. 10, Figure 8 · p. 10
VIII. CONCLUSION
- The framework uses operators commuting with the target Hamiltonian as test specifications, with a stepwise health check and a converged-state acceptance check, avoiding an exact-solution oracle.Source: §VIII · p. 10
- The checks detect diverse faults; acceptance correlates with solution quality across molecular systems and a Z2 lattice gauge model, filters low-quality runs, and tracks noise-related degradation.Source: §VIII · p. 10