Skip to main content

The CP2K plugin for the AiiDA workflow and provenance engine.

Project description


The CP2K plugin for the AiiDA workflow and provenance engine.



If you use pip, you can install it as:

pip install aiida-cp2k


Following the philosophy to ''enable without getting in the way'', this plugin provides access to all of CP2K's capabilities through a small set of well-tested features:

params = {'FORCE_EVAL': {'METHOD': 'Quickstep', 'DFT': { ... }}}
  • Section parameters are stored as key _ in the dictionary:
xc_section = {'XC_FUNCTIONAL': {'_': 'LDA'}}
  • Repeated sections are stored as a list:
kind_section = [{'_': 'H', 'BASIS_SET': 'DZVP-MOLOPT-GTH', 'POTENTIAL': 'GTH-LDA'},
                {'_': 'O', 'BASIS_SET': 'DZVP-MOLOPT-GTH', 'POTENTIAL': 'GTH-LDA'}]
  • Most data files (basis sets, pseudo potentials, VdW, etc.) are auto-discovered from CP2K's data directory.
dft_section = {'BASIS_SET_FILE_NAME': 'BASIS_MOLOPT', ...}
  • Additional data files can be added as AiiDA SinglefileData (example):
water_pot = SinglefileData(file="/tmp/water.pot")
calc.use_file(water_pot, linkname="water_pot")
  • The start geometry can be provided as AiiDA StructureData (example):
atoms ='H2O', vacuum=2.0)
  • Alternatively the start geometry can be contained in the CP2K input (example):
coord_section = {' ': ['H    2.0   2.0   2.737166',
                       'H    2.0   2.0   2.000000']},
  • For restarting a calculation a parent folder can be attached (example):
  • By default only the output and restart file (if present) are retrieved. Additional files are retrieved upon request (example):
settings = {'additional_retrieve_list': ["*.cube"]}
  • The final geometry is extracted from the restart file (if present) and stored in AiiDA (example):
  • From the CP2K output only the #warnings and final energy are parsed (example):
print(calc.res.nwarnings,, calc.res.energy_units)
  • The calculation is considered failed if #warnings can not be found (example).

  • The conversion of geometries between AiiDA and CP2K has a precision of at least 1e-10 Ångström (example).

  • The Python code complies with the Flake8 coding conventions.


Every commit and pull request is automatically tested by TravisCI.

To run the tests locally install Docker and execute the following commands:

git clone
docker build -t aiida_cp2k_test aiida-cp2k
docker run -it --init aiida_cp2k_test

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for aiida-cp2k, version 1.0.0b3
Filename, size File type Python version Upload date Hashes
Filename, size aiida_cp2k-1.0.0b3.tar.gz (17.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page