seemps.expectation.expectation1#

seemps.expectation.expectation1(state: MPS, O: Operator, i: int) Weight[source]#

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 mps.`i`-th subsystem

iint

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

Returns:
float | complex

Expectation value.