Skip to content

Add in zbl potential#351

Merged
chrisiacovella merged 13 commits intochoderalab:mainfrom
chrisiacovella:dev-zbl_potential
Apr 9, 2025
Merged

Add in zbl potential#351
chrisiacovella merged 13 commits intochoderalab:mainfrom
chrisiacovella:dev-zbl_potential

Conversation

@chrisiacovella
Copy link
Copy Markdown
Member

@chrisiacovella chrisiacovella commented Apr 4, 2025

Pull Request Summary

This adds the ZBL potential has a post processing operation. This is implemented similar to the electrostatics, in that it will appear in the output of the potential as a separate key "zbl_energy"; summing this with the per_system_energy will therefore prevent significant overlap of particles during a simulation.

Note this also fixes bugs in the Coulombic potential and adds tests for it.

Key changes

Notable points that this PR has either accomplished or will accomplish.

  • Add ZBL potential
  • Fix Coulombic potential
  • Add tests for both
  • update the docs to provide clearer examples of how to implement these post processing options.

Note, to better implement the Coulombic interactions, I need to reimplement the multiple cutoff neighbor lists; that will be better in a separate PR to keep this focused.

Associated Issue(s)

Pull Request Checklist

  • Issue(s) raised/addressed and linked
  • Includes appropriate unit test(s)
  • Appropriate docstring(s) added/updated
  • Appropriate .rst doc file(s) added/updated
  • PR is ready for review

…ystem_indices directly which does not work since we operate on the pre-determined set of interacting pairs (and their distances), not the atoms directly. Also, preliminary implementation of zbl as a postprocessing option.
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 4, 2025

Codecov Report

Attention: Patch coverage is 92.68293% with 3 lines in your changes missing coverage. Please review.

Project coverage is 81.63%. Comparing base (660b3fb) to head (090c9f9).

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@chrisiacovella chrisiacovella requested a review from Copilot April 4, 2025 05:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

modelforge/potential/processing.py:711

  • Creating radius_i (and similarly radius_j) via torch.tensor from a list comprehension might cause a device mismatch when the input data is on a GPU. Consider constructing these tensors using methods that preserve the device and datatype from the input data.
        radius_i = torch.tensor([

Comment thread modelforge/potential/processing.py Outdated
chrisiacovella and others added 3 commits April 4, 2025 23:50
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…potential

# Conflicts:
#	modelforge/potential/processing.py
@chrisiacovella chrisiacovella requested a review from Copilot April 6, 2025 05:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

modelforge/potential/processing.py:713

  • Consider specifying the device for the radii tensor (e.g., device=atomic_numbers.device) to avoid potential device mismatch errors when running on GPU.
radius_i = torch.tensor([self.radii[int(n)] for n in atomic_number_i], dtype=torch.float32)

@chrisiacovella chrisiacovella requested a review from Copilot April 7, 2025 05:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

modelforge/potential/potential.py:191

  • The registration key 'zbl_potential' is used while the ZBLPotential.forward method returns its output under the key 'zbl_energy'. Consider aligning these names for consistency in the API.
if "zbl_potential" in properties_to_process:

Comment thread modelforge/potential/processing.py
Comment thread modelforge/potential/processing.py
@chrisiacovella chrisiacovella merged commit 0b0ee6d into choderalab:main Apr 9, 2025
14 checks passed
@chrisiacovella chrisiacovella deleted the dev-zbl_potential branch May 7, 2025 16:53
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.

4 participants