cuquantum.custatevec.compute_expectation_get_workspace_size

cuquantum.custatevec.compute_expectation_get_workspace_size(intptr_t handle, int sv_data_type, uint32_t n_index_bits, intptr_t matrix, int matrix_data_type, int layout, uint32_t n_basis_bits, int compute_type) size_t[source]

This function gets the required workspace size for compute_expectation().

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.

  • matrix (intptr_t) – host or device pointer to a matrix.

  • matrix_data_type (int) – data type of matrix.

  • layout (MatrixLayout) – enumerator specifying the memory layout of matrix.

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

  • compute_type (ComputeType) – compute_type of matrix multiplication.

Returns

size of the extra workspace.

Return type

size_t