论文标题

基于LLVM的C ++编译器工具链,用于变异杂种量子古典算法和量子加速器

An LLVM-based C++ Compiler Toolchain for Variational Hybrid Quantum-Classical Algorithms and Quantum Accelerators

论文作者

Khalate, Pradnya, Wu, Xin-Chuan, Premaratne, Shavindra, Hogaboam, Justin, Holmes, Adam, Schmitz, Albert, Guerreschi, Gian Giacomo, Zou, Xiang, Matsuura, A. Y.

论文摘要

变分算法是将量子和经典计算结合的量子计算工作负载的代表性类别。本文介绍了基于LLVM的C ++编译器工具链,以有效地在计算系统上执行各种混合量子量子算法,其中量子设备充当加速器。我们向C ++语言介绍了一组扩展,以编程这些算法。我们为量子定义了一种新颖的可执行和链接格式(ELF),并在LLVM框架中创建量子设备编译器组件,以编译C ++源的量子部分,并在LLVM框架中重复使用主机编译器以编译C ++源的经典计算部分。每次使用不同的栅极参数,差异算法会反复运行量子电路。我们添加到量子运行时,可以动态执行具有不同参数的量子电路的功能。因此,程序员可以以与经典例程相同的方式调用量子例程。借助这些功能,可以在单源代码中指定差异混合量子古典算法,并且只需要对所有迭代进行一次编译。单个汇编大大减少了变分算法的执行延迟。我们通过运行制备Thermofield Double(TFD)状态的量子电路来评估框架的性能,该状态是一种量子经典的变分算法。

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.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源