NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Mitigating Noise in Quantum Software Testing Using Machine Learning

Asmar Muqeet, Tao Yue, Shaukat Ali, Paolo ArcainiarXiv 2023

This paper presents QOIN (Quantum sOftware testIng Noise-aware), a machine learning-based framework designed to filter hardware noise from quantum program outputs. By distinguishing between execution errors caused by hardware noise and those caused by actual software bugs, QOIN enables reliable software testing on real-world, noisy quantum computers.

TL;DR

QOIN uses transfer learning to build circuit-specific noise filters that reduce hardware-induced errors in quantum program outputs by over 80%. This allows developers to accurately test quantum software on noisy NISQ devices, achieving high precision and recall in identifying actual code faults.

What Problem Does This Paper Address?

We are currently in the NISQ (Noisy Intermediate-Scale Quantum) era. Quantum computers are extremely sensitive to their environment, leading to "noise" from factors like decoherence, crosstalk between qubits, and imperfect gate calibrations.

For software engineers, this creates a massive headache: test flakiness. When a quantum program produces the wrong result, is it because of a bug in the code or just a random hardware glitch? Existing testing methods often rely on ideal, noise-free simulators, which are computationally expensive and don't reflect the reality of running code on actual quantum hardware. The authors aim to bridge this gap by creating a "noise-aware" testing layer.

Methods

The core of QOIN is a three-stage machine learning pipeline:

  1. Baseline Trainer: This module learns the "noise fingerprint" of a specific quantum backend (e.g., an IBM or Google processor). It trains a Multilayer Perceptron (MLP) using data from simple "baseline circuits."
  2. Baseline Tuner: Because noise is not just hardware-specific but also circuit-specific (depending on how gates are arranged), QOIN employs transfer learning. It takes the pre-trained baseline model and fine-tunes it using a small amount of data from the specific "Circuit Under Test" (CUT). This allows the model to adapt to the unique noise patterns of a complex program without needing a massive new dataset.
  3. Test Analyzer: This acts as a filter. When a test suite is executed, the noisy output is fed into the fine-tuned model, which predicts what the "clean" output should have been. This filtered output is then passed to a standard test oracle to determine if the test passed or failed.
Figure 2: Overview of QOIN . ODR is the Odds ratio for each output; POS is the Probability of success for each output; POF is the Probability of failure for each output.

The authors use three key statistical features for their ML models: Probability of Success (POS), Probability of Failure (POF), and the Odds Ratio (ODR). These help the model distinguish between correct states that just have the wrong probability and entirely spurious states induced by noise.

Datasets

The authors conducted an extensive empirical evaluation using:

  • Real-world Benchmarks: 9 programs including Addition, Simon’s algorithm, and Quantum Fourier Transform (QFT).
  • Artificial Benchmarks: 1,000 diverse, randomly generated quantum circuits to test generalizability.
  • Noise Models: 26 different models, including 23 from IBM, 2 from Google (Rainbow and Weber), and Rigetti’s Quantum Virtual Machine.
  • Faulty Versions: To test bug detection, the authors created three faulty versions of every benchmark program by seeding errors using conditional gates.

Key Insights and Ideas

  • Noise as a Fingerprint: The study confirms that every NISQ device has a unique, learnable noise signature.
  • The Power of Transfer Learning: A general noise model isn't enough because gate interactions create unique noise patterns for every circuit. Transfer learning is the "secret sauce" that makes QOIN practical, as it only requires a few (e.g., four) non-failing test inputs to fine-tune a model for a new program.
  • Statistical Features Matter: Using the Odds Ratio (ODR) proved effective for identifying noise-induced states. As shown in the table below, noise doesn't just shift probabilities; it introduces entirely new, incorrect output states that weren't in the original specification.
Table 1: The ideal and noisy outputs of a three-qubit entanglement program (see Fig. 1) after being executing 1024 times on both an ideal and a noisy simulator. Column Probability shows the probability of having a specific output.

Key Results

  • Noise Reduction: QOIN reduced the noise effect (measured by Hellinger Distance) by more than 80% on the majority of the 26 noise models tested.
  • Testing Effectiveness: When integrated with a standard test oracle, QOIN achieved impressive results across real-world programs:
  • Precision: 99% (very few false alarms).
  • Recall: 75% (successfully caught most bugs).
  • F1-Score: 86%.
  • Scalability: The approach proved much faster than running full noise-free simulations for large circuits, as the ML inference takes only seconds.

Limitations and Future Work

  • Phase Gate Sensitivity: QOIN struggled with programs heavily reliant on phase gates (like Phase Estimation), where it only achieved ~21% improvement. The authors suggest that phase-specific noise is harder to distinguish and requires more specialized training data.
  • Data Drift: Quantum hardware is unstable; IBM, for instance, recalibrates its machines every 24 hours. QOIN models would need frequent retraining or "online learning" to stay accurate.
  • Qubit Count: The evaluation focused on circuits with up to 7 qubits. Future work is needed to see how these ML models scale as qubit counts grow into the hundreds.
  • Future Directions: The authors plan to explore Bayesian inference to better characterize noise and test QOIN on real physical hardware rather than just high-fidelity noise models.

Summary updated

BibTeX
@misc{muqeet2023mitigating,
  author = {Asmar Muqeet and Tao Yue and Shaukat Ali and Paolo Arcaini},
  title = {{Mitigating Noise in Quantum Software Testing Using Machine Learning}},
  year = {2023},
  eprint = {2306.16992},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2306.16992},
}
Figure