Skip to content

Quadrupole moment loss#382

Merged
chrisiacovella merged 12 commits intochoderalab:mainfrom
chrisiacovella:dev-quadrupole
Sep 17, 2025
Merged

Quadrupole moment loss#382
chrisiacovella merged 12 commits intochoderalab:mainfrom
chrisiacovella:dev-quadrupole

Conversation

@chrisiacovella
Copy link
Copy Markdown
Member

@chrisiacovella chrisiacovella commented Sep 12, 2025

Pull Request Summary

This PR will add in the quadrupole moment calculation (from the per atom charges) and have this be an option for uses in the training loss.

Questions

Right now the way this was set up initially, dipole moment will only be calculated as part of the losses. quadrupole moment is implemented the same way. That means, in inference mode, these properties are no output by the model. Right now, users can take the partial charges predicted by the model, and then compute these properties on their own. While this is slightly annoying when doing testing, these properties aren't necessarily something used directly in simulations and such, so it makes sense for them not to be returned. I'm not sure it would be worth it to modify this such that these properties are also registered during inference (from the production side of things, if we won't use a quantity, there is no sense wasting computational time computing it), and if they can just be toggled on/off (toggled on when needed for testing).

Key changes

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

  • Add in quadrupole moment code
  • add in as loss option
  • add as an option in the parameter models
  • Add in tests for quadrupole moment

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

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Sep 12, 2025

Codecov Report

❌ Patch coverage is 98.03922% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 90.91%. Comparing base (1f89c84) to head (bbfbae3).

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

@MarshallYan MarshallYan self-requested a review September 17, 2025 02:17
Comment thread modelforge/tests/test_dataset.py Outdated
Comment thread modelforge/train/losses.py
@chrisiacovella chrisiacovella merged commit d274b12 into choderalab:main Sep 17, 2025
22 of 27 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