pele.landscape.connect_min#

class pele.landscape.connect_min.DoubleEndedConnect[source]

Source

class DoubleEndedConnect:

Find a connected network of minima and transition states between min1 and min2

Parameters:
min1, min2Mimumum() objects

the two minima to try to connect

potpotential object

the potential

mindistcallable

the function which returns the optimized minimum distance between two structures

databasepele Database object

Used to store the new minima and transition states found.

niterint, optional

maximum number of iterations

verbosityint

this controls how many status messages are printed. (not really implemented yet)

merge_minimabool

if True, minima for which NEB finds no transition state candidates between them will be merged

max_dist_mergefloat

merging minima will be aborted if the distance between them is greater than max_dist_merge

local_connect_paramsdict

parameters passed to the local connect algorithm. This includes all NEB and all transition state search parameters, along with, e.g. now many times to retry a local connect run. See documentation for LocalConnect for details.

fresh_connectbool

if true, ignore all existing minima and transition states in the database and try to find a new path

longest_firstbool

if true, always try to connect the longest segment in the path guess first

conf_checkslist of callables

a list of callable function that determine if a configuration is valid. They must return a bool, and accept the keyword parameters

conf_check(energy=energy, coords=coords)

If any configuration in a minimum-transition_state-minimum triplet fails a test then the whole triplet is rejected.

See also

LocalConnect

the core algorithm of this routine

Notes

The algorithm is iterative, with each iteration composed of

While min1 and min2 are not connected:
  1. choose a pair of known minima to try to connect

  2. use NEB to get a guess for the transition states between them

  3. refine the transition states to desired accuracy

4) fall off either side of the transition states to find the two minima associated with that candidate

5) add the transition states and associated minima to the known network

Of the above, steps 1 and 2 and 3 are the most involved. 2, 3, 4 are wrapped into a separate class called LocalConnect. See this class and the NEB and FindTransitionState classes for detailed descriptions of these procedures.

An important note is that the NEB is used only to get a guess for the transition state. Thus we only want to put enough time and energy into the NEB routine to get the guess close enough that FindTransitionState can refine it to the correct transition state. FindTransitionState is very fast if the initial guess is good, but can be very slow otherwise.

Choose a pair:

Here I will describe step 1), the algorithm to find a pair of known minima to try to connect. This choice will keep in mind that the ultimate goal is to connect min1 and min2.

In addition to the input parameter “graph”, we keep a second graph “Gdist” (now wrapped in a separate class _DistanceGraph) which also has minima as the vertices. Gdist has an edge between every pair of nodes. The edge weight between vertices u and v is

if u and v are connected by transition states:

weight(u, v) = 0.

elif we have already tried local_connect on (u,v):

weight(u, v) = Infinity

else:

weight(u, v) = dist(u, v)**2

This edge weight is set to Infinity to ensure we don’t repeat LocalConnect runs over and over again. The minimum weight path between min1 and min2 in Gdist gives a good guess for the best way to try connect min1 and min2. So the algorithm to find a pair of know minima (trial1, trial2) to try to connect is

path = Gdist.minimum_weight_path(min1, min2) trial1, trial2 = minima pair in path with lowest nonzero edge weight. (note: if parameter longest_first is True) then the edgepair with the largest edge weight will be selected)

todo:

allow user to pass graph

DoubleEndedConnect.mergeMinima()[source]

Source

def mergeMinima(self, min1, min2):

merge two minimum objects

This will delete min2 and make everything that pointed to min2 point to min1.

DoubleEndedConnect.getDist()[source]

Source

def getDist(self, min1, min2):

get the distance between min1 and min2.

DoubleEndedConnect.connect()[source]

Source

def connect(self):

the main loop of the algorithm

DoubleEndedConnect.returnPath()[source]

Source

def returnPath(self):

return information about the path

Returns:
mintslist of Minimum and TransitionStates

a list of Minimum, TransitionState, Minimum objects that make up the path

Slist of float

numpy array of the distance along the path. len(S) == len(mints)

energieslist of float

numpy array of the energies along the path

If the minima are not connected, return (None, None, None)