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

Will Artificial Intelligence slop kill the creator economy?

New Artificial Intelligence video feeds from Meta and OpenAI are surging in popularity, raising questions about which creators are at risk. Authenticity still matters, but models and brand spokespeople may be the first to feel the squeeze.

Artificial intelligence makes Alibaba great again

Alibaba’s Qwen model family and a renewed push into global infrastructure are reshaping China’s artificial intelligence landscape in 2025. Investors have taken notice as the company pairs open-weight models with rapid datacenter expansion.

How artificial intelligence is changing white-collar work

From translators to lawyers and bankers, artificial intelligence is reshaping tasks, workflows, and required skills faster than companies can measure returns. Early gains hinge on customization, careful implementation, and new expertise.

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.