[ase-users] SingleCalculatorNEB

Ask Hjorth Larsen asklarsen at gmail.com
Tue Mar 20 15:50:02 CET 2018


Hi Oliver,

2018-03-19 17:41 GMT+01:00 "Oliver Brügner" via ase-users
<ase-users at listserv.fysik.dtu.dk>:
> Hi ase-users,
>
> I'm want to use the SingleCalculatorNEB combined with the ExternalForce
> constraint. I've found that the constraint was applied twice in each step of
> the optimization and I've looked into the code of the SingleCalculatorNEB
> (https://wiki.fysik.dtu.dk/ase/_modules/ase/neb.html) and was confused about
> the method get_energies_and_forces where all the calculators of the images
> are replaced by the SinglePointCalculator which gets the energy and forces
> corrected by the constraint:
>
>                 if not isinstance(calc, SinglePointCalculator):
>                     self.images[i].set_calculator(
>                         SinglePointCalculator(
>                             image,
>                             energy=image.get_potential_energy(),
>                             forces=image.get_forces()))
>
> Energies and forces which are obtained with this SinglePointCalculator are
> again corrected by the constraint. This happens for instance one line later
> in this code:
>
>
>                 self.emax = min(self.emax, image.get_potential_energy())
>
> Is there a reason for that?

One could say that the reason is that a true "constraint" should be
idempotent: Applying it twice should be the same as applying it once.
Clearly the ExternalForce contraint is not a true constraint and hence
the code misbehaves.

Also it stands to reason that since a SinglePointCalculator is a cache
of already calculated (and hence already constrained) quantities,
ideally, it should not perform any further processing.

So indeed we should fix this somehow.

Best regards
Ask

> Thank you.
>
> Best,
> Oliver
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users



More information about the ase-users mailing list