seemps.expectation.expectation2# seemps.expectation.expectation2(state: MPS, O: Operator, Q: Operator, i: int, j: int | None = None) → Weight[source]# Compute the expectation value \(\langle\psi|O_i Q_j|\psi\rangle\) of two operators O and Q acting on the i-th and j-th subsystems. Parameters: stateMPSQuantum state \(\psi\) used to compute the expectation value. O, QOperatorLocal observables iint jint, default=`i+1`Indices of sites, in the range [0, state.size) Returns: float | complexExpectation value.