onsite_expectation_value

tenpy.simulations.measurement.onsite_expectation_value(results, psi, simulation, opname, key=None)[source]

Measure expectation values of an onsite operator.

The resulting array of measurements is indexed by lattice indices (x, y, u) (possibly dropping y and/or u if they are trivial), not by the MPS index. Note that this makes the result independent of the way the MPS winds through the lattice.

The key defaults to f"<{opname}>".

Parameters
  • results – See measurement_index().

  • psi – See measurement_index().

  • simulation – See measurement_index().

  • key – See measurement_index().

  • opname (str) – The operator to be measured. Passed on to expectation_value().