Refactoring is a crucial technique for improving the efficiency and maintainability of software by restructuring its internal design while preserving its external behavior. While classical programs have benefited from various refactoring methods, the field of quantum programming lacks dedicated refactoring techniques. The distinct properties of quantum computing, such as quantum superposition, entanglement, and the no-cloning principle, necessitate specialized refactoring techniques. This paper bridges this gap by presenting a comprehensive set of refactorings specifically designed for quantum programs. Each refactoring is carefully designed and explained to ensure the effective restructuring of quantum programs. Additionally, we highlight the importance of tool support in automating the refactoring process for quantum programs. Although our study focuses on the quantum programming language Q\#, our approach is applicable to other quantum programming languages, offering a general solution for enhancing the maintainability and efficiency of quantum software.
Refactoring is a crucial technique for improving the efficiency and maintainability of software by restructuring its internal design while preserving its external behavior. While classical programs have benefited from various refactoring methods, the field of quantum programming lacks dedicated refactoring techniques. The distinct properties of quantum computing, such as quantum superposition, entanglement, and the no-cloning principle, necessitate specialized refactoring techniques. This paper bridges this gap by presenting a comprehensive set of refactorings specifically designed for quantum programs. Each refactoring is carefully designed and explained to ensure the effective restructuring of quantum programs. Additionally, we highlight the importance of tool support in automating the refactoring process for quantum programs. Although our study focuses on the quantum programming language Q#, our approach is applicable to other quantum programming languages, offering a general solution for enhancing the maintainability and efficiency of quantum software.
Refactoring is the process of restructuring existing computer code without changing its external behavior. Refactoring aims to improve the design, structure, and implementation of software while preserving its functionality. While classical programs have benefited from various refactoring methods, the field of quantum programming lacks dedicated refactoring techniques. This paper bridges this gap by presenting a preliminary catalog of refactorings designed for quantum programs in Q#. The paper also highlights the importance of tool support in automating the refactoring process for quantum programs.
Quantum computing is advancing rapidly, with developers increasingly adopting quantum programming languages. However, despite progress in quantum research, there is a notable lack of development tools and technologies that assist developers in designing and analyzing quantum programs. This work aims to address this gap using a software engineering approach. Specifically, we leverage the srcML infrastructure to automate the static analysis and refactoring of OpenQASM quantum programs by implementing a tool, QStatic. We then demonstrate QStatic’s potential by identifying and refactoring common code patterns. Our approach enables the exploration and manipulation of quantum source code, effectively addressing numerous challenges in quantum programming, such as optimizing quantum gates to reduce runtime costs.
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 is rapidly transitioning from a scientific curiosity to an industrial reality, offering the potential to overcome classical computation limitations. This shift has given rise to the field of quantum software engineering (QSE), focused on developing novel approaches for engineering large-scale quantum applications. Traditional software engineering methods fall short in addressing the unique characteristics of quantum computing, necessitating innovative QSE methodologies and tools. While progress has been made in testing and debugging quantum programs, very little work has been done on analyzing if and how existing requirements engineering techniques can address the challenges that designing quantum software raises. This paper discusses some of the challenges for requirements engineers while eliciting requirements for quantum software, modeling the collected requirements, and analyzing them, and introduces some initial solutions for eliciting, modeling, and analyzing quantum requirements.
Quantum computing is the latest revolution in computing and will probably come to be seen as an advance as important as the steam engine or the information society. In the last few decades, our understanding of quantum computers has expanded and multiple efforts have been made to create languages, libraries, tools, and environments to facilitate their programming. Nonetheless, quantum computers are complex systems at the bottom of a stack of layers that programmers need to understand. Hence, efforts towards creating quantum programming languages and computing environments that can abstract low-level technology details have become crucial steps to achieve a useful quantum computing technology. However, most of these environments still lack many of the features that would be desirable, such as those outlined in The Talavera Manifesto for Quantum Software Engineering and Programming. For advancing quantum computing, we will need to develop quantum software engineering techniques and tools to ensure the feasibility of this new type of quantum software. To contribute to this goal, this paper provides a review of the main quantum software components and platforms. We also propose a set of quality requirements for the development of quantum software platforms and the conduct of their quality assessment.
Over the last few years, quantum computing has been growing at an exponential pace. Every day, new techniques, frameworks, modeling, and programming languages are emerging that aim to facilitate the development of quantum software, which is key to achieving the promising applications of quantum computing. However, which of these are actively used and the degree of satisfaction of researchers and developers regarding these quantum software frameworks and languages is not known. To address this, we conducted a survey to characterize which modeling tools and which quantum programming languages are used during the quantum software lifecycle. Researchers in academia and industry developers were surveyed, and a total of 57 responses were collected. The results indicate that during quantum software development, some models and diagrams are used to guide development. In addition, the survey results show what quantum programming languages are the most used alongside the classical programming languages employed to build hybrid programs, among other important insights. The implications of this survey are: (i) to find out what the current trends are within quantum software development and (ii) to find out what the needs are of quantum software developers with respect to current modeling and programming languages and tools.