Static analysis is the process of analyzing software code without executing the software. It can help find bugs and potential problems in software that may only appear at runtime. Although many static analysis tools have been developed for classical software, due to the nature of quantum programs, these existing tools are unsuitable for analyzing quantum programs. This paper presents QChecker, a static analysis tool that supports finding bugs in quantum programs in Qiskit. QChecker consists of two main modules: a module for extracting program information based on abstract syntax tree (AST), and a module for detecting bugs based on patterns. We evaluate the performance of QChecker using the Bugs4Q benchmark. The evaluation results show that QChecker can effectively detect various bugs in quantum programs.
翻译:静态分析是指在不执行软件的情况下分析软件代码的过程。它有助于发现软件中可能仅在运行时显现的缺陷和潜在问题。尽管针对经典软件已开发出众多静态分析工具,但由于量子程序的特性,这些现有工具并不适用于分析量子程序。本文提出QChecker——一款支持在Qiskit框架中检测量子程序缺陷的静态分析工具。QChecker包含两大核心模块:基于抽象语法树(AST)的程序信息提取模块,以及基于模式的缺陷检测模块。我们采用Bugs4Q基准测试对QChecker性能进行了评估。评估结果表明,QChecker能够有效检测量子程序中的多种缺陷。