cuquantum.custatevec.collapse_by_bitstring

cuquantum.custatevec.collapse_by_bitstring(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, bit_string, bit_ordering, uint32_t bit_string_len, double norm)[source]

Collapse the statevector to the state specified by the given bit string.

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.

  • bit_string

    A host array of a bit string. It can be

    • an int as the pointer address to the array

    • a Python sequence of bits

  • bit_ordering

    A host array of bit string ordering. It can be

    • an int as the pointer address to the array

    • a Python sequence of bit ordering

  • bit_string_len (uint32_t) – The length of bit_string.

  • norm (double) – The normalization factor for the statevector after collapse.