compute_expectation_batched#

cuquantum.bindings.custatevec.compute_expectation_batched(
intptr_t handle,
intptr_t batched_sv,
int sv_data_type,
uint32_t n_index_bits,
uint32_t n_svs,
int64_t sv_stride,
intptr_t expectation_values,
intptr_t matrices,
int matrix_data_type,
int layout,
uint32_t n_matrices,
basis_bits,
uint32_t n_basis_bits,
int compute_type,
intptr_t extra_workspace,
size_t extra_workspace_size_in_bytes,
)[source]#

Compute the expectation values of matrix observables for each of the batched state vectors.

Parameters:
  • handle (intptr_t) – the handle to the cuStateVec library.

  • batched_sv (intptr_t) – batched state vector allocated in one continuous memory chunk on device.

  • 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.

  • expectation_values (intptr_t) – pointer to a host or device array to store expectation values.

  • matrices (intptr_t) – pointer to allocated matrices in one contiguous memory chunk on host or device.

  • matrix_data_type (int) – data type of matrices.

  • layout (MatrixLayout) – matrix memory layout.

  • n_matrices (uint32_t) – the number of matrices.

  • basis_bits (object) –

    pointer to a host array of basis index bits. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • n_basis_bits (uint32_t) – the number of basis bits.

  • compute_type (ComputeType) – compute_type of matrix multiplication.

  • extra_workspace (intptr_t) – pointer to an extra workspace.

  • extra_workspace_size_in_bytes (size_t) – the size of extra workspace.