QDiff: Differential Testing for Quantum Software Stacks (ASE 2021)
The past few years have witnessed the proliferation of quantum software stacks (QSS) developed in response to rapid hardware advances in quantum computing. A QSS includes a quantum programming language, an optimizing compiler that compiles a quantum algorithm expressed in a high-level language into quantum gate instructions, a quantum simulator that emu- lates these instructions on a classical device, the control software that turns circuits into analog signals sent to the quantum computer, and execution on very expensive quantum hardware. 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.
We propose 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 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.
This project is developed by Professor Miryung Kim and Harry Xu's group at UCLA. If you encounter any problems, please open an issue or feel free to contact us:
Jiyuan Wang: PhD student, wangjiyuan@cs.ucla.edu;
Qian Zhang: Postdoctoral researcher, zhangqian@cs.ucla.edu;
Please refer to our ASE'21 paper, QDiff: Differential Testing for Quantum Software Stacks for more details.
Coming soon.
To run QDiff, you'll need to install Qiskit, Cirq, and Pyquil first. If you want to use IBM quantum computer, you need to register an IBM account.
You can start QDiff directly with the default seed programs.
python3 ./direction/to/QDiff/beginTest/QTest.py
Coming soon.