[ase-users] how to avoid calculator reset when generating a SumCalculator
Gaël Donval
gdonval at pm.me
Tue Mar 23 16:22:08 CET 2021
Dear Rochus,
Thanks a lot for the report!
I have opened an issue describing the problem
(https://gitlab.com/ase/ase/-/issues/884). If it's not solved by then I'll write
a fix at some point.
Regards,
Gaël
>
> dear ase experts,
>
> after a bit of fiddling i found a solution for my problem which was
> discussed in a number of emails before. i dare calling it an issue of
> ase, but it might be that this is an intended behavior ... in any case
> the fix is simple and straight forward.
>
> Note:
> i use the current dftd4 version from conda-forge. it contains "just" a
> regular ase calculator interface. thus, the solution using the older
> interface with D4_model does not work for me.
>
> Problem:
> I want to restart a GPaw calculation that took a long time to converge
> and pack it into a SumCalculator with DFTD4 and optimize the system. My
> problem was, that the GPaw calculator was triggered to discard the
> wavefunctions and initialize from the LCAO guess again, when wrapping it
> into the SumCalculator like this:
>
> dft = GPAW('restart.gpw')
> system = dft.get_atoms()
> d4 = DFTD4(method='pbe')
> sumcalc = SumCalculator([dft, d4], atoms=system)
> e_total = system.get_potential_energy()
>
> i expected that calling SumCalculator with atoms=system would set the
> atoms object of the new SumCalculator object. but it does not (not
> exactly sure why? is that a feature?)!
> in other words, after setting
>
> sumcalc = SumCalculator([dft, d4], atoms=system)
>
> sumcalc.atoms is still None, which then triggers the above unwanted
> behavior.
>
> Solution:
> one has to explicitly set the atoms afterwards. i do it this way now and
> all is fine:
>
> sumcalc = SumCalculator([d4, dft], atoms=system)
> system.calc = sumcalc
> sumcalc.atoms = system
> e_total = system.get_potential_energy()
>
> hope this prevents others from searching.
> best greetings,
>
> rochus
>
>
> --
>
>
> Prof. Dr. Rochus Schmid
> Lehrstuhl für Anorganische Chemie II
> Computational Materials Chemistry Group
> Ruhr-Universität Bochum
> Room NC02/30 (Postbox 9)
> D-44780 Bochum
> Tel.: ++49(234) 32 24166
> Fax: ++49(234) 32 14174
> Email: rochus.schmid at rub.de
> http://www.rochusschmid.de
>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 294 bytes
Desc: OpenPGP digital signature
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20210323/407aa2c0/attachment.sig>
More information about the ase-users
mailing list