cuquantum.custatevec.swap_index_bits

cuquantum.custatevec.swap_index_bits(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, swapped_bits, uint32_t n_swapped_bits, mask_bit_string, mask_ordering, uint32_t mask_len)[source]

Swap index bits and reorder statevector elements on the device.

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.

  • swapped_bits

    A host array of pairs of swapped index bits. It can be

    • an int as the pointer address to the nested sequence

    • a nested Python sequence of swapped index bits

  • n_swapped_bits (uint32_t) – The number of pairs of swapped index bits.

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