diff --git a/docs/source/nodes.rst b/docs/source/nodes.rst index 13c28c7..7dfac29 100644 --- a/docs/source/nodes.rst +++ b/docs/source/nodes.rst @@ -77,3 +77,9 @@ Each Node is documented in the following section. PermutationInvariance .. autofunction:: mlipx.PermutationInvariance + + RelaxAdsorptionConfigs + .. autofunction:: mlipx.RelaxAdsorptionConfigs + + BuildASEslab + .. autofunction:: mlipx.BuildASEslab diff --git a/docs/source/recipes.rst b/docs/source/recipes.rst index cf5f43c..c4b3f50 100644 --- a/docs/source/recipes.rst +++ b/docs/source/recipes.rst @@ -13,6 +13,7 @@ The following recipes are currently available within :code:`mlipx`. recipes/relax recipes/md recipes/neb + recipes/adsorption recipes/phase_diagram recipes/pourbaix_diagram recipes/vibrational_analysis diff --git a/docs/source/recipes/adsorption.rst b/docs/source/recipes/adsorption.rst new file mode 100644 index 0000000..391612f --- /dev/null +++ b/docs/source/recipes/adsorption.rst @@ -0,0 +1,39 @@ +.. _neb: + +Adsorption Energies +=================== + +This recipe calculates the adsorption energies of a molecule on a surface. +The following example creates a slab of ``Cu(111)`` and calculates the adsorption energy of ethanol ``(CCO)`` on the surface. + +.. code-block:: console + + (.venv) $ mlipx recipes adsorption --models mace_mp,sevennet,orb_v2,mattersim --slab-config '{"crystal": "fcc111", "symbol": "Cu", "size": [3,4,4]}' --smiles CCO --repro + (.venv) $ compare --glob "*RelaxAdsorptionConfigs" + + +.. jupyter-execute:: + :hide-code: + + from mlipx.doc_utils import get_plots + + plots = get_plots("*RelaxAdsorptionConfigs", "../../examples/adsorption/") + plots["adsorption_energies"].show() + +This test uses the following Nodes together with your provided model in the :term:`models.py` file: + +* :term:`RelaxAdsorptionConfigs` +* :term:`BuildASEslab` +* :term:`Smiles2Conformers` + + +.. dropdown:: Content of :code:`main.py` + + .. literalinclude:: ../../../examples/adsorption/main.py + :language: Python + + +.. dropdown:: Content of :code:`models.py` + + .. literalinclude:: ../../../examples/adsorption/models.py + :language: Python diff --git a/examples/adsorption/main.py b/examples/adsorption/main.py index f53e3fe..13cb886 100644 --- a/examples/adsorption/main.py +++ b/examples/adsorption/main.py @@ -14,9 +14,6 @@ ).frames ) - -# TODO: datapath - adsorbates = [] with project.group("initialize"): diff --git a/mlipx/nodes/adsorption.py b/mlipx/nodes/adsorption.py index 6f97caf..82381e2 100644 --- a/mlipx/nodes/adsorption.py +++ b/mlipx/nodes/adsorption.py @@ -31,7 +31,7 @@ class BuildASEslab(zntrack.Node): a : float (optional) The lattice constant. If specified, it overrides the experimental lattice constant of the element. Must be specified if setting up a crystal - structure different from the one found in nature. + structure different from the one found in nature. c : float (optional) Extra HCP lattice constant. If specified, it overrides the experimental lattice constant of the element. diff --git a/mlipx/recipes/adsorption.py.jinja2 b/mlipx/recipes/adsorption.py.jinja2 index d2f8389..7ab6ed8 100644 --- a/mlipx/recipes/adsorption.py.jinja2 +++ b/mlipx/recipes/adsorption.py.jinja2 @@ -11,8 +11,6 @@ with project.group("initialize"): slabs.append(mlipx.BuildASEslab(**{{ slab_config }}).frames) {% endif %} -# TODO: datapath - adsorbates = [] {% if smiles %} with project.group("initialize"):