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 about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext 003efe1c-7a80-4e79-a7cb-f52ba7271f3cCited by top-tier papers8
- Bugs in Quantum computing platforms: an empirical studyMatteo Paltenghi, Michael PradelOOPSLA 2022 · 70 citations
- MorphQ: Metamorphic Testing of the Qiskit Quantum Computing PlatformMatteo Paltenghi, Michael PradelICSE 2023 · 44 citations
- Analyzing Quantum Programs with LintQ: A Static Analysis Framework for QiskitMatteo Paltenghi, Michael PradelFSE 2024 · 19 citations
- 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
- UPBEAT: Test Input Checks of Q# Quantum LibrariesTianmin Hu, Guixin Ye, Zhanyong Tang, Shin Hwei Tan et al.ISSTA 2024 · 4 citations
Builds on8
- Evaluating Fuzz TestingGeorge Klees, Andrew Ruef, Benji Cooper, Shiyi Wei et al.CCS 2018 · 753 citations
- CollAFL: Path Sensitive FuzzingShuitao Gan, Chao Zhang, Xiaojun Qin, Xuwen Tu et al.S&P 2018 · 426 citations
- NEZHA: Efficient Domain-Independent Differential TestingTheofilos Petsios, Adrian Tang, Salvatore J. Stolfo, Angelos D. Keromytis et al.S&P 2017 · 132 citations
- MemLock: memory usage guided fuzzingCheng Wen, Haijun Wang, Yuekang Li, Shengchao Qin et al.ICSE 2020 · 116 citations
- A verified optimizer for Quantum circuitsKesha Hietala, Robert Rand, Shih-Han Hung, Xiaodi Wu et al.POPL 2021 · 111 citations
Related papers
- IterTestQ: Assembly-Level, Cross-Platform Testing of Quantum Computing PlatformsMatteo Paltenghi, Michael PradelISSTA 2026
- Exact Inference for Quantum Circuits: A Testing Oracle for Quantum Software StacksKanguk Lee, Jaemin Hong, Sukyoung RyuASE 2025 · 1 citation
- Shaking Up Quantum Simulators with Fuzzing and RigourVasileios Klimis, Avner Bensoussan, Elena Chachkarova, Karine Even-Mendoza et al.OOPSLA 2025 · 3 citations
- UniQ: A Unified Programming Model for Efficient Quantum Circuit SimulationChen Zhang, Haojie Wang, Zixuan Ma, Lei Xie et al.SC 2022 · 11 citations
- Giallar: push-button verification for the qiskit Quantum compilerRunzhou Tao, Yunong Shi, Jianan Yao, Xupeng Li et al.PLDI 2022 · 44 citations
