Catalyst Quantum Runtime¶
The Catalyst Runtime is a C++ QIR runtime that enables the execution of Catalyst-compiled quantum programs, and is currently backed by PennyLane-Lightning state-vector simulators, and Amazon Braket devices. Additional hardware support, including QPUs, to come.
The runtime employs the QuantumDevice public interface to support an extensible list of backend devices. This interface comprises two collections of abstract methods:
The Qubit management, device shot noise, and quantum tape recording methods are utilized for the implementation of Quantum Runtime (QR) instructions.
The quantum operations, observables, measurements, and gradient methods are used to implement Quantum Instruction Set (QIS) instructions.
A complete list of instructions supported by the runtime can be found in RuntimeCAPI.h.
Contents¶
The directory is structured as follows:
- include:
This contains the public header files of the runtime including the
QuantumDevice
API for backend quantum devices and the runtime CAPI.
- lib:
The core modules of the runtime are structured into
lib/capi
andlib/backend
. lib/capi implements the semantics for QIR instructions lowered to our custom runtime. lib/backend contains implementations of theQuantumDevice
API for backend simulators.
- tests:
A collection of C++ tests for modules and methods in the runtime.
Backend Devices¶
New device backends for the runtime can be realized by implementing the quantum device interface. The following table shows the available devices along with supported features:
Features |
PennyLane-Lightning-Qubit |
PennyLane-Lightning-Kokkos and PennyLane-Lightning-GPU |
Amazon-Braket-OpenQasm |
Qubit Management |
Dynamic allocation/deallocation |
Static allocation/deallocation |
Static allocation/deallocation |
Gate Operations |
Lightning operations without controlled gates support |
||
Quantum Observables |
|
|
|
Expectation Value |
All observables; Finite-shots supported |
All observables; Finite-shots supported |
All observables; Finite-shots supported |
Variance |
All observables; Finite-shots supported |
All observables; Finite-shots supported |
All observables; Finite-shots supported |
Probability |
Only for the computational basis on the supplied qubits; Finite-shots supported |
Only for the computational basis on the supplied qubits; Finite-shots supported |
The computational basis on all active qubits; Finite-shots supported |
Sampling |
Only for the computational basis on the supplied qubits |
Only for the computational basis on the supplied qubits |
The computational basis on all active qubits; Finite-shots supported |
Mid-Circuit Measurement |
Only for the computational basis on the supplied qubit |
Only for the computational basis on the supplied qubit |
Not supported |
Gradient |
The Adjoint-Jacobian method for expectation values on all observables |
The Adjoint-Jacobian method for expectation values on all observables |
Not supported |
Requirements¶
To build the runtime from source, it is required to have an up to date version of a C/C++ compiler such as gcc or clang with support for the C++20 standard library.
Installation¶
By default, the runtime builds all supported backend devices. You can build the runtime with custom devices from the list of Backend Devices.
You can use ENABLE_OPENQASM=OFF
to disable building the runtime with Amazon-Braket-OpenQasm:
make runtime ENABLE_OPENQASM=OFF
This device currently offers generators for the OpenQasm3 specification and Amazon Braket assembly extension. Moreover, the generated assembly can be executed on Amazon Braket devices leveraging amazon-braket-sdk-python.
To check the runtime test suite from the root directory:
make test-runtime