run_seq_simulations

  • full name: tenpy.run_seq_simulations

  • parent module: tenpy

  • type: function

tenpy.run_seq_simulations(sequential, simulation_class='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 initialize another one. This allows to “adiabatically” or “smoothly” follow the evolution of the ground state as certain model (or algorithm) parameters change.

Options

config sequential
option summary

base_directory

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

format_strs

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

index

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

recursive_keys

Mandatory. [...]

separator

Separator to split recursive keys in :func:`~tenpy.tools.misc.get_recursive [...]

value_lists

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 Simulation.directory of the individual simulations is specified. Defaults to the current working directory at the beginning of this function.

Parameters:
  • sequential (dict) – Parameters 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 (str)

  • simulation_class_kwargs (dict | None)

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

Returns:

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