QEMI: 一种通过输入等价性进行的量子软件堆栈测试框架
QEMI: A Quantum Software Stacks Testing Framework via Equivalence Modulo Inputs
AI总结:
QEMI通过输入等价性技术,提出了一种用于量子软件堆栈的测试方法,能够检测潜在的错误并扩展测试技术。
摘要:
随着量子算法和硬件的不断发展,确保量子软件堆栈(QSS)的正确性变得越来越重要。然而,由于或acles问题,即缺乏可靠的预期程序行为的地面真实值,测试QSS仍然具有挑战性。现有的元测试方法通常依赖于等价电路转换、后端修改或参数调整来解决这个问题。在本工作中,受等价模输入(EMI)的启发,我们提出了量子EMI(QEMI),一种新的QSS测试方法。我们的关键贡献包括:(1)一个随机量子程序生成器,根据量子控制流结构生成包含死代码的代码,以及(2)将EMI技术从经典编译器测试中适应到生成变体,通过移除死代码来生成变体。通过比较这些变体的行为,我们可以检测QSS实现中的潜在错误。我们应用QEMI到Qiskit、Q#和Cirq,并成功发现了11个崩溃错误和1个行为不一致。QEMI通过超越结构转换,将语义保持的转换纳入量子程序分析,扩展了量子软件堆栈可用的测试技术集。
英文摘要:
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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。