Skip to main content

MatterSim: A Deep Learning Atomistic Model Across Elements, Temperatures and Pressures.

Project description

MatterSim logo

arXiv Requires Python 3.10+ 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.10

Install from PyPI

[!TIP] While not mandatory, we recommend creating a clean conda environment before installing MatterSim to avoid potential package conflicts. You can create and activate a conda environment with the following commands:

# create the environment
conda create -n mattersim python=3.10

# activate the environment
conda activate mattersim

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

[!WARNING] We strongly recommend that users install MatterSim using mamba or micromamba, because conda can be significantly slower when resolving the dependencies in environment.yaml.

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

[!TIP] Note for macOS Users: If you are using macOS with Apple Silicon, please be aware of potential numerical instability with the MPS backend. We recommend using the CPU device for MatterSim on Mac to avoid these issues.

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

[!TIP] MatterSim provides a finetune script to finetune the pre-trained MatterSim model on a custom dataset. Please refer to the MatterSim documentation for more details.

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}
}

[!IMPORTANT] We kindly ask users to explicitly specify the exact model version and checkpoint (e.g., MatterSim-v1.0.0-1M) when reporting results in academic papers or technical reports, rather than referring to the model generically as MatterSim. Precise versioning is crucial for ensuring reproducibility. For instance, the statement "This study was conducted using MatterSim-v1.0.0-1M" serves as a good example.

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mattersim-1.2.3.tar.gz (27.3 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

mattersim-1.2.3-cp313-cp313-musllinux_1_2_x86_64.whl (738.3 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

mattersim-1.2.3-cp313-cp313-musllinux_1_2_i686.whl (715.8 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

mattersim-1.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (715.5 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

mattersim-1.2.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (702.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

mattersim-1.2.3-cp313-cp313-macosx_11_0_arm64.whl (316.1 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mattersim-1.2.3-cp312-cp312-musllinux_1_2_x86_64.whl (745.6 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

mattersim-1.2.3-cp312-cp312-musllinux_1_2_i686.whl (728.2 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

mattersim-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (723.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mattersim-1.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (701.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

mattersim-1.2.3-cp312-cp312-macosx_11_0_arm64.whl (316.9 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mattersim-1.2.3-cp311-cp311-musllinux_1_2_x86_64.whl (746.4 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

mattersim-1.2.3-cp311-cp311-musllinux_1_2_i686.whl (727.5 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

mattersim-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (727.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mattersim-1.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (709.3 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

mattersim-1.2.3-cp311-cp311-macosx_11_0_arm64.whl (317.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mattersim-1.2.3-cp310-cp310-musllinux_1_2_x86_64.whl (716.8 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

mattersim-1.2.3-cp310-cp310-musllinux_1_2_i686.whl (704.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

mattersim-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (697.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mattersim-1.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (683.2 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

mattersim-1.2.3-cp310-cp310-macosx_11_0_arm64.whl (317.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file mattersim-1.2.3.tar.gz.

File metadata

  • Download URL: mattersim-1.2.3.tar.gz
  • Upload date:
  • Size: 27.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mattersim-1.2.3.tar.gz
Algorithm Hash digest
SHA256 04bc55dd97bc1170c744ae93d30d773f3d8c07d35ad3efbeb817314ec0ecb16b
MD5 bd37d769daf58c67910a25738b282077
BLAKE2b-256 e3574719dbcf54fb28e04232940cf5db44665b02b996ff6164af95b1e503b851

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 250d71fc58dddb1ee4f1f8639c3c8ca1ed2213902be9b2287619e666e3f7c342
MD5 7213ce1ddb0187637e9b4116f6846f0a
BLAKE2b-256 aa8b8616fb4611042f86f2f7126fc88384fb9fee0b79ee7a6a9a3b053d3084e5

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 04de6cc38082f81e7f7dc6c2cf01e731de7bbe81a6bfd1d0bd490b1128fe0005
MD5 4d1d5601ccfe611e1dc566e95724967f
BLAKE2b-256 6ec7e3de2ae3b62495016df8bdac29a0192248ff6dcd5abe82d9b23bcb83a51c

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 95e327f70647c1c2cebcdbd9b8cfab4f7810eb7ad6b533fe70ab04776e08dab3
MD5 ca698437307942aaee22ab56c58b1a62
BLAKE2b-256 cb4010c63ccd774cfbf8d00391934948863387868192cd725a9ef6d658b58da8

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 88ae4b79125689c0712d981741f3d82ae272f02e17946138bc9f77c03b64033d
MD5 745a1983e6d95ea7a574ccd6813f65ed
BLAKE2b-256 def81b430f39167be85680a243527bd6c7fe2fb5079162b029284a77ee975f80

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 29959bedbfd340531c36f6613f1a1c58ee7db46df020016e5c11f06b7db2b1f5
MD5 7d6ea0aa9b12a6d67a767fc8695cd784
BLAKE2b-256 5a286e0d44d16fe05d9e52dda3f20fedfbdacc2edf74da7dd2cab8acd210f4c9

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 711fb49c0f304a9e0dd5a6e5ac6c7c4dd210b228fad7149efe19fc98ee036efc
MD5 f6f14c97a5e32e32280797745cef16dd
BLAKE2b-256 d7b73ca705482e687ac66ace102aba6d347feb2b8b5d763ddeb7dedf5a29db0d

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp312-cp312-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 95ffb6b97bef061e020f0b3d5526f8f56c5519eb9e12948c78d6b95de5ed34af
MD5 4b90d480587f8a8a0858c2751b602c1d
BLAKE2b-256 05ea9a749ad688760cd6613ac692a51b2e16ec0df923d2af3ea17cd0c0b45390

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 963ccc50db45012b62650cf84f4f75b65c5b54a6c8a9e892851e8d63e4dbe806
MD5 fd5de54d211050c4fdf7e217bce6fb44
BLAKE2b-256 58e52558733af812de0b08ac64546e09e4a22fde180379c1d95eaded4b53500f

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fef24dccb394e11c1ee7c64a87c5c26b54da16ea9cb730e0b83ca91d96460a4a
MD5 da0dbbf7b233174bf2380e1ccd5e78a0
BLAKE2b-256 8167102452d06e4855155519126f94b9c687b9d3a0fc1ac54ec047a42a8e63f5

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7b2f4eefd41a95f430c42c57c7206abaf211e40e75d328006ef20aea35429ebd
MD5 a58aaa1480e8a54fe3b3314f0ba5330c
BLAKE2b-256 e845dd736780e028c04a2272ff2a2cea49a0d731a11c4ac7e5fd5c9927327e56

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9e2a8a4db0a99ee35ed552bee5e1c73fe6f82b7eead34a0d5ee2a1844bc06056
MD5 99b0a62c1b7e61c43fb0e7bb2ea63c4e
BLAKE2b-256 b123529b34e6a49a4eb18eae0f99672fecf3570e52fc16b46656f40f708614e6

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 9695bb44affe8dc88d77db72878b4d0a7d8545448f55b6151c5ed5bde20d0ab7
MD5 3aa923540019cdcb671dd9f55310df9c
BLAKE2b-256 b38d6035a956a911da1fcab4bc2496c952c02ea66f3467e08d8268d26a86a678

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8dfa718f8b02a8d49e76a3b261caa9059c4bfcf40ef33d8bca9485fac4292034
MD5 d8a831d066dc171dd1efa0364939bb3a
BLAKE2b-256 2ffe279ef22ac684955e7c115a0e404af4e2d6cd55fcf9b10b568124d60e476d

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bda482613ce46039dee4b321ba63fa0cd7d675eedb579bcd849b7f244e71e22e
MD5 bfc6f9dad799b15a7590efa186b1022b
BLAKE2b-256 c966616396fa4fda31a513876001052a57f30d4fd1890def4eaf47498b2d93f2

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f108be8c218f88bef8e92c073d5be950522f3428e010fe5cbcec82d6a45ccc0f
MD5 9de916fb5603c54189f483f6ae2b9238
BLAKE2b-256 c810b8f11e0d887b0e3598c718ffbcfe374ce6eac3266ee32d97f3654021b38f

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8a93ab0fcc2622864471f3d57d17861d33e8f8256ced726c286ccc32435c2285
MD5 e41cb9d1240d49b3a50f41ce37ea3933
BLAKE2b-256 84409df39777e371a3bd406ef58f1b8e1edecc3ea118ddd1ff98ad0bf7c25fc2

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp310-cp310-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 9e1ec1a3eb4e3004c2ff82fa23c82ebd161a6df50f6d04a4c1fc9574a83b839e
MD5 4d6f9a2fe6991253ab5dcd1104420901
BLAKE2b-256 61f760bc9bb7ea3edf7127dcf2cb2f79adf706dc9144c1bb174ccf9fb0f83fe1

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 128f9b4789a27f970dcf69288d0c334a6685e155600b90479e878c601cbfa2a2
MD5 c1164be4650d9f62d4c2bee96d55dee8
BLAKE2b-256 fea13d86b8abfa1158b04083f7b64e93392dc915ead21fa318f3a934e6134067

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b40f22ce16785168e29fd9a31acd806837ec54882b5ba123387ff86bca40dd8b
MD5 2665d669610760393fe9d869ae661223
BLAKE2b-256 cdfd26cd9de61b106000567a160ac2d78ac79826f6f7296477c910f30aad6db8

See more details on using hashes here.

File details

Details for the file mattersim-1.2.3-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mattersim-1.2.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fe1bd7e62be7ff19ce6a05c958012bb6691a2a30166424ca9980c5c0db39bd1e
MD5 889413e53074ddda978d00aa6a4f9f89
BLAKE2b-256 514fba5109a5cfdd06bfd16050a559e7272a236aa98095333eddac7e7dfdece7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page