Skip to main content

The CP2K plugin for the AiiDA workflow and provenance engine.

Project description

AiiDA CP2K

Build Status codecov

The CP2K plugin for the AiiDA workflow and provenance engine.

logo

Installation

If you use pip, you can install it as:

pip install aiida-cp2k

Features

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': { ... }}}
calc.use_parameters(ParameterData(dict=params))
  • 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 = ase.build.molecule('H2O', vacuum=2.0)
calc.use_structure(StructureData(ase=atoms))
  • 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):
calc2.use_parent_folder(calc1.out.remote_folder)
  • By default only the output and restart file (if present) are retrieved. Additional files are retrieved upon request (example):
settings = {'additional_retrieve_list': ["*.cube"]}
calc.use_settings(ParameterData(dict=settings))
  • The final geometry is extracted from the restart file (if present) and stored in AiiDA (example):
print(calc.out.output_structure)
  • From the CP2K output only the #warnings and final energy are parsed (example):
print(calc.res.nwarnings, calc.res.energy, 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.

Testing

Every commit and pull request is automatically tested by TravisCI.

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

git clone https://github.com/cp2k/aiida-cp2k
docker build -t aiida_cp2k_test aiida-cp2k
docker run -it --init aiida_cp2k_test pytest -v

Project details


Download files

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

Source Distribution

aiida_cp2k_ng-1.0.0b2.tar.gz (18.9 kB view details)

Uploaded Source

Built Distribution

aiida_cp2k_ng-1.0.0b2-py2-none-any.whl (29.0 kB view details)

Uploaded Python 2

File details

Details for the file aiida_cp2k_ng-1.0.0b2.tar.gz.

File metadata

  • Download URL: aiida_cp2k_ng-1.0.0b2.tar.gz
  • Upload date:
  • Size: 18.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for aiida_cp2k_ng-1.0.0b2.tar.gz
Algorithm Hash digest
SHA256 791e839d5497c1de841046602f30c4b32c9b883ce46bcf47aa6cbdddafa2a073
MD5 c3de999419a0274a9373f3c9e96938fc
BLAKE2b-256 be2a25d9f272e93f4d0600f4d8e183f8276862034fe4409e4cbcdb49629dc216

See more details on using hashes here.

File details

Details for the file aiida_cp2k_ng-1.0.0b2-py2-none-any.whl.

File metadata

  • Download URL: aiida_cp2k_ng-1.0.0b2-py2-none-any.whl
  • Upload date:
  • Size: 29.0 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.16

File hashes

Hashes for aiida_cp2k_ng-1.0.0b2-py2-none-any.whl
Algorithm Hash digest
SHA256 eef81c87bb9d2d04c6c80dc307908d4f060e8cad1a3f5230324eabf76744e911
MD5 73c452f5881c50a3fe5e2f8fba1e9cdc
BLAKE2b-256 49933ef4f355c7eabffcd865ee60d39c65ee01722913e9e39d07bb270bf5d483

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page