TY - JOUR
T1 - Extending C++ for Heterogeneous Quantum-Classical Computing
AU - McCaskey, Alexander
AU - Nguyen, Thien
AU - Santana, Anthony
AU - Claudino, Daniel
AU - Kharazi, Tyler
AU - Finkel, Hal
N1 - Publisher Copyright:
© 2021 ACM.
PY - 2021/7
Y1 - 2021/7
N2 - We present qcor-a language extension to C++ and compiler implementation that enables heterogeneous quantum-classical programming, compilation, and execution in a single-source context. Our work provides a first-of-its-kind C++ compiler enabling high-level quantum kernel (function) expression in a quantum-language agnostic manner, as well as a hardware-agnostic, retargetable compiler workflow targeting a number of physical and virtual quantum computing backends. qcor leverages novel Clang plugin interfaces and builds upon the XACC system-level quantum programming framework to provide a state-of-the-art integration mechanism for quantum-classical compilation that leverages the best from the community at-large. qcor translates quantum kernels ultimately to the XACC intermediate representation, and provides user-extensible hooks for quantum compilation routines like circuit optimization, analysis, and placement. This work details the overall architecture and compiler workflow for qcor, and provides a number of illuminating programming examples demonstrating its utility for near-term variational tasks, quantum algorithm expression, and feed-forward error correction schemes.
AB - We present qcor-a language extension to C++ and compiler implementation that enables heterogeneous quantum-classical programming, compilation, and execution in a single-source context. Our work provides a first-of-its-kind C++ compiler enabling high-level quantum kernel (function) expression in a quantum-language agnostic manner, as well as a hardware-agnostic, retargetable compiler workflow targeting a number of physical and virtual quantum computing backends. qcor leverages novel Clang plugin interfaces and builds upon the XACC system-level quantum programming framework to provide a state-of-the-art integration mechanism for quantum-classical compilation that leverages the best from the community at-large. qcor translates quantum kernels ultimately to the XACC intermediate representation, and provides user-extensible hooks for quantum compilation routines like circuit optimization, analysis, and placement. This work details the overall architecture and compiler workflow for qcor, and provides a number of illuminating programming examples demonstrating its utility for near-term variational tasks, quantum algorithm expression, and feed-forward error correction schemes.
KW - Quantum computing
KW - compilers
KW - domain specific languages
KW - quantum programming
UR - http://www.scopus.com/inward/record.url?scp=85115240674&partnerID=8YFLogxK
U2 - 10.1145/3462670
DO - 10.1145/3462670
M3 - Article
AN - SCOPUS:85115240674
SN - 2643-6817
VL - 2
JO - ACM Transactions on Quantum Computing
JF - ACM Transactions on Quantum Computing
IS - 2
M1 - 6
ER -