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

量子软件开发工具包中的代码注释:一项针对Qiskit的实证研究

Code Comments for Quantum Software Development Kits: An Empirical Study on Qiskit

Beihang University(北京航空航天大学)

Zenghui Zhou, Yuechen Li, Yi Cai, Jinlong Wen, Xiaohan Yu, Zheng Zheng, Beibei Yin

AI总结:

本文通过Qiskit提出首个量子计算代码注释数据集CC4Q,分析了量子软件注释的结构、开发者意图及量子主题,揭示了经典与量子软件注释的关键差异。

摘要:

量子计算正受到学术界和工业界越来越多的关注。随着量子软件开发工具包(SDKs)的出现,程序员可以开发量子软件以探索量子计算的潜力。然而,由于量子力学的非直观性,程序员在理解量子软件时可能会遇到困难。为了促进软件开发和维护,量子SDKs中提供的代码注释作为一种自然语言解释程序功能和逻辑流程的工具。尽管它们很重要,但很少有系统的研究报告其价值并为程序员提供建设性的指导。为了解决这一差距,本文聚焦于最受欢迎的量子SDK之一Qiskit,并提出了CC4Q,这是首个针对量子计算的代码注释数据集。CC4Q包含9677对代码注释和21970个句子级代码注释单元,后者涉及大量人工标注。关于标注,我们验证了在经典程序中使用的开发者意图分类法的适用性,并提出了一个新的分类法,考虑了量子特定的知识。我们从三个角度全面地解释了代码注释:注释的结构和覆盖范围、开发者的意图以及相关的量子主题。我们的发现揭示了经典和量子软件之间代码注释的主要差异,并概述了与量子软件开发相关的量子特定知识。

英文摘要:

Quantum computing is gaining attention from academia and industry. With the quantum Software Development Kits (SDKs), programmers can develop quantum software to explore the power of quantum computing. However, programmers may face challenges in understanding quantum software due to the non-intuitive quantum mechanics. To facilitate software development and maintenance, code comments offered in quantum SDKs serve as a natural language explanation of program functionalities and logical flows. Despite their importance, scarce research systematically reports their value and provides constructive guidelines for programmers. To address this gap, our paper focuses on Qiskit, one of the most popular quantum SDKs, and presents CC4Q, the first dataset of code comments for quantum computing. CC4Q incorporates 9677 code comment pairs and 21970 sentence-level code comment units, the latter of which involve heavy human annotation. Regarding the annotation, we validate the applicability of the developer-intent taxonomy used in classical programs, and also propose a new taxonomy considering quantum-specific knowledge. We conduct an empirical study comprehensively interpreting code comments from three perspectives: comment structure and coverage, developers' intentions, and associated quantum topics. Our findings uncover key differences in code comments between classical and quantum software, and also outline quantum-specific knowledge relevant to quantum software development.

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

↑