def anim_opt(self, opt, energy_profile=False, colorbar=False, figsize=(8, 6), show=False): try: min_ = self.levels.min() max_ = self.levels.max() num = self.levels.size levels = (min_, max_, num) except TypeError: levels = None anim = AnimPlot(self.__class__(), opt, xlim=self.xlim, ylim=self.ylim, levels=levels, energy_profile=energy_profile, colorbar=colorbar, figsize=figsize) anim.animate() if show: plt.show() return anim
def animate(opt): xlim = (-2, 2.5) ylim = (0, 5) levels = (-3, 4, 80) ap = AnimPlot(AnaPot(), opt, xlim=xlim, ylim=ylim, levels=levels) ap.animate() return ap
def test_anapot_growingstring_opt(): coords = ( (-1.05274, 1.02776, 0), (1.94101, 3.85427, 0), ) calc_getter = AnaPot eps = .05 damp = .05 images = get_geoms(coords, calc_getter) gs_kwargs = { "max_nodes": 10, "perp_thresh": 0.5, # "perp_thresh": 1, } gs = GrowingString(images, calc_getter, reparam_every=1) # from pysisyphus.optimizers.QuickMin import QuickMin # opt = QuickMin(gs) # self.coords = [c.reshape(-1, 3) for c in self.gs.coords_list] # self.tangents = self.gs.tangent_list # self.perp_forces = self.gs.perp_force_list from pysisyphus.optimizers.SteepestDescent import SteepestDescent # opt = SteepestDescent(gs, alpha=0.05, bt_disable=True, max_cycles=175) opt = SteepestDescent(gs, alpha=0.05, bt_disable=True, max_cycles=70) opt.run() xlim = (-2, 2.5) ylim = (0, 5) levels = (-3, 4, 80) ap = AnimPlot(AnaPot(), opt, xlim=xlim, ylim=ylim, levels=levels) ap.animate()
def animate(opt): xlim = (-1.5, 1.5) ylim = (-0.5, 1.5) levels = (-.5, 2, 30) interval = 250 ap = AnimPlot(AnaPot3(), opt, xlim=xlim, ylim=ylim, levels=levels, interval=interval) ap.animate()
def animate_bare(opt): xlim = (-2, 2.5) ylim = (0, 5) levels = (-3, 4, 80) ap = AnimPlot( AnaPot(), opt, xlim=xlim, ylim=ylim, levels=levels, energy_profile=False, colorbar=False, figsize=(8, 6), save=False, title=False, ) ap.animate() return ap
def test_mb_gs_opt(): coords = ( (0.614, 0.031, 0), (-.563, 1.43, 0), ) calc_getter = MullerBrownPot # pot = calc_getter() # pot.plot() # plt.show() images = get_geoms(coords, calc_getter) gs_kwargs = { "max_nodes": 16, "perp_thresh": 50, "fix_ends": True, } gs = GrowingString(images, calc_getter, **gs_kwargs) from pysisyphus.optimizers.QuickMin import QuickMin from pysisyphus.optimizers.SteepestDescent import SteepestDescent as SD # opt = QuickMin(gs) opt = SD(gs, alpha=0.4, bt_disable=True) opt.run() ap = AnimPlot(calc_getter(), opt) ap.animate()
def animate(opt): xlim = (-1.75, 1.25) ylim = (-0.5, 2.25) levels = (-150, -15, 40) ap = AnimPlot(MullerBrownPot(), opt, xlim=xlim, ylim=ylim, levels=levels) ap.animate()