cuquantum.custatevec.apply_generalized_permutation_matrix_buffer_size

cuquantum.custatevec.apply_generalized_permutation_matrix_buffer_size(intptr_t handle, int sv_data_type, uint32_t n_index_bits, permutation, intptr_t diagonals, int diagonals_data_type, basis_bits, uint32_t n_basis_bits, uint32_t mask_len) size_t

Computes the required workspace size for apply_generalized_permutation_matrix().

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

  • permutation

    A host or device array for the permutation table. It can be

    • an int as the pointer address to the array

    • a Python sequence of permutation elements

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

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

  • basis_bits

    A host array of permutation matrix basis bits. It can be

    • an int as the pointer address to the array

    • a Python sequence of basis bits

  • n_basis_bits (uint32_t) – The length of basis_bits.

  • mask_len (uint32_t) – The length of mask_ordering.

Returns

The required workspace size (in bytes).

Return type

size_t