As quantum programming evolves, more and more quantum programming languages are being developed. As a result, debugging and testing quantum programs have become increasingly important. While bug fixing in classical programs has come a long way, there is a lack of research in quantum programs. To this end, this paper presents a comprehensive study on bug fixing in quantum programs. We collect and investigate 96 real-world bugs and their fixes from four popular quantum programming languages Qiskit, Cirq, Q#, and ProjectQ). Our study shows that a high proportion of bugs in quantum programs are quantum-specific bugs (over 80%), which requires further research in the bug fixing domain. We also summarize and extend the bug patterns in quantum programs and subdivide the most critical part, math-related bugs, to make it more applicable to the study of quantum programs. Our findings summarize the characteristics of bugs in quantum programs and provide a basis for studying testing and debugging quantum programs.
翻译:随着量子编程的发展,正在开发越来越多的量子编程语言。结果,调试和测试量子程序变得日益重要。在古典程序中的错误修正已经取得了很大进展,但在量子程序方面却缺乏研究。为此,本文件介绍了一项关于量子程序中的错误修正的全面研究。我们从四种流行量子编程语言Qiskit、Cirq、 ⁇ 和ProjectQ中收集和调查了96个真实世界的错误及其修正。我们的研究显示,量子方案中的错误比例很高的是量子错误(超过80%),这需要在错误修正域进行进一步研究。我们还总结和扩展量子程序中的错误模式,并分解最重要的部分,即与数学有关的错误,使之更适用于量子程序的研究。我们的调查结果总结了量子程序中的错误特征,并为研究量子程序的测试和调试调提供了基础。