compute_expectation_on_pauli_basis#

cuquantum.bindings.custatevecEx.compute_expectation_on_pauli_basis(
intptr_t state_vector,
intptr_t expectation_values,
pauli_operator_arrays,
int32_t num_pauli_operator_arrays,
basis_wires_array,
num_basis_wires_array,
)[source]#

Compute expectation values for a batch of (multi-qubit) Pauli operators.

Parameters:
  • state_vector (intptr_t) – state vector instance.

  • expectation_values (intptr_t) – pointer to a host array to store expectation values.

  • pauli_operator_arrays (object) –

    pointer to a host array of Pauli operator arrays. It can be:

    • an int as the pointer address to the nested sequence, or

    • a Python sequence of ints, each of which is a pointer address to a valid sequence of ‘custatevecPauli_t’, or

    • a nested Python sequence of custatevecPauli_t.

  • num_pauli_operator_arrays (int32_t) – the number of Pauli operator arrays.

  • basis_wires_array (object) –

    host array of basis wire arrays. It can be:

    • an int as the pointer address to the nested sequence, or

    • a Python sequence of ints, each of which is a pointer address to a valid sequence of ‘int32_t’, or

    • a nested Python sequence of int32_t.

  • num_basis_wires_array (object) –

    host array of the number of basis wires. It can be:

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

    • a Python sequence of int32_t.