arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2310.00718cs.SE
收藏

基于LintQ的量子程序分析:一种面向Qiskit的静态分析框架

Analyzing Quantum Programs with LintQ: A Static Analysis Framework for Qiskit

Matteo Paltenghi, Michael Pradel

AI总结:

针对现有静态检测框架难以识别量子领域特有错误的问题,本文提出量子程序静态分析框架LintQ,在7568个Qiskit程序数据集上准确率达91.0%,远超现有方法。

摘要:

随着量子计算日益普及,量子程序的数量以及编写这类程序的开发者人数都在快速增长。遗憾的是,由于开发者需要掌握各类精细的规则,编写正确的量子程序颇具挑战。实证研究表明,量子软件中40%-82%的错误都属于量子领域特有的问题。然而,现有的静态错误检测框架大多不了解量子领域特有的概念,比如电路、门和量子比特,因此会遗漏大量错误。本文提出LintQ,这是一款用于检测量子程序错误的综合性静态分析框架。我们的方法依托一组专门设计的抽象机制实现,这些抽象可用于推理量子计算中的常见概念,无需涉及底层量子计算平台的细节。基于这些抽象构建的LintQ提供了一套可扩展的分析方法,共包含10项分析,可检测常见的潜在错误,比如对已损坏的量子态进行操作、冗余测量以及子电路组合错误等。我们将该方法应用于新收集的包含7568个真实世界基于Qiskit的量子程序的数据集,结果表明LintQ能有效识别各类编程问题,在采用6项性能最优的分析的默认配置下,其准确率达到91.0%。与一款通用静态代码检查工具以及两种现有的量子感知技术相比,我们评估中LintQ发现的几乎所有问题(92.1%)都未被现有方法检测到。因此,在蓬勃发展的量子计算领域,LintQ为实现可靠软件迈出了重要一步。

英文摘要:

As quantum computing is rising in popularity, the amount of quantum programs and the number of developers writing them are increasing rapidly. Unfortunately, writing correct quantum programs is challenging due to various subtle rules developers need to be aware of. Empirical studies show that 40-82% of all bugs in quantum software are specific to the quantum domain. Yet, existing static bug detection frameworks are mostly unaware of quantum-specific concepts, such as circuits, gates, and qubits, and hence miss many bugs. This paper presents LintQ, a comprehensive static analysis framework for detecting bugs in quantum programs. Our approach is enabled by a set of abstractions designed to reason about common concepts in quantum computing without referring to the details of the underlying quantum computing platform. Built on top of these abstractions, LintQ offers an extensible set of ten analyses that detect likely bugs, such as operating on corrupted quantum states, redundant measurements, and incorrect compositions of sub-circuits. We apply the approach to a newly collected dataset of 7,568 real-world Qiskit-based quantum programs, showing that LintQ effectively identifies various programming problems, with a precision of 91.0% in its default configuration with the six best performing analyses. Comparing to a general-purpose linter and two existing quantum-aware techniques shows that almost all problems (92.1%) found by LintQ during our evaluation are missed by prior work. LintQ hence takes an important step toward reliable software in the growing field of quantum computing.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑