pele.rates._kmc#
- pele.rates._kmc.weighted_pick()
-
def weighted_pick(weights):sample uniformly from the objects with given weights
- Parameters:
- weightsdict
a dictionary with objects as the keys and weights as the values
- Returns:
- the object selected uniformly from the weights
- class pele.rates._kmc.KineticMonteCarlo
-
class KineticMonteCarlo:class to do kinetic Monte Carlo runs
- Parameters:
- graphnetworkx.DiGraph()
see GraphReduction for a description of how to attach transition probabilities and waiting times
- KineticMonteCarlo.first_passage()
-
def first_passage(self, a, B, maxiter=100000):start at a and stop when you get to B, return the time elapsed
- Parameters:
- anode
the start node
- Biterable
the set of final states
- Returns:
- total_time, niter
- KineticMonteCarlo.mean_first_passage_time()
-
def mean_first_passage_time(self, a, B, niter=1000):compute the mean first passage time from node a to nodes B
- KineticMonteCarlo.mean_rate()
-
def mean_rate(self, A, B, niter=1000, weights=None):return the mean rate from A to B
- Parameters:
- A, Biteratables
groups of nodes
- weightsdict
The equilibrium occupation probabilities of the states in group A. For doing the weighted average over the states in A
Notes
the mean rate is the inverse mean first passage time averaged over the states in A
- KineticMonteCarlo.committor()
-
def committor(self, x, A, B, maxiter=100000):starting from x return True if the trajectory ends up B before it enters A