def test_o(self): """test orthogopt""" from pele.transition_states import zeroEV_cluster natoms = 13 vec = np.random.uniform(-1,1,natoms*3) vec /= np.linalg.norm(vec) coords = np.random.uniform(-1,1,natoms*3) #orthogonalize vec vec = orthogopt(vec, coords) zeroev = zeroEV_cluster(coords) for u in zeroev: #print np.dot(u, vec) self.assertAlmostEqual(0., np.dot(u, vec), 5)
def test_o(self): # test orthogopt from pele.transition_states import zeroEV_cluster natoms = 13 vec = np.random.uniform(-1, 1, natoms * 3) vec /= np.linalg.norm(vec) coords = np.random.uniform(-1, 1, natoms * 3) # orthogonalize vec vec = orthogopt(vec, coords) zeroev = zeroEV_cluster(coords) for u in zeroev: # print np.dot(u, vec) self.assertAlmostEqual(0., np.dot(u, vec), 5)
natoms = 1000 system = LJCluster(natoms) #system.params.structural_quench_params.debug = True #system.params.structural_quench_params.iprint = 100 db = system.create_database() bh = system.get_basinhopping(db) bh.run(1) m = db.minima()[0] coords = m.coords potential = system.get_potential() energy, gradient, hessian = potential.getEnergyGradientHessian(coords) dummy_vec = ts.gramm_schmidt(ts.zeroEV_cluster(coords)) shifted_hess = hessian.copy() for i in range(6): shifted_hess += np.outer(dummy_vec[i], dummy_vec[i]) shifted_eval, shifted_evec = get_sorted_eig(shifted_hess) print "First log sum: ", np.sum(np.log(shifted_eval[6:])) sparse_hess = scipy.sparse.csc_matrix(shifted_hess) factor = cholmod.cholesky(sparse_hess) diagonal = np.diagonal(factor.L().todense())
natoms = 1000 system = LJCluster(natoms) #system.params.structural_quench_params.debug = True #system.params.structural_quench_params.iprint = 100 db = system.create_database() bh = system.get_basinhopping(db) bh.run(1) m = db.minima()[0] coords = m.coords potential = system.get_potential() energy, gradient, hessian = potential.getEnergyGradientHessian(coords) dummy_vec = ts.gramm_schmidt(ts.zeroEV_cluster(coords)) shifted_hess = hessian.copy() for i in range(6): shifted_hess += np.outer(dummy_vec[i], dummy_vec[i]) shifted_eval, shifted_evec = get_sorted_eig(shifted_hess) print("First log sum: ", np.sum(np.log(shifted_eval[6:]))) sparse_hess = scipy.sparse.csc_matrix(shifted_hess) factor = cholmod.cholesky(sparse_hess) diagonal = np.diagonal(factor.L().todense())