As quantum algorithms and hardware continue to evolve, ensuring the correctness of the quantum software stack (QSS) has become increasingly important. However, testing QSSes remains challenging due to the oracle problem, i.e., the lack of a reliable ground truth for expected program behavior. Existing metamorphic testing approaches often rely on equivalent circuit transformations, backend modifications, or parameter tuning to address this issue. In this work, inspired by Equivalence Modulo Inputs (EMI), we propose Quantum EMI (QEMI), a new testing approach for QSSes. Our key contributions include: (1) a random quantum program generator that produces code with dead code based on quantum control-flow structures, and (2) an adaptation of the EMI technique from classical compiler testing to generate variants by removing dead code. By comparing the behavior of these variants, we can detect potential bugs in QSS implementations. We applied QEMI to Qiskit, Q#, and Cirq, and successfully identified 11 crash bugs and 1 behavioral inconsistency. QEMI expands the limited set of testing techniques available for quantum software stacks by going beyond structural transformations and incorporating semantics-preserving ones into quantum program analysis.


翻译:随着量子算法和硬件的持续发展,确保量子软件栈的正确性变得日益重要。然而,由于预言机问题(即缺乏可靠的程序预期行为基准真值),量子软件栈的测试仍然面临挑战。现有的蜕变测试方法通常依赖于等效电路变换、后端修改或参数调优来解决此问题。受经典编译器测试中“输入模等价”技术的启发,本文提出量子EMI方法,这是一种针对量子软件栈的新型测试方法。我们的核心贡献包括:(1)基于量子控制流结构、能够生成包含死代码的随机量子程序生成器;(2)将经典编译器测试中的EMI技术适配至量子领域,通过移除死代码来生成程序变体。通过比较这些变体的行为,我们能够检测量子软件栈实现中的潜在缺陷。我们将QEMI应用于Qiskit、Q#和Cirq三大主流量子编程框架,成功识别出11个崩溃缺陷和1个行为不一致问题。QEMI通过超越结构变换、将语义保持变换纳入量子程序分析,扩展了当前有限的量子软件栈测试技术集合。

0
下载
关闭预览

相关内容

软件(中国大陆及香港用语,台湾作软体,英文:Software)是一系列按照特定顺序组织的计算机数据和指令的集合。一般来讲软件被划分为编程语言、系统软件、应用软件和介于这两者之间的中间件。软件就是程序加文档的集合体。
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
《量子目标检测》182页博士论文,约克大学
专知会员服务
28+阅读 · 2023年3月22日
专知会员服务
37+阅读 · 2021年9月12日
一个牛逼的 Python 调试工具
机器学习算法与Python学习
15+阅读 · 2019年4月30日
教程 | 基于Keras的LSTM多变量时间序列预测
机器之心
20+阅读 · 2017年10月30日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 2月13日
VIP会员
相关VIP内容
大型语言模型对齐技术综述:RLHF、RLAIF、PPO、DPO 等
专知会员服务
55+阅读 · 2024年7月24日
《量子目标检测》182页博士论文,约克大学
专知会员服务
28+阅读 · 2023年3月22日
专知会员服务
37+阅读 · 2021年9月12日
相关基金
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员