Beispiel #1
0
    def _build_disconnectivity_graph(self, show_minima=True, **params):
        #this should be somewhere else
        if self.database is None:
            graph = self.graph
        else:
            db = self.database
            graphwrapper = Graph(db)
            graph = graphwrapper.graph
        dg = DisconnectivityGraph(graph, **params)
        dg.calculate()
        
        ax = self.canvas.axes
        ax.clear()
        ax.hold(True)        

        #draw minima as points and make them interactive
        if show_minima:
            xpos, minima = dg.get_minima_layout()
            energies = [m.energy for m in minima]
            points = ax.scatter(xpos, energies, picker=5)        
            
            def on_pick(event):
                if event.artist != points:
    #                print "you clicked on something other than a node"
                    return True
                thispoint = event.artist
                ind = event.ind[0]
                min1 = minima[ind]
                print "you clicked on minimum with id", min1._id, "and energy", min1.energy
                self.minimum_selected(min1)
            self.canvas.mpl_connect('pick_event', on_pick)
        
        # plot the lines and set up the rest of the plot using the built in function 
        dg.plot(axes=ax, show_minima=False)
        self.canvas.draw()
Beispiel #2
0
 def test_disconn_graph(self,database):
     from pygmin.utils.disconnectivity_graph import DisconnectivityGraph
     from pygmin.landscape import Graph
     import matplotlib.pyplot as plt
     graph = Graph(database).graph
     dg = DisconnectivityGraph(graph, nlevels=3, center_gmin=True)
     dg.calculate()
     dg.plot()
     plt.show()
Beispiel #3
0
 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()
Beispiel #4
0
def make_disconnectivity_graph(database):
    graph = Graph(database).graph
    dg = DisconnectivityGraph(graph, nlevels=3, center_gmin=True)
    dg.calculate()
    dg.plot()
    plt.show()
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()
Beispiel #6
0
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
Beispiel #7
0
print "starting with a database of", len(db.minima()), "minima"

# turn of status printing for the connect run
# first use the logging module to turn off the status messages
logger = logging.getLogger("pygmin.connect")
logger.setLevel("WARNING")


# 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()
Beispiel #8
0
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
Beispiel #9
0
def make_disconnectivity_graph(database):
    graph = TSGraph(database).graph
    dg = DisconnectivityGraph(graph, nlevels=3, center_gmin=True)
    dg.calculate()
    dg.plot()
    plt.show()