QuanBench+: un benchmark unificato multi-framework per la generazione di codice quantistico basata su LLM
QuanBench+: A Unified Multi-Framework Benchmark for LLM-Based Quantum Code Generation
March 25, 2026
Autori: Ali Slim, Haydar Hamieh, Jawad Kotaich, Yehya Ghosn, Mahdi Chehimi, Ammar Mohanna, Hasan Abed Al Kader Hammoud, Bernard Ghanem
cs.AI
Abstract
I modelli linguistici di grandi dimensioni (LLM) sono sempre più utilizzati per la generazione di codice, ma la generazione di codice quantistico è ancora valutata principalmente all'interno di singoli framework, rendendo difficile separare il ragionamento quantistico dalla familiarità con il framework. Introduciamo QuanBench+, un benchmark unificato che comprende Qiskit, PennyLane e Cirq, con 42 task allineati che coprono algoritmi quantistici, decomposizione di porte e preparazione degli stati.
Valutiamo i modelli con test funzionali eseguibili, riportiamo Pass@1 e Pass@5 e utilizziamo un'accettazione basata sulla divergenza KL per gli output probabilistici. Studiamo inoltre il Pass@1 dopo una riparazione basata sul feedback, in cui un modello può revisionare il codice dopo un errore di runtime o una risposta errata. Tra i framework, i punteggi one-shot più elevati raggiungono il 59,5% in Qiskit, il 54,8% in Cirq e il 42,9% in PennyLane; con la riparazione basata sul feedback, i punteggi migliori salgono rispettivamente all'83,3%, al 76,2% e al 66,7%. Questi risultati mostrano un progresso evidente, ma anche che una generazione affidabile di codice quantistico multi-framework rimane irrisolta e dipende ancora fortemente dalla conoscenza specifica del framework.
English
Large Language Models (LLMs) are increasingly used for code generation, yet quantum code generation is still evaluated mostly within single frameworks, making it difficult to separate quantum reasoning from framework familiarity. We introduce QuanBench+, a unified benchmark spanning Qiskit, PennyLane, and Cirq, with 42 aligned tasks covering quantum algorithms, gate decomposition, and state preparation.
We evaluate models with executable functional tests, report Pass@1 and Pass@5, and use KL-divergence-based acceptance for probabilistic outputs. We additionally study Pass@1 after feedback-based repair, where a model may revise code after a runtime error or wrong answer. Across frameworks, the strongest one-shot scores reach 59.5% in Qiskit, 54.8% in Cirq, and 42.9% in PennyLane; with feedback-based repair, the best scores rise to 83.3%, 76.2%, and 66.7%, respectively. These results show clear progress, but also that reliable multi-framework quantum code generation remains unsolved and still depends strongly on framework-specific knowledge.