Cell optimization using ASE

724 views
Skip to first unread message

Lucas Bandeira

unread,
May 12, 2021, 1:13:26 PM5/12/21
to cp...@googlegroups.com
Dear cp2k group, 

I am trying to perform some cell optimization using cp2k interfaced with ASE. The command lines I am using are the following:

sys=bulk('Cu', 'fcc', a=3.7, cubic=True)
sys.calc = calc
opt=BFGS(sys, trajectory='CuBulk.traj', logfile='CuBulk.log', restart='Cubulk.rst')
opt.run(fmax=0.01)

This is based on this ASE tutorial: https://wiki.fysik.dtu.dk/ase/gettingstarted/surface.html.

However, as I have seen, the maximum force on each atom oscillates about the same range 0.6-0.8 eV/A (for a Cu unit cell), and it also depends on the metal I am working with. To be honest, I chose this value for fmax because I thought it was the convergence criteria for the maximum force between two consecutive optimization steps. My question is: How do I choose the maximum value for the force on each atom, or any other convergence criteria? Is this the right way to perform cell optimization using ASE?

Yours faithfully,

Lucas Bandeira

Maxime Van den Bossche

unread,
May 17, 2021, 4:13:56 AM5/17/21
to cp2k
Dear Lucas,

(I'm not a CP2K developer, but I have worked quite a bit with ASE.)

Your code snippet looks fine, except that this will simply relax the ionic positions.
If you also want to optimize the cell vectors, you will need to look at e.g. the StrainFilter
or UnitCellFilter in ase.constraints. An "fmax" value of 0.01 eV/Angstrom should
generally give well-converged minima. Fmax=0.05 eV/Angstrom is also sufficiently
accurate in many cases (but please check it yourself to be sure).

But the fact that the forces do not readily decrease in this calculation suggests
that something may be wrong with your CP2K input. But without a minimal working
example (including all input and output files you get when running the example),
it is impossible to diagnose that further.

Best,
Maxime
Op woensdag 12 mei 2021 om 19:13:26 UTC+2 schreef bandeir...@gmail.com:
Reply all
Reply to author
Forward
0 new messages