seemps.state.CanonicalMPS.expectation2#

method

CanonicalMPS.expectation2(Opi, Opj, i, j=None)#

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.