Skip to content

Add MACE-POLAR-1 pretrained models - #164

Merged
epretti merged 5 commits into
openmm:mainfrom
epretti:mace-polar
Aug 24, 2026
Merged

Add MACE-POLAR-1 pretrained models#164
epretti merged 5 commits into
openmm:mainfrom
epretti:mace-polar

Conversation

@epretti

@epretti epretti commented Aug 13, 2026

Copy link
Copy Markdown
Member

Adds MACE-POLAR-1 pretrained MACE models and fixes #143.

Like MACELES, requires an extra dependency to be installed from a repository (git+https://github.com/WillBaldwin0/graph_electrostatics.git@v0.4.0) as documented; this is a versioned release though.

Comment thread openmmml/models/macepotential.py Outdated
if torch.abs(volume) > 0:
rcell = 2 * torch.pi * torch.linalg.inv(cellTensor.mT)
else:
rcell = torch.zeros((3, 3), dtype=dtype, device=ptr.device)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is more complicated than it needs to be. Because of the requirements we have for box vectors, the box volume is just the product of the diagonal elements and is guaranteed to be positive.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This was copied from their implementation which was copied from inside the MACE library. They probably can't make the same guarantees we can about the box vectors. I'll update it.

Comment thread test/data/mace_energies.py Outdated
Comment on lines +30 to +31
has_graph_longrange = False
if has_graph_longrange:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You could get rid of the has_graph_longrange variable and just put the calculations inside the try block.

@epretti

epretti commented Aug 14, 2026

Copy link
Copy Markdown
Member Author

I also want to ask them about whether the external_field and fermi_level are things that can/should be exposed for users to set. What they sent me showed these set to default values, which is what I did here. external_field is semi-documented in one place but fermi_level seems not to be.

@epretti
epretti merged commit 45c0895 into openmm:main Aug 24, 2026
8 checks passed
@epretti
epretti deleted the mace-polar branch August 24, 2026 21:30
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.

PolarMACE (MACE-Polar-1) support: missing keys in _computeMACE inputDict

2 participants