CUDA-Q Integration
Overview
The Classiq–CUDA-Q integration enables users to design quantum algorithms at a high level using Classiq, while leveraging CUDA-Q for execution, simulation, and hybrid quantum–classical workflows. This integration is particularly well suited for variational algorithms, such as QAOA, where circuit synthesis, parameterized execution, and classical optimization must work together efficiently.Prerequisites
Before using the integration, ensure the following are installed in your python environment:- Python 3.9 or later
- Classiq SDK
- CUDA-Q
pip install classiq[cudaq].
Integration Core Functions
The Integration is built around two Classiq SDK helper functions:qprog_to_cudaq_kernel()
Converts a synthesized Classiq quantum program (qprog) into a CUDA-Q kernel that can be executed using CUDA-Q SDK. The default kernel type is a main kernel, which is compatible with CUDA-Q execution functions and key capabilities. In case that the kernel is meant to be added as a component to another main kernel, useis_main_kernel=Falseso that it can be passed as a parameter toapply_call(for example:other_kernel.apply_call(your_kernel)).pauli_operator_to_cudaq_spin_op()
Transforms Qmod’sSparsePauliOpdata structure to CUDA-Q’sSpinOperator.
Usage Example
Here is a minimal example:- Defining and synthesizing a parametric model using Classiq.
- Converting to CUDA-Q kernel, assigning value to the parameter and sampling.