-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
115 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Examples | ||
-------- | ||
|
||
See `examples` folder for complete examples of setting up a calculation or a work chain. | ||
|
||
|
||
Simple calculation | ||
================== | ||
|
||
.. code-block:: bash | ||
cd examples/single_calculations | ||
verdi run example_dft.py <code_label> # Submit example calculation. | ||
verdi process list -a -p1 # Check status of calculation. | ||
Work chain | ||
========== | ||
|
||
.. code-block:: bash | ||
cd examples/workchains | ||
verdi run example_base.py <code_label> # Submit test calculation. | ||
verdi process list -a -p1 # Check status of the work chain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
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 <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_dft.py>`__: | ||
|
||
.. code-block:: python | ||
params = {'FORCE_EVAL': {'METHOD': 'Quickstep', 'DFT': { ... }}} | ||
builder.parameters = Dict(dict=params) | ||
Section parameters are stored as key `_` in the dictionary: | ||
|
||
.. code-block:: python | ||
xc_section = {'XC_FUNCTIONAL': {'_': 'LDA'}} | ||
Repeated sections are stored as a list: | ||
|
||
.. code-block:: python | ||
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/data>`__. | ||
|
||
.. code-block:: python | ||
dft_section = {'BASIS_SET_FILE_NAME': 'BASIS_MOLOPT', ...} | ||
Additional data files can be added as AiiDA SinglefileData (`example <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_mm.py>`__): | ||
|
||
.. code-block:: python | ||
water_pot = SinglefileData(file=os.path.join("/tmp", "water.pot")) | ||
builder.file = {"water_pot": water_pot} | ||
The start geometry can be provided as AiiDA StructureData (`example <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_dft.py>`__): | ||
|
||
.. code-block:: python | ||
structure = StructureData(ase=ase.io.read(os.path.join(thisdir, '..', "files", 'h2o.xyz'))) | ||
Alternatively the start geometry can be contained in the CP2K input (`example <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_no_struct.py>`_): | ||
|
||
.. code-block:: python | ||
'COORD': {' ': ['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 <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_restart.py>`__): | ||
|
||
.. code-block:: python | ||
builder.parent_calc_folder = calc1['remote_folder'] | ||
By default only the output and restart file (if present) are retrieved. Additional files are retrieved upon request (`example <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_mm.py>`__): | ||
|
||
.. code-block:: python | ||
settings = Dict(dict={'additional_retrieve_list': ["runtime.callgraph"]}) | ||
builder.settings = settings | ||
The final geometry is extracted from the restart file (if present) and stored in AiiDA (`example <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_geopt.py>`__): | ||
|
||
.. code-block:: python | ||
dist = calc['output_structure'].get_ase().get_distance(0, 1) | ||
The conversion of geometries between AiiDA and CP2K has a precision of at least 1e-10 Ångström (`example <https://github.com/aiidateam/aiida-cp2k/blob/develop/examples/single_calculations/example_precision.py>`__). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,8 @@ The aiida-cp2k plugin for `AiiDA`_ | |
.. toctree:: | ||
:maxdepth: 1 | ||
|
||
features | ||
examples | ||
workflows | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
workflows | ||
Workflows | ||
--------- | ||
|
||
.. aiida-workchain:: Cp2kBaseWorkChain | ||
|