expectation_value

Operator.expectation_value(state)

Return the expectation value of the operator with respect to the state. If multiple states are given, then return multiple expectation values (expectation values are calculated with respect to the last axis).

Parameters:

state (ndarray | Array) – State or states.

Return type:

ndarray | Array

Returns:

Expectation value or expectation values.