一句话:提出面向量子软件栈的差分测试方法 QDiff,通过语义保持变换、电路过滤与分布等价检查发现关键缺陷。
量子软件栈(QSS)包含量子编程语言、优化编译器、模拟器和硬件控制器,因结果概率性、硬件规范不明确及编程复杂性而难以测试。本文提出 QDiff:以语义保持的源到源变换生成测试程序;通过分析电路深度、双门操作、门错误率和 T1 弛豫时间等静态特征,过滤不值得在量子硬件上执行的电路;并用 Kolmogorov–Smirnov 检验、交叉熵等分布比较函数进行可扩展等价检查。作者在 IBM Qiskit、Google Cirq 和 Rigetti Pyquil 上,于真实硬件和模拟器上评估,发现多个关键缺陷,变换能产生 34% 语义等价但非完全相同的电路,过滤机制加速差分测试 66%。
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%.
DOI 原文 ·
@inproceedings{paperbot6622,
title = {QDiff: Differential Testing of Quantum Software Stacks},
author = {Jiyuan Wang and Qian Zhang and Guoqing Harry Xu and Miryung Kim},
booktitle = {ASE},
year = {2021},
doi = {10.1109/ase51524.2021.9678792}
}