🤖 AI Summary
Current AI-assisted quantum programming research predominantly focuses on Qiskit, whereas the widely adopted hybrid quantum-classical framework PennyLane lacks high-quality, semantically annotated training data—hindering large language models’ (LLMs) code generation capability for it. To address this, we introduce the first open-source, high-fidelity PennyLane-specific dataset comprising 3,347 quantum circuits, each accompanied by contextual natural-language descriptions. Our methodology encompasses systematic data collection, structured cleaning, and fine-grained semantic annotation. We further propose the first RAG-based evaluation framework tailored to PennyLane and a reproducible data refinement pipeline. Finally, we conduct LLM fine-tuning and empirical validation. Experiments demonstrate substantial improvements in both accuracy and practical utility of generated PennyLane code, enabling efficient quantum circuit development. This work fills a critical gap in LLM-driven code generation for non-Qiskit platforms and advances equitable, multi-framework progress in AI-augmented quantum programming.
📝 Abstract
Large Language Models (LLMs) offer remarkable capabilities in code generation, natural language processing, and domain-specific reasoning. Their potential in aiding quantum software development remains underexplored, particularly for the PennyLane framework-a leading platform for hybrid quantum-classical computing. To address this gap, we introduce a novel, high-quality dataset comprising 3,347 PennyLane-specific code samples of quantum circuits and their contextual descriptions, specifically curated to train/fine-tune LLM-based quantum code assistance. Our key contributions are threefold: (1) the automatic creation and open-source release of a comprehensive PennyLane dataset leveraging quantum computing textbooks, official documentation, and open-source repositories; (2) the development of a systematic methodology for data refinement, annotation, and formatting to optimize LLM training efficiency; and (3) a thorough evaluation, based on a Retrieval-Augmented Generation (RAG) framework, demonstrating the effectiveness of our dataset in streamlining PennyLane code generation and improving quantum development workflows. Compared to existing efforts that predominantly focus on Qiskit, our dataset significantly broadens the spectrum of quantum frameworks covered in AI-driven code assistance. By bridging this gap and providing reproducible dataset-creation methodologies, we aim to advance the field of AI-assisted quantum programming, making quantum computing more accessible to both newcomers and experienced developers.