示例#1
0
def do_connect(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    m1 = db.minima()[0]
    for m2 in db.minima()[1:5]:
        connect = system.get_double_ended_connect(m1, m2, db, fresh_connect=True)
        connect.connect()
示例#2
0
def do_mindist(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    mindist = system.get_mindist()
    m0 = db.minima()[0]
    for m1 in db.minima()[1:6]:
        d, x1, x2 = mindist(m0.coords, m1.coords)
        print d
示例#3
0
def do_mindist(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    mindist = system.get_mindist()
    m0 = db.minima()[0]
    for m1 in db.minima()[1:6]:
        d, x1, x2 = mindist(m0.coords, m1.coords)
        print d
示例#4
0
def do_NEB(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    mindist = system.get_mindist()
    pot = system.get_potential()
    m1 = db.minima()[0]
    for m2 in db.minima()[1:3]:
        neb = NEBDriver(pot, m1.coords, m2.coords)
        neb.run()
示例#5
0
def do_NEB(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    mindist = system.get_mindist()
    pot = system.get_potential()
    m1 = db.minima()[0]
    for m2 in db.minima()[1:3]:
        neb = NEBDriver(pot, m1.coords, m2.coords)
        neb.run()
示例#6
0
def do_connect(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    m1 = db.minima()[0]
    for m2 in db.minima()[1:5]:
        connect = system.get_double_ended_connect(m1,
                                                  m2,
                                                  db,
                                                  fresh_connect=True)
        connect.connect()
示例#7
0
def do_ts_search(nmol=20):
    from pele.transition_states import findTransitionState
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    orthogopt = system.get_orthogonalize_to_zero_eigenvectors()
    for ts in db.transition_states():
        coords = db.transition_states()[0].coords.copy() 
        coords += np.random.uniform(-.5,.5, coords.size)
    
        print system.params.double_ended_connect.local_connect_params.tsSearchParams
        findTransitionState(coords, system.get_potential(), orthogZeroEigs=orthogopt, 
                            **system.params.double_ended_connect.local_connect_params.tsSearchParams)
示例#8
0
class TestOTPCluster(unittest.TestCase):
    def setUp(self):
        np.random.seed(0)
        self.nmol = 4
        self.system = OTPCluster(self.nmol)
        pot = self.system.get_potential()
        self.db = self.system.create_database()
        self.m1 = self.db.addMinimum(pot.getEnergy(_x1), _x1)
        self.m2 = self.db.addMinimum(pot.getEnergy(_x2), _x2)

    def test1(self):
        pot = self.system.get_potential()
        self.assertLess(np.linalg.norm(pot.getGradient(self.m1.coords)), .1)
        self.assertLess(np.linalg.norm(pot.getGradient(self.m2.coords)), .1)

    def test_basinhopping(self):
        db = self.system.create_database()
        bh = self.system.get_basinhopping(db)
        bh.setPrinting(ostream=None)
        bh.run(5)
        self.assertGreaterEqual(db.number_of_minima(), 1)

    def test_double_ended_connect(self):
        connect = self.system.get_double_ended_connect(self.m1, self.m2,
                                                       self.db)
        connect.connect()
        self.assertTrue(connect.success())

        path = connect.returnPath()

    def test_thermodynamics(self):
        get_thermodynamic_information(self.system,
                                      self.db,
                                      nproc=None,
                                      recalculate=True)
        self.assertIsNotNone(self.m1.fvib)

        mt = self.system.get_metric_tensor(self.m1.coords)
        print("metric tensor")
        print(mt)
示例#9
0
class TestOTPCluster(unittest.TestCase):
    def setUp(self):
        np.random.seed(0)
        self.nmol = 4
        self.system = OTPCluster(self.nmol)
        pot = self.system.get_potential()
        self.db = self.system.create_database()
        self.m1 = self.db.addMinimum(pot.getEnergy(_x1), _x1)
        self.m2 = self.db.addMinimum(pot.getEnergy(_x2), _x2)
    
    def test1(self):
        pot = self.system.get_potential()
        self.assertLess(np.linalg.norm(pot.getGradient(self.m1.coords)), .1)
        self.assertLess(np.linalg.norm(pot.getGradient(self.m2.coords)), .1)
    
    def test_basinhopping(self):
        db = self.system.create_database()
        bh = self.system.get_basinhopping(db)
        bh.setPrinting(ostream=None)
        bh.run(5)
        self.assertGreaterEqual(db.number_of_minima(), 1)

    def test_double_ended_connect(self):
        connect = self.system.get_double_ended_connect(self.m1, self.m2, self.db)
        connect.connect()
        self.assertTrue(connect.success())
        
        path = connect.returnPath()
    
    def test_thermodynamics(self):
        get_thermodynamic_information(self.system, self.db, nproc=None, recalculate=True)
        self.assertIsNotNone(self.m1.fvib)
        
        mt = self.system.get_metric_tensor(self.m1.coords)
        print("metric tensor")
        print(mt)
示例#10
0
def do_ts_search(nmol=20):
    from pele.transition_states import findTransitionState
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    orthogopt = system.get_orthogonalize_to_zero_eigenvectors()
    for ts in db.transition_states():
        coords = db.transition_states()[0].coords.copy()
        coords += np.random.uniform(-.5, .5, coords.size)

        print system.params.double_ended_connect.local_connect_params.tsSearchParams
        findTransitionState(coords,
                            system.get_potential(),
                            orthogZeroEigs=orthogopt,
                            **system.params.double_ended_connect.
                            local_connect_params.tsSearchParams)
示例#11
0
def getdb(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    bh = system.get_basinhopping(db)
    bh.run(20)
示例#12
0
def getdb(nmol=20):
    system = OTPCluster(nmol)
    db = system.create_database("test.sqlte")
    bh = system.get_basinhopping(db)
    bh.run(20)