As the scale of quantum programs grows to match that of classical software, the nascent field of quantum software engineering must mature and tools such as debuggers will become increasingly important. However, developing a quantum debugger is challenging due to the nature of a quantum computer; sneaking a peek at the value of a quantum state will cause either partial or complete collapse of the superposition and may destroy the necessary entanglement. As a first step to developing a full quantum circuit debugger, we have designed and implemented a quantum circuit debugging tool. The tool allows the user to divide the circuit vertically or horizontally into smaller chunks known as slices, and manage their simulation or execution for either interactive debugging or automated testing. The tool also enables developers to track gates within the overall circuit and each chunk to understand their behavior better. Feedback on usefulness and usability from early users shows that using the tool to slice and test their circuits has helped make the debugging process more time-efficient for them.
As the scale of quantum programs grows to match that of classical software, the nascent field of quantum software engineering must mature and tools such as debuggers will become increasingly important. However, developing a quantum debugger is challenging due to the nature of a quantum computer; sneaking a peek at the value of a quantum state will cause either partial or complete collapse of the superposition and may destroy the necessary entanglement. As a first step to developing a full quantum circuit debugger, we have designed and implemented a quantum circuit debugging tool. The tool allows the user to divide the circuit vertically or horizontally into smaller chunks known as slices, and manage their simulation or execution for either interactive debugging or automated testing. The tool also enables developers to track gates within the overall circuit and each chunk to understand their behavior better. Feedback on usefulness and usability from early users shows that using the tool to slice and test their circuits has helped make the debugging process more time-efficient for them.
Advances in NISQ devices have allowed quantum researchers and enthusiasts to design and develop quantum programs for different applications. As the hardware progresses from noisy to fault-tolerant, the size of the programs implemented will increase. As the circuits get larger, testing and debugging these circuits will become more complex. To overcome the counterintuitive nature of quantum circuits and help developers better understand their programs and locate bugs during the development process's testing and debugging stages, we must understand the different types of bugs that occur in quantum circuits and how they affect the state of the qubits and propagate through the circuit. In this work, we categorize some bugs that could occur when implementing quantum circuits. This poster is part of a bigger work that aims to assist developers in debugging their circuits. This is done by bridging some testing and debugging techniques from the classical world, such as hypothesis and binary-like testing, and debugging-assistance functions, such as tracking gates and detecting qubits' light cones. In addition, we collected and studied bugs from Stack Exchange, Stack Overflow, and GitHub and categorized these bugs based on their source to provide developers with tools and information for an efficient and systematic debugging process for their programs.
Recent advancements in quantum computing software are gradually increasing the scope and size of quantum programs being developed. At the same time, however, these larger programs provide more possibilities for functional errors that are harder to detect and resolve. Meanwhile, debugging tools that could aid developers in resolving these errors are still barely existent and far from what we take for granted in classical design automation and software engineering. As a result, even if one manages to identify the incorrect behavior of a developed quantum program, detecting and resolving the underlying errors in the program remains a time-consuming and tedious task. Moreover, the exponential growth of the state space in quantum programs makes the efficient manual investigation of errors radically difficult even for respectively simple algorithms, and almost impossible as the number of qubits increases. To address this problem, this work proposes a debugging framework, available as an open-source implementation at https://github.com/cda-tum/mqt-debugger. It assists developers in debugging errors in quantum programs, allowing them to efficiently identify the existence of errors and diagnose their causes. Users are given the ability to place assertions in the code that test for the correctness of a given algorithm and are evaluated using classical simulations of the underlying quantum program. Once an assertion fails, the proposed framework employs different diagnostic methods to point towards possible error causes. This way, the debugging workload for quantum programs is drastically reduced.
The forty-year history of quantum computers has taken us through initial curiosity, naive optimism, then dismay at the scale of proposed error-corrected systems, and into today's excitement over the availability of real, but still small and error-prone, systems [1, 2, 3].Algorithms have followed a similar roller coaster, arriving at the point where a demonstration of the implementation of algorithms originally defined as abstract equations in theory papers are now commonly represented as circuit diagrams [4].The challenge now is, for both the hardware and software is scalability, how can we have more qubits and build larger and more sophisticated programs.This thesis introduces a collection of software functions (Cirquo), a packaged testing suite aiming to address the complex challenges of quantum circuit development as quantum programs scale up to the complexities of classical software.As the field of quantum software engineering evolves, the need for sophisticated tools that can handle the nuances of quantum computing becomes imperative.Cirquo stands out by offering tailored debugging strategies and comprehensive testing capabilities specifically designed to manage the unique aspects of quantum computation.In this thesis we discuss the three main types of quantum circuit blocks: Amplitude Permutation, Phase Modulation, and Amplitude Redistribution.Each type presents specific challenges that we proposed different approaches to address.For Amplitude Permutation Circuits, we provide techniques to correct amplitude permutations, effectively mimicking classical operations and ensuring circuit accuracy.In the realm of Phase Modulation Circuits, the suite offers precise calibration tools for phase alterations, which are critical for the successful execution of quantum algorithms.The most complex Amplitude Redistribution Circuits benefit from advanced methods that adjust probability amplitudes to maintain the integrity of quantum states.The suite enhances quantum circuit debugging by allowing developers to divide circuits into manageable slices, either vertically or horizontally, categorize these slices, ii iii and perform targeted tests.This slicing mechanism is vital for isolating problematic sections and applying focused debugging strategies without disrupting the circuit's overall functionality.Additionally, Cirquo facilitates gate tracking within each circuit slice, providing developers with detailed insights into gate behavior and interactions.One of the main features of Cirquo is its automated test generation, which supports six common subroutines used in quantum algorithms.This feature streamlines the testing process and enhances the efficiency of detecting and resolving bugs.Moreover, the suite's capability to simulate or execute tests on current quantum devices ensures that developers can optimize circuits for real-world applications.This thesis also offers strategic advice on creating efficient test cases for different circuit categories.These test cases are instrumental in pinpointing the location of bugs, thus significantly reducing debugging time and improving circuit reliability.In conclusion, this research significantly advances the field of quantum computing by providing a robust framework for debugging quantum circuits.The introduction of Cirquo is a pivotal step towards developing reliable quantum computing systems, which are expected to have profound implications across various domains.The empirical evidence confirms the effectiveness of Cirquo in optimizing quantum circuit performance, marking a significant milestone in the maturation of quantum software engineering.
A Suite for Testing and Debugging Quantum Programs", addresses an underdeveloped area of research in the current scope of quantum computing: testing and debugging quantum programs.This work makes a significant contribution not only to the future of quantum software development but also more broadly to the advancement of the field of quantum computing, as software tools are critical to maturing from the current NISQ (noisy intermediate-scale quantum) era to the FTQC (fault-tolerant quantum computation) era.Quantum technology has been rapidly evolving, as seen through the significant advances in quantum computing, sensing, cryptography, and communication.Quantum technology is transitioning from experimental prototypes to more practical, yet still limited, applications.These advances offer the prospect of unprecedented computational capabilities for specific tasks like optimization, chemical simulation, and cryptography but are hindered by challenges such as error rates, qubit coherence times, and scalability.All of these problems are being addressed by physicists and engineers.One area receiving far too little attention is the emerging field of quantum software engineering.
As new advancements in the field of quantum computing lead to the development of increasingly complex programs, approaches to validate and debug these programs are becoming more important. To this end, methods employed in classical debugging, such as assertions for testing specific properties of a program's state, have been adapted for quantum programs. However, to efficiently debug quantum programs, it is key to properly place these assertions. This usually requires a deep understanding of the program's underlying mathematical properties, constituting a time-consuming manual task for developers. To address this problem, this work proposes methods for automatically refining assertions in quantum programs by moving them to more favorable positions in the program or by placing new assertions that help to further narrow down potential error locations. This allows developers to take advantage of rich and expressive assertions that greatly improve the debugging experience without requiring them to place these assertions manually in an otherwise tedious manner. An opensource implementation of the proposed methods is available at https://github.com/cda-tum/mqt-debugger.
The continuous growth of quantum computing and the increasingly complex quantum programs resulting from it lead to unprecedented obstacles in ensuring program correctness. Runtime assertions are, therefore, becoming a crucial tool in the development of quantum programs. They assist developers in the debugging process and help to test and verify the program. However, while assertions can be implemented in a straightforward manner on classical computers, physical limitations of quantum computers pose considerable challenges for the evaluation of quantum assertions. Access to the quantum state of a program is limited, execution time is expensive and noise can significantly distort measurement outcomes. To address these problems, this work proposes a framework that assists developers in the evaluation of runtime assertions on real quantum computers. It translates a variety of assertions into sets of measurements, reduces execution overhead where possible and evaluates the measurement results after the execution even in the presence of noise. This approach substantially aids developers in the debugging process, enabling efficient assertion-driven debugging even in large programs. The proposed framework is available as an open-source implementation at https://github.com/munich-quantum-toolkit/debugger