measure#

cuquantum.bindings.custatevecEx.measure(
intptr_t state_vector,
bit_string_ordering,
int32_t bit_string_ordering_len,
double randnum,
int collapse,
intptr_t reserved,
) int64_t[source]#

Perform qubit measurements.

Parameters:
  • state_vector (intptr_t) – StateVector instance.

  • bit_string_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_ordering_len (int32_t) – length of bit_stringOrdering.

  • randnum (double) – random number, [0, 1).

  • collapse (int) – Collapse operation.

  • reserved (intptr_t) – Reserved argument. A null pointer should be passed.

Returns:

measured bit string.

Return type:

int64_t