KQFuzz: Knowledge-Guided Fuzzing for Quantum Libraries via Large Language Models

Fuyuan Xia, Qixin Zhang, Chenhao Ying, Haojin Zhu, Shuai Wang +3 more
7/28/2026
cs.SEcs.AIcs.MA

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

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.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{xia2026kqfuzz,
  title  = {KQFuzz: Knowledge-Guided Fuzzing for Quantum Libraries via Large Language Models},
  author = {Fuyuan Xia and Qixin Zhang and Chenhao Ying and Haojin Zhu and Shuai Wang and Yuan Luo and Pingchuan Ma and Yuxuan Du},
  year   = {2026},
  eprint = {2607.25647},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2607.25647v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2607.25647.svg)](https://codeofpaper.com/paper/2607.25647)

Discussion