Researchers unlock quantum code generation from models using retrieval-augmented pipelines

Researchers at the University of Colorado Colorado Springs use Artificial Intelligence-driven large language models combined with retrieval-augmented generation to produce Qiskit Python code from software system models, reporting up to four times better code accuracy with careful prompt design.

Quantum software development faces a complex technological landscape and a shortage of skilled developers. Nazanin Siavash and Armin Moin of the University of Colorado Colorado Springs explore using Artificial Intelligence-driven large language models (LLMs) to automate quantum code generation from software system models. Their approach targets quantum and hybrid quantum-classical systems and demonstrates that carefully engineered prompts can significantly improve the quality and consistency of generated code. The team validated the method by producing Python code that utilises IBM’s Qiskit library, showing the feasibility of moving from high-level models to executable quantum circuits.

The core technique is a retrieval-augmented generation pipeline that pairs an LLM with a retrieval system to provide contextual code examples and documentation during generation. This model-driven process avoids manually crafted transformation rules by leveraging the LLM’s learned code patterns while grounding outputs with retrieved materials. The researchers experimented with both general and highly specific prompt templates and found that prompt engineering was a primary factor in boosting performance. In their experiments, well-designed prompts combined with the pipeline improved code accuracy metrics by up to fourfold compared with baseline methods focused solely on the LLM.

The study also highlights limitations and next steps. Incorporating external code repositories as contextual knowledge did not demonstrably improve results in this instance, and current performance still lags behind some existing methods when generating code for entire system models, since the evaluation emphasized the quantum circuit portion. Future work will refine the retrieval-augmented generation pipeline with more relevant data, improved query formulation, alternative language models, and broader evaluation metrics. The authors validated compatibility with existing tools and published their source code and research data to encourage follow-up work; the paper is available on arXiv (2508.21097).

68

Impact Score

Nvidia closes purchase of Intel shares as chip partnership expands

Nvidia has closed a purchase of Intel shares tied to a broader collaboration that will integrate Intel central processing units with Nvidia artificial intelligence accelerators and graphics technology in future Intel personal computer chips, while investors reacted by pushing both stocks lower.

Contact Us

Got questions? Use the form to contact us.

Contact Form

Clicking next sends a verification code to your email. After verifying, you can enter your message.