cuquantum.custatevec.measure_on_z_basis(intptr_t handle, intptr_t sv, int sv_data_type, uint32_t n_index_bits, basis_bits, uint32_t n_basis_bits, double rand_num, int collapse) int[source]

Performs measurement on the given Z-product basis.

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

  • basis_bits

    A host array of Z-basis index bits. It can be

    • an int as the pointer address to the array

    • a Python sequence of index bits

  • n_basis_bits (uint32_t) – The number of basis bits.

  • rand_num (double) – A random number in [0, 1).

  • collapse (Collapse) – Indicate the collapse operation.


The parity measurement outcome.

Return type