cuquantum.custatevec.apply_matrix_batched_get_workspace_size¶
- cuquantum.custatevec.apply_matrix_batched_get_workspace_size(intptr_t handle, int sv_data_type, uint32_t n_index_bits, uint32_t n_svs, int64_t sv_stride, int map_type, matrix_indices, intptr_t matrices, int matrix_data_type, int layout, int32_t adjoint, uint32_t n_matrices, uint32_t n_targets, uint32_t n_controls, int compute_type) size_t [source]¶
This function gets the required workspace size for
apply_matrix_batched()
.- Parameters
handle (intptr_t) – the handle to the cuStateVec context.
sv_data_type (int) – Data type of the state vector.
n_index_bits (uint32_t) – the number of index bits of the state vector.
n_svs (uint32_t) – the number of state vectors.
sv_stride (int64_t) – distance of two consecutive state vectors.
map_type (MatrixMapType) – enumerator specifying the way to assign matrices.
matrix_indices (object) –
pointer to a host or device array of matrix indices. It can be:
an
int
as the pointer address to the array, ora Python sequence of
int32_t
.
matrices (intptr_t) – pointer to allocated matrices in one contiguous memory chunk on host or device.
matrix_data_type (int) – data type of matrix.
layout (MatrixLayout) – enumerator specifying the memory layout of matrix.
adjoint (int32_t) – apply adjoint of matrix.
n_matrices (uint32_t) – the number of matrices.
n_targets (uint32_t) – the number of target bits.
n_controls (uint32_t) – the number of control bits.
compute_type (ComputeType) – compute_type of matrix multiplication.
- Returns
workspace size.
- Return type
size_t