The Catalyst Runtime is a C++ QIR runtime that enables the execution of Catalyst-compiledquantum programs, and is currently backed byPennyLane-Lightningstate-vector simulators, andAmazon Braketdevices. Additional hardware support, including QPUs, to come.
The runtime employs theQuantumDevicepublic 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 inRuntimeCAPI.h.
The directory is structured as follows:
This contains the public header files of the runtime including theQuantumDevice
APIfor backend quantum devices and the runtime CAPI.
The core modules of the runtime are structured intolib/capi
andlib/backend
.lib/capi implements the semantics forQIR instructions lowered to our custom runtime.lib/backendcontains implementations of theQuantumDevice
API for backend simulators.
A collection of C++ tests for modules and methods in the runtime.
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 andPennyLane-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 |
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 clangwith support for the C++20 standard library.
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 useENABLE_OPENQASM=OFF
to disable building the runtime withAmazon-Braket-OpenQasm:
make runtime ENABLE_OPENQASM=OFF
This device currently offers generators for theOpenQasm3 specification andAmazon Braket assembly extension.Moreover, the generated assembly can be executed on Amazon Braket devices leveragingamazon-braket-sdk-python.
To check the runtime test suite from the root directory:
make test-runtime