DensityMatrix.expectation_value

DensityMatrix.expectation_value(oper, qargs=None)[source]

Compute the expectation value of an operator.

Parameters
  • oper (Operator) – an operator to evaluate expval.

  • qargs (None or list) – subsystems to apply the operator on.

Returns

the expectation value.

Return type

complex