Lune

ASE2021Top-tier venue

QDiff: Differential Testing of Quantum Software Stacks

Jiyuan Wang, Qian Zhang, Guoqing Harry Xu, Miryung Kim

Abstract

Over the past few years, several quantum software stacks (QSS) have been developed in response to rapid hardware advances in quantum computing. A QSS includes a quantum programming language, an optimizing compiler that translates a quantum algorithm written in a high-level language into quantum gate instructions, a quantum simulator that emulates these instructions on a classical device, and a software controller that sends analog signals to a very expensive quantum hardware based on quantum circuits. In comparison to traditional compilers and architecture simulators, QSSes are difficult to tests due to the probabilistic nature of results, the lack of clear hardware specifications, and quantum programming complexity.This work devises a novel differential testing approach for QSSes, named QDiff with three major innovations: (1) We generate input programs to be tested via semantics-preserving, source to source transformation to explore program variants. (2) We speed up differential testing by filtering out quantum circuits that are not worthwhile to execute on quantum hardware by analyzing static characteristics such as a circuit depth, 2-gate operations, gate error rates, and T1 relaxation time. (3) We design an extensible equivalence checking mechanism via distribution comparison functions such as Kolmogorov–Smirnov test and cross entropy.We evaluate QDiff with three widely-used open source QSSes: Qiskit from IBM, Cirq from Google, and Pyquil from Rigetti. By running QDiff on both real hardware and quantum simulators, we found several critical bugs revealing potential instabilities in these platforms. QDiff’s source transformation is effective in producing semantically equivalent yet not-identical circuits (i.e., 34% of trials), and its filtering mechanism can speed up differential testing by 66%.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

8 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Bugs in Quantum computing platforms: an empirical study cites A verified optimizer for Quantum circuits
  • UPBEAT: Test Input Checks of Q# Quantum Libraries cites Bugs in Quantum computing platforms: an empirical study
  • UPBEAT: Test Input Checks of Q# Quantum Libraries cites MorphQ: Metamorphic Testing of the Qiskit Quantum Computing Platform
  • MemLock: memory usage guided fuzzing cites CollAFL: Path Sensitive Fuzzing
  • MemLock: memory usage guided fuzzing cites Evaluating Fuzz Testing
  • Analyzing Quantum Programs with LintQ: A Static Analysis Framework for Qiskit cites Bugs in Quantum computing platforms: an empirical study
  • Analyzing Quantum Programs with LintQ: A Static Analysis Framework for Qiskit cites MorphQ: Metamorphic Testing of the Qiskit Quantum Computing Platform
  • MorphQ: Metamorphic Testing of the Qiskit Quantum Computing Platform cites Bugs in Quantum computing platforms: an empirical study
  • Evaluating Fuzz Testing cites NEZHA: Efficient Domain-Independent Differential Testing
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers8

  1. Bugs in Quantum computing platforms: an empirical studyMatteo Paltenghi, Michael PradelOOPSLA 2022 · 70 citations
  2. MorphQ: Metamorphic Testing of the Qiskit Quantum Computing PlatformMatteo Paltenghi, Michael PradelICSE 2023 · 44 citations
  3. Analyzing Quantum Programs with LintQ: A Static Analysis Framework for QiskitMatteo Paltenghi, Michael PradelFSE 2024 · 19 citations
  4. BQSim: GPU-accelerated Batch Quantum Circuit Simulation using Decision DiagramShui Jiang, Yi-Hua Chung, Chih-Chun Chang, Tsung-Yi Ho et al.ASPLOS 2025 · 9 citations
  5. UPBEAT: Test Input Checks of Q# Quantum LibrariesTianmin Hu, Guixin Ye, Zhanyong Tang, Shin Hwei Tan et al.ISSTA 2024 · 4 citations

Builds on8

  1. Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei et al.CCS 2018 · 753 citations
  2. CollAFL: Path Sensitive FuzzingShuitao Gan, Chao Zhang, Xiaojun Qin, Xuwen Tu et al.S&P 2018 · 426 citations
  3. NEZHA: Efficient Domain-Independent Differential TestingTheofilos Petsios, Adrian Tang, Salvatore J. Stolfo, Angelos D. Keromytis et al.S&P 2017 · 132 citations
  4. MemLock: memory usage guided fuzzingCheng Wen, Haijun Wang, Yuekang Li, Shengchao Qin et al.ICSE 2020 · 116 citations
  5. A verified optimizer for Quantum circuitsKesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu et al.POPL 2021 · 111 citations

Related papers

  1. IterTestQ: Assembly-Level, Cross-Platform Testing of Quantum Computing PlatformsMatteo Paltenghi, Michael PradelISSTA 2026
  2. Exact Inference for Quantum Circuits: A Testing Oracle for Quantum Software StacksKanguk Lee, Jaemin Hong, Sukyoung RyuASE 2025 · 1 citation
  3. Shaking Up Quantum Simulators with Fuzzing and RigourVasileios Klimis, Avner Bensoussan, Elena Chachkarova, Karine Even-Mendoza et al.OOPSLA 2025 · 3 citations
  4. UniQ: A Unified Programming Model for Efficient Quantum Circuit SimulationChen Zhang, Haojie Wang, Zixuan Ma, Lei Xie et al.SC 2022 · 11 citations
  5. Giallar: push-button verification for the qiskit Quantum compilerRunzhou Tao, Yunong Shi, Jianan Yao, Xupeng Li et al.PLDI 2022 · 44 citations
Dusk over the sea between two cliffs drawn in fine vertical lines