Skip to main content

MatterSim logo

arXiv Requires Python 3.12+ PyPI Downloads

MatterSim is a deep learning atomistic model across elements, temperatures and pressures.

Documentation

This README provides a quick start guide. For more comprehensive information, please refer to the MatterSim documentation.

Installation

Prerequisite

  • Python >= 3.12

Install from PyPI

To install MatterSim, use the following command. Please note that downloading the dependencies may take some time:

pip install mattersim

In case you want to install the package with the latest version, you can run the following command:

pip install git+https://github.com/microsoft/mattersim.git

Install from source code

  1. Download the source code of MatterSim and change to the directory
git clone git@github.com:microsoft/mattersim.git
cd mattersim
  1. Install MatterSim

To install the package, run the following command under the root of the folder:

mamba env create -f environment.yaml
mamba activate mattersim
uv pip install -e .

Pre-trained Models

We currently offer two pre-trained MatterSim-v1 models based on the M3GNet architecture in the pretrained_models folder:

  1. MatterSim-v1.0.0-1M: A mini version of the model that is faster to run.
  2. MatterSim-v1.0.0-5M: A larger version of the model that is more accurate.

These models have been trained using the data generated through the workflows introduced in the MatterSim manuscript, which provides an in-depth explanation of the methodologies underlying the MatterSim model.

More advanced and fully-supported pretrained versions of MatterSim, and additional materials capabilities are available in Azure Quantum Elements.

Usage

A minimal test

import torch
from loguru import logger
from ase.build import bulk
from ase.units import GPa
from mattersim.forcefield import MatterSimCalculator

device = "cuda" if torch.cuda.is_available() else "cpu"
logger.info(f"Running MatterSim on {device}")

si = bulk("Si", "diamond", a=5.43)
si.calc = MatterSimCalculator(device=device)
logger.info(f"Energy (eV)                 = {si.get_potential_energy()}")
logger.info(f"Energy per atom (eV/atom)   = {si.get_potential_energy()/len(si)}")
logger.info(f"Forces of first atom (eV/A) = {si.get_forces()[0]}")
logger.info(f"Stress[0][0] (eV/A^3)       = {si.get_stress(voigt=False)[0][0]}")
logger.info(f"Stress[0][0] (GPa)          = {si.get_stress(voigt=False)[0][0] / GPa}")

In this release, we provide two checkpoints: MatterSim-v1.0.0-1M.pth and MatterSim-v1.0.0-5M.pth. By default, the 1M version is loaded. To switch to the 5M version, manually set the load_path of MatterSimCalculator as shown below:

MatterSimCalculator(load_path="MatterSim-v1.0.0-5M.pth", device=device)

Finetune

A minimal finetune example

torchrun --nproc_per_node=1 src/mattersim/training/finetune_mattersim.py --load_model_path mattersim-v1.0.0-1m --train_data_path tests/data/high_level_water.xyz

Reference

We kindly request that users of MatterSim version 1.0.0 cite our preprint available on arXiv:

@article{yang2024mattersim,
      title={MatterSim: A Deep Learning Atomistic Model Across Elements, Temperatures and Pressures},
      author={Han Yang and Chenxi Hu and Yichi Zhou and Xixian Liu and Yu Shi and Jielan Li and Guanzhi Li and Zekun Chen and Shuizhou Chen and Claudio Zeni and Matthew Horton and Robert Pinsler and Andrew Fowler and Daniel Zügner and Tian Xie and Jake Smith and Lixin Sun and Qian Wang and Lingyu Kong and Chang Liu and Hongxia Hao and Ziheng Lu},
      year={2024},
      eprint={2405.04967},
      archivePrefix={arXiv},
      primaryClass={cond-mat.mtrl-sci},
      url={https://arxiv.org/abs/2405.04967},
      journal={arXiv preprint arXiv:2405.04967}
}

Limitations

MatterSim-v1 is designed specifically for atomistic simulations of bulk materials. Applications or interpretations beyond this scope should be approached with caution. For instance, when using the model for simulations involving surfaces, interfaces, or properties influenced by long-range interactions, the results may be qualitatively accurate but are not suitable for quantitative analysis. In such cases, we recommend fine-tuning the model to better align with the specific application.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Responsible AI Transparency Documentation

The responsible AI transparency documentation can be found here.

Researcher and Developers

MatterSim is actively under development, and we welcome community engagement. If you have research interests related to this model, ideas you’d like to contribute, or issues to report, we encourage you to reach out to us at ai4s-materials@microsoft.com.

Metadata

Release files for mattersim 1.2.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mattersim 1.2.5
File Size Uploaded
mattersim-1.2.5.tar.gz 27.3 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for mattersim 1.2.5
File
mattersim-1.2.5-cp313-cp313-musllinux_1_2_x86_64.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-64 Details
mattersim-1.2.5-cp313-cp313-musllinux_1_2_i686.whl CPython 3.13 CPython 3.13 Linux musl 1.2+ x86-32 Details
mattersim-1.2.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
mattersim-1.2.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-32, Linux glibc 2.5+ x86-32 Details
mattersim-1.2.5-cp313-cp313-macosx_11_0_arm64.whl CPython 3.13 CPython 3.13 macOS 11.0+ ARM64 Details
mattersim-1.2.5-cp312-cp312-musllinux_1_2_x86_64.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-64 Details
mattersim-1.2.5-cp312-cp312-musllinux_1_2_i686.whl CPython 3.12 CPython 3.12 Linux musl 1.2+ x86-32 Details
mattersim-1.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
mattersim-1.2.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.12 CPython 3.12 Linux glibc 2.5+ x86-32, Linux glibc 2.17+ x86-32 Details
mattersim-1.2.5-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 34.0 MB

Release files / mattersim-1.2.5.tar.gz

Download URL mattersim-1.2.5.tar.gz
Size 27.3 MB
Tags Source
SHA-256 checksum
How to use checksums
2691b8376690b80947f93dc3f683985b2ec44aa9a0b16fda376678ef15aed8b9
BLAKE2b-256 checksum
How to use checksums
6b8ff69685c2f7574e7942bc02cb592be0fc46d03d55339467aff2214af19365
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp313-cp313-musllinux_1_2_x86_64.whl

Download URL mattersim-1.2.5-cp313-cp313-musllinux_1_2_x86_64.whl
Size 767.2 kB
Tags CPython 3.13 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
27ac6987585f316418287f865291c44f723a461ef841f13dea1c101f8422279b
BLAKE2b-256 checksum
How to use checksums
f4db4758ba1196aaa1311b6b629681bcd8e9593d77ee34812c30ced4c35ebf41
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp313-cp313-musllinux_1_2_i686.whl

Download URL mattersim-1.2.5-cp313-cp313-musllinux_1_2_i686.whl
Size 746.7 kB
Tags CPython 3.13 Linux musl 1.2+ x86-32
SHA-256 checksum
How to use checksums
ffd54ebd11fffe749e32beb6d2c6adcf7a766e1d2220d9142aa337cb50650ba1
BLAKE2b-256 checksum
How to use checksums
2df60c207e3e2bf969cdc9db6a18fb0793aafe43e341679ab7a6d8e2bac46df4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mattersim-1.2.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 747.6 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
e0502e733a827d9489ddbffa3c06cf94442d987dffb7bfbe843c0dd27e94dc92
BLAKE2b-256 checksum
How to use checksums
cca513da5b681c2a4becf43780486b58d8f8bea7a7e41f1310cb9047eda8389e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL mattersim-1.2.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 735.3 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
123feb7705758cd2fd23057d543ec93c478fec802a6c52892c74dbd829c0c89e
BLAKE2b-256 checksum
How to use checksums
fee9c2b8b6ee850ac11b716d47dd47bc972ee7f68c76d21bc8604f5fcda0771b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp313-cp313-macosx_11_0_arm64.whl

Download URL mattersim-1.2.5-cp313-cp313-macosx_11_0_arm64.whl
Size 349.3 kB
Tags CPython 3.13 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7019503a4ca5640382aaff9b626ec6c321c6bc875cbee1036e5cd61a358fab91
BLAKE2b-256 checksum
How to use checksums
6a6837e4b1c260a3580c8a8ddb2ba4cf348a3048d394cce21473fdda9ace63dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp312-cp312-musllinux_1_2_x86_64.whl

Download URL mattersim-1.2.5-cp312-cp312-musllinux_1_2_x86_64.whl
Size 773.0 kB
Tags CPython 3.12 Linux musl 1.2+ x86-64
SHA-256 checksum
How to use checksums
f472e340c07ee4e1ee76687653622b854c542b4fe41fc253adf619936c7ea279
BLAKE2b-256 checksum
How to use checksums
3a28c464d60a641c8a93cbc96dc2b9b83f59a33eeac589c929b7ec5e9b2fabf5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp312-cp312-musllinux_1_2_i686.whl

Download URL mattersim-1.2.5-cp312-cp312-musllinux_1_2_i686.whl
Size 747.7 kB
Tags CPython 3.12 Linux musl 1.2+ x86-32
SHA-256 checksum
How to use checksums
d4cddb8d9221e9070bd11105b2a2a0ace9e21c3b0c1bc6df6bca7601c0966b51
BLAKE2b-256 checksum
How to use checksums
417de6e1612c8027e0d5899e753549e4bbe4bddd265584020a79914767539061
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL mattersim-1.2.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 755.9 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1b5e46ba56efa5c1e93372ad32321300fa5e1f07dd9188a11b727bd578cf8d7f
BLAKE2b-256 checksum
How to use checksums
63005ebc37661b3333793b2861827439cc8e2a3129dd0c9694d54028328650ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl

Download URL mattersim-1.2.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Size 734.4 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-32 Linux glibc 2.5+ x86-32
SHA-256 checksum
How to use checksums
f2d7b115033cf34ed371c5a41c1904f3f1e3c8b21bc99d409bd10b64f451888e
BLAKE2b-256 checksum
How to use checksums
f09eda46e4269ae267993f411ddc4a0efe8e042a479b675059d144337af2943b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12

Release files / mattersim-1.2.5-cp312-cp312-macosx_11_0_arm64.whl

Download URL mattersim-1.2.5-cp312-cp312-macosx_11_0_arm64.whl
Size 350.0 kB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
eda9a6c594111541298872f25fd577c3bb4de764290b479af13921039cc4b64e
BLAKE2b-256 checksum
How to use checksums
7d0ac7754e4bd86b7778533f2375ff58ac4187b75fc5e137bbd535815b17e429
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.12
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page