def _compute_barriers(self, graph, min1): """for each minimum graph compute the (approximate) energy barrier to min1""" dgraph = DisconnectivityGraph(graph, nlevels=self.nlevels) dgraph.calculate() tree = dgraph.tree_graph energy_barriers = dict() self._recursive_label(tree, min1, energy_barriers) return energy_barriers
def test_disconn_graph(self,database): from pygmin.utils.disconnectivity_graph import DisconnectivityGraph from pygmin.landscape import TSGraph import matplotlib.pyplot as plt graph = TSGraph(database).graph dg = DisconnectivityGraph(graph, nlevels=3, center_gmin=True) dg.calculate() dg.plot() plt.show()
def _build_disconnectivity_graph(self, **params): if self.database is None: graph = self.graph else: db = self.database if self.params.has_key('Emax'): graph = reduced_db2graph(db, params['Emax']) else: graphwrapper = TSGraph(db) graph = graphwrapper.graph dg = DisconnectivityGraph(graph, **params) dg.calculate() self.dg = dg
logger = logging.getLogger("pygmin.connect") logger.setLevel("WARNING") # now create the double ended connect object connect = system.get_double_ended_connect(m1, m2, db) connect.connect() mints, S, energies = connect.returnPath() nts = (len(mints) - 1) / 2 print "\nprint found a connection with", nts, "transition states" # connect all minima to the lowest minimum print "now connecting all the minima to the lowest energy minimum" m1 = db.minima()[0] for m2 in db.minima()[1:]: print "connecting minima with id's", m1._id, m2._id connect = system.get_double_ended_connect(m1, m2, db) connect.connect() # print some data about the database print "database summary:" print " ", len(db.minima()), "minima" print " ", len(db.transition_states()), "transition states" # finally, create a disconnectivity graph from the database print "computing and showing disconnectivity graph" import pylab as pl graph = database2graph(db) dg = DisconnectivityGraph(graph, nlevels=6) dg.calculate() dg.plot() pl.show()
from pygmin.utils.disconnectivity_graph import DisconnectivityGraph from pygmin.storage import Database from pygmin.landscape import TSGraph import pylab as pl import numpy as np kbT = 0.75 db = Database(db="tip4p_8.sqlite", createdb=False) graph = TSGraph(db) dg = DisconnectivityGraph(graph.graph, db.minima(), subgraph_size=20) dg.calculate() dg.plot() for m in db.minima(): if m.pgorder != 2: print m.pgorder m.free_energy = m.energy + kbT * 0.5 * m.fvib + kbT * np.log(m.pgorder) for ts in db.transition_states(): # if ts.pgorder != 2: print ts.pgorder #assert ts.pgorder == 2 ts.free_energy = ts.energy + kbT * 0.5 * ts.fvib + kbT * np.log( ts.pgorder) + kbT * np.log(kbT) if ts.free_energy > ts.minimum1.free_energy or ts.free_energy > ts.minimum2.free_energy: print "warning, free energy of transition state lower than minimum" print ts.free_energy, ts.minimum1.free_energy, ts.minimum2.free_energy
def make_disconnectivity_graph(database): graph = TSGraph(database).graph dg = DisconnectivityGraph(graph, nlevels=3, center_gmin=True) dg.calculate() dg.plot() plt.show()