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).