Qiskit QuantumKatas: Adapting Microsoft's Quantum Computing exercises for LLM evaluation

📄 arXiv: 2605.27210v1 📥 PDF

作者: Juan Cruz-Benito, Ismael Faro

分类: quant-ph, cs.AI

发布日期: 2026-05-26


💡 一句话要点

构建Qiskit QuantumKatas基准,用于评估LLM在量子计算任务中的能力。

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 量子计算 大型语言模型 基准测试 Qiskit QuantumKatas

📋 核心要点

  1. 现有方法缺乏系统评估LLM在量子计算任务中能力的基准,阻碍了该领域的发展。
  2. 将QuantumKatas从Q#适配到Qiskit,并构建评估框架,提供包含350个任务的综合基准。
  3. 实验结果表明,该基准能够有效区分不同LLM的能力,并揭示了模型在不同类型量子计算任务中的优劣。

📝 摘要(中文)

本文将微软的QuantumKatas量子计算课程从Q#迁移到Qiskit,并构建了一个评估框架,用于系统地评估大型语言模型(LLM)。该基准包含26个类别共350个任务,涵盖基本量子门、高级量子算法(Grover算法、Simon算法、Deutsch-Jozsa算法)、量子纠错、密钥分发和量子游戏。每个任务都包含自然语言提示、标准答案以及通过经典电路模拟进行的确定性测试验证。通过复用QuantumKatas成熟的教学设计,而非从头创建任务,继承了其难度递进和概念覆盖的优点。同时,贡献了框架适配、评估基础设施和实证分析。评估了16个LLM在7种提示配置下的性能(总计39200次模型运行),结果表明:(1) 该基准有效区分了模型能力,最佳配置通过率从32.3%到83.1%不等,前沿模型和开源模型之间平均差距为26.1%;(2) 模型在实现已知算法方面表现良好(SimonsAlgorithm 82.1%,BasicGates 81.6%),但在问题编码方面表现不佳(SolveSATWithGrover 34.4%,DistinguishUnitaries 40.0%);(3) 思维链提示表现出轻微的双峰效应,对三个模型(其中两个根据供应商文档进行了显式推理调整)是最佳策略,但降低了其余模型的性能。发布了该基准、评估框架和基线结果,以支持LLM在量子计算能力方面的研究。

🔬 方法详解

问题定义:论文旨在解决如何系统性地评估大型语言模型(LLM)在量子计算领域的应用能力的问题。现有方法要么是任务设计不合理,要么缺乏统一的评估标准,难以准确衡量LLM在量子计算问题上的表现。现有方法的痛点在于缺乏一个难度适中、覆盖面广、易于使用的基准测试。

核心思路:论文的核心思路是复用已有的、经过验证的量子计算教学材料QuantumKatas,并将其适配到更流行的Qiskit框架下。通过这种方式,可以继承QuantumKatas在难度设计和概念覆盖方面的优势,避免从零开始设计任务的复杂性。同时,构建一个评估框架,自动运行LLM生成的代码并进行验证。

技术框架:整体框架包括以下几个主要模块:1) QuantumKatas任务的Qiskit适配:将原有的Q#代码转换为Qiskit代码,并确保任务的语义不变;2) 评估框架构建:设计自动化测试流程,包括代码生成、执行、验证等环节;3) LLM评估:选择不同的LLM和提示策略,运行基准测试,并记录结果;4) 结果分析:对实验结果进行统计分析,评估LLM在不同任务上的表现。

关键创新:最重要的技术创新点在于将QuantumKatas这一成熟的量子计算教学资源与LLM评估相结合。通过这种方式,可以利用现有的知识体系,快速构建一个高质量的基准测试。此外,论文还对不同的提示策略进行了比较,揭示了思维链提示在量子计算任务中的特殊表现。

关键设计:关键设计包括:1) 任务选择:选择具有代表性的量子计算任务,涵盖基本量子门、量子算法、量子纠错等多个方面;2) 提示设计:设计不同的提示策略,包括零样本、少样本、思维链等,以探索最佳的提示方式;3) 评估指标:采用通过率作为主要评估指标,衡量LLM生成代码的正确性。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,该基准能够有效区分不同LLM的能力,最佳配置通过率从32.3%到83.1%不等,前沿模型和开源模型之间平均差距为26.1%。模型在实现已知算法方面表现良好(SimonsAlgorithm 82.1%,BasicGates 81.6%),但在问题编码方面表现不佳(SolveSATWithGrover 34.4%,DistinguishUnitaries 40.0%)。

🎯 应用场景

该研究成果可应用于量子计算教育、LLM能力评估和量子软件开发等领域。通过该基准,可以更好地了解LLM在量子计算领域的优势和不足,从而指导LLM的改进和应用。此外,该基准还可以用于评估量子计算教育的效果,并为量子软件开发提供参考。

📄 摘要(原文)

We adapt Microsoft's QuantumKatas -- a well-established quantum computing curriculum -- from Q# to Qiskit, the most widely-adopted quantum computing framework, and package it with an evaluation framework for systematic LLM assessment. The resulting benchmark comprises 350 tasks across 26 categories, spanning fundamental gates through advanced algorithms (Grover's, Simon's, Deutsch-Jozsa), error correction, key distribution, and quantum games. Each task includes a natural language prompt, canonical solution, and deterministic test verification via classical circuit simulation. By building on the QuantumKatas' proven pedagogical design rather than creating tasks from scratch, we inherit a principled difficulty progression and comprehensive concept coverage while contributing the framework adaptation, evaluation infrastructure, and empirical analysis. We evaluate 16 LLMs across 7 prompting configurations -- a total of 39,200 model runs -- to demonstrate the benchmark's utility. Three key findings emerge: (1) the benchmark effectively differentiates model capabilities, with best-configuration pass rates ranging from 32.3% to 83.1% and a 26.1 pp average gap between frontier and open-source models; (2) models perform well at implementing known algorithms (SimonsAlgorithm 82.1%, BasicGates 81.6%) but struggle with problem encoding (SolveSATWithGrover 34.4%, DistinguishUnitaries 40.0%); and (3) chain-of-thought prompting shows a modestly bimodal effect -- it is the best strategy for three models (two of them explicitly reasoning-tuned per vendor documentation) but degrades performance for the rest, leaving it mid-pack in aggregate (56.3% mean) behind few-shot-5 (57.8%). We release the benchmark, evaluation framework, and baseline results to support research on LLM capabilities in quantum computing.