Extending C++ for Heterogeneous Quantum-Classical Computing
Alexander McCaskey, Thien Nguyen, Anthony SANTANA et al. · ACM Transactions on Quantum Computing · 2021
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.
Cited by 38 works. doi:10.1145/3462670 Open-access PDF
Authors
References
- Algorithm 778: L-BFGS-B
- Scalable Parallel Programming with CUDA
- A variational eigenvalue solver on a photonic quantum processor
- Surface codes: Towards practical large-scale quantum computation
- The Open Services Gateway Initiative: an introductory overview
- Direct search algorithms for optimization calculations
- Kokkos: Enabling manycore performance portability through polymorphic memory access patterns
- F-bounded polymorphism for object-oriented programming
- Quantum Computation by Adiabatic Evolution
- An adaptive variational algorithm for exact molecular simulations on a quantum computer