[ase-users] Constrained optimization with the VASP interface

Prateek Mehta pmehta1 at nd.edu
Tue Aug 25 10:17:00 CEST 2015


On Mon, Aug 24, 2015 at 6:12 AM, Torstein Fjermestad <tfjermestad at gmail.com>
wrote:

> Dear ASE users,
>
> I am trying to do a constrained geometry optimization using the VASP
> interface. I specify the constraints in the following way:
>
> c1 = FixBondLengths([[101, 226], [222, 101]])
> fracCoordInterm1=interm1.get_scaled_positions()
> freezeBelow = 0.26
> c2 = FixAtoms(mask=[coordAtom[2] < freezeBelow for coordAtom in
> fracCoordInterm1])
> interm1.set_constraint([c1, c2])
>
>
> Then I run the optimization as follows:
>
> dyn=BFGSLineSearch(interm1, logfile='defect.qn', trajectory='defect.traj')
> dyn.run(fmax = 0.02, steps=200)
>
>
> After a few seconds, the program stops with the following error messages:
>
> Traceback (most recent call last):
>   File "./ase-script.py", line 34, in <module>
>     dyn.run(fmax = 0.02, steps=200)
>   File "/scratch/software/ase/ase/optimize/optimize.py", line 148, in run
>     f = self.atoms.get_forces()
>   File "/scratch/software/ase/ase/atoms.py", line 693, in get_forces
>     forces = self._calc.get_forces(self)
>   File "/scratch/software/ase/ase/calculators/vasp.py", line 777, in
> get_forces
>     self.update(atoms)
>   File "/scratch/software/ase/ase/calculators/vasp.py", line 428, in update
>     self.calculate(atoms)
>   File "/scratch/software/ase/ase/calculators/vasp.py", line 570, in
> calculate
>     self.initialize(atoms)
>   File "/scratch/software/ase/ase/calculators/vasp.py", line 491, in
> initialize
>     self.atoms_sorted = atoms[self.sort]
>   File "/scratch/software/ase/ase/atoms.py", line 883, in __getitem__
>     con.index_shuffle(i)
>   File "/scratch/software/ase/ase/constraints.py", line 46, in
> index_shuffle
>     raise NotImplementedError
> NotImplementedError
>
>
> Any advise on how to solve this problem will be appreciated.
>
> Thanks in advance for your help.
>
> Regards,
> Torstein Fjermestad
>
> I think only FixAtoms and FixScaled constraints are implemented to work
with Vasp. Also, to run dynamics you probably need to set the appropriate
vasp keywords in the calculator and not use BFGSLineSearch.

Thanks,

Prateek

>
> _______________________________________________
> ase-users mailing list
> ase-users at listserv.fysik.dtu.dk
> https://listserv.fysik.dtu.dk/mailman/listinfo/ase-users
>



-- 
Prateek Mehta
Chemical Engineering PhD Student
University of Notre Dame
(412) 417-0152
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.fysik.dtu.dk/pipermail/ase-users/attachments/20150825/19e47ac9/attachment.html>


More information about the ase-users mailing list