materialsproject / atomate2

atomate2 is a library of computational materials science workflows
https://materialsproject.github.io/atomate2/
Other
167 stars 96 forks source link

Feat: Add DeepMD MLFF support #999

Open MoseyQAQ opened 1 month ago

MoseyQAQ commented 1 month ago

Summary

I have integrated atomate2 with the DeepMD MLFF, enabling efficient high-throughput calculations using this powerful tool.

Checklist

JaGeo commented 1 month ago

@MoseyQAQ Thanks for your contribution.

As you might have seen, we want to deprecate the concrete implementations of the force fields in the future and just provide a general interface. I am not sure if it makes sense to add this new implementation just now and directly deprecate it in a few months.

@utf @janosh Opinions?

MoseyQAQ commented 1 month ago

@JaGeo Hi, thanks for your comment! I opted for concrete implementations because the atomate2 workflow for calculating phonons tutorial uses concrete implementations. I aim to maintain consistency with the established practices in these resources to ensure a seamless user experience.

JaGeo commented 1 month ago

@utf Opinions?

@MoseyQAQ Yes, sure, it does. However, we decided to change this in the future. You can even see this from the code that you implemented.

utf commented 1 month ago

Thanks for this @MoseyQAQ. I agree with @JaGeo, there doesn't seem much point adding something already with a deprecation notice. I would remove the concrete implementations but leave the rest of your code. DeepMD is great to have in atomate2.

In the future, we should think about convenience functions to create entire flows with a specific forcefield. E.g., something like:


from atomate2.forcefields.flows import ElasticMaker

maker = ElasticMaker.from_forcefield("DeepMD")
MoseyQAQ commented 1 month ago

@utf Thank you!

MoseyQAQ commented 1 month ago

@utf @JaGeo , Hi! I’m currently working on removing the old implementations as suggested and addressing the issue preventing the code from passing the unit tests (which might be related to the dependency version). I’ll update as I make progress.

MoseyQAQ commented 1 month ago

@utf @JaGeo Hi! This PR is ready for review and could be merged.

MoseyQAQ commented 1 month ago

@janosh Hi, I found that the test can't pass because MACE is unable to download the foundation model from tinyurl.com. In the latest release of MACE, the original tinyurl.com link has been replaced with GitHub. The previous tinyurl.com URL returns a 403 error, which prevents the model from being downloaded properly.

janosh commented 1 month ago

thanks for letting me know. could you replace tinyurl.com with one of the checkpoints from here? maybe 2023-12-10-mace-128-L0_epoch-199.model

codecov[bot] commented 1 month ago

Codecov Report

Attention: Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.

Project coverage is 4.36%. Comparing base (ec1b598) to head (b012a93). Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
src/atomate2/forcefields/utils.py 0.00% 5 Missing :warning:
src/atomate2/forcefields/__init__.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #999 +/- ## ========================================== - Coverage 76.09% 4.36% -71.74% ========================================== Files 174 175 +1 Lines 12690 12742 +52 Branches 1892 1899 +7 ========================================== - Hits 9657 556 -9101 - Misses 2494 12152 +9658 + Partials 539 34 -505 ``` | [Files with missing lines](https://app.codecov.io/gh/materialsproject/atomate2/pull/999?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject) | Coverage Δ | | |---|---|---| | [src/atomate2/forcefields/jobs.py](https://app.codecov.io/gh/materialsproject/atomate2/pull/999?src=pr&el=tree&filepath=src%2Fatomate2%2Fforcefields%2Fjobs.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-c3JjL2F0b21hdGUyL2ZvcmNlZmllbGRzL2pvYnMucHk=) | `0.00% <ø> (-96.38%)` | :arrow_down: | | [src/atomate2/forcefields/schemas.py](https://app.codecov.io/gh/materialsproject/atomate2/pull/999?src=pr&el=tree&filepath=src%2Fatomate2%2Fforcefields%2Fschemas.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-c3JjL2F0b21hdGUyL2ZvcmNlZmllbGRzL3NjaGVtYXMucHk=) | `0.00% <ø> (-97.23%)` | :arrow_down: | | [src/atomate2/forcefields/\_\_init\_\_.py](https://app.codecov.io/gh/materialsproject/atomate2/pull/999?src=pr&el=tree&filepath=src%2Fatomate2%2Fforcefields%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-c3JjL2F0b21hdGUyL2ZvcmNlZmllbGRzL19faW5pdF9fLnB5) | `0.00% <0.00%> (-100.00%)` | :arrow_down: | | [src/atomate2/forcefields/utils.py](https://app.codecov.io/gh/materialsproject/atomate2/pull/999?src=pr&el=tree&filepath=src%2Fatomate2%2Fforcefields%2Futils.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject#diff-c3JjL2F0b21hdGUyL2ZvcmNlZmllbGRzL3V0aWxzLnB5) | `0.00% <0.00%> (-90.00%)` | :arrow_down: | ... and [153 files with indirect coverage changes](https://app.codecov.io/gh/materialsproject/atomate2/pull/999/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=materialsproject)
esoteric-ephemera commented 1 month ago

@utf : I added that kind of convenience function for the forcefield EOS flows but didn't for more complex ones - happy to do that in a separate PR

utf commented 1 month ago

Thanks @esoteric-ephemera and @MoseyQAQ. Is this ready for final review?

MoseyQAQ commented 1 month ago

@utf Yes. @esoteric-ephemera Thank you!