Skip to content

Commit

Permalink
add the adsorption energy to the docs
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonFZ committed Dec 12, 2024
1 parent 142701f commit ae78d4e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 6 deletions.
6 changes: 6 additions & 0 deletions docs/source/nodes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ Each Node is documented in the following section.

PermutationInvariance
.. autofunction:: mlipx.PermutationInvariance

RelaxAdsorptionConfigs
.. autofunction:: mlipx.RelaxAdsorptionConfigs

BuildASEslab
.. autofunction:: mlipx.BuildASEslab
1 change: 1 addition & 0 deletions docs/source/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 39 additions & 0 deletions docs/source/recipes/adsorption.rst
Original file line number Diff line number Diff line change
@@ -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
3 changes: 0 additions & 3 deletions examples/adsorption/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
).frames
)


# TODO: datapath

adsorbates = []

with project.group("initialize"):
Expand Down
2 changes: 1 addition & 1 deletion mlipx/nodes/adsorption.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 0 additions & 2 deletions mlipx/recipes/adsorption.py.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -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"):
Expand Down

0 comments on commit ae78d4e

Please sign in to comment.