Hybrid quantum-classical (HQC) algorithms, such as the Variational Quantum Eigensolver (VQE) and the Quantum Approximate Optimization Algorithm (QAOA), are central to near-term quantum computing but remain challenging to test. Sampling-based fuzzing can expose faulty or non-convergent configurations, but under realistic execution budgets, it may miss failure-prone regions in the joint space of classical optimizer settings and quantum circuit parameters.
This paper studies failure-guided fuzzing for HQC programs. It models a hybrid input as a pair of classical optimizer hyperparameters and quantum circuit parameters, and evaluates a two-phase strategy that first searches for non-convergent seeds and then locally fuzzes circuit parameters around those seeds. To understand where the gains come from, five budgeted strategies are compared: random hybrid testing, classical enumeration without fuzzing, random-seed local fuzzing, enumeration-seed local fuzzing, and concolic-seed local fuzzing. The study is implemented on a VQE instance and a QAOA MaxCut instance in Qiskit. The results show that failure-guided local fuzzing is the main driver of improvement over random testing, while concolic seed discovery provides additional benefits on VQE but is less stable on QAOA. These findings suggest that reusing failure information is a promising direction for HQC testing, but that the value of concolic seed discovery is workload-dependent.
Hybrid quantum-classical (HQC) algorithms, such as the Variational Quantum Eigensolver (VQE) and the Quantum Approximate Optimization Algorithm (QAOA), are central to near-term quantum computing but remain challenging to test. Sampling-based fuzzing can expose faulty or non-convergent configurations, but under realistic execution budgets, it may miss failure-prone regions in the joint space of classical optimizer settings and quantum circuit parameters.
This paper studies failure-guided fuzzing for HQC programs. It models a hybrid input as a pair of classical optimizer hyperparameters and quantum circuit parameters, and evaluates a two-phase strategy that first searches for non-convergent seeds and then locally fuzzes circuit parameters around those seeds. To understand where the gains come from, five budgeted strategies are compared: random hybrid testing, classical enumeration without fuzzing, random-seed local fuzzing, enumeration-seed local fuzzing, and concolic-seed local fuzzing. The study is implemented on a VQE instance and a QAOA MaxCut instance in Qiskit. The results show that failure-guided local fuzzing is the main driver of improvement over random testing, while concolic seed discovery provides additional benefits on VQE but is less stable on QAOA. These findings suggest that reusing failure information is a promising direction for HQC testing, but that the value of concolic seed discovery is workload-dependent.
Hybrid quantum-classical (HQC) algorithms, such as the Variational Quantum Eigensolver (VQE) and the Quantum Approximate Optimization Algorithm (QAOA), are central to near-term quantum computing but remain challenging to test. Sampling-based fuzzing can expose faulty or non-convergent configurations, but under realistic execution budgets, it may miss failure-prone regions in the joint space of classical optimizer settings and quantum circuit parameters. This paper studies failure-guided fuzzing for HQC programs. It models a hybrid input as a pair of classical optimizer hyperparameters and quantum circuit parameters, and evaluates a two-phase strategy that first searches for non-convergent seeds and then locally fuzzes circuit parameters around those seeds. To understand where the gains come from, five budgeted strategies are compared: random hybrid testing, classical enumeration without fuzzing, random-seed local fuzzing, enumeration-seed local fuzzing, and concolic-seed local fuzzing. The study is implemented on a VQE instance and a QAOA MaxCut instance in Qiskit. The results show that failure-guided local fuzzing is the main driver of improvement over random testing, while concolic seed discovery provides additional benefits on VQE but is less stable on QAOA. These findings suggest that reusing failure information is a promising direction for HQC testing, but that the value of concolic seed discovery is workload-dependent.
# Concolic-based Fuzzing for Hybrid Quantum–Classical Programs This repository contains a **prototype** for *concolic-guided fuzzing* of hybrid quantum–classical programs, instantiated on two canonical NISQ workloads implemented in Qiskit: - **VQE case study** – small molecular Hamiltonian (H₂-like) - **QAOA case study** – small MaxCut instance The core idea is to treat a **hybrid input** as (`c`, `θ`) where - `c` = classical hyperparameters (optimizer type, max iterations, learning rate) - `θ` = quantum circuit parameters (angles for VQE/QAOA ansätze), and to compare three testing strategies under a **fixed execution budget**: 1. **Random Hybrid (RH)** – sample `(c, θ)` i.i.d. from global distributions. 2. **Concolic+Fuzz (CF-ENUM)** – enumerative “concolic” exploration over classical configs, then local fuzzing on `θ`. 3. **Concolic+Fuzz (CF-SYM)** – lightweight SMT-based exploration over classical configs, then local fuzzing on `θ`. All strategies share the same: - non-convergence oracle (per case study), - shot configuration, - and total number of hybrid driver calls per trial (e.g., 2,000). ## 1. Environment and Dependencies Tested with: - **Python**: 3.10 - **Qiskit** (Terra + Aer) - **NumPy** - **Matplotlib** - **z3-solver** (for the symbolic concolic layer) Example setup with Conda: ```bash conda create -n qiskit python=3.10 conda activate qiskit pip install qiskit qiskit-aer numpy matplotlib z3-solver ``` ## 2. Running the VQE Case Study Smoke Test with single VQE run + random baseline ```bash python vqe_driver.py python input_space.py python concolic_runner.py ``` To reproduce the main VQE results (e.g., with budget = 2000, 20 trials): ```bash python budgeted_experiments.py ``` This will run multiple trials with the three strategies, and the results go to `vqe_results_budget2000.csv`. ## 3. Running the QAOA Case Study Smoke Test: ```bash python qaoa_smoke_test.py ``` Concolic demo: ```bash python qaoa_concolic_engine.py python qaoa_concolic_runner.py ``` Reproduce the results: ```bash python qaoa_budgeted_experiments.py ``` The results go to: `qaoa_results_budget2000.csv`. ## License & Citation This project is released under the **MIT License**. See the `LICENSE` file for the full text. If you use this code in academic or scientific work, we kindly ask you to cite our project. ## Acknowledgments Parts of the design and implementation of this prototype were developed with assistance from OpenAI's ChatGPT. The system was used to help brainstorm the architecture, draft and refine Python code snippets. All code and experiments in this repository were executed, inspected, and validated by the author(s). Any errors or omissions remain the responsibility of the author(s).
As quantum computing continually improves, ensuring the reliability and correctness of quantum libraries has become increasingly critical. To this end, many LLM-based fuzzing approaches towards quantum libraries have been proposed to uncover potential bugs. However, these methods still suffer from limitations such as insufficient flexibility and low efficiency, which hinder the progress of the quantum computing field. To address these challenges, we propose KQFuzz, a novel knowledge-guided fuzzer for quantum libraries. It leverages comprehensive codebase knowledge to ground LLM-based test generation, synergizing this with fitness-guided evaluation and two-level mutations to explore complex execution paths and trigger potential bugs. Firstly, KQFuzz introduces a novel prompting scheme tailored to quantum programs, which strategically incorporates knowledge of the codebase to efficiently generate high-quality quantum seed programs. Moreover, we develop evaluation and mutation strategies to handle the generated seed programs, facilitating efficient fuzzing execution while further enriching the diversity of the resulting test cases. We implement KQFuzz and conduct fuzzing on three popular quantum libraries, including Qiskit, PennyLane, and Cirq. Experimental results demonstrate that our approach significantly outperforms other state-of-the-art methods, with coverage improved by up to 18.44%. During the development of KQFuzz, we discovered 13 bugs, all of which have been confirmed and 12 have already been fixed by the developers.
Quantum enhanced optimization of classical cost functions is a central theme of quantum computing due to its high potential value in science and technology. The variational quantum eigensolver (VQE) and the quantum approximate optimization algorithm (QAOA) are popular variational approaches that are considered the most viable solutions in the noisy-intermediate scale quantum (NISQ) era. Here, we study the scaling of the quantum resources, defined as the required number of circuit repetitions, to reach a fixed success probability as the problem size increases, focusing on the role played by measurement shot noise, which is unavoidable in realistic implementations. Simple and reproducible problem instances are addressed, namely, the ferromagnetic and disordered Ising chains. Our results show that: (1) VQE with the standard heuristic Ansatz scales comparably to direct brute-force search when energy-based optimizers are employed. The performance improves at most quadratically using a gradient-based optimizer. (2) When the parameters are optimized from random guesses, also the scaling of QAOA implies problematically long absolute runtimes for large problem sizes. (3) QAOA becomes practical when supplemented with a physically inspired initialization of the parameters. Our results suggest that hybrid quantum-classical algorithms should possibly avoid a brute force classical outer loop, but focus on smart parameters initialization.
The central claim of this thesis is simple but underappreciated: the primary bottleneck in near-term quantum computing is not a shortage of algorithms; it is a lack of systematic decision-making. Which problem instances should we test? Which circuit architectures are worth training? Which hyperparameters actually drive performance, and which are distractions? Today’s quantum hardware sits in an uncomfortable middle ground. It is expressive enough to explore nontrivial quantum dynamics, yet it is too noisy and shallow for the theoretical speedups that motivate the field. This thesis argues that applying machine learning to classical control decisions in hybrid quantum classical methods is one of the most tractable ways to make these methods genuinely useful in this regime. This argument is developed through four research questions, each addressing a distinct decision-making layer and illustrating the thesis. The first asks whether the decisions inside a hybrid heuristic can be learned rather than hand-coded. Chapter 4 analyzes Recursive QAOA (RQAOA), a promising yet brittle approach to combinatorial optimization, and identifies regimes in which its fixed-elimination strategy fails. It then replaces that strategy with a reinforcement learning policy, RL-RQAOA, that adapts to instance structure. The resulting method performs better on the constructed failure cases while remaining competitive elsewhere. The broader point is that learned classical control policies can materially improve hybrid quantum heuristics without increasing quantum depth, which is a significant practical advantage on constrained hardware. The second question evaluates whether the quantum optimization algorithm benchmarking instances we use are principled. Chapter 5 observes that much benchmarking in this space is driven by convenience. Researchers test on whatever graphs are readily available and then report aggregate performance. Instead, the chapter proposes a generative pipeline that couples a permutation-invariant graph autoencoder with evolutionary optimization to deliberately construct Max-Cut instances that strongly discriminate between a quantum-inspired solver, RQAOA, and a strong classical baseline, Goemans-Williamson, in both directions. By connecting solver behavior to structural graph features, the chapter turns benchmarking from a static choice into an interpretable experimental tool. The generated instances also expose failure modes that random graphs often fail to reveal. The third question asks what changes when realistic noise constraints are taken seriously during circuit design, not only during execution. Chapter 6 develops RLQAS, a reinforcement learning framework for quantum architecture search that incorporates noise assumptions informed by real IBM device characteristics throughout training, rather than treating noise as a post hoc correction. Paired with an efficient Pauli transfer matrix simulation, the framework makes large-scale noisy circuit search computationally feasible. The circuits it discovers are compact, trainable, and achieve competitive accuracy on ground-state energy tasks. This suggests that hardware-aware circuit design is tractable and can yield materially different choices than noise-agnostic search. The fourth question asks: even when the circuit architecture is fixed, how much of what we attribute to quantum model design is actually due to hyperparameter sensitivity? Chapter 7 extends functional ANOVA to quantum neural networks to quantify which hyperparameter choices drive performance variance. The finding is clear. Learning rate, circuit depth, and data encoding/reuploading dominate, while many architectural micro-choices contribute far less than the literature often implies. Rather than stopping at diagnosis, the chapter turns these importance rankings into data-driven priors that accelerate hyperparameter optimization. It converts a critique into a practical improvement. Taken together, these contributions form a coherent toolkit for developing and evaluating hybrid quantum–classical methods in the NISQ regime. While the work does not eliminate the fundamental constraints of shallow, noisy hardware, it clarifies what can be improved immediately and how to do so in a reproducible manner. The broader goal is to help shift near-term quantum research from isolated demonstrations toward an engineering discipline, in which algorithms, benchmarks, and model-selection practices can be compared fairly, stress-tested rigorously, and iterated systematically as hardware matures.
Early quantum computers are being offered by Cloud providers, with the ability to run Hybrid Quantum-Classical (HQC) applications that span Quantum and Classical (binary) computing resources. These HQC algorithms help benchmark and validate the performance of such near-term quantum hardware. Equally important is the software platform that allows a remote user to program the quantum computer on the cloud. The recent Qiskit Runtime platform from IBM allows a seamless and prioritized access to quantum backends and co-located classical hardware within their hybrid cloud for optimized execution of HQC workloads. In contrast, IBM’s Circuit API offers finer application definition but the classical resources are not co-located but placed farther away. Here, we study and contrast the execution flows of a Variational Quantum Eigensolver (VQE) application defined using Qiskit Runtime, and an equivalent implementation using the Circuit API. We quantify the latencies of the various components in these execution. This offers insights on how to better orchestrate the execution of quantum applications across such hybrid resources.