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.2.tar.gz (27.2 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.2-cp313-cp313-musllinux_1_2_x86_64.whl (730.1 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

mattersim-1.2.2-cp313-cp313-musllinux_1_2_i686.whl (707.6 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

mattersim-1.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (707.3 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

mattersim-1.2.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (693.9 kB view details)

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

mattersim-1.2.2-cp313-cp313-macosx_11_0_arm64.whl (308.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mattersim-1.2.2-cp312-cp312-musllinux_1_2_x86_64.whl (737.4 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

mattersim-1.2.2-cp312-cp312-musllinux_1_2_i686.whl (720.1 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

mattersim-1.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (715.4 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mattersim-1.2.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (693.7 kB view details)

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

mattersim-1.2.2-cp312-cp312-macosx_11_0_arm64.whl (308.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mattersim-1.2.2-cp311-cp311-musllinux_1_2_x86_64.whl (738.2 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

mattersim-1.2.2-cp311-cp311-musllinux_1_2_i686.whl (719.4 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

mattersim-1.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (719.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mattersim-1.2.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (701.2 kB view details)

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

mattersim-1.2.2-cp311-cp311-macosx_11_0_arm64.whl (308.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mattersim-1.2.2-cp310-cp310-musllinux_1_2_x86_64.whl (708.6 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

mattersim-1.2.2-cp310-cp310-musllinux_1_2_i686.whl (695.8 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

mattersim-1.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (688.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mattersim-1.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (675.0 kB view details)

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

mattersim-1.2.2-cp310-cp310-macosx_11_0_arm64.whl (309.2 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for mattersim-1.2.2.tar.gz
Algorithm Hash digest
SHA256 b1ce486d4bc3fae38395dd4b16d21486e012aedcce2fec30994d9a19fb80e6e0
MD5 7ee6ae8c9108bb71460751eeddfb4246
BLAKE2b-256 fdd4860edc78d9f2f0b455cbd9a9a00186845c6b2f3694467ba89091870fa690

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a409681081e4622d9ffb73849dc814722c1161f33d3f117aedf9e42231a5d48f
MD5 057fdba4fb946067551db6bca82ed42e
BLAKE2b-256 8095fe9ee58b0d5884110b0013730c29e9ee4279d709f44e91fea840322e5198

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3cb1fb3c450d82c2bafae83ac7b6350578732721cd5e29858e6623483b0792ff
MD5 02ff4070db8d742b29ba2df05b0dba34
BLAKE2b-256 44f3d0a7b0636e95d24291f0a4475fdc4c5fac1894c85abae91d5e20fbcb4c14

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 907d35ce9f5c294ecc8d17b0974014ac3cb3d7d70296f8d3d84fd5ebb1b51e54
MD5 bd97e54186d5c608a3fc84703cbb73a6
BLAKE2b-256 6819862175fde9975a1daf96d163dbfa392f7425135cf0024770e88e131e522f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2c729761ba20d6adc80753488b323c024547cb1836f610fa0b08d4df58fc84f2
MD5 ae13a3e25026a51279e5870ff970687f
BLAKE2b-256 ea6791a3f07b6f4769489814197dd1904825b0e963dd85483f270b0595bdda04

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6e2272323c509a3b81a8fa616ac705e5bfc7f4cb5943a075540c52d54ca45881
MD5 faa0070229909513b1d3953c202ea413
BLAKE2b-256 8da15e61dbb22074735957f469808b06b495a0c011a3f77266031051cad44164

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9ff85e71a3f7b52217b5fa0e2fa05c7a2222d8f179743b6aacf72dfbc63a72ce
MD5 a1073bb9e5cdcc0b3f8eacbae8e762a5
BLAKE2b-256 06abb986a23e49bb89717b5b2a78282d89e6377a88fae695cb40f24141c67185

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3685de7b56a5508d08e34bd387979cb3e648ce06fb3cfa9d2f380bba07f6c7f9
MD5 cfac49ba5538eed44a5130bfbc3c542e
BLAKE2b-256 d4b9a89c617f68410d45f085399a04f477b55018e9e5083d3f209e94869313c6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a5a95464a3719e932240885614804650ec2cb7b7c99e49a98e4567493581de93
MD5 5a68ee062b8949ee2ef376342de7503c
BLAKE2b-256 4c4612ad48ddcfab9b699c46a0d7997123aed06d1ce601e96413ff77fc812636

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 3d2127bd5c75188304e4d3e60211f8cf116855262fae052b29889053692a7616
MD5 1b6c6974de55d4ed192af9c0634e3cbf
BLAKE2b-256 0cfa9d77aa1d8d693f07274fa4a0cd0894d2251d06982ecde0de93c1b95417ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0c8785ca65d3c64ce2453ab47a76fe4c3f46e04e3eda83bce4beacc8d3e26a6c
MD5 3039bbcf8764bece05a9d79e83bab4f4
BLAKE2b-256 819ed61035b91f8c222492f8a67ac7d7391b9a949461d51e1bd848d112c16129

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4e235b9c1c388982f86580f56de993ed608b4b619a3354dcbdf99f30ed84c6ee
MD5 c3629f416addce63637c21b106c89036
BLAKE2b-256 f38ecc08e4ce3d982266cef62bd3af602f390c34241880ac3944ce49aecdf524

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 02fb2a6094b7837fd3c6aec2d825f627d80b8a9dd2fefa482259addbf4954cee
MD5 575cb66d4d89c2c8b3ebd95024b4f8a8
BLAKE2b-256 c063ea2d8f75890761eb913679231d1c0ee86fc1aea5924c6f73947e7853eee7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 58f2ae408a7fc89836cfd27d04e955f8c4cd03399980ae4e1ff4ff15caeb04bc
MD5 61c8491c718e4aa4046929bbe3a81ab8
BLAKE2b-256 eb4d45a293be3f05ea38a9f7eee12c4fae8a27c7eae5884c09b55460b0254264

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 00fa11be7b389436c0891fcb4d81f8ba205f168a89599eaa538cacf4bf10325f
MD5 2d99d2831fcbff3172e7f76cfd3e9150
BLAKE2b-256 8442f2ec0e3b271b1867fab5ff5100abde034ec9d7817409c059d5e3965966cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ddded0f48371eea0f2a540fb7c76a863e3b07753cd038632052f66ce8e1d7f87
MD5 20f4c9bcd6d7247b87d83261e8344703
BLAKE2b-256 8bb7deb72444d05e9b87ee97eee01a01594fe0ca7ca93a64d99a76d1b88e0d73

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 1a1e4d47cfe0342a5d903a8045979867891243e703b5bf5c8b884d740f126e6e
MD5 a8bff31a58c0d62af074e00970075433
BLAKE2b-256 a4f52abeede1494832a4345ec50e74d82cd1d3cfefb56c1e318309480f2a2aef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 e0cab95aa72496bca4c7cb8a3f4144851a0248a63a951909e91e0163393c1cbe
MD5 d497e37c16b71d4a73ba45a31d8696f2
BLAKE2b-256 0bd8c6221f319ee191cc1dcc913ce1bf7cb7e7b1d51171467f9425850fdfe021

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 64e7d8a16e10af64f0ceafe60927d64e6109b39e70a89896a6aeaa73be0b841a
MD5 204428e37ebf3984f004b06a31f48376
BLAKE2b-256 6c04a3e8e62b43e2d203fbcf39d5dfb3926accbf2becab44b5c48dc3b3cbc0af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 e4f44ed769e1180ac60879ff4b07d38ac2fac0d1a2e9339a45ee93eb09ac1d90
MD5 70f1ee938e28032a1add8e9ea6c563fd
BLAKE2b-256 458f9d179850521a2d5eeea4ba744105b75da020dcf5cda064155ef6b1b142b4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 545a64797b9a412a28c7af9dff7de089a45eac1c1c70be9b7a26e1184a0cf778
MD5 a3c9ccefedfc8ddf80741c306328ffe2
BLAKE2b-256 84c8cce5cc8aa48842b63116d145ae90f94600f3337991228d5486bf73753d22

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