Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Tags: microsoft/mattersim

Tags

v1.2.5

Toggle v1.2.5's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: non-periodic systems in TorchSim graph construction (#161)

* fix: normalize non-periodic systems in TorchSim graph construction

The TorchSim code path (build_graph_from_simstate) was passing raw
pbc=False and a zero cell for non-periodic molecules, while the ASE
calculator path (_normalize_atoms) creates a large fake periodic cell
and wraps positions into it. This caused the M3GNet model to receive
different graph inputs for the same molecule, producing inconsistent
energies and forces.

Add _normalize_nonperiodic_systems() that replicates the same fake-cell
normalization for the TorchSim path, ensuring both code paths feed
identical inputs to the model.

Fixes #160

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: add regression tests for non-periodic TorchSim normalization

Add unit tests for _normalize_nonperiodic_systems() verifying:
- Periodic systems pass through unchanged
- Non-periodic molecules get a large fake periodic cell
- Cell and positions match the ASE _normalize_atoms code path
- Original SimState tensors are not mutated

Add end-to-end test (test_wrapper_molecule_consistency) comparing
TorchSimWrapper vs MatterSimCalculator on a water molecule.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: request full FC format for phono3py v4 compatibility

Phono3py v4 defaults to compact force constants format, changing
fc2 shape from (n_satom, n_satom, 3, 3) to (n_patom, n_satom, 3, 3).
Explicitly pass is_compact_fc=False to produce_fc2() and produce_fc3()
to maintain the full format expected by downstream code.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

v1.2.4

Toggle v1.2.4's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
feat: add double precision (float64) inference support (#156)

* feat: add double precision (float64) inference support

Add dtype='float64' option to MatterSimCalculator for double-precision
inference. This improves numerical stability for sensitive properties
like thermal conductivity.

Changes:
- MatterSimCalculator: new dtype parameter ('float32' or 'float64'),
  converts model weights via model.double() and creates inputs in the
  matching dtype
- m3gnet.py: replace .float() with .to(pos.dtype) for pbc_offsets so
  it respects the model's precision
- calculate(): upcast legacy-path float tensors to match model dtype

On equilibrium Si diamond, float64 reduces force noise from ~1e-6 to
~1e-15 eV/Å compared to float32.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: use float64 precision in BTE thermal conductivity tests

Switch BTE tests to dtype='float64' for more stable force constants.
Update reference kappa values to float64 means verified across 3 runs
(rel_std < 0.03%). Tighten tolerance from 8% to 2%.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: reject float64 on MPS devices and skip float64 BTE tests on MPS

MPS does not support float64 tensors. This commit:
- Validates dtype+device combo early in MatterSimCalculator.__init__,
  raising ValueError before loading the model
- Falls back to float32 in the basic BTE test on MPS
- Skips the strict BTE test on MPS (reference values require float64)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test: allow strict BTE test to run on MPS with relaxed tolerances

Use float32 with 10% kappa tolerance and 0.5% FC tolerance on MPS,
while keeping float64 with tight tolerances (2% / 0.1%) on CUDA.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: alias torch._inductor.config import to avoid shadowing torch

The local 'import torch._inductor.config' statement caused Python to
treat 'torch' as a local variable in __init__, making earlier references
to torch.float32/torch.float64 fail with UnboundLocalError.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix: preserve float64 dtype after calculator pickle roundtrip

Agent-Logs-Url: https://github.com/microsoft/mattersim/sessions/b2ac740c-f04e-4e6b-a5c0-b3389a4caaf3

Co-authored-by: yanghan234 <32856137+yanghan234@users.noreply.github.com>

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

v1.2.3

Toggle v1.2.3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: make MatterSimCalculator picklable and remove DeepCalculator (#83)…

… (#153)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

v1.2.2

Toggle v1.2.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Merge pull request #143 from microsoft/fix-stress-import

fix stress import import

v1.2.1

Toggle v1.2.1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
fix: fixing import failure with setuptools>=82 (#141)

* fix the issue with pkg_resources to get version

* add test case for the fix

v1.2.0

Toggle v1.2.0's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
ci: remove py39 for cibuildwheel (#123)

* update the cibuildwheel configuration

* remove building for py3.9

v1.1.2

Toggle v1.1.2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update python-publish.yaml (#94)

v1.1.2rc3

Toggle v1.1.2rc3's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
Update python-publish.yaml (#94)

v1.1.2rc2

Toggle v1.1.2rc2's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
ci: Update python-publish.yaml (#93)

* Update python-publish.yaml

bump-to-py313

* Update build.yaml

Update the versions of python to test on and include python 3.13

* Update build.yaml

* Update environment.yaml

v1.1.2rc1

Toggle v1.1.2rc1's commit message

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
unpin torch<2.5.0 (#89)

Morty Proxy This is a proxified and sanitized view of the page, visit original site.