Beispiel #1
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)
Beispiel #2
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)
Beispiel #3
0
def _refineTS(pot, coords, tsSearchParams=dict(), eigenvec0=None, pushoff_params=dict()):
    """
    find nearest transition state to NEB climbing image.  Then fall
    off the transition state to find the associated minima.
    
    This would naturally be a part of DoubleEndedConnect.  I separated it
    to make it more easily parallelizable.      
    """
    #run ts search algorithm
    kwargs = dict(tsSearchParams.items())
    ret = findTransitionState(coords, pot, eigenvec0=eigenvec0, **kwargs)
    
    #check to make sure it is a valid transition state 
    coords = ret.coords
    if not ret.success:
        logger.info("transition state search failed")
        return False, ret, None, None
        
    if ret.eigenval >= 0.:
        logger.info("transition state has positive lowest eigenvalue, skipping: %s %s %s", ret.eigenval, ret.energy, ret.rms)
        logger.info( "         not adding transition state")
        return False, ret, None, None
    
    #find the minima which this transition state connects
    logger.info("falling off either side of transition state to find new minima")
    ret1, ret2 = minima_from_ts(pot, coords, n = ret.eigenvec, \
        **pushoff_params)
#    print "testing", ret1.energy
    
    return True, ret, ret1, ret2
Beispiel #4
0
def compare_HEF(x0, evec0, system, **kwargs):
    from pele.transition_states import findTransitionState
    pot = PotWrapper(system.get_potential())
    ret = findTransitionState(x0, pot, eigenvec0=evec0, orthogZeroEigs=None, **kwargs)
    print ret.eigenval
    print pot.nfev
    print ret.rms
Beispiel #5
0
def compare_HEF(x0, evec0, system, **kwargs):  # pragma: no cover
    from pele.transition_states import findTransitionState

    pot = PotWrapper(system.get_potential())
    ret = findTransitionState(x0, pot, eigenvec0=evec0, orthogZeroEigs=None, **kwargs)
    print ret.eigenval
    print pot.nfev
    print ret.rms
Beispiel #6
0
def _refineTS(pot,
              coords,
              tsSearchParams=None,
              eigenvec0=None,
              pushoff_params=None):
    """
    find nearest transition state to NEB climbing image.  Then fall
    off the transition state to find the associated minima.
    
    This would naturally be a part of DoubleEndedConnect.  I separated it
    to make it more easily parallelizable.      
    """
    if pushoff_params is None: pushoff_params = dict()
    if tsSearchParams is None: tsSearchParams = dict()
    # run ts search algorithm
    kwargs = dict(list(tsSearchParams.items()))
    ret = findTransitionState(coords, pot, eigenvec0=eigenvec0, **kwargs)

    # check to make sure it is a valid transition state
    coords = ret.coords
    if not ret.success:
        logger.info("transition state search failed")
        return False, ret, None, None

    if ret.eigenval >= 0.:
        logger.info(
            "transition state has positive lowest eigenvalue, skipping: %s %s %s",
            ret.eigenval, ret.energy, ret.rms)
        logger.info("         not adding transition state")
        return False, ret, None, None

    # find the minima which this transition state connects
    logger.info(
        "falling off either side of transition state to find new minima")
    ret1, ret2 = minima_from_ts(pot, coords, n=ret.eigenvec, **pushoff_params)

    return True, ret, ret1, ret2
 def test_wrapper(self):
     ret = findTransitionState(self.x0, self.pot, orthogZeroEigs=None)
     self.assertTrue(ret.success)
     assert_arrays_almost_equal(self, ret.coords, self.xts, places=3)
Beispiel #8
0
 def test_wrapper(self):
     ret = findTransitionState(self.x0, self.pot, orthogZeroEigs=None)
     self.assertTrue(ret.success)
     assert_arrays_almost_equal(self, ret.coords, self.xts, places=3)