Skip to content

Commit

Permalink
Prepare readme for the 1.0.0 release.
Browse files Browse the repository at this point in the history
  • Loading branch information
yakutovicha committed Mar 26, 2020
1 parent 534fda5 commit d811298
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 75 deletions.
98 changes: 23 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
[![PyPI version](https://badge.fury.io/py/aiida-cp2k.svg)](https://badge.fury.io/py/aiida-cp2k)

# AiiDA CP2K
**The CP2K plugin for the AiiDA workflow and provenance engine.**
[AiiDA](http://www.aiida.net/) plugin for [CP2K](https://www.cp2k.org/).


![logo](./aiida-cp2k_logo.png)
# Documentation
The full documenation for this package can be found on [Read the Docs](https://aiida-cp2k.readthedocs.io/en/latest/)

# Installation

Expand All @@ -15,88 +15,36 @@ 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:

- A full [CP2K input](https://manual.cp2k.org) has to be provided as a nested Python dictionary ([example](./test/test_dft.py)):
```
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](https://github.com/cp2k/cp2k/tree/master/cp2k/data).
```
dft_section = {'BASIS_SET_FILE_NAME': 'BASIS_MOLOPT', ...}
```

- Additional data files can be added as AiiDA SinglefileData ([example](test/test_mm.py)):
```
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](./test/test_dft.py)):
If you want to install the plugin in an editable mode, run:
```
atoms = ase.build.molecule('H2O', vacuum=2.0)
calc.use_structure(StructureData(ase=atoms))
git clone https://github.com/aiidateam/aiida-cp2k
cd aiida-cp2k
pip install -e . # Also installs aiida, if missing (but not postgres/rabbitmq).
```

- Alternatively the start geometry can be contained in the CP2K input ([example](./test/test_no_struct.py)):
```
coord_section = {' ': ['H 2.0 2.0 2.737166',
'H 2.0 2.0 2.000000']},
```
# Examples
See `examples` folder for complete examples of setting up a calculation or a work chain.

- For restarting a calculation a parent folder can be attached ([example](./test/test_restart.py)):
```
calc2.use_parent_folder(calc1.out.remote_folder)
## Simple calculation
```shell
cd examples/single_calculations
verdi run example_dft.py <code_label> # Submit example calculation.
verdi process list -a -p1 # Check status of calculation.
```

- By default only the output and restart file (if present) are retrieved. Additional files are retrieved upon request ([example](test/test_mm.py)):
```
settings = {'additional_retrieve_list': ["*.cube"]}
calc.use_settings(ParameterData(dict=settings))
## Work chain
```shell
cd examples/workchains
verdi run example_base.py <code_label> # Submit test calculation.
verdi process list -a -p1 # Check status of the work chain.
```

- The final geometry is extracted from the restart file (if present) and stored in AiiDA ([example](./test/test_geopt.py)):
```
print(calc.out.output_structure)
```
# License
MIT

- From the CP2K output only the #warnings and final energy are parsed ([example](./test/test_mm.py)):
```
print(calc.res.nwarnings, calc.res.energy, calc.res.energy_units)
```

- The calculation is considered failed if #warnings can not be found ([example](./test/test_failure.py)).

- The conversion of geometries between AiiDA and CP2K has a precision of at least 1e-10 Ångström ([example](./test/test_precision.py)).

- The Python code complies with the [Flake8](http://flake8.pycqa.org) coding conventions.


# Testing

Every commit and pull request is automatically tested by [TravisCI](https://travis-ci.org/cp2k/aiida-cp2k/).

To run the tests locally install [Docker](https://docs.docker.com/engine/installation/) 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
```
# Contact
yakutovicha@gmail.com


## Acknowledgements
Expand Down
Binary file removed aiida-cp2k_logo.png
Binary file not shown.

0 comments on commit d811298

Please sign in to comment.