cuquantum.custatevec.collapse_on_z_basis(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, int32_t parity, basis_bits, uint32_t n_basis_bits, double norm)[source]

Collapse state vector on a given Z product basis.

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

  • sv (intptr_t) – state vector.

  • sv_data_type (int) – data type of state vector.

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

  • parity (int32_t) – parity, 0 or 1.

  • basis_bits (object) –

    pointer to a host array of Z-basis index bits. It can be:

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

    • a Python sequence of int32_t.

  • n_basis_bits (uint32_t) – the number of Z basis bits.

  • norm (double) – normalization factor.