Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add adsorption energy to docs #42

Merged
merged 1 commit into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading