qgrad_qutip.expect

qgrad_qutip.expect(oper, state)

Calculates the expectation value of an operator with respect to an input state.

Note

Input state, represented by the argumuent state can only be a density matrix or a ket.

Parameters
  • oper (jnp.ndarray) – JAX numpy array representing an operator

  • state (jnp.ndarray) – JAX numpy array representing a density matrix or a ket

Returns

Expectation value. real if the oper is Hermitian, complex otherwise

Return type

float