[ase-users] Optimization with the genetic algorithm and VASP

Steen Lysgaard stly at dtu.dk
Mon Oct 3 11:09:25 CEST 2016


Hi Ivan,

the best thing would of be that the VASP calculator gets the todict() 
function implemented, maybe someone will look into that? In the meantime 
a workaround would be to use the SinglePointCalculator instead, that 
will make the algorithm work.

from ase.calculators.singlepoint import SinglePointCalculator

# After the raw_score is set by something like:

atoms.info['key_value_pairs']['raw_score'] = -atoms.get_potential_energy()

# do:

atoms.set_calculator(SinglePointCalculator(atoms, 
energy=atoms.get_potential_energy()))

Best regards,
Steen

On 2016-10-02 13:56, Kondov, Ivan (SCC) via ase-users wrote:
> Dear all,
>
> i am trying to get the GA optimization working with VASP as calculator. When i just take the sample scripts from
>
> https://wiki.fysik.dtu.dk/ase/tutorials/ga/ga_optimize.html
>
> and substitute the EMT calculator with VASP i get the following error right after the first structure is optimized:
>
> Relaxing starting candidate 2
> Traceback (most recent call last):
>    File "./ga-example.py", line 52, in <module>
>      da.add_relaxed_step(a)
>    File "/myhome/anaconda4/lib/python2.7/site-packages/ase/ga/data.py", line 116, in add_relaxed_step
>      data=a.info['data'])
>    File "/myhome/anaconda4/lib/python2.7/site-packages/ase/db/core.py", line 140, in new_method
>      return method(self, *args, **kwargs)
>    File "/myhome/anaconda4/lib/python2.7/site-packages/ase/db/core.py", line 201, in write
>      id = self._write(atoms, kvp, data)
>    File "/myhome/anaconda4/lib/python2.7/site-packages/ase/db/sqlite.py", line 190, in _write
>      row = AtomsRow(atoms)
>    File "/myhome/anaconda4/lib/python2.7/site-packages/ase/db/row.py", line 67, in __init__
>      dct = atoms2dict(dct)
>    File "/myhome/anaconda4/lib/python2.7/site-packages/ase/db/row.py", line 49, in atoms2dict
>      dct['calculator_parameters'] = atoms.calc.todict()
> AttributeError: Vasp instance has no attribute 'todict'
>
> The VASP calculations and BFGS work with no error. Obviously the Vasp calculator cannot be saved in the database together with the Atoms object because todict() method is missing. I will appreciate very much if somebody has a clue how to deal with this.
>
> Best regards,
> Ivan
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users

-- 
Steen Lysgaard
Post doc
Department of Energy Conversion and Storage
Technical University of Denmark
-------------------------------------------
Frederiksborgvej 399, P.O. Box 49
4000 Roskilde
Mobile +45 5194 4886
stly at dtu.dk
http://www.dtu.dk



More information about the ase-users mailing list