Analyzing Quantum Programs with LintQ: A Static Analysis Framework for Qiskit
Abstract.
As quantum computing is rising in popularity, the amount of quantum programs and the number of developers writing them are increasing rapidly. Unfortunately, writing correct quantum programs is challenging due to various subtle rules developers need to be aware of. Empirical studies show that 40–82% of all bugs in quantum software are specific to the quantum domain. Yet, existing static bug detection frameworks are mostly unaware of quantum-specific concepts, such as circuits, gates, and qubits, and hence miss many bugs. This paper presents LintQ, a comprehensive static analysis framework for detecting bugs in quantum programs. Our approach is enabled by a set of abstractions designed to reason about common concepts in quantum computing without referring to the details of the underlying quantum computing platform. Built on top of these abstractions, LintQ offers an extensible set of ten analyses that detect likely bugs, such as operating on corrupted quantum states, redundant measurements, and incorrect compositions of sub-circuits. We apply the approach to a newly collected dataset of 7,568 real-world Qiskit-based quantum programs, showing that LintQ effectively identifies various programming problems, with a precision of 91.0% in its default configuration with the six best performing analyses. Comparing to a general-purpose linter and two existing quantum-aware techniques shows that almost all problems (92.1%) found by LintQ during our evaluation are missed by prior work. LintQ hence takes an important step toward reliable software in the growing field of quantum computing.
1. Introduction
Given the rising interest in quantum computing, ensuring the correctness of quantum software is increasingly important. Studies on bugs in quantum computing platforms (Paltenghi and Pradel, 2022) and quantum programs (Luo et al., 2022) show that many bugs in such software are problems specific to the quantum computing domain. For example, Paltenghi and Pradel (2022) and Luo et al. (2022) report that 40% and 82%, respectively, of the bugs found in quantum software are due to quantum-specific bug patterns. Detecting bugs in quantum programs is especially important because many bugs silently lead to unexpected results, which may be hard to spot due to the probabilistic results of quantum computations.
Unfortunately, popular bug detection tools, such as CodeQL (Avgustinov et al., 2016), Pylint (Pyl, [n. d.]), Flake8 (Fla, [n. d.]), Infer (Calcagno et al., 2015), and ErrorProne (Google, 2015), are unaware of quantum computing. These tools consist of two parts: First, a framework that provides a set of abstractions to reason about general properties of programs, such as data flow and control flow. Second, a set of analyses built on top of the framework, each of which detects a particular kind of bug. This design has proven effective for general-purpose bug detection, as it allows to reuse the framework for different analyses. Yet, the abstractions provided by these frameworks are not sufficient to reason about quantum-specific concepts, such as quantum gates, quantum circuits, and quantum registers.
As a motivating example, Figure 1 shows a buggy quantum program. The program is based on Qiskit, a popular quantum computing platform, where a quantum program is Python code that uses a specific library. The code creates a circuit with a quantum register and a classical register, and then applies a sequence of gates and measurements to the circuit. The image on the right of the figure shows a graphical representation of the circuit. Despite being a simple program, the code contains two bugs. First, the code creates a circuit with four qubits, but then uses only three of them. Oversizing a circuit is strongly discouraged in quantum computing, because it wastes resources and because current hardware offers only a limited amount of qubits. Second, the code measures the state of qubit 0 at line 9, and afterwards applies a gate to the same qubit at line 10. Unfortunately, due to the properties of quantum mechanics, the measurement destroys the quantum state, and hence, the program feeds a collapsed state to the ry operation. Finding such bugs in an automated bug detector requires the ability to reason about quantum-specific concepts.
Applying a general-purpose static bug detector, e.g., Pylint (Pyl, [n. d.]), to the code in Figure 1 does not reveal the quantum-specific bugs. Recently, first techniques aimed at quantum programs have been proposed. One of them, QSmell (Chen et al., 2023) relies on dynamic analysis for most of its checks, and hence, is inherently harder to apply to real-world programs than a static analysis. Another one, QChecker (Zhao et al., 2023b), operates directly on the AST representation of quantum programs, but does not provide a general framework that abstracts over the details of the underlying quantum computing platform. Besides their conceptual limitations, neither QSmell111Here and also in our empirical evaluation, we refer to the static subset of QSmell’s checks because getting arbitrary quantum programs to execute is non-trivial, e.g., due to unresolved dependencies and user input expected by a program. nor QChecker detects the bugs in Figure 1, showing that there is a need for a comprehensive static bug detection framework for quantum programs.
This paper introduces LintQ, a static analysis framework for detecting bugs in quantum programs. The approach is enabled by two key contributions. First, LintQ offers a set of abstractions of common concepts in quantum computing, such as circuits, gates, and qubits. These abstractions lift code written based on a specific quantum computing API, such as Qiskit, onto a higher level of abstraction. Second, we implement on top these abstractions an extensible set of ten analyses, each of which queries the code for a particular kind of quantum programming problem. To benefit from prior work on general-purpose program analysis, the approach builds on an existing analysis framework, CodeQL (Avgustinov et al., 2016).
Applying LintQ to the code in Figure 1 leads to warnings about the two bugs. To reach this conclusion, the framework first represents the different elements of the program using our quantum-specific abstractions. For example, this representation expresses the fact that the circuit created at line 5 has four qubits. An analysis checking for oversized circuits then uses this information to determine that the circuit only uses the first three of the four qubits. To find the second bug, an analysis aimed at warning about operations to a qubit applied after measuring the qubit builds upon the fact that our framework indicates that lines 9 and 10 operate on the same qubit. Importantly, none of the analyses need to reason about specific API calls in the Python code, but instead reasons about the quantum program at the level of LintQ’s abstractions, which greatly simplifies the implementation of analyses.
We evaluate our approach by applying it to a novel dataset of 7,568 real-world, Qiskit-based quantum programs. The analyses built on top of our framework identify various problems in these programs. Manually inspecting a sample of 345 warnings from ten analyses shows that LintQ identifies 216 legitimate programming problems. Moreover, when using the default and recommended configuration of LintQ with six analyses, it achieves a precision of 91.0% (121 true positives out of 133 warnings). We reported 70 problems, seven of which have already been confirmed or even fixed. Our evaluation also shows that implementing an analysis on top of our abstractions is relatively simple, with an average of only 10 LoC per analysis, and that the analysis time is reasonable, with an average of 1.3 seconds per program.
In summary, this work makes the following contributions:
-
•
A comprehensive framework for quantum program analysis, which provides reusable abstractions to reason about quantum software.
- •
-
•
A novel dataset of 7,568 real-world, Qiskit-based quantum programs, which is the largest such dataset and hence, may serve as a basis for future work.
-
•
A thorough evaluation of the effectiveness of the analyses, showing that the approach in its default configuration finds real-world issues with a precision of 91.0% while taking only 1.3 seconds to analyze a program.
2. Background
2.1. Quantum Programming
Several quantum programming languages have been proposed, such as Qiskit (Developers, 2021b), Cirq (Developers, 2021a), Q# (Svore et al., 2018), and Silq (Bichsel et al., 2020). Quantum programs, also called quantum circuits, are expressed as a sequence of operations, called quantum gates, applied to individual qubits. In Figure 1, we show a Qiskit program with four qubits and one classical bit, represented as horizontal lines, whereas the gates are shown as boxes or colored vertical lines. A special type of gate, called measurement gate, is used to measure the state of a qubit and store the result in a classical bit. The measurement gate, represented in black in the figure, produces a certain bit, either 0 or 1, with probabilities determined by the qubit state. Once the circuit has been defined, it is sent to a backend that executes it, typically a simulator or a real quantum computer. Note that a measurement has the important side-effect of destroying the quantum state. To sufficiently characterize its output, the circuit is executed multiple times, called shots, each time measuring the qubit.
To define and run quantum programs, developers rely on a quantum computing platform. A popular approach is to implement a platform on top of Python, as done by Qiskit (Developers, 2021b), Cirq (Developers, 2021a), Tket (Sivarajah et al., 2020), and Pennylane (Bergholm et al., 2020), so that a quantum program is essentially Python code that uses a specific library. Most platforms, with some noteworthy exceptions (Bichsel et al., 2020; Paradis et al., 2021; Weigold et al., 2021) describe programs on the level of circuits, and LintQ focuses on the analysis of quantum circuits. In particular, LintQ focus on code written using the Qiskit quantum computing platform due to its popularity in both practice (Dargan, 2022) and research (Paltenghi and Pradel, 2022; Zhao et al., 2021b; Luo et al., 2022; Fortunato et al., 2022b, a; Wang et al., 2021b; Paltenghi and Pradel, 2023).
2.2. Static Analysis with CodeQL
CodeQL (Avgustinov et al., 2016)222https://codeql.github.com/ is a popular engine for static analysis. It extracts facts from a program, such as its syntactic structure, data flow, and control flow, and then stores them in a relational database, which can be queried with the QL logic language. A query refers to classes, which we call abstractions, and their predicates, which represent relations between the abstractions. As a simple example, Figure LABEL:fig:example_codeql shows a CodeQL query that finds redundant if statements in Python. In the from section of the query, we define which program elements we consider, namely all if statements (If) and all statements (Stmt). Then, the where section restricts the query and focuses on those if statements that contain the pass keyword in their body. Finally, the select section specifies the warning and its message. At line 3, we see how the If abstraction offers a getStmt predicate, which connects the if statement with its first statement in the “if true” block. Although Python is the language of choice of many quantum computing platforms (Qis, 2021; Developers, 2021a; Sivarajah et al., 2020), the built-in QL library for Python extracts no information regarding quantum computing concepts, such as the quantum registers, the qubit position in a register, the quantum gates, or the difference between a state manipulation and a measurement, further motivating the need for LintQ.
2.3. RQ3: Precision and Recall
Analysis Name | Tot. warnings | % Files | Precision | FP / NW / TP |
---|---|---|---|---|
DoubleMeas | 39 | 0.36% | 72.0% | 4/3/18 |
OpAfterMeas | 127 | 0.92% | 100.0% | 0/0/44 |
MeasAllAbuse | 22 | 0.26% | 94.1% | 0/1/16 |
ConstClasBit | 533 | 4.29% | 48.3% | 21/10/29 |
CondWoMeas | 46 | 0.22% | 100.0% | 0/0/28 |
InsuffClasReg | 3489 | 17.35% | 34.8% | 22/21/23 |
OversizedCircuit | 378 | 3.01% | 50.0% | 16/13/29 |
OpAfterTransp | 7 | 0.05% | 100.0% | 0/0/7 |
GhostCompose | 12 | 0.09% | 66.7% | 0/4/8 |
OldIdenGate | 46 | 0.37% | 50.0% | 11/3/14 |
Precision. Because precision is crucial for practical adoption of static analyzers (Flanagan et al., 2002; Bessey et al., 2010; Johnson et al., 2013), we assess to what extent the analyses suffer from false positives. We manually inspect a random sample of ten warnings for each analysis, or all produced warnings if that number is lower than ten. Two of the authors, who are both experienced in static analysis and with quantum computing knowledge, independently inspect the warnings and then discuss them to reach a consensus. After the initial inspection, a 70.1% agreement was reached, and after the discussion, all disagreements were resolved. Based on the agreement, we compile an annotation protocol and a single author proceeds to annotate more warnings up to reaching a statistically relevant sample with a confidence level of 90% and a margin of error of 10% for each of the ten analyses, similar to related work (Ghaleb et al., 2023). We categorize each warning into one of three categories. A true positive is a warning that reveals clearly incorrect behavior in the program. Such incorrect behavior may result in a program crash, in incorrect output, or in an unnecessary performance degradation. A noteworthy warning is a potential problem where the analysis correctly detects an instance of the targeted programming problem, but we cannot certainly say whether the behavior is unexpected by the developer. Finally, a false positive is a warning reported despite the code being correct, which is typically caused by overly strong assumptions made by an analysis. Based on this classification, we compute precision as the percentage of true positives among all warnings. That is, our notion of precision underestimates the true precision, as it includes noteworthy warnings in the denominator, but not in the numerator. Table 1 illustrates the results of our manual inspection. Each analysis identifies at least a few true positives. The median precision across all analyses is 69.3%. The overall precision across all inspected warnings is 62.6% (216 true positives out of 345 inspected warnings). In practice, we recommend to enable those analyses that produce sufficiently precise results for the usage environment, and to inspect warnings by high-precision analyses first. For example, keeping only analyses with precision above 50%, yields an overall precision of 91.0% from the remaining six analyses, which we recommend as the default configuration for LintQ. Root causes of false positives. To better understand the reasons for false positives, we discuss representative cases in the following. False positives of the InsuffClasReg happen when: (ii) the circuit has more qubits than classical bits because of the presence of ancilla qubits, i.e., auxiliary storage used during a computation that does not need to be measured; (ii) the circuit is used as a submodule of a bigger circuit, thus it is not responsible of instantiating the classical bits. Better distinguishing between ancilla qubits and missed classical bits remains as a challenge for future work. The OversizedCircuit analysis causes false positives when the circuit has sub-circuits generated via a function call (e.g., qc.append(QFT(3), qargs=[0, 1, 2])), which LintQ currently does not track, thus making the circuit appear underused. Recall. Since we do not know the ground truth of all bugs in the 7,568 real-world quantum programs, we cannot compute the recall of LintQ on this large dataset. Instead, we use Bugs4Q (Zhao et al., 2021b; Luo et al., 2022)333https://github.com/Z-928/Bugs4Q-Framework, an existing benchmark of 42 quantum bugs. We run LintQ on the 42 buggy files, manually inspect the warnings by using the same annotation procedure applied in the rest of this work, and then check how many of LintQ’s true positives match a known bug in Bugs4Q. LintQ raises four true positive warnings (two by the OpAfterMeas, one by MeasAllAbuse, and one by OldIdenGate) that correspond to three known bugs in Bugs4Q. Thus, the recall of LintQ is 7.1% (3/42). While this number may seem low, it is actually higher than the recall of popular static bug detectors on Defect4J (Just et al., 2014), which prior work has measured to be between 1% and 3%, depending on the bug detector (Habib and Pradel, 2018). Interestingly, LintQ also finds some problems in the benchmark code beyond the known bugs of the benchmark. For example, the InsuffClasReg analysis raises several true positive warnings because some circuits do not have any classical register, which is likely due to the fact that the examples are incomplete code snippets gathered from issues and forum questions.
2.4. RQ4: Comparison with Prior Work
Due to the young field of quantum software engineering, there are only few static analyzers aimed at quantum programs: (i) QSmell (Chen et al., 2023), which detects smells in quantum programs, (ii) QChecker (Zhao et al., 2023b), an AST-based static analysis tool for quantum programs, (iii) QCPG (Kaul et al., 2023), a toolkit that extends Code Property Graphs (Yamaguchi et al., 2014) to analyze quantum code. Moreover, since the quantum programs we analyze are written in Python, we also compare with Pylint (Pyl, [n. d.]), a popular linter for Python designed for classical software. For QSmell we focus on their two static analysis-based detectors; for QChecker we use their eight AST-based checkers; for Pylint, we run the tool its default configuration. Unfortunately, we had to drop QCPG from the comparison because the tool is not available yet.444Although the authors plan to release the tool, the repository states the code is undergoing export checks, as confirmed by email. Prior work applied to problems found by LintQ. We run all three competitors on the programs where LintQ detects one of the 216 true positives that we have manually confirmed (Section 2.3), and we check which of them the existing techniques detect. QSmell, QChecker, and Pylint raise 77, 200, and 8,627 warnings, respectively. We inspect each warning that is at the same line as one of the LintQ warnings, which corresponds to 0, 9, and 42 warnings, and we assess whether they refer to the same problem or coincidentally flag the same line. For the QChecker warnings, we found that seven problems are found by both QChecker and LintQ, two of QChecker’s warnings coincidentally flag the same line, and the remaining 207 are missed by QChecker and found only by LintQ. For the Pylint warnings, 15 Pylint warnings correspond to the same issues flagged by OldIdenGate (14) and OversizedCircuit (1), 32 warnings coincidentally flag the same line, including conventions and coding style (29), and uses of missing APIs and arguments (3), and the remaining 174 warnings are missed by Pylint and found only by LintQ. Overall, prior work can find only 7.9% (17/216) of the true positives found by LintQ, overlooking the remaining 92.1% (199/216). LintQ applied to problems found by prior work. We also study the opposite direction: How many of the warnings raised by the competitors are also raised by LintQ? To this end, we run each quantum-specific competitor and inspect a sample of up to ten warnings produced by each of their detectors. For QSmell and QChecker we inspect, respectively, 20 warnings from two detectors and 59 warnings from six detectors. For QSmell, we unfortunately found no true positives among the 20 inspected warnings. The first detector (NC) flags a file that has more run and execute calls, used to run a circuit on a simulator or real hardware, than bind_parameters calls, used to convert any parametric gate into its concrete version before execution. These warnings are false positives, for two reasons: (1) The warning is emitted also when there is a single execute call, which is normal for any circuit that uses only concrete gates. (2) The detector does not model the assign_parameters API, which is a legitimate alternative to calling bind_parameters. The second detector (LPQ) checks if there is a transpile API call without the argument initial_layout set, since passing that argument is a good practice when running on a real quantum computer. Again, all the inspected warnings are false positives, for two main reasons: (1) The missing initial_layout argument is present with a simulator backend, which in practice has no hardware constraint to respect. (2) The rule considers any transpile calls, even those not belonging to Qiskit, which has no initial_layout argument. For QChecker, we found three true positives among the 59 inspected warnings. The true positives are raised by the Deprecated Order detector, which flags a deprecated usage of the iden, analogously to our OldIdenGate analysis. However, QChecker also reports many false positives, primarly because it warns about any function call that includes the substring iden, which also happens in functions unrelated to the quantum library. All three true positives found by QChecker are also detected by LintQ, because our OldIdenGate analysis targets the same kind of problem. The main difference is that LintQ raises fewer false positives, because it explicitly models gates, instead of relying on a text-based matching of the API name.
2.5. RQ5: Efficiency
We measure the time spent for analyzing all 7,568 quantum programs with all ten analyses. All experiments are run on an Ubuntu machine with an Intel Xeon Silver 4214 CPU with 48 cores and 252 GB of RAM. There are three main computational steps: (i) Using CodeQL to build the database of facts about the Python code, which takes 74 minutes for all 7,568 programs; (ii) Compiling the query plan of the analyses, which takes 97.0 seconds; and (iii) Running the analyses on the database, which takes 162 minutes. Inspecting the computational cost of individual analyses shows that the two most expensive analyses are those that reason about the gate execution order, DoubleMeasurement and OpAfterMeasurement, which take 2,290 and 1,761 seconds to evaluate, respectively. Taking all three steps together, LintQ takes 1.3 seconds per analyzed program.
3. Threats to Validity
Internal Validity
First, our analyses scan each program file individually, not considering the other files in the same repository. Applying LintQ at the repository level may produce different warnings. Second, we inspect only a subset of all warnings. To mitigate this thread, we sample the inspected warnings randomly and use a statistically relevant sample size. Third, our implementation may contains bugs. To mitigate this risk, we implement test cases for the abstractions and the analyses, and we make our implementation publicly available as open-source. Fourth, our literature review may have missed some relevant bug patterns. However, LintQ is designed to be extensible, i.e., additional bug patterns can be added to the framework in the future. Fifth, the manual inspection of warnings is inherently subjective. To mitigate this, two authors participated in the process, collaboratively developing and agreeing on an annotation protocol. This protocol has been documented and is made available in our artifact.
External Validity
First, while the abstractions of LintQ are designed to be also applicable to other quantum computing platforms, such as Cirq (Developers, 2021a) and Tket (Sivarajah et al., 2020), we cannot claim that our results generalize beyond Qiskit. Second, we cannot guarantee that our results generalize to other quantum programs. To mitigate this threat, we evaluate the approach on 7,568 real-world programs, which represents the largest such dataset to date.
4. Related Work
Quantum Software Testing
Miranskyy et al. (2020) highlight quantum-specific debugging issues when working with quantum programs and discuss how classical solutions could be adapted to the quantum domain. Regarding platform code, various approaches have been proposed, including differential testing (Wang et al., 2021b), metamorphic testing (Paltenghi and Pradel, 2023), and fuzzing (Xia et al., 2024). However, they all focus on platform code and require executing the code, whereas LintQ focuses on application code and is based on static analysis. Regarding application code, various techniques have been proposed. QuanFuzz(Wang et al., 2021a) tests a single algorithm with different inputs with the goal of maximizing branch coverage via a genetic algorithm. Quito (Ali et al., 2021) relies on a program specification and statistical tests to evaluate the correctness of a single small program. Huang and Martonosi (2019) propose statistical approaches to evaluate assertions in a quantum program. Li et al. (2020) describe a projection-based runtime assertion scheme that allows for asserting in the middle of the circuit without affecting the tested state if the assertion is satisfied. All these approaches assume to have single circuit programs that can be easily executed multiple times, which may not be the case in practice. Moreover, they rely on executing the programs, whereas LintQ is based on static analysis.
Quantum Program Analysis
Few analyses for quantum programs have been proposed so far, including QSmell (Chen et al., 2023), ScaffCC (JavadiAbhari et al., 2014), QChecker (Zhao et al., 2023b), and QCPG (Kaul et al., 2023). QSmell mostly relies on dynamic analysis, and it focuses on code smells only. ScaffCC is a compiler that performs a limited set of analyses using a new flavor of QASM, whereas we focus on Qiskit-based Python code. QChecker is a static analysis tool that relies only on AST information, but does not provide a general framework to build new analyses and does not model any control flow. QCPG (Kaul et al., 2023) extends Code Property Graphs (Yamaguchi et al., 2014) to analyze quantum code in a single circuit, whereas LintQ is designed to analyze entire programs and models the composition of circuits, as well as unknown quantum operators. There also exist quantum-specific program analyses, such as entanglement analysis (JavadiAbhari et al., 2014; Perdrix, 2008) and automatic uncomputation (Bichsel et al., 2020; Paradis et al., 2021; Xia and Zhao, 2023). However, most of them address a single problem each, whereas LintQ offers a set of general abstractions.Quantum abstract interpretation (Yu and Palsberg, 2021) and runtime assertions (Li et al., 2020) are two techniques to assert properties of quantum computations. They require manually crafted, algorithm-specific assertions, whereas LintQ does not require any prior knowledge of the program. In summary, LintQ goes beyond the purely syntactic level and single-circuit approaches by providing reusable abstractions to build a wide range of analyses in realistic settings with multiple circuits and unknown quantum operators.
Datasets of Quantum Programs
Paltenghi and Pradel (2022) share a large dataset of bugs in quantum computing platforms. However, the focus of LintQ is on application code written in Qiskit, and not on platform code. Two application-level datasets are QASMBench (Li et al., 2023), which includes 48 programs written in OpenQASM, and work by Long and Zhao (2023), which proposes a dataset of 63 Q# programs.However, they are not suitable for our evaluation because they are not written in Python/Qiskit. Luo et al. (2022) and Zhao et al. (2021b) study the bugs in quantum computing programs in Qiskit, mainly collected from GitHub issues of the official Qiskit repository and StackOverflow questions. In contrast, we present a much larger dataset of 7,568 real-world programs, including many programs that are not part of the Qiskit repositories.
Domain-Specific API Modeling
Previous work has modeled other specialized Python libraries, e.g., in machine learning (Lagouvardos et al., 2020; Baker et al., 2022), to spot bugs with static analysis. Our work also relates to general static API misuse detectors (Amann et al., 2019), which mostly focuses on Java and traditional application domains. Instead, we focus on the quantum domain, which comes with its own concepts and APIs to model.
5. Conclusion
We present LintQ, a framework for statically analyzing quantum programs and an extensible set of ten analyses. The approach introduces a set of abstractions that capture common concepts in quantum programs, such as circuits, gates, and qubits, as well as the relations between these concepts. Thanks to these abstractions, analyses aimed at finding specific kinds of programming problems can be easily implemented in a few lines of code (10 LoC). To evaluate LintQ, we apply the approach to a novel dataset of 7,568 quantum programs, and in its default configuration with six analyses, LintQ achieves a precision of 91.0% (121 true positives out of 133 warnings).
6. Data Availability
LintQ, our dataset, and all results are publicly available at https://github.com/sola-st/LintQ and archived at https://zenodo.org/records/11095456.
7. Acknowledgments
This work was supported by the European Research Council (ERC, grant agreement 851895), and by the German Research Foundation within the ConcSys, DeMoCo, and QPTest projects.
References
- (1)
- Fla ([n. d.]) [n. d.]. Flake8: Your Tool For Style Guide Enforcement — Flake8 6.0.0 Documentation. https://flake8.pycqa.org/en/latest/.
- Nbc ([n. d.]) [n. d.]. Nbconvert: Convert Notebooks to Other Formats — Nbconvert 7.2.9 Documentation. https://nbconvert.readthedocs.io/en/latest/index.html.
- Opt ([n. d.]) [n. d.]. OptimizeSwapBeforeMeasure Pass Drops Swap Gate (Even If There Is NO Measure after It) Issue #7642 Qiskit/Qiskit. https://github.com/Qiskit/qiskit/issues/7642.
- Pyl ([n. d.]) [n. d.]. Pylint - Code Analysis for Python — Www.Pylint.Org. https://www.pylint.org/.
- Qis (2021) 2021. Qiskit/Qiskit. https://github.com/Qiskit/qiskit.
- Ali et al. (2021) Shaukat Ali, Paolo Arcaini, Xinyi Wang, and Tao Yue. 2021. Assessing the Effectiveness of Input and Output Coverage Criteria for Testing Quantum Programs. In 2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST). 13–23. https://doi.org/10.1109/ICST49551.2021.00014
- Amann et al. (2019) Sven Amann, Hoan Anh Nguyen, Sarah Nadi, Tien N. Nguyen, and Mira Mezini. 2019. A Systematic Evaluation of Static API-Misuse Detectors. IEEE Transactions on Software Engineering 45, 12 (Dec. 2019), 1170–1188. https://doi.org/10.1109/TSE.2018.2827384
- Avgustinov et al. (2016) Pavel Avgustinov, Oege de Moor, Michael Peyton Jones, and Max Schäfer. 2016. QL: Object-oriented Queries on Relational Data. In 30th European Conference on Object-Oriented Programming (ECOOP 2016) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 56), Shriram Krishnamurthi and Benjamin S. Lerner (Eds.). Schloss Dagstuhl–Leibniz-Zentrum fuer Informatik, Dagstuhl, Germany, 2:1–2:25. https://doi.org/10.4230/LIPIcs.ECOOP.2016.2
- Baker et al. (2022) Wilson Baker, Michael O’Connor, Seyed Reza Shahamiri, and Valerio Terragni. 2022. Detect, Fix, and Verify TensorFlow API Misuses. In 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). 925–929. https://doi.org/10.1109/SANER53432.2022.00110
- Bergholm et al. (2020) Ville Bergholm, Josh Izaac, Maria Schuld, Christian Gogolin, M. Sohaib Alam, Shahnawaz Ahmed, Juan Miguel Arrazola, Carsten Blank, Alain Delgado, Soran Jahangiri, Keri McKiernan, Johannes Jakob Meyer, Zeyue Niu, Antal Száva, and Nathan Killoran. 2020. PennyLane: Automatic Differentiation of Hybrid Quantum-Classical Computations. arXiv:1811.04968 [physics, physics:quant-ph] (Feb. 2020). arXiv:1811.04968 [physics, physics:quant-ph]
- Bessey et al. (2010) Al Bessey, Ken Block, Ben Chelf, Andy Chou, Bryan Fulton, Seth Hallem, Charles Henri-Gros, Asya Kamsky, Scott McPeak, and Dawson Engler. 2010. A Few Billion Lines of Code Later: Using Static Analysis to Find Bugs in the Real World. Commun. ACM 53, 2 (Feb. 2010), 66–75. https://doi.org/10.1145/1646353.1646374
- Bichsel et al. (2020) Benjamin Bichsel, Maximilian Baader, Timon Gehr, and Martin Vechev. 2020. Silq: A High-Level Quantum Language with Safe Uncomputation and Intuitive Semantics. In Proceedings of the 41st ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2020). Association for Computing Machinery, New York, NY, USA, 286–300. https://doi.org/10.1145/3385412.3386007
- Calcagno et al. (2015) Cristiano Calcagno, Dino Distefano, Jérémy Dubreil, Dominik Gabi, Pieter Hooimeijer, Martino Luca, Peter O’Hearn, Irene Papakonstantinou, Jim Purbrick, and Dulma Rodriguez. 2015. Moving fast with software verification. In NASA Formal Methods: 7th International Symposium, NFM 2015, Pasadena, CA, USA, April 27-29, 2015, Proceedings 7. Springer, 3–11.
- Chen et al. (2023) Qihong Chen, Rúben Câmara, José Campos, André Souto, and Iftekhar Ahmed. 2023. The Smelly Eight: An Empirical Study on the Prevalence of Code Smells in Quantum Computing - Artifact. 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE) (Jan. 2023). https://doi.org/10.5281/ZENODO.7556360
- Dargan (2022) James Dargan. 2022. Top 5 Quantum Programming Languages in 2022.
- Deutsch and Penrose (1997) David Elieser Deutsch and Roger Penrose. 1997. Quantum Computational Networks. Proceedings of the Royal Society of London. A. Mathematical and Physical Sciences 425, 1868 (Jan. 1997), 73–90. https://doi.org/10.1098/rspa.1989.0099
- Developers (2021a) Cirq Developers. 2021a. Cirq. Zenodo. https://doi.org/10.5281/zenodo.5182845
- Developers (2021b) Qiskit Developers. 2021b. Qiskit: An Open-Source Framework for Quantum Computing. https://doi.org/10.5281/zenodo.2573505
- Egretta.Thula (2023) Egretta.Thula. 2023. Answer to ”Why Does Composing a Clifford Circuit to Another Circuit Not Work? (Qiskit)” - Quantum Computing Stack Exchange.
- Flanagan et al. (2002) Cormac Flanagan, K. Rustan M. Leino, Mark Lillibridge, Greg Nelson, James B. Saxe, and Raymie Stata. 2002. Extended Static Checking for Java. ACM SIGPLAN Notices 37, 5 (May 2002), 234–245. https://doi.org/10.1145/543552.512558
- Fortunato et al. (2022a) Daniel Fortunato, José Campos, and Rui Abreu. 2022a. Mutation Testing of Quantum Programs Written in QISKit. In Proceedings of the ACM/IEEE 44th International Conference on Software Engineering: Companion Proceedings (ICSE ’22). Association for Computing Machinery, New York, NY, USA, 358–359. https://doi.org/10.1145/3510454.3528649
- Fortunato et al. (2022b) Daniel Fortunato, José Campos, and Rui Abreu. 2022b. QMutPy: A Mutation Testing Tool for Quantum Algorithms and Applications in Qiskit. In Proceedings of the 31st ACM SIGSOFT International Symposium on Software Testing and Analysis (ISSTA 2022). Association for Computing Machinery, New York, NY, USA, 797–800. https://doi.org/10.1145/3533767.3543296
- Ghaleb et al. (2023) Asem Ghaleb, Julia Rubin, and Karthik Pattabiraman. 2023. AChecker: Statically Detecting Smart Contract Access Control Vulnerabilities. In 2023 IEEE/ACM 45th International Conference on Software Engineering (ICSE). 945–956. https://doi.org/10.1109/ICSE48619.2023.00087
- Google (2015) Google. 2015. Error Prone: static analysis tool for Java. http://errorprone.info/.
- Habib and Pradel (2018) Andrew Habib and Michael Pradel. 2018. How Many of All Bugs Do We Find? A Study of Static Bug Detectors. In 2018 33rd IEEE/ACM International Conference on Automated Software Engineering (ASE). 317–328. https://doi.org/10.1145/3238147.3238213
- Huang and Martonosi (2019) Yipeng Huang and Margaret Martonosi. 2019. Statistical Assertions for Validating Patterns and Finding Bugs in Quantum Programs. In Proceedings of the 46th International Symposium on Computer Architecture (ISCA ’19). Association for Computing Machinery, New York, NY, USA, 541–553. https://doi.org/10.1145/3307650.3322213
- JavadiAbhari et al. (2014) Ali JavadiAbhari, Shruti Patil, Daniel Kudrow, Jeff Heckey, Alexey Lvov, Frederic T. Chong, and Margaret Martonosi. 2014. ScaffCC: A Framework for Compilation and Analysis of Quantum Computing Programs. In Proceedings of the 11th ACM Conference on Computing Frontiers (CF ’14). Association for Computing Machinery, New York, NY, USA, 1–10. https://doi.org/10.1145/2597917.2597939
- Johnson et al. (2013) Brittany Johnson, Yoonki Song, Emerson Murphy-Hill, and Robert Bowdidge. 2013. Why Don’t Software Developers Use Static Analysis Tools to Find Bugs?. In Proceedings of the 2013 International Conference on Software Engineering (ICSE ’13). IEEE Press, San Francisco, CA, USA, 672–681.
- Just et al. (2014) René Just, Darioush Jalali, and Michael D. Ernst. 2014. Defects4J: A Database of Existing Faults to Enable Controlled Testing Studies for Java Programs. In Proceedings of the 2014 International Symposium on Software Testing and Analysis (ISSTA 2014). Association for Computing Machinery, New York, NY, USA, 437–440. https://doi.org/10.1145/2610384.2628055
- Kaul et al. (2023) Maximilian Kaul, Alexander Küchler, and Christian Banse. 2023. A Uniform Representation of Classical and Quantum Source Code for Static Code Analysis. https://doi.org/10.48550/arXiv.2308.06113 arXiv:2308.06113 [cs]
- Lagouvardos et al. (2020) Sifis Lagouvardos, Julian Dolby, Neville Grech, Anastasios Antoniadis, and Yannis Smaragdakis. 2020. Static Analysis of Shape in TensorFlow Programs. In 34th European Conference on Object-Oriented Programming (ECOOP 2020) (Leibniz International Proceedings in Informatics (LIPIcs), Vol. 166), Robert Hirschfeld and Tobias Pape (Eds.). Schloss Dagstuhl–Leibniz-Zentrum für Informatik, Dagstuhl, Germany, 15:1–15:29. https://doi.org/10.4230/LIPIcs.ECOOP.2020.15
- Li et al. (2023) Ang Li, Samuel Stein, Sriram Krishnamoorthy, and James Ang. 2023. QASMBench: A Low-Level Quantum Benchmark Suite for NISQ Evaluation and Simulation. ACM Transactions on Quantum Computing 4, 2 (Feb. 2023), 10:1–10:26. https://doi.org/10.1145/3550488
- Li et al. (2020) Gushu Li, Li Zhou, Nengkun Yu, Yufei Ding, Mingsheng Ying, and Yuan Xie. 2020. Projection-Based Runtime Assertions for Testing and Debugging Quantum Programs. Proceedings of the ACM on Programming Languages 4, OOPSLA (Nov. 2020), 150:1–150:29. https://doi.org/10.1145/3428218
- Livshits et al. (2015) Benjamin Livshits, Manu Sridharan, Yannis Smaragdakis, Ondrej Lhoták, José Nelson Amaral, Bor-Yuh Evan Chang, Samuel Z. Guyer, Uday P. Khedker, Anders Møller, and Dimitrios Vardoulakis. 2015. In defense of soundiness: a manifesto. Commun. ACM 58, 2 (2015), 44–46.
- Long and Zhao (2023) Peixun Long and Jianjun Zhao. 2023. Equivalence, Identity, and Unitarity Checking in Black-Box Testing of Quantum Programs. https://doi.org/10.48550/arXiv.2307.01481 arXiv:2307.01481 [quant-ph]
- Luo et al. (2022) Junjie Luo, Pengzhan Zhao, Zhongtao Miao, Shuhan Lan, and Jianjun Zhao. 2022. A Comprehensive Study of Bug Fixes in Quantum Programs. In 2022 IEEE International Conference on Software Analysis, Evolution and Reengineering (SANER). 1239–1246. https://doi.org/10.1109/SANER53432.2022.00147
- Miranskyy et al. (2020) Andriy Miranskyy, Lei Zhang, and Javad Doliskani. 2020. Is Your Quantum Program Bug-Free? Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering: New Ideas and Emerging Results (June 2020), 29–32. https://doi.org/10.1145/3377816.3381731 arXiv:2001.10870
- Nielsen et al. (2002) Michael A Nielsen, Isaac Chuang, and Lov K Grover. 2002. Quantum Computation and Quantum Information. Am. J. Phys. 70, 5 (2002), 4.
- Paltenghi and Pradel (2022) Matteo Paltenghi and Michael Pradel. 2022. Bugs in Quantum Computing Platforms: An Empirical Study. Proceedings of the ACM on Programming Languages 6, OOPSLA1 (April 2022), 86:1–86:27. https://doi.org/10.1145/3527330
- Paltenghi and Pradel (2023) Matteo Paltenghi and Michael Pradel. 2023. MorphQ: Metamorphic Testing of the Qiskit Quantum Computing Platform. In Proceedings of the 45th International Conference on Software Engineering (ICSE ’23). IEEE Press, Melbourne, Victoria, Australia, 2413–2424. https://doi.org/10.1109/ICSE48619.2023.00202
- Paradis et al. (2021) Anouk Paradis, Benjamin Bichsel, Samuel Steffen, and Martin Vechev. 2021. Unqomp: Synthesizing Uncomputation in Quantum Circuits. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI 2021). Association for Computing Machinery, New York, NY, USA, 222–236. https://doi.org/10.1145/3453483.3454040
- Perdrix (2008) Simon Perdrix. 2008. Quantum Entanglement Analysis Based on Abstract Interpretation. In Static Analysis (Lecture Notes in Computer Science), María Alpuente and Germán Vidal (Eds.). Springer, Berlin, Heidelberg, 270–282. https://doi.org/10.1007/978-3-540-69166-2_18
- Sivarajah et al. (2020) Seyon Sivarajah, Silas Dilkes, Alexander Cowtan, Will Simmons, Alec Edgington, and Ross Duncan. 2020. T—ket: A Retargetable Compiler for NISQ Devices. Quantum Science and Technology 6, 1 (Nov. 2020), 014003. https://doi.org/10.1088/2058-9565/ab8e92
- Svore et al. (2018) Krysta Svore, Alan Geller, Matthias Troyer, John Azariah, Christopher Granade, Bettina Heim, Vadym Kliuchnikov, Mariia Mykhailova, Andres Paz, and Martin Roetteler. 2018. Q#: Enabling Scalable Quantum Computing and Development with a High-level DSL. In Proceedings of the Real World Domain Specific Languages Workshop 2018 (RWDSL2018). Association for Computing Machinery, New York, NY, USA, 1–10. https://doi.org/10.1145/3183895.3183901
- user19571 (2022) user19571. 2022. Question: ”Remove Inactive Qubits from Qiskit Circuit” - Quantum Computing Stack Exchange.
- Wang et al. (2021a) Jiyuan Wang, Fucheng Ma, and Yu Jiang. 2021a. Poster: Fuzz Testing of Quantum Program. In 2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST). 466–469. https://doi.org/10.1109/ICST49551.2021.00061
- Wang et al. (2021b) Jiyuan Wang, Qian Zhang, Guoqing Harry Xu, and Miryung Kim. 2021b. QDiff: Differential Testing of Quantum Software Stacks. In 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE). 692–704. https://doi.org/10.1109/ASE51524.2021.9678792
- Weigold et al. (2021) Manuela Weigold, Johanna Barzen, Frank Leymann, and Marie Salm. 2021. Encoding Patterns for Quantum Algorithms. IET Quantum Communication 2, 4 (2021), 141–152. https://doi.org/10.1049/qtc2.12032
- Xia et al. (2024) Chunqiu Steven Xia, Matteo Paltenghi, Jia Le Tian, Michael Pradel, and Lingming Zhang. 2024. Fuzz4All: Universal Fuzzing with Large Language Models. In Proceedings of the IEEE/ACM 46th International Conference on Software Engineering (ICSE ’24). Association for Computing Machinery, New York, NY, USA, 1–13. https://doi.org/10.1145/3597503.3639121
- Xia and Zhao (2023) Shangzhou Xia and Jianjun Zhao. 2023. Static Entanglement Analysis of Quantum Programs. In 2023 IEEE/ACM 4th International Workshop on Quantum Software Engineering (Q-SE). 42–49. https://doi.org/10.1109/Q-SE59154.2023.00013
- Yamaguchi et al. (2014) Fabian Yamaguchi, Nico Golde, Daniel Arp, and Konrad Rieck. 2014. Modeling and Discovering Vulnerabilities with Code Property Graphs. In 2014 IEEE Symposium on Security and Privacy. 590–604. https://doi.org/10.1109/SP.2014.44
- Yu and Palsberg (2021) Nengkun Yu and Jens Palsberg. 2021. Quantum Abstract Interpretation. In Proceedings of the 42nd ACM SIGPLAN International Conference on Programming Language Design and Implementation (PLDI 2021). Association for Computing Machinery, New York, NY, USA, 542–558. https://doi.org/10.1145/3453483.3454061
- Zhao et al. (2023a) Pengzhan Zhao, Zhongtao Miao, Shuhan Lan, and Jianjun Zhao. 2023a. Bugs4Q: A Benchmark of Existing Bugs to Enable Controlled Testing and Debugging Studies for Quantum Programs. Journal of Systems and Software 205 (Nov. 2023), 111805. https://doi.org/10.1016/j.jss.2023.111805
- Zhao et al. (2023b) Pengzhan Zhao, Xiongfei Wu, Zhuo Li, and Jianjun Zhao. 2023b. QChecker: Detecting Bugs in Quantum Programs via Static Analysis. https://doi.org/10.48550/arXiv.2304.04387 arXiv:2304.04387 [cs]
- Zhao et al. (2021a) Pengzhan Zhao, Jianjun Zhao, and Lei Ma. 2021a. Identifying Bug Patterns in Quantum Programs. In 2021 IEEE/ACM 2nd International Workshop on Quantum Software Engineering (Q-SE). 16–21. https://doi.org/10.1109/Q-SE52541.2021.00011
- Zhao et al. (2021b) Pengzhan Zhao, Jianjun Zhao, Zhongtao Miao, and Shuhan Lan. 2021b. Bugs4Q: A Benchmark of Real Bugs for Quantum Programs. In 2021 36th IEEE/ACM International Conference on Automated Software Engineering (ASE). https://doi.org/10.1109/ASE51524.2021.9678908