ArXiv TLDR

Beyond Rules: LLM-Powered Linting for Quantum Programs

🐦 Tweet
2605.03943

Pietro Cassieri, Giuseppe Scanniello, Seung Yeob Shin, Fabrizio Pastore, Domenico Bianculli

cs.SE

TLDR

This paper introduces LLM-powered linters, LintQ-LLM+CoT and LintQ-LLM+RAG, which significantly outperform traditional rule-based tools for quantum program error detection.

Key contributions

  • Introduces LintQ-LLM+CoT and LintQ-LLM+RAG, novel LLM-powered linters for quantum programs.
  • LintQ-LLM+CoT uses Chain-of-Thought prompting; LintQ-LLM+RAG leverages a knowledge base for reasoning.
  • LLM-based linters significantly outperform traditional rule-based LintQ in precision and recall.
  • Achieved F1-scores of 0.70 and 0.68, compared to LintQ's 0.41, demonstrating superior detection.

Why it matters

Traditional quantum program linters struggle with evolving APIs and complex problems. This work demonstrates that LLMs provide a scalable and adaptive solution for next-generation quantum software reliability. The RAG variant further improves precision, making these tools highly practical.

Original Abstract

As quantum computing transitions from theoretical experimentation to its practical application, the reliability of quantum software has become a critical bottleneck. Traditional static analysis techniques for quantum programs, primarily rule-based linters, are increasingly inadequate; they struggle to keep pace with rapidly evolving APIs and fail to capture complex, context-dependent quantum programming problems. This results in high maintenance overhead and limited detection capabilities. In this paper, we introduce LintQ-LLM+CoT and LintQ-LLM+RAG, novel approaches that redefine the detection of quantum programming problems by employing Large Language Models (LLMs) specialized, respectively, via Chain-of-Thought (CoT) prompting and a Retrieval-Augmented Generation (RAG) system that grounds the model's reasoning in a curated knowledge base of verified quantum programming problems and best practices. We conducted a rigorous and manual comparative evaluation against the state-of-the-art rule-based tool, LintQ, using a corpus of 55 Qiskit programs. Our results show that LLM-based approaches, with and without RAG, outperform LintQ in terms of quantum programming problems detection correctness (precision) and completeness (recall). Overall, LLM-based approaches were more effective than LintQ (F1-score equal to 0.70 and 0.68 vs. 0.41). Furthermore, the RAG-enhanced variant demonstrated a slightly superior precision, effectively reducing false positives. Our findings suggest that LLMs provide a scalable and adaptive foundation for the next generation of linters in quantum software engineering.

📬 Weekly AI Paper Digest

Get the top 10 AI/ML arXiv papers from the week — summarized, scored, and delivered to your inbox every Monday.