pele.rates._rate_calculations#

Module source

routines for computing rates from one subset of a graph to another

pele.rates._rate_calculations.kmcgraph_from_rates()[source]

Source

def kmcgraph_from_rates(rates):

create a graph for input to GraphReduction from a dictionary of rates

Parameters:
ratesdict

a dictionary of rates. the keys are tuples of nodes (u,v), the values are the rate constants from u to v.

Returns:
graphnetworkx.DiGraph object
A directed graph specifying the connectivity, the initial transition
probabilities and the occupation times. The graph must have all the
data in the correct format. Each node must have the following keys in
their attributes dictionary::

“tau” : occupation time

Each edge between nodes u and v must have the following keys in their
attributes dictionary:

“P” : transition probability from u to v

class pele.rates._rate_calculations.GraphReduction[source]

Source

class GraphReduction:

class to apply the graph reduction method for finding transition rates between two groups of nodes

Parameters:
rate_constantsdict

a dictionary of rates. the keys are tuples of nodes (u,v), the values are the rate constants from u to v.

A, Biterables

Groups of nodes specifying the reactant and product groups. The rates returned will be the rate from A to B and vice versa.

weightsdict

Dictionary with nodes as keys and weights as values. The weights are the equilibrium occupation probabilities of the nodes in A and B. They are used to do the weighted mean for the final average over inverse mean first passage times.

Notes

This follows the new graph transformation procedure (NGT) described by David Wales, J. Chem. Phys., 2009 http://dx.doi.org/10.1063/1.3133782

The rate, rAB computed by this calculation (returned by self.get_final_rates) is the inverse mean first passage time averaged over the states in A

GraphReduction.get_committor_probabilityAB()[source]

Source

def get_committor_probabilityAB(self, x):

return the committor probability for node x

x must be in A or in B. If x is in A return the the probability that a trajectory starting at x gets to B before returning to x. If x is in B return the the probability that a trajectory starting at x gets to A before returning to x.

GraphReduction.get_rate_AB()[source]

Source

def get_rate_AB(self):

Return the transition rate from A to B

This is the inverse mean first passage time averaged over the elements in A

GraphReduction.get_rate_BA()[source]

Source

def get_rate_BA(self):

Return the transition rate from B to A

This is the inverse mean first passage time averaged over the elements in B

GraphReduction.compute_rates()[source]

Source

def compute_rates(self):

do the computation to compute the rates

GraphReduction.compute_committor_probability()[source]

Source

def compute_committor_probability(self, x):

compute the probability that trajectory starting from x reaches B before it reaches A

Notes

Since compute_rates() modifies the original graph this must be called before copute_rates()

GraphReduction.compute_committor_probabilities()[source]

Source

def compute_committor_probabilities(self, nodes):

compute the committor probability for each node in nodes

Returns:
a dictionary of the committor probabilies for each node in nodes

Notes

this is the probability that the trajectory starting from node x reaches B before it reaches A.

Since compute_rates() modifies the original graph this must be called before copute_rates()