m_measurement_index

tenpy.simulations.measurement.m_measurement_index(results, psi, model, simulation, results_key='measurement_index')[source]

‘Measure’ the index of how many measurements have been performed so far.

The parameter description below documents the common interface of all measurement functions that can be registered to simulations.

See Measurements for Simulations for the general setup using measurements.

Changed in version 0.10.0: The model parameter is new! Any measurement function for simulations now has to accept this as keyword argument!

Parameters:
  • results (dict) – A dictionary with measurement results performed so far. Instead of returning the result, the output should be written into this dictionary under an appropriate key (or multiple keys, if applicable).

  • psi

  • model – Tensor network state and matching model (with same sites/indexing) to be measured. Usually shorthand for simulation.psi and simulation.model, respectively, but can be different, e.g., when grouping sites. See get_measurement_psi_model(). Note that psi is compatible with model, and simulation.psi should be compatible with simulation.model, but you should not mix them.

  • simulation (Simulation) – The simulation class. This gives also access to the model, algorithm engine, etc.

  • results_key (str) – The key under which to save data in results. For some measurement functions optional, e.g in this case. Note that a single measurement function can add results under multiple keys, if desired.

  • **kwargs – Other optional keyword arguments for individual measurement functions. Those are documented inside each measurement function.