Skip to main content
QUICK REVIEW

[论文解读] An LLVM-based C++ Compiler Toolchain for Variational Hybrid Quantum-Classical Algorithms and Quantum Accelerators

Pradnya Khalate, Xin-Chuan Wu|arXiv (Cornell University)|Feb 22, 2022
Quantum Computing Algorithms and Architecture被引用 13
一句话总结

本论文提出了一种基于LLVM的C++编译器工具链,集成量子语言扩展,支持在量子加速器上实现变分混合量子-经典算法的单次编译执行。通过扩展C++以支持量子特定语法,集成一种新型量子ELF格式,并支持运行时动态参数调优,该框架消除了优化迭代过程中重复编译的开销,显著降低执行延迟,在高达12量子比特的场景下实现了高保真度的TFD态生成,与MATLAB基准测试结果高度一致。

ABSTRACT

Variational algorithms are a representative class of quantum computing workloads that combine quantum and classical computing. This paper presents an LLVM-based C++ compiler toolchain to efficiently execute variational hybrid quantum-classical algorithms on a computational system in which the quantum device acts as an accelerator. We introduce a set of extensions to the C++ language for programming these algorithms. We define a novel Executable and Linking Format (ELF) for Quantum and create a quantum device compiler component in the LLVM framework to compile the quantum part of the C++ source and reuse the host compiler in the LLVM framework to compile the classical computing part of the C++ source. A variational algorithm runs a quantum circuit repeatedly, each time with different gate parameters. We add to the quantum runtime the capability to execute dynamically a quantum circuit with different parameters. Thus, programmers can call quantum routines the same way as classical routines. With these capabilities, a variational hybrid quantum-classical algorithm can be specified in a single-source code and only needs to be compiled once for all iterations. The single compilation significantly reduces the execution latency of variational algorithms. We evaluate the framework's performance by running quantum circuits that prepare Thermofield Double (TFD) states, a quantum-classical variational algorithm.

研究动机与目标

  • 解决由于针对不同参数集重复重新编译而导致的变分量子算法中高编译开销问题。
  • 实现量子代码与经典代码在单一C++源文件中的无缝集成,支持统一编译与执行。
  • 通过支持无需重新编译的动态参数更新,降低混合量子-经典工作负载的运行时延迟。
  • 提供基于LLVM的模块化、可扩展编译器堆栈,支持未来量子硬件后端与仿真目标。
  • 通过高性能量子模拟器作为物理量子加速器的代理,端到端演示变分算法(TFD态制备)的编译与执行。

提出的方法

  • 扩展C++以支持量子特定语法与内建函数,直接在主机代码中表达量子线路与变分参数。
  • 设计一种新型量子可执行与链接格式(ELF),用于表示编译后的量子内核以及与经典代码的联合表示。
  • 在LLVM框架内集成量子设备编译器,以目标量子加速器,同时复用现有主机编译器处理经典C++代码。
  • 实现一个量子运行时库,支持在优化迭代过程中对不同参数的量子线路进行动态执行。
  • 利用LLVM的优化传递基础设施与代码生成流水线,对经典与量子代码组件进行联合优化。
  • 使用Intel量子模拟器作为硬件代理,评估该框架在真实世界变分算法(TFD态制备)中的性能表现。

实验结果

研究问题

  • RQ1与重复重新编译相比,单次编译方法是否能显著降低变分混合量子-经典算法的执行延迟?
  • RQ2基于C++的编译器工具链若集成量子扩展,能否在无需重新编译的情况下有效支持量子线路中的动态参数调优?
  • RQ3当通过高保真度模拟器模拟量子加速器时,所提出的基于LLVM的框架在保真度与性能方面能维持多大程度的稳定性?
  • RQ4在变分量子算法中,该框架的性能随量子比特数量增加如何扩展?
  • RQ5该工具链的模块化设计是否可扩展以支持多样化的量子硬件后端,包括物理量子比特设备与专用模拟器?

主要发现

  • 该框架实现了变分算法的单次编译执行,消除了优化迭代过程中重复编译的需求,显著降低了执行延迟。
  • 在全栈仿真与独立MATLAB基准测试(使用fminsearch函数)之间,热态保真度实现了极佳的一致性,最高达12量子比特。
  • 对于超过12量子比特的系统规模,MATLAB实现性能显著下降,而基于Intel的工具链则保持了良好的性能,凸显其可扩展性优势。
  • 在低温下,随着系统规模增大,TFD态生成的保真度呈现出非单调趋势,与已知物理预期一致。
  • 该框架的模块化设计支持未来扩展至物理量子硬件后端,包括量子点模拟器与物理量子比特器件的控制电子系统。
  • 使用dlib库的find_min_bobyqa优化器实现了有效的收敛,证实了该框架与标准优化流水线的兼容性。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。