def fire(coords, getEnergyGradient, tol = 1e-3, nsteps=100000, maxstep = 0.5, **kwargs): """ A wrapper function for the pygmin FIRE implementation """ opt = Fire(coords, getEnergyGradient, maxmove = maxstep, **kwargs) opt.run(fmax=tol, steps=nsteps) e,g = getEnergyGradient(opt.coords) rms = np.linalg.norm(g)/np.sqrt(len(g)) return opt.coords, e, rms, opt.nsteps
def fire(coords, pot, tol=1e-3, nsteps=100000, **kwargs): """ A wrapper function for the pygmin FIRE implementation """ if not hasattr(pot, "getEnergyGradient"): # for compatibility with old quenchers. # assume pot is a getEnergyGradient function pot = _getEnergyGradientWrapper(pot) opt = Fire(coords, pot, **kwargs) res = opt.run(fmax=tol, steps=nsteps) return res
def fire(coords, getEnergyGradient, tol=1e-3, nsteps=100000, **kwargs): """ A wrapper function for the pygmin FIRE implementation """ if hasattr(getEnergyGradient, "getEnergyGradient"): # this is to aid compatibility between old and new quenchers. # This function will now accept a potential object getEnergyGradient = getEnergyGradient.getEnergyGradient pot = getEnergyGradientWrapper(getEnergyGradient) opt = Fire(coords, pot, **kwargs) opt.run(fmax=tol, steps=nsteps) e, g = getEnergyGradient(opt.coords) rms = np.linalg.norm(g) / np.sqrt(len(g)) return opt.coords, e, rms, opt.nsteps
def fire(coords, getEnergyGradient, tol=1e-3, nsteps=100000, **kwargs): """ A wrapper function for the pygmin FIRE implementation """ if hasattr(getEnergyGradient, "getEnergyGradient"): # this is to aid compatibility between old and new quenchers. # This function will now accept a potential object getEnergyGradient = getEnergyGradient.getEnergyGradient pot = getEnergyGradientWrapper(getEnergyGradient) opt = Fire(coords, pot, **kwargs) opt.run(fmax=tol, steps=nsteps) e,g = getEnergyGradient(opt.coords) rms = np.linalg.norm(g)/np.sqrt(len(g)) return opt.coords, e, rms, opt.nsteps