kmc

kmc

Kinetic Monte Carlo (KMC) classes and functions.

In our system, the reaction rate r = (deterministic) reaction constant k = stochastic reaction constant c (from gillespie 1977) = propensity a (from Anderson 2007) because of the fundamental premise of chemical kinetics and because we have one reactant molecule

Classes

Name Description
KMCResult The result of a KMC step. Similar to a Recipe but for the concrete realization of a reaction.

KMCResult

kmc.KMCResult(self, recipe=lambda: Recipe([], [], [])(), reaction_probability=None, time_delta=None, time_start=None)

The result of a KMC step. Similar to a Recipe but for the concrete realization of a reaction.

Attributes

Name Type Description
recipe Recipe Single sequence of RecipeSteps to build product
reaction_probability Optional[list[float]] Integral of reaction propensity with respect to time
time_delta Optional[float] MC time jump during which the reaction occurs [ps]
time_start Optional[float] Time, from which the reaction starts. The reaction changes the geometry/topology of this timestep and continues from there. [ps]

Functions

Name Description
extrande Extrande KMC
extrande_mod Modified Extrande KMC
frm First Reaction Method variant of Kinetic Monte Carlo.
rf_kmc Rejection-Free Monte Carlo.

extrande

kmc.extrande(recipe_collection, tau_scale, logger=logging.getLogger(__name__), rng=default_rng())

Extrande KMC

Implemented as in Stochastic Simulation of Biomolecular Networks in Dynamic Environments 10.1371/journal.pcbi.1004923

Parameters

Name Type Description Default
recipe_collection RecipeCollection from which one will be choosen required
rng np.random.Generator function to generate random numbers in the KMC step default_rng()
tau_scale float Scaling factor for tau, by default 1.0 required

Returns

Type Description
KMCResult time delta set to 0

extrande_mod

kmc.extrande_mod(recipe_collection, tau_scale, logger=logging.getLogger(__name__), rng=default_rng())

Modified Extrande KMC

Improved implementation of Stochastic Simulation of Biomolecular Networks in Dynamic Environments 10.1371/journal.pcbi.1004923 Changes: The considered time window is chosen to be a window containing constant rates. This prevents very small tau caused by a spike in the rate at a later point. As a side effect, the upper rate bound b and current rate a0 are the same, and the ‘extra’ side channel can not be triggered anymore.

This should be more efficient given a limited number of time windows containing constant rates.

Parameters

Name Type Description Default
recipe_collection RecipeCollection from which one will be choosen required
rng np.random.Generator function to generate random numbers in the KMC step default_rng()
tau_scale float Scaling factor for tau, by default 1.0 required

Returns

Type Description
KMCResult time delta set to 0

frm

kmc.frm(recipe_collection, logger=logging.getLogger(__name__), rng=default_rng(), MD_time=None)

First Reaction Method variant of Kinetic Monte Carlo. takes RecipeCollection and choses a recipe based on which reaction would occur.

Compare e.g. Wikipedia KMC - time dependent

Parameters

Name Type Description Default
recipe_collection RecipeCollection from which one will be choosen required
rng np.random.Generator to generate random numbers in the KMC step default_rng()
MD_time Optional[float] time [ps] to compare conformational events with reaction events in the time domain None

rf_kmc

kmc.rf_kmc(recipe_collection, logger=logging.getLogger(__name__), rng=default_rng())

Rejection-Free Monte Carlo. Takes RecipeCollection and choses a recipe based on the relative propensity of the events. The ‘start’ time of the reaction is the time of the highest rate of the accepted reaction.

Compare e.g. Wikipedia KMC - rejection free

Parameters

Name Type Description Default
recipe_collection RecipeCollection from which one will be choosen required
rng np.random.Generator function to generate random numbers in the KMC step default_rng()
Back to top