cuquantum.custatevec.collapse_by_bitstring_batched

cuquantum.custatevec.collapse_by_bitstring_batched(intptr_t handle, intptr_t batched_svs, int sv_data_type, uint32_t n_index_bits, uint32_t n_svs, _Index sv_stride, bit_strings, bit_ordering, uint32_t bit_string_len, norms, intptr_t workspace, size_t workspace_size)[source]

Collapse the batched statevectors to the states specified by the given bit strings.

Parameters
  • handle (intptr_t) – The library handle.

  • batched_svs (intptr_t) – The pointer address (as Python int) to the batched statevectors (on device).

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

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

  • n_svs (uint32_t) – The number of batched statevectors.

  • sv_stride (int64_t) – The stride between each state vector in the batch.

  • bit_strings

    An array of bit strings. It can be

    • an int as the pointer address to the array (on host or device)

    • a Python sequence of bits on host

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

  • norms

    An array of normalization factors for the statevectors after collapse. It can be

    • an int as the pointer address to the array (on host or device)

    • a Python sequence of normalization factors on host

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

  • workspace_size (size_t) – The workspace size (in bytes).