Beispiel #1
0
        #pl.semilogy()
        pl.xlabel("energy evaluations")
        pl.ylabel("energy")
        pl.show()

if __name__ == "__main__":
    import pygmin.potentials.lj as lj
    import scipy.optimize
    from pygmin.optimize import _quench as quench
    print "Running benchmark with lennard jones potential"
    pot = lj.LJ()
    
    natoms = 36
    
    coords = np.random.random(3*natoms)*10.0
    coords, E, tmp, tmp=quench.lbfgs_scipy(coords, pot.getEnergyGradient, tol=1e-3)
    
    coords = coords + np.random.random(coords.shape)*0.1
    tmp, Emin, tmp, tmp = quench.lbfgs_scipy(coords, pot.getEnergyGradient, tol=1e-3)
    
    bench = QuenchBenchmark(pot)
    bench.addMinimizer("lbfgs", quench.lbfgs_scipy)
    bench.addMinimizer("mylbfgs", quench.mylbfgs)
    bench.addMinimizer("lbfgs_py", quench.lbfgs_py)
    bench.addMinimizer("lbfgs_ase", quench.lbfgs_ase)
    bench.addMinimizer("cg", quench.cg)
    bench.addMinimizer("fire", quench.fire)
    bench.addMinimizer("bfgs", quench.bfgs)
    #bench.addMinimizer("fmin", quench.fmin)
    #bench.addMinimizer("steep", quench.steepest_descent)
    
Beispiel #2
0
        pl.xlabel("energy evaluations")
        pl.ylabel("energy")
        pl.show()


if __name__ == "__main__":
    import pygmin.potentials.lj as lj
    import scipy.optimize
    from pygmin.optimize import _quench as quench
    print "Running benchmark with lennard jones potential"
    pot = lj.LJ()

    natoms = 36

    coords = np.random.random(3 * natoms) * 10.0
    res = quench.lbfgs_scipy(coords, pot, tol=1e-3)
    coords = res.coords
    coords = coords + np.random.random(coords.shape) * 0.1
    res = quench.lbfgs_scipy(coords, pot, tol=1e-3)
    Emin = res.energy

    bench = QuenchBenchmark(pot)
    bench.addMinimizer("lbfgs", quench.lbfgs_scipy)
    bench.addMinimizer("mylbfgs", quench.mylbfgs)
    bench.addMinimizer("lbfgs_py", quench.lbfgs_py)
    #bench.addMinimizer("lbfgs_ase", quench.lbfgs_ase)
    bench.addMinimizer("cg", quench.cg)
    bench.addMinimizer("fire", quench.fire)
    bench.addMinimizer("bfgs_scipy", quench.bfgs_scipy)
    #bench.addMinimizer("fmin", quench.fmin)
    #bench.addMinimizer("steep", quench.steepest_descent)
Beispiel #3
0
        pl.ylabel("energy")
        pl.show()


if __name__ == "__main__":
    import pygmin.potentials.lj as lj
    import scipy.optimize
    from pygmin.optimize import _quench as quench

    print "Running benchmark with lennard jones potential"
    pot = lj.LJ()

    natoms = 36

    coords = np.random.random(3 * natoms) * 10.0
    res = quench.lbfgs_scipy(coords, pot, tol=1e-3)
    coords = res.coords
    coords = coords + np.random.random(coords.shape) * 0.1
    res = quench.lbfgs_scipy(coords, pot, tol=1e-3)
    Emin = res.energy

    bench = QuenchBenchmark(pot)
    bench.addMinimizer("lbfgs", quench.lbfgs_scipy)
    bench.addMinimizer("mylbfgs", quench.mylbfgs)
    bench.addMinimizer("lbfgs_py", quench.lbfgs_py)
    # bench.addMinimizer("lbfgs_ase", quench.lbfgs_ase)
    bench.addMinimizer("cg", quench.cg)
    bench.addMinimizer("fire", quench.fire)
    bench.addMinimizer("bfgs_scipy", quench.bfgs_scipy)
    # bench.addMinimizer("fmin", quench.fmin)
    # bench.addMinimizer("steep", quench.steepest_descent)