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

02/22/2022
by   Pradnya Khalate, et al.
0

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.

READ FULL TEXT

page 10

page 16

page 17

page 18

page 19

research
10/08/2020

Extending C++ for Heterogeneous Quantum-Classical Computing

We present qcor - a language extension to C++ and compiler implementatio...
research
08/21/2023

One-Time Compilation of Device-Level Instructions for Quantum Subroutines

A large class of problems in the current era of quantum devices involve ...
research
02/03/2021

Quantum Accelerator Stack: A Research Roadmap

This paper presents the definition and implementation of a quantum compu...
research
07/20/2023

Post-variational quantum neural networks

Quantum computing has the potential to provide substantial computational...
research
12/08/2022

Compiler Optimization for Quantum Computing Using Reinforcement Learning

Any quantum computing application, once encoded as a quantum circuit, mu...
research
12/17/2021

A prototypical model of universal quantum computer system

A modern computer system, based on the von Neumann architecture, is a co...
research
06/02/2021

Single-component gradient rules for variational quantum algorithms

Many near-term quantum computing algorithms are conceived as variational...

Please sign up or login with your details

Forgot password? Click here to reset