def getPairLJ(natoms=38): from pygmin.systems import LJCluster system = LJCluster(natoms) ret1 = system.get_random_minimized_configuration() ret2 = system.get_random_minimized_configuration() coords1, coords2 = ret1[0], ret2[0] E1, E2 = ret1[1], ret2[1] mindist = system.get_mindist() mindist(coords1, coords2) return coords1, coords2, system.get_potential(), mindist, E1, E2
def spawnlj(**kwargs): from pygmin.systems import LJCluster from pygmin.config import config import os natoms = 13 sys = LJCluster(natoms) db = sys.create_database() x1, E1 = sys.get_random_minimized_configuration()[:2] x2, E2 = sys.get_random_minimized_configuration()[:2] m1 = db.addMinimum(E1, x1) m2 = db.addMinimum(E2, x2) optim = "/home/js850/git/OPTIM/source/build/OPTIM" optim = config.get("exec", "OPTIM") optim = os.path.expandvars(os.path.expanduser(optim)) spawner = SpawnOPTIM_LJ(x1, x2, sys, OPTIM=optim, **kwargs) spawner.run() spawner.load_results(db)
def plot_hist(hess): import pylab as pl pl.hist(np.log10(np.abs(hess.reshape(-1)))) pl.show() if __name__ == "__main__": from pygmin.systems import LJCluster natoms = 30 system = LJCluster(natoms) pot = system.get_potential() coords = system.get_random_configuration() xmin = system.get_random_minimized_configuration()[0] e, g, h = pot.getEnergyGradientHessian(xmin) evals = get_eigvals(h) print evals quencher = system.get_minimizer(tol=10.) coords = quencher(coords)[0] e, g, h = pot.getEnergyGradientHessian(coords) w1, v1 = get_smallest_eig(h) print w1 w, v = get_smallest_eig_arpack(h) print w w2, v2 = get_smallest_eig_sparse(h) print w2, w2 / w1 w3, v3 = get_smallest_eig_nohess(coords, system) print w3, w3 / w1
app = QtGui.QApplication(sys.argv) from pygmin.systems import LJCluster pl.ion() natoms = 13 system = LJCluster(natoms) system.params.double_ended_connect.local_connect_params.NEBparams.iter_density = 5. dbname = "lj%dtest.db" % (natoms,) db = system.create_database(dbname) #get some minima if False: bh = system.get_basinhopping(database=db) bh.run(10) minima = db.minima() else: x1, e1 = system.get_random_minimized_configuration()[:2] x2, e2 = system.get_random_minimized_configuration()[:2] min1 = db.addMinimum(e1, x1) min2 = db.addMinimum(e2, x2) minima = [min1, min2] # connect some of the minima nmax = min(3, len(minima)) m1 = minima[0] for m2 in minima[1:nmax]: connect = system.get_double_ended_connect(m1, m2, db) connect.connect()
def start(): wnd.start() print >> sys.stderr, "started decrunner" if __name__ == "__main__": from OpenGL.GLUT import glutInit import sys import pylab as pl app = QtGui.QApplication(sys.argv) from pygmin.systems import LJCluster pl.ion() natoms = 113 system = LJCluster(natoms) system.params.double_ended_connect.local_connect_params.NEBparams.iter_density = 5. x1, e1 = system.get_random_minimized_configuration()[:2] x2, e2 = system.get_random_minimized_configuration()[:2] db = system.create_database() min1 = db.addMinimum(e1, x1) min2 = db.addMinimum(e2, x2) wnd = ConnectViewer(system, db, min1=min1, min2=min2, app=app) # decrunner = DECRunner(system, db, min1, min2, outstream=wnd.textEdit_writer) glutInit() wnd.show() from PyQt4.QtCore import QTimer QTimer.singleShot(10, start) sys.exit(app.exec_())
print "times", n, time1, time2, time3, time4 sys.stdout.flush() def plot_hist(hess): import pylab as pl pl.hist(np.log10(np.abs(hess.reshape(-1)))) pl.show() if __name__ == "__main__": from pygmin.systems import LJCluster natoms = 30 system = LJCluster(natoms) pot = system.get_potential() coords = system.get_random_configuration() xmin = system.get_random_minimized_configuration()[0] e, g, h = pot.getEnergyGradientHessian(xmin) evals = get_eigvals(h) print evals quencher = system.get_minimizer(tol=10.) coords = quencher(coords)[0] e, g, h = pot.getEnergyGradientHessian(coords) w1, v1 = get_smallest_eig(h) print w1 w, v = get_smallest_eig_arpack(h) print w w2, v2 = get_smallest_eig_sparse(h) print w2, w2/w1 w3, v3 = get_smallest_eig_nohess(coords, system) print w3, w3/w1