pyretis.initiation package

This package defines methods for initiating path ensembles.

Package structure

Modules

__init__.py
This file, imports from the other modules and defines helper methods for the initiation.
initiate_kick.py (pyretis.initiation.initiate_kick)
Methods for initiating using the kick method.
initiate_load.py (pyretis.initiation.initiate_load)
Methods for initiating by loading already existing paths from files.

Important methods defined in this package

get_initiation_method (get_initiation_method())
Method to select initiation method from settings.
initiate_path_simulation (initiate_path_simulation())
Method to initiate a path simulation.
pyretis.initiation.initiate_path_simulation(simulation, settings)[source]

Initialise a path simulation.

Parameters:
  • simulation (object like PathSimulation) – The simulation we are doing the initiation for.
  • settings (dict) – A dictionary with settings for the initiation.
Returns:

out – The method to be used for the initiation.

Return type:

callable

pyretis.initiation.get_initiation_method(settings)[source]

Return the initiation method from given settings.

Parameters:settings (dict) – This dictionary contains the settings for the initiation.
Returns:out – The method to be used for the initiation.
Return type:callable

pyretis.initiation.initiate_kick module

This file contains functions used for initiation of paths.

Important methods defined here

generate_initial_path_kick (generate_initial_path_kick())
Function for generating an initial path by repeatedly kicking a phase point.
initiate_kick (initiate_kick())
Helper method, selects either initiate_kicki() or initiate_kick_max().
initiate_kicki (initiate_kicki())
A method for initiating a path ensemble by repeatedly modifying velocities to find the crossing with the interfaces.
initiate_kick_max (initiate_kick_max())
A method similar to py:meth:.initiate_kick. Here, if possible, we will use points from the previous paths, closest to the target interface.
initiate_path_ensemble_kick (initiate_path_ensemble_kick())
Method to initiate a single path ensemble.
pyretis.initiation.initiate_kick.generate_initial_path_kick(system, order_function, path_ensemble, engine, rgen, tis_settings)[source]

Generate an initial path with the kicking method.

This function will generate an initial path by repeatedly kicking a phase-space point until the middle interface is crossed. The point before and after kicking are stored, so when the middle interface is crossed we have two points we can integrate forward and backward in time. This function is intended for use with TIS. For use with RETIS one should set the appropriate tis_settings so that the starting conditions are fine (i.e. for the [0^-] ensemble it might be different for the other ensembles).

Parameters:
  • system (object like System) – This is the system that contains the particles we are investigating.
  • order_function (object like OrderParameter) – The class used for obtaining the order parameter(s).
  • path_ensemble (object like PathEnsemble) – The path ensemble to create an initial path for.
  • engine (object like EngineBase) – The engine to use for propagating a path.
  • rgen (object like RandomGenerator) – This is the random generator that will be used.
  • tis_settings (dict) –

    This dictionary contains settings for TIS. Explicitly used here:

    • start_cond: string, starting condition, ‘L’eft or ‘R’ight
    • maxlength: integer, maximum allowed length of paths.
Returns:

out – This is the generated initial path.

Return type:

object like PathBase

pyretis.initiation.initiate_kick.initiate_kick(simulation, cycle, settings)[source]

Run the initiation method for several ensembles.

Please see documentation for initiate_path_ensemble_kick().

pyretis.initiation.initiate_kick.initiate_kicki(simulation, cycle)[source]

Run the initiation for several ensembles.

Please see documentation for initiate_path_ensemble_kick().

pyretis.initiation.initiate_kick.initiate_kick_max(simulation, cycle)[source]

Run the initiation for several ensembles.

This method is similar to initiate_kick(), but here we update the initial point for an ensemble to use that of the previous path (if this exist).

Please see documentation for initiate_path_ensemble_kick().

pyretis.initiation.initiate_kick.initiate_path_ensemble_kick(path_ensemble, system, order_function, engine, rgen, tis_settings, cycle)[source]

Run the “kick” initiate for a given ensemble.

Parameters:
  • path_ensemble (object like PathEnsemble) – The path ensemble to create an initial path for.
  • system (object like System) – System is used here since we need access to the temperature and to the particle list.
  • order_function (object like OrderParameter) – The class used for obtaining the order parameter(s).
  • engine (object like EngineBase) – The engine to use for propagating a path.
  • rgen (object like RandomGenerator) – This is the random generator that will be used.
  • tis_settings (dict) – This dictionary contain the TIS settings.
  • cycle (integer, optional) – The cycle number we are initiating at, typically this will be 0 which is the default value.
Returns:

  • out[0] (boolean) – True if the initial path was accepted
  • out[1] (object like py:class:.PathBase) – The initial path.
  • out[2] (string) – The status of the path.

pyretis.initiation.initiate_load module

This file contains functions used for initiation of paths.

Important methods defined here

initiate_load (initiate_load())
Method that will get the initial path from the output from a previous simulation.
pyretis.initiation.initiate_load.initiate_load(simulation, cycle, settings)[source]

Initialise paths by loading already generated ones.

Parameters:
  • simulation (object like Simulation) – The simulation we are setting up.
  • cycle (integer) – The simulation cycles we are starting at.
  • settings (dictionary) – A dictionary with settings for the initiation.