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:
stateMPS

Quantum state \(\psi\) used to compute the expectation value.

O, QOperator

Local observables

iint
jint, default=`i+1`

Indices of sites, in the range [0, state.size)

Returns:
float | complex

Expectation value.