예제 #1
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()
예제 #2
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()
예제 #3
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)
예제 #4
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)
예제 #5
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)
예제 #6
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)