tenpy.simulations.measurement.m_onsite_expectation_value(results, psi, model, simulation, opname, results_key=None, fix_u=None, **kwargs)[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 results_key defaults to f"<{opname}>".

  • results – See measurement_index().

  • psi – See measurement_index().

  • model – See measurement_index().

  • simulation – See measurement_index().

  • results_key – See measurement_index().

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

  • fix_u (None | int) – Select a (lattice) unit cell index to restrict measurements to.