seemps.state.CanonicalMPS.expectation1#

method

CanonicalMPS.expectation1(O, site)#

Compute the expectation value \(\langle\psi|O_i|\psi\rangle\) of an operator O acting on the i-th site

Parameters:
stateMPS

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

OOperator

Local observable acting onto the i-th subsystem

iint

Index of site, in the range [0, state.size)

Returns:
float | complex

Expectation value.