tenpy.simulations.simulation.run_seq_simulations(sequential, simulation_class_name='GroundStateSearch', simulation_class_kwargs=None, *, resume_data=None, collect_results_in_memory=False, **simulation_params)[source]

Sequentially run (variational) simulations.

Uses the results (in particular the state) from one simulation to intialize another one. This allows to “adiabatically” or “smoothly” follow the evolution of the ground state as certain model (or algorithm) parameters change.


config sequential
option summary


Working directory relative to which the :cfg:option:`` [...]


For each of the `recursive_keys` a formatting string `format_str` to be for [...]


The first index for each of the `value_lists` to run things with.


Mandatory. [...]


Separator to split recursive keys in :func:` [...]


For each entry of `recursive_keys` the list of values that this parameter s [...]

option recursive_keys: list of str

Mandatory. The list of recursive keys for the simulation_params to be changed. for example an entry 'model_params.Jz' indicates that simulation_params['model_params']['Jz'] should be changed, see get_recursive().

option value_lists: list of list

For each entry of recursive_keys the list of values that this parameter should take. If value_lists is not given at the beginning of this function, it is read out from the simulation_params, i.e. you can alternatively directly change the values in you simulation_params options to be lists. We iterate through all values with zip(*values).

option format_strs: list of str

For each of the recursive_keys a formatting string format_str to be formatted with format_str.format(value). If non-zero, the format_strs are used for parts in output_filename_from_dict() to find a unique output_filename . For example, for 'model_params.Jz' a good choice would be 'Jz_{0:.3f}'. If format_strs is not given at all, it defaults to [rkey.split(separator)[-1] + '_{0!s}' for rkey in recursive_keys]. Exception: if output_filename or directory is part of the recursive_keys, the whole list of format_strs is ignored and the output_filename is not updated.

option separator: str

Separator to split recursive keys in get_recursive() etc. Defaults to '.'.

option index: int

The first index for each of the value_lists to run things with.

option base_directory: pathlike

Working directory relative to which the of the individual simulations is specified. Defaults to the current working directory at the beginning of this function.

  • sequential (dict) – Paramters specifying the sequential simulation, see sequential above.

  • resume_data (None | dict) – Usually None if you didn’t already run a simulation that you want to continue. Otherwise the resume_data as given to the Simulation class.

  • collect_results_in_memory (bool) – If False (default), just save the results to the corresponding output files. If True, collect the results by keeping copies of psi and all simulation results in memory. (This can kill your available RAM quickly!)

  • simulation_class_name (str) –

  • simulation_class_kwargs (dict | None) –

  • **simulation_params – Further arguments as in run_simulation().


results – If collect_results_in_memory, a list of dictionaries with the results for each simulation. Otherwise just the results of the last simulation run.

Return type

list | dict