cuquantum.custatevec.apply_matrix¶
- cuquantum.custatevec.apply_matrix(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, intptr_t matrix, int matrix_data_type, int layout, int32_t adjoint, targets, uint32_t n_targets, controls, control_bit_values, uint32_t n_controls, int compute_type, intptr_t extra_workspace, size_t extra_workspace_size_in_bytes)[source]¶
Apply gate matrix.
- Parameters
handle (intptr_t) – the handle to the cuStateVec library.
sv (intptr_t) – state vector.
sv_data_type (int) – data type of the state vector.
n_index_bits (uint32_t) – the number of index bits of the state vector.
matrix (intptr_t) – host or device pointer to a square matrix.
matrix_data_type (int) – data type of matrix.
layout (MatrixLayout) – enumerator specifying the memory layout of matrix.
adjoint (int32_t) – apply adjoint of matrix.
targets (object) –
pointer to a host array of target bits. It can be:
an
int
as the pointer address to the array, ora Python sequence of
int32_t
.
n_targets (uint32_t) – the number of target bits.
controls (object) –
pointer to a host array of control bits. It can be:
an
int
as the pointer address to the array, ora Python sequence of
int32_t
.
control_bit_values (object) –
pointer to a host array of control bit values. It can be:
an
int
as the pointer address to the array, ora Python sequence of
int32_t
.
n_controls (uint32_t) – the number of control bits.
compute_type (ComputeType) – compute_type of matrix multiplication.
extra_workspace (intptr_t) – extra workspace.
extra_workspace_size_in_bytes (size_t) – extra workspace size.
See also