[CP2K-user] Running CP2K calc with ASE

Maxime Van den Bossche maxime.cp.... at gmail.com
Tue Aug 4 05:16:11 UTC 2020


Dear Aniruddha,

Since you haven't provided a minimal example, nor the error message you're 
getting
from ASE or CP2K, I haven't looked into debugging the (bulky) example you 
sent.

But I don't think you can do the geometry optimization in this way. ASE 
uses the cp2k_shell binary,
which seems to only perform single-point calculations but not e.g. geometry 
optimizations.

The idea behind cp2k_shell is that the 'driver' (in this case ASE) is the 
one moving the atoms
around, and what CP2K does is e.g. calculating the energy and the gradients 
for a given geometry.

Here is a minimal example of a geometry optimization, and you can work your 
way up
from there:

from ase.build import molecule
from ase.calculators.cp2k import CP2K
from ase.optimize import BFGS

atoms = molecule('H2O')
atoms.center(vacuum=2.0)

calc = CP2K(command='cp2k_shell.sopt')
atoms.set_calculator(calc)

dyn = BFGS(atoms)
dyn.run(fmax=0.05)

Best regards,
Maxime
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cp2k.org/archives/cp2k-user/attachments/20200803/c547ce80/attachment.htm>


More information about the CP2K-user mailing list