cuquantum.custatevec.abs2sum_array

cuquantum.custatevec.abs2sum_array(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, intptr_t abs2sum, bit_ordering, uint32_t bit_ordering_len, mask_bit_string, mask_ordering, uint32_t mask_len)[source]

Calculates the sum of squared absolute values for a given set of index bits.

Parameters
  • handle (intptr_t) – The library handle.

  • sv (intptr_t) – The pointer address (as Python int) to the statevector (on device).

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

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

  • abs2sum (intptr_t) – The pointer address (as Python int) to the array (on either host or device) that would hold the sums.

  • bit_ordering

    A host array of index bit ordering. It can be

    • an int as the pointer address to the array

    • a Python sequence of index bit ordering

  • bit_ordering_len (uint32_t) – The length of bit_ordering.

  • mask_bit_string

    A host array for specifying mask values. It can be

    • an int as the pointer address to the array

    • a Python sequence of mask values

  • mask_ordering

    A host array of mask ordering. It can be

    • an int as the pointer address to the array

    • a Python sequence of index bit ordering

  • mask_len (uint32_t) – The length of mask_ordering.