Skip to content

Conversation

@mkphuthi
Copy link
Contributor

@mkphuthi mkphuthi commented Nov 4, 2025

Summary

This PR introduces the AdsorptionCalc class for single molecule adsorption calculations on surfaces. It supports:

  • Generation of slabs using SlabGenerator and adsorbate placement using AdsorbateSitefinder. One can also directly supply an adslab.
  • Internally handles relaxation of adsorbate, slab and adslab with option of spcifying adsorbate energy explicitly

Key Features

  • calc: Calculation of adsorption energy given a slab, adsorbate and adslab.
  • calc_adslabs: Calculation of adsorption energies on a set of adsorption sites given a bulk structure and how to generate slabs from it and an adsorbate. Parallelized using calc_many.
  • Extensive docstrings and type hints for clarity and maintainability.
  • Supports customizable relaxation via RelaxCalc and ASE optimizers.

Todos

Some tests not related to AdsorptionCalc need to be fixed

Checklist

  • Google format doc strings added. Check with ruff.
  • Type annotations included. Check with mypy.
  • Tests added for new features/fixes.
  • If applicable, new classes/functions/modules have duecredit @due.dcite decorators to reference relevant papers by DOI (example)

@rul048 rul048 changed the title AdsorptionCalc [WIP] Add AdsorptionCalc Class for Adsorption Energy Calculation Nov 4, 2025
@rul048 rul048 self-requested a review November 4, 2025 01:27
@mkphuthi
Copy link
Contributor Author

mkphuthi commented Nov 5, 2025

@rul048 Seems tests are failing due to other parts of the code that I probably shouldn't modify. Please advise. Note that I also bumped pyright to pyright==1.1.407 due to a known error in pyright==1.1.406 in pyproject.toml.

@shyuep
Copy link
Contributor

shyuep commented Dec 8, 2025

@rul048 @mkphuthi When will this PR be done? It really shouldn't take weeks for an adsorption PR to be done. We cannot be working at this kind of efficiency.

@rul048
Copy link
Contributor

rul048 commented Dec 9, 2025

All lints and tests for AdsorptionCalc have passed. The failing of notebooks seems to be due to two reasons: 1. The PR from forks cannnot access to the GitHub Action secrets, and this will cause the API empty error. 2. The backend of M3GNet is DGL so that M3GNet models cannot be correctly loaded as the default backend in MatGL is PYG, and this will cause the bad model error.

For the first issue, I will remove the example notebook from this PR and upload it by myself. For the second issue, I will set the backend to DGL for each notebook.

@rul048 rul048 changed the title [WIP] Add AdsorptionCalc Class for Adsorption Energy Calculation Add AdsorptionCalc Class for Adsorption Energy Calculation Dec 9, 2025
@shyuep shyuep merged commit aaf15f9 into materialyzeai:main Dec 9, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants