-
Notifications
You must be signed in to change notification settings - Fork 69
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
dEdLat contribution for stress calculations is added and Universal Potentials are updated #189
Conversation
…x and little cleanup in united tests
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #189 +/- ##
==========================================
+ Coverage 98.00% 98.59% +0.59%
==========================================
Files 28 28
Lines 1901 1928 +27
==========================================
+ Hits 1863 1901 +38
+ Misses 38 27 -11 ☔ View full report in Codecov by Sentry. |
I'm checking out the source in VS Code, and I jumped in from this merged PR. Not sure if this is the right place to ask, but I've got a question about g.edata["pbc_offshift"] = torch.matmul(g.edata["pbc_offset"], lat[0])
g.ndata["pos"] = g.ndata["frac_coords"] @ lat[0] If so, then how does the subsequent code operate, such as the function dst_pos = g.ndata["pos"][g.edges()[1]] + g.edata["pbc_offshift"]
src_pos = g.ndata["pos"][g.edges()[0]]
bond_vec = dst_pos - src_pos
bond_dist = torch.norm(bond_vec, dim=1) Jiang You |
Summary
I finally figured out that the stress contribution due to the change of lattice vectors in the Potential class is missing in the current implementation, now I have modified the implementations to add the strain (st) variable for lattices to include the gradient of potential energy with respect to lattice vectors for stress calculations. I also added unit tests for checking force and stress implementations with central finite difference methods and completed the retraining of both universal M3GNet MLIPs. The resulting pretrained universal MLIPs achieve better accuracy and stability in benchmark examples. Finally, I have checked all Jupyter Notebook examples, and everything works for the implementation.
Checklist
ruff
.mypy
.duecredit
@due.dcite
decorators to reference relevant papers by DOI (example)Tip: Install
pre-commit
hooks to auto-check types and linting before every commit: