QuanBench: Benchmarking Quantum Code Generation with Large Language Models

Fuente: arXiv
Saved in:
Bibliographic Details
Main Authors: Guo, Xiaoyu, Wang, Minggu, Zhao, Jianjun
Format: Preprint
Published: 2025
Subjects:
Online Access:
Tags: Add Tag
No Tags, Be the first to tag this record!
_version_ 1866909856509722624
author Guo, Xiaoyu
Wang, Minggu
Zhao, Jianjun
author_facet Guo, Xiaoyu
Wang, Minggu
Zhao, Jianjun
contents Large language models (LLMs) have demonstrated good performance in general code generation; however, their capabilities in quantum code generation remain insufficiently studied. This paper presents QuanBench, a benchmark for evaluating LLMs on quantum code generation. QuanBench includes 44 programming tasks that cover quantum algorithms, state preparation, gate decomposition, and quantum machine learning. Each task has an executable canonical solution and is evaluated by functional correctness (Pass@K) and quantum semantic equivalence (Process Fidelity). We evaluate several recent LLMs, including general-purpose and code-specialized models. The results show that current LLMs have limited capability in generating the correct quantum code, with overall accuracy below 40% and frequent semantic errors. We also analyze common failure cases, such as outdated API usage, circuit construction errors, and incorrect algorithm logic. QuanBench provides a basis for future work on improving quantum code generation with LLMs.
format Preprint
id arxiv_https___arxiv_org_abs_2510_16779
institution arXiv
publishDate 2025
record_format arxiv
spellingShingle QuanBench: Benchmarking Quantum Code Generation with Large Language Models
Guo, Xiaoyu
Wang, Minggu
Zhao, Jianjun
Software Engineering
Large language models (LLMs) have demonstrated good performance in general code generation; however, their capabilities in quantum code generation remain insufficiently studied. This paper presents QuanBench, a benchmark for evaluating LLMs on quantum code generation. QuanBench includes 44 programming tasks that cover quantum algorithms, state preparation, gate decomposition, and quantum machine learning. Each task has an executable canonical solution and is evaluated by functional correctness (Pass@K) and quantum semantic equivalence (Process Fidelity). We evaluate several recent LLMs, including general-purpose and code-specialized models. The results show that current LLMs have limited capability in generating the correct quantum code, with overall accuracy below 40% and frequent semantic errors. We also analyze common failure cases, such as outdated API usage, circuit construction errors, and incorrect algorithm logic. QuanBench provides a basis for future work on improving quantum code generation with LLMs.
title QuanBench: Benchmarking Quantum Code Generation with Large Language Models
topic Software Engineering
url https://arxiv.org/abs/2510.16779