cudaq extra (install classiq[cudaq]).
Note that the cudaq extra is only available in Classiq Studio and on any Linux
Machine.
qprog_to_cudaq_kernel
qprog_to_cudaq_kernel(
quantum_program: QuantumProgram,
is_main_kernel: bool = True
) -> Union[cudaq.PyKernel, tuple]
Translates a quantum program into a CUDA-Q kernel.
The ‘is_main_kernel’ parameter controls the kind of the returned kernel.
If ‘is_main_kernel’ is True, the returned kernel can be used with CUDA-Q functions
such as ‘cudaq.draw()’ and ‘cudaq.get_state()’, but it cannot be added to another
kernel via `apply_call()’.
If ‘is_main_kernel’ is False, the reverse holds: The returned kernel cannot be used
with CUDA-Q functions but can be added to another kernel.
Parameters:
Returns:
- Type:
Union[cudaq.PyKernel, tuple] - A CUDA-Q kernel. If the quantum program includes foreach statements, a tuple
- containing a CUDA-Q kernel and its foreach arguments will be returned.
pauli_operator_to_cudaq_spin_op
pauli_operator_to_cudaq_spin_op(
operator: SparsePauliOp
) -> cudaq.SpinOperator
Transforms Qmod’s SparsePauliOp data structure to CUDA-Q’s SpinOperator.
Parameters:
Returns:
- Type:
cudaq.SpinOperator - The equivalent operator in CUDA-Q’s data structure