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

Kondov, Ivan (SCC) ivan.kondov at kit.edu
Tue Oct 4 09:14:26 CEST 2016


Hi Steen,

thanks a lot! This is a good workaround. Now it is working. Regarding
implementing a todict() method in Vasp calculator I will add this to my todo
list first and will ask for a merge when ready.

Best regards,
Ivan

> -----Original Message-----
> From: ase-users-bounces at listserv.fysik.dtu.dk [mailto:ase-users-
> bounces at listserv.fysik.dtu.dk] On Behalf Of Steen Lysgaard via ase-users
> Sent: Monday, October 03, 2016 11:09 AM
> To: ase-users at listserv.fysik.dtu.dk
> Subject: Re: [ase-users] Optimization with the genetic algorithm and VASP
> 
> 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
> 
> _______________________________________________
> 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: smime.p7s
Type: application/pkcs7-signature
Size: 6317 bytes
Desc: not available
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20161004/21c5c433/attachment.p7s>


More information about the ase-users mailing list