[ase-users] Help-minima-hopping

Ask Hjorth Larsen asklarsen at gmail.com
Wed Sep 12 12:39:59 CEST 2018


Hi,
Am Mi., 12. Sep. 2018 um 00:38 Uhr schrieb Kondov, Ivan (SCC) via
ase-users <ase-users at listserv.fysik.dtu.dk>:
>
> Dear Rafael,
>
>
> everything seems to be correct but the only issue is with the geometry optimization mode. As far as I understand the minima hopping method, as implemented in ASE,
>
>
> https://wiki.fysik.dtu.dk/ase/tutorials/minimahopping/minimahopping.html
>
>
> requires only the energy and the forces from the calculator but not the locally optimized structure (nor the energy of the locally optimized structure). Please correct me if this is wrong.

Right, the minima hopping uses a combination of MD and optimization runs.

If you want ASE to work with the code's internal optimizer, you need
to implement an optimizer which does that.  For example for GULP (see
ase.calculators.gulp):

class GULPOptimizer:
    def __init__(self, atoms, calc):
        self.atoms = atoms
        self.calc = calc

    def todict(self):
        return {'type': 'optimization',
                'optimizer': 'GULPOptimizer'}

    def run(self, fmax=None, steps=None, **gulp_kwargs):
        if fmax is not None:
            gulp_kwargs['gmax'] = fmax
        if steps is not None:
            gulp_kwargs['maxcyc'] = steps

        self.calc.set(**gulp_kwargs)
        self.atoms.calc = self.calc
        self.atoms.get_potential_energy()
        self.atoms.positions[:] = self.calc.get_atoms().positions

It's a special ASE optimizer which uses a GULP calculator in
optimization mode as a backend.

Best regards
Ask

>
>
> The Turbomole calculator expects that the calculate() method is invoked first with task 'geometry optimization'. Otherwise, with the get_potential_energy() and get_forces() methods the convergence tests fail and this is exactly the error you get.
>
>
> Here a modified parameters dictionary with which the calculation is running:
>
>
> params = {
>     'title': 'water',
>     'basis set name': 'def2-SV(P)',
>     'total charge': 0,
>     'multiplicity': 1,
>     'use dft': True,
>     'density functional': 'b-p',
>     'use resolution of identity': True,
>     'ri memory': 1000,
>     'force convergence': 0.01,
>     'scf iterations': 100
> }
>
>
> i.e. remove
>
>
> 'task': 'geometry optimization',
> 'use redundant internals': True,
>
> 'geometry iterations': 50,
>
>
> and change
>
>
> 'maximum number of scf iterations': 100
>
>
> to
>
>
> 'scf iterations': 100
>
>
> Best regards,
>
> Ivan
>
>
>
> ________________________________
> Von: ase-users-bounces at listserv.fysik.dtu.dk <ase-users-bounces at listserv.fysik.dtu.dk> im Auftrag von Rafael Barros Barros via ase-users <ase-users at listserv.fysik.dtu.dk>
> Gesendet: Donnerstag, 23. August 2018 16:38
> An: ase-users at listserv.fysik.dtu.dk
> Betreff: [ase-users] Help-minima-hopping
>
>  Dear ASE users,
>
> I am a new user of ASE and I kindly ask for your help.
> I am trying to perform a global minimization with minima hopping method and Turbomol. However, the calculation is crashing.
> The script I am using is as below.  Any help to solve this issue would be greatly appreciated.
>
> Looking forward to hearing from you,
> Kind regards,
> Rafael
>
>
> ____________________________________________________
> from ase.io import read
> from ase.io import write
> from ase.optimize.minimahopping import MinimaHopping
> from ase.calculators.turbomole import Turbomole
> atoms = read('mol.xyz')
>
> params = {
>     'title': 'water',
>     'task': 'geometry optimization',
>     'use redundant internals': True,
>     'basis set name': 'def2-SV(P)',
>     'total charge': 0,
>     'multiplicity': 1,
>     'use dft': True,
>     'density functional': 'b-p',
>     'use resolution of identity': True,
>     'ri memory': 1000,
>     'force convergence': 0.01,
>     'geometry iterations': 50,
>     'maximum number of scf iterations': 100
> }
>
> calc = Turbomole(**params)
> atoms.set_calculator(calc)
>
> # Instantiate and run the minima hopping algorithm.
> hop = MinimaHopping(atoms,
>                     Ediff0=0.5,
>                     T0=600.)
> hop()
> ____________________________________________________
>
> The output file looks like this:
>
> __________________________________________
> TM command: "define" successfully executed
> TM command: "kdg" successfully executed
> TM command: "kdg" successfully executed
> TM command: "ridft" successfully executed
> Traceback (most recent call last):
>   File "minima.py", line 47, in <module>
>     hop()
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/optimize/minimahopping.py", line 58, in __call__
>     self._startup()
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/optimize/minimahopping.py", line 107, in _startup
>     self._optimize()
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/optimize/minimahopping.py", line 259, in _optimize
>     opt.run(fmax=self._fmax)
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/optimize/optimize.py", line 170, in run
>     self.set_force_consistent()
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/optimize/optimize.py", line 223, in set_force_consistent
>     self.atoms.get_potential_energy(force_consistent=True)
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/atoms.py", line 683, in get_potential_energy
>     self, force_consistent=force_consistent)
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/calculators/turbomole.py", line 1949, in get_potential_energy
>     self.converged = self.read_convergence()
>   File "/apps/Hebbe/software/MPI/intel/2018.1.163-GCC-6.4.0-2.28/impi/2018.1.163/ASE/3.16.2-Python-3.6.4/lib/python3.6/site-packages/ase-3.16.2-py3.6.egg/ase/calculators/turbomole.py", line 1300, in read_convergence
>     raise RuntimeError('error during geometry optimization')
> RuntimeError: error during geometry optimization
> __________________________________________________
>
> and the mol.xyz is:
> 13
>
> O          1.89690       -0.00470        0.00000
> N         -0.44610       -0.01170        0.00000
> C         -1.64560       -0.83150        0.00000
> C          0.81590       -0.58320        0.00000
> C         -0.62110        1.43100        0.00000
> H         -2.23160       -0.59960        0.89390
> H         -1.39690       -1.89620        0.00000
> H         -2.23150       -0.59970       -0.89410
> H          0.77020       -1.68450        0.00000
> H         -1.66551        1.66359        0.00000
> H         -0.16332        1.84581       -0.87365
> H         -0.16332        1.84581        0.87365
> Ca         -1.85739        0.01164       -2.61402
>
> _______________________________________________
> 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