cuquantum.custatevec.collapse_by_bit_string_batched

cuquantum.custatevec.collapse_by_bit_string_batched(intptr_t handle, intptr_t batched_sv, int sv_data_type, uint32_t n_index_bits, uint32_t n_svs, int64_t sv_stride, bit_strings, bit_ordering, uint32_t bit_string_len, norms, intptr_t extra_workspace, size_t extra_workspace_size_in_bytes)[source]

Collapse the batched state vectors to the state specified by a given bit string.

Parameters
  • handle (intptr_t) – the handle to the cuStateVec library.

  • batched_sv (intptr_t) – batched state vector allocated in one continuous memory chunk on device.

  • sv_data_type (int) – data type of the state vectors.

  • n_index_bits (uint32_t) – the number of index bits of the state vectors.

  • n_svs (uint32_t) – the number of batched state vectors.

  • sv_stride (int64_t) – distance of two consecutive state vectors.

  • bit_strings (object) –

    pointer to an array of bit strings, on either host or device. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of custatevecIndex_t.

  • bit_ordering (object) –

    pointer to a host array of bit string ordering. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of int32_t.

  • bit_string_len (uint32_t) – length of bit string.

  • norms (object) –

    pointer to an array of normalization constants on either host or device. It can be:

    • an int as the pointer address to the array, or

    • a Python sequence of double.

  • extra_workspace (intptr_t) – extra workspace.

  • extra_workspace_size_in_bytes (size_t) – size of the extra workspace.