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]

Computes the required workspace size for compute_expectation().

  • handle (intptr_t) – The library handle.

  • sv_data_type (cuquantum.cudaDataType) – The data type of the statevector.

  • n_index_bits (uint32_t) – The number of index bits.

  • matrix (intptr_t) – The pointer address (as Python int) to a matrix (on either host or device).

  • matrix_data_type (cuquantum.cudaDataType) – The data type of the matrix.

  • layout (MatrixLayout) – The memory layout the the matrix.

  • n_basis_bits (uint32_t) – The length of basis_bits.

  • compute_type (cuquantum.ComputeType) – The compute type of matrix multiplication.


The required workspace size (in bytes).

Return type