Quantum Computing (QC) is a fast-growing field that has enhanced the emergence of new programming languages and frameworks. Furthermore, the increased availability of computational resources has also contributed to an influx in the development of quantum programs. Given that classical and QC are significantly different due to the intrinsic nature of quantum programs, several aspects of QC (e.g., performance, bugs) have been investigated, and novel approaches have been proposed. However, from a purely quantum perspective, maintenance, one of the major steps in a software development life-cycle, has not been considered by researchers yet. In this paper, we fill this gap and investigate the prevalence of code smells in quantum programs as an indicator of maintenance issues. We defined eight quantum-specific smells and validated them through a survey with 35 quantum developers. Since no tool specifically aims to detect quantum smells, we developed a tool called QSmell that supports the proposed quantum-specific smells. Finally, we conducted an empirical investigation to analyze the prevalence of quantum-specific smells in 15 open-source quantum programs. Our results showed that 11 programs (73.33%) contain at least one smell and, on average, a program has three smells. Furthermore, the long circuit is the most prevalent smell present in 53.33% of the programs.
Quantum Computing (QC) is a fast-growing field that has enhanced the emergence of new programming languages and frameworks. Furthermore, the increased availability of computational resources has also contributed to an influx in the development of quantum programs. Given that classical and QC are significantly different due to the intrinsic nature of quantum programs, several aspects of QC (e.g., performance, bugs) have been investigated, and novel approaches have been proposed. However, from a purely quantum perspective, maintenance, one of the major steps in a software development life-cycle, has not been considered by researchers yet. In this paper, we fill this gap and investigate the prevalence of code smells in quantum programs as an indicator of maintenance issues. We defined eight quantum-specific smells and validated them through a survey with 35 quantum developers. Since no tool specifically aims to detect quantum smells, we developed a tool called QSmell that supports the proposed quantum-specific smells. Finally, we conducted an empirical investigation to analyze the prevalence of quantum-specific smells in 15 open-source quantum programs. Our results showed that 11 programs (73.33%) contain at least one smell and, on average, a program has three smells. Furthermore, the long circuit is the most prevalent smell present in 53.33% of the programs.
Abstract Quantum computing is a promising field that can solve complex problems beyond traditional computers’ capabilities. Developing high-quality quantum software applications, called quantum software engineering, has recently gained attention. However, quantum software development faces challenges related to code quality. A recent study found that many open-source quantum programs are affected by quantum-specific code smells, with long circuit being the most common. While the study provided relevant insights into the prevalence of code smells in quantum circuits, it did not explore the potential effect of transpilation, a necessary step for executing quantum computer programs, on the emergence of code smells. Indeed, transpilation might alter those characteristics employed to detect the presence of a smell on a circuit. To address this limitation, we present a new study investigating the impact of transpilation on quantum-specific code smells and how different target gate sets affect the results. We conducted experiments on 17 open-source quantum programs alongside a set of 100 synthetic circuits. We found that transpilation can significantly alter the metrics that are used to detect code smells, even into previously smell-free circuits, with the long circuit smell being the most susceptible to transpilation. Furthermore, the choice of the gate set significantly influences the presence and severity of code smells in transpiled circuits, highlighting the need for careful gate set selection to mitigate their impact. These findings have implications for circuit optimization and high-quality quantum software development. Further research is needed to understand the consequences of code smells and their potential impact on quantum computations, considering the characteristics and constraints of different gate sets and hardware platforms.
Abstract The field of Quantum Computing (QC) is advancing rapidly, introducing new programming paradigms and frameworks. This rapid growth also increases the vulnerability of quantum programs (QPs) to bugs and code smells. Despite considerable research, detecting code smells in QPs remains underexplored. To bridge this gap, this paper presents QUAMET , a novel structural and semantic analysis approach designed to establish software metrics for QPs and detect quantum code smells. Structural analysis examines code structure and program architecture, focusing on rules and patterns essential for identifying code smells. Semantic analysis, utilising quantum circuit analysis and parse trees, explores the meaning of the code. The study used a publicly available LintQ dataset, which contains real-world QPs implemented with Qiskit. After thorough pre-processing, the dataset was refined to extract structural and semantic metrics, resulting in a labelled dataset of 4,102 projects. This dataset is instrumental in identifying six distinct types of code smells, reviewed by industry and academic experts. The dataset and metrics are validated using reviews and classifications, demonstrating significant advancements in detecting quantum code smells. The results highlight the importance of combining structural and semantic analyses to enhance code smell detection accuracy, providing insights into their potential impact on QPs' performance and maintainability.
Quantum computing is rapidly advancing, but quantum software development faces significant challenges, including a steep learning curve, high hardware error rates, and a lack of mature engineering practices. This study conducts a large-scale mining analysis of over 21,000 GitHub repositories, containing 1.2 million commits from more than 10,000 developers, to examine the evolution and maintenance of quantum software. We analyze repository growth, programming language and framework adoption, and contributor trends, revealing a 200 % increase in repositories and a 150 % rise in contributors since 2017. Additionally, we investigate software development and maintenance practices, showing that perfective commits dominate (51.76 %), while the low occurrence of corrective commits (18.54%) indicates potential gaps in bug resolution. Furthermore, 34% of reported issues are quantum-specific, highlighting the need for specialized debugging tools beyond conventional software engineering approaches. This study provides empirical insights into the software engineering challenges of quantum computing, offering recommendations to improve development workflows, tooling, and documentation. We are also open-sourcing our dataset to support further analysis by the community and to guide future research and tool development for quantum computing. The dataset is available at: https://github.com/kriss-u/QRepoAnalysis-Paper.
The interest in quantum computing is growing, and with it, the importance of software platforms to develop quantum programs. Ensuring the correctness of such platforms is important, and it requires a thorough understanding of the bugs they typically suffer from. To address this need, this paper presents the first in-depth study of bugs in quantum computing platforms. We gather and inspect a set of 223 real-world bugs from 18 open-source quantum computing platforms. Our study shows that a significant fraction of these bugs (39.9%) are quantum-specific, calling for dedicated approaches to prevent and find them. The bugs are spread across various components, but quantum-specific bugs occur particularly often in components that represent, compile, and optimize quantum programming abstractions. Many quantum-specific bugs manifest through unexpected outputs, rather than more obvious signs of misbehavior, such as crashes. Finally, we present a hierarchy of recurrent bug patterns, including ten novel, quantum-specific patterns. Our findings not only show the importance and prevalence bugs in quantum computing platforms, but they help developers to avoid common mistakes and tool builders to tackle the challenge of preventing, finding, and fixing these bugs.
Abstract Quantum computing holds great promise for solving complex problems that classical computing cannot address, with applications in various industries and sectors. However, developing efficient quantum software remains a challenge. Quantum software engineering (QSE) has emerged to address this, adapting classical software engineering practices for quantum systems. Design patterns, widely used in classical software, can provide reusable solutions for common quantum development issues, but their use in quantum software remains underexplored. This paper presents an empirical study investigating the use of design patterns in 2610 Qiskit programs from GitHub. Using the QCPD Tool to detect four design patterns (initialization, superposition, entanglement, and oracle) and QMetrics to compute software metrics, the study creates a dataset linking patterns with code characteristics. Three research questions guide the study: RQ1 examines the prevalence of design patterns in quantum software, RQ2 explores the relationship between design patterns and code metrics, and RQ3 analyzes the combinations of patterns that occur together. The findings provide insights into quantum software development, offering developers practical guidance on applying specific patterns. The results contribute to QSE by revealing key relationships between patterns and metrics, which can inform future research and tool development. These findings support improved performance, maintainability, and scalability, fostering the broader adoption of quantum computing.
Quantum computing (QC) is increasingly transitioning toward practical and industrial adoption, highlighting the need to understand how developers engage with quantum technologies. In this study, we analyze 1,404 Stack Overflow posts related to quantum computing topics, including quantum programming, tools, and algorithms, to investigate real-world developer discussions. Using topic modeling and quantitative analysis, we identify the main discussion topics, their popularity, and the tools, programming languages, and quantum algorithms referenced by practitioners. We further assess the difficulty of developer questions using two metrics: (i) the percentage of questions without accepted answers and (ii) the median time required to receive an accepted answer. Our findings reveal seven main topics, with hybrid quantum--classical computing and quantum circuit implementation emerging as the most prevalent. We observe that Qiskit and Q-sharp dominate developer discussions, while Grover's and Shor's algorithms are the most frequently referenced. Moreover, our analysis highlights differences in engagement and difficulty across topics, tools, and algorithms, indicating varying levels of maturity and community support. These findings provide actionable insights for researchers, tool developers, and educators, supporting improvements in usability, documentation, and learning resources in quantum software engineering. To support transparency and reproducibility, the open-source dataset used in this study is publicly available at Zenodo.