torch-sim-atomistic

raw JSON →
0.6.0 verified Mon Apr 27 auth: no python

A PyTorch toolkit for calculating material properties using machine learning interatomic potentials (MLIPs). Current version 0.6.0 supports SIMPL, MACE, CHGNet, and other models via a unified interface. Release cadence is quarterly.

pip install torch-sim-atomistic
error ModuleNotFoundError: No module named 'torch_sim'
cause Package was renamed from torch-sim to torch-sim-atomistic in v0.6.0.
fix
Install the correct package: pip install torch-sim-atomistic, and import from torch_sim_atomistic.
error ImportError: cannot import name 'MACE' from 'torch_sim_atomistic'
cause MACE model might not be installed or registered. Requires optional dependency: pip install torch-sim-atomistic[mace].
fix
Install with MACE extra: pip install 'torch-sim-atomistic[mace]' or install MACE separately: pip install mace-torch.
error ValueError: Unknown model 'CHGNet'. Available models: ['MACE', 'SIMPL']
cause CHGNet and M3GNet were deprecated in v0.6.0 and removed.
fix
Use supported models: 'MACE' or 'SIMPL'. For CHGNet, downgrade to v0.5.x.
breaking In v0.6.0, the package name changed from 'torch-sim' to 'torch-sim-atomistic'. Import paths updated accordingly.
fix Update imports: from torch_sim_atomistic import ... instead of from torch_sim import ...
deprecated Models like CHGNet and M3GNet are deprecated in v0.6.0 and will be removed in v0.7.0. Use MACE or SIMPL instead.
fix Switch to supported models: TorchSim(model='MACE') or TorchSim(model='SIMPL')
gotcha The default device is 'cuda' if available; this can cause issues on CPU-only systems without explicit device setting.
fix Always set device explicitly: TorchSim(..., device='cpu') or device='cuda'.

Compute potential energy of bulk silicon using a MACE model.

import torch
from torch_sim_atomistic import TorchSim
from ase.build import bulk

# Create a silicon crystal
atoms = bulk('Si', 'diamond', a=5.431)

# Initialize MLIP calculator
calc = TorchSim(model='MACE', device='cpu')
atoms.calc = calc

# Compute energy
energy = atoms.get_potential_energy()
print(f"Energy: {energy:.3f} eV")