mlsanityData to 7 Oct 2026

Automatic Qiskit Code Refactoring Using Large Language Models

arXiv 2506.14535 ↗First posted 17 Jun 2025cs.SE cs.AI cs.ETcited by 1

Not on the map. Why?

Abstract (arXiv)

As quantum software frameworks evolve, developers face increasing challenges in maintaining compatibility with rapidly changing APIs. In this work, we present a novel methodology for refactoring Qiskit code using large language models (LLMs). We begin by extracting a taxonomy of migration scenarios from the different sources of official Qiskit documentation (such as release notes), capturing common patterns such as migration of functionality to different modules and deprecated usage. This taxonomy, along with the original Python source code, is provided as input to an LLM, which is then tasked with identifying instances of migration scenarios in the code and suggesting appropriate refactoring solutions. Our approach is designed to address the context length limitations of current LLMs by structuring the input and reasoning process in a targeted, efficient manner. The results demonstrate that LLMs, when guided by domain-specific migration knowledge, can effectively assist in automating Qiskit code migration. This work contributes both a set of proven prompts and taxonomy for Qiskit code migration from earlier versions to version 0.46 and a methodology to asses the capabilities of LLMs to assist in the migration of quantum code.

Key facts. Cited by 1 paper in the map (data through 7 Oct 2026). Builds on 13 of its 25 references that are in the map. First posted on arXiv 17 Jun 2025.

Builds on

13 of 25 references.

References · 13

  1. 2020Retrieval-Augmented Generation for Knowledge-Intensive NLP Taskscited by 9,160
  2. 2022Large Language Models are Zero-Shot Reasonerscited by 4,323
  3. 2024A Survey on Large Language Models for Code Generationcited by 646
  4. 2024A Systematic Survey of Prompt Engineering in Large Language Models: Techniques and Applicationscited by 428
  5. 2023Rephrase and Respond: Let Large Language Models Ask Better Questions for Themselvescited by 123
  6. 2023InstructCoder: Instruction Tuning Large Language Models for Code Editingcited by 28
  7. 2024Qiskit Code Assistant: Training LLMs for generating Quantum Computing Codecited by 24
  8. 2024An Empirical Study on the Code Refactoring Capability of Large Language Modelscited by 19
  9. 2025Migrating Code At Scale With LLMs At Googlecited by 14
  10. 2024The Impact of Prompt Programming on Function-Level Code Generationcited by 13
  11. 2024Automatic Library Migration Using Large Language Models: First Resultscited by 9
  12. 2024Exploring LLM-Driven Explanations for Quantum Algorithmscited by 7
1 more
  1. 2025Taxonomy of migration scenarios for Qiskit refactoring using LLMscited by 2

Built on by

Cited by year

Citing papers per year: 2025: 1.

1 paper.

Similar, not cited

Close in wording, no citation either way

  1. 2026Qiskit Code Migration with LLMs ↗
  2. 2025LLM-Powered Quantum Code Transpilation
  3. 2026Revisiting Quantum Code Generation: Where Should Domain Knowledge Live?
  4. 2025Model-Driven Quantum Code Generation Using Large Language Models and Retrieval-Augmented Generation
  5. 2025A PennyLane-Centric Dataset to Enhance LLM-based Quantum Code Generation using RAG
  6. 2026Qiskit QuantumKatas: Adapting Microsoft's Quantum Computing exercises for LLM evaluation
  7. 2026PennySynth: RAG-Driven Data Synthesis for Automated Quantum Code Generation
  8. 2026QBugLM: An Agentic Benchmarking Framework for LLM-based Quantum Software Debugging