Registry / ai-ml / mattersim

mattersim

JSON →
library1.2.5pypypi✓ verified 83d ago

MatterSim is a deep learning atomistic model developed by Microsoft, designed for simulating materials across various elements, temperatures, and pressures. It provides a flexible framework for energy, force, and stress calculations, and integrates with the Atomic Simulation Environment (ASE). The library is actively maintained with frequent patch releases addressing compatibility and bug fixes, typically on major versions like 1.x.

pip install mattersim
INSTALL
IMPORT
SIG · MATTERSIM
M
mattersim
ai-mlpythonv1.2.5
Install
112.6s avg
Import
Disk
6451MB
Pass rate
1/ 10
Env Coverage1 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✕ timeout
py 3.11
✕ build_error
✕ timeout
py 3.12
✕ build_error
✕ timeout
py 3.13
✕ build_error
✓ 112.6s
py 3.9
✕ build_error
✕ build_error
6451MB installed
● package 6451MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MatterSimModel
import mattersim
from mattersim.models import MatterSimModel

This quickstart demonstrates how to load a pre-trained MatterSim model, initialize a calculator, attach it to an ASE Atoms object, and perform a basic energy minimization. It relies on `torch.hub.load` for convenient model retrieval.

import torch from ase import Atoms from ase.optimize import LBFGS from mattersim.models import MatterSimModel from mattersim.calc import MatterSimCalculator # 1. Load a pre-trained MatterSim model # Using torch.hub.load handles model downloading automatically model = torch.hub.load("microsoft/mattersim", "mattersim_model_v1_0") # 2. Initialize MatterSimCalculator # Use 'cuda' if a GPU is available, otherwise 'cpu' calculator = MatterSimCalculator(model=model, device="cpu") # 3. Create an ASE Atoms object and set the calculator atoms = Atoms("H2O", positions=[[0, 0, 0], [0, 1, 0], [0.5, -0.5, 0]], cell=[10,10,10], pbc=False) atoms.set_calculator(calculator) # 4. Perform an energy minimization using an ASE optimizer print(f"Initial energy: {atoms.get_potential_energy():.4f} eV") optimizer = LBFGS(atoms) optimizer.run(fmax=0.01) # Relax until forces are below 0.01 eV/Å print(f"Final energy: {atoms.get_potential_energy():.4f} eV") print(f"Relaxed positions:\n{atoms.get_positions()}")
Debug
Known issues
breakingUpgrading Atomic Simulation Environment (ASE) to version 3.27 or newer may cause import errors related to `Filter` or API changes in optimizers when using older MatterSim versions.
fix
Upgrade MatterSim to version 1.2.1 or newer to ensure compatibility with ASE 3.27+.
affects: <1.2.1
gotchaOlder MatterSim versions (prior to 1.2.1) had compatibility issues with `setuptools` version 82 or higher, leading to import failures.
fix
Ensure MatterSim is updated to version 1.2.1 or newer. If you must use an older MatterSim version, you might need to downgrade `setuptools`.
affects: <1.2.1
gotchaMatterSim versions prior to 1.2.2 had an incorrect import path for stress calculation utilities, which could lead to `ImportError` when attempting to compute stress.
fix
Upgrade MatterSim to version 1.2.2 or newer to resolve the `stress` calculation import issue.
affects: <1.2.2
deprecatedOlder MatterSim versions (prior to 1.1.2) had strict `torch` version pinning (`torch<2.5.0`), which could conflict with other libraries or newer hardware/software setups.
fix
Upgrade MatterSim to version 1.1.2 or newer to benefit from unpinned `torch` dependency, allowing greater flexibility in your environment. If staying on an older version, ensure your `torch` version matches the strict requirement.
affects: <1.1.2
Upgrade
Version history
1.2.5latest on PyPI · released May 28, 2026
Audit
Dependencies
aserequiredCore integration for atomistic simulations and optimization.
torchrequiredUnderlying deep learning framework for model execution.
numpyrequiredFundamental package for numerical computing.
scipyrequiredScientific computing library, often used for optimizers and utilities.
Agent activity
9 hits · last 30 days
node
8
Amazon
1
Resources
mattersim — pip install mattersim · libregistry