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
KMCAccept The result of a KMC step. Similar to a Recipe but for the concrete realization of a reaction.

KMCAccept

kmc.KMCAccept(
    self
    recipe
    reaction_probability
    time_delta
    time_start
    time_start_index
    time_start_index_within_plugin=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 list[float] | None Integral of reaction propensity with respect to time
time_delta float MC time jump during which the reaction occurs [ps]
time_start float Time, from which the reaction starts. The reaction changes the geometry/topology of this timestep and continues from there. [ps]
time_start_index int Index into the list of timesteps or rates of the timestep where the reaction starts

Functions

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

extrande

kmc.extrande(recipe_collection, tau_scale, 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

Name Type Description
KMCResult time delta set to 0

extrande_mod

kmc.extrande_mod(recipe_collection, tau_scale, 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

Name Type Description
KMCResult time delta set to 0

frm

kmc.frm(recipe_collection, 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

multi_rfkmc

kmc.multi_rfkmc(recipe_collection, n, 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()

rf_kmc

kmc.rf_kmc(recipe_collection, 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