Skip to main content

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

Project description

MatterSim logo

arXiv Requires Python 3.9+ 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.9

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.9

# activate the environment
conda activate mattersim

Although MatterSim can be installed with Python > 3.9, we recommend using Python == 3.9 for optimal compatibility.

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.1.1.tar.gz (24.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.1.1-cp312-cp312-musllinux_1_1_x86_64.whl (718.9 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ x86-64

mattersim-1.1.1-cp312-cp312-musllinux_1_1_i686.whl (687.8 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ i686

mattersim-1.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (712.8 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mattersim-1.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (692.2 kB view details)

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

mattersim-1.1.1-cp312-cp312-macosx_11_0_arm64.whl (305.0 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mattersim-1.1.1-cp311-cp311-musllinux_1_1_x86_64.whl (719.4 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

mattersim-1.1.1-cp311-cp311-musllinux_1_1_i686.whl (689.5 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ i686

mattersim-1.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (719.4 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mattersim-1.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (701.3 kB view details)

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

mattersim-1.1.1-cp311-cp311-macosx_11_0_arm64.whl (304.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mattersim-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl (681.9 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

mattersim-1.1.1-cp310-cp310-musllinux_1_1_i686.whl (657.8 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ i686

mattersim-1.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (681.4 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mattersim-1.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (665.5 kB view details)

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

mattersim-1.1.1-cp310-cp310-macosx_11_0_arm64.whl (304.1 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mattersim-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl (684.3 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

mattersim-1.1.1-cp39-cp39-musllinux_1_1_i686.whl (660.4 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ i686

mattersim-1.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (684.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

mattersim-1.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (668.1 kB view details)

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

mattersim-1.1.1-cp39-cp39-macosx_11_0_arm64.whl (304.7 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for mattersim-1.1.1.tar.gz
Algorithm Hash digest
SHA256 c8d87236d35200a07159e85e065c789b843f10771f5ca18196e025d7678dd4f1
MD5 03a363105cf5a13e1779eccd54c1f3b6
BLAKE2b-256 2b3d712be1749af2a6f4f91b076ac18b8ce3a943b2f44164b621414e648002f8

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp312-cp312-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2b7a37a1712c97bceb20129ce24fe8c1c33d7643e84073ebcdf744e310d9dada
MD5 27f40bfabf57f3e2985b08ae46a7ee3e
BLAKE2b-256 c465fdecc49e3b7639100594d3594b99829e9f2f5f394dbbed5f670faff1fc9b

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp312-cp312-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 8b77d53845b79ecad7c8a01343a7c713db6dfe4d279e023dd063bb771d0f2901
MD5 d27ac1beced00383e0c98a1cb8a7eab9
BLAKE2b-256 23631d047ef2c550f6e9de33f1d1ebfd25297dfce4bad4456a1664ed7515b3b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 38706ce524740889469fb89d269c0b2ccd5ab4ad041c985f9a97a50a879714fe
MD5 d41af827357e204fff6b5eee22b9bcda
BLAKE2b-256 78753b350f3e643200c39e135eef4ee752b87e139cc9023582e4aeed47d3a6d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 df733770df1e1f26f3167685ffba42a386a048af049da59c5e65b508d0cb0ea8
MD5 ee9ec2b64c66d178e2d71769ad23a09b
BLAKE2b-256 82f34a3a78534daf543d2073309e5808d040e22071524388e50f91ee3e582ac4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9c24c954b5c8b12bb0e623e0a578b85169b71367975957e0876bad0cc5e4a5a
MD5 6b1e29d98e0ee01e716775f3645694ea
BLAKE2b-256 24133478fb50214047a3e7c091055c8d863af40d5a542485ec6f681199ce1e27

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp311-cp311-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 66c155fd638005544fb64e29813de70a154d12e280f708fccc4a2ba034a5f3c0
MD5 e9fa43a9524295f4d0aae466c0021d17
BLAKE2b-256 6d7cec07698f843898452b630e58ebb97a92bcc831df577ad0c1dbad9250e925

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp311-cp311-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 4a65f22fff54fc39628a3cc16e48f1c291f7262125c8f871904248cafdda285f
MD5 b2680aa4948267c0131f94ad8096d77e
BLAKE2b-256 ed83a302a491ecd2231e1fe0a6c01ef328385031e07e1bd9ab6546c858bf1014

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc61f8e79fe51f2f45480a116661485edeb8b19933a237112c97c8b6dc0930c9
MD5 af657482b3ccefa494f33755ca541563
BLAKE2b-256 b12e62637f85e9ea9f25b6e9cfb16e0595382078e5066820e1c6df324892c89d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 f6cca24ab922fd66809dcdb77c0a8279a0d3433e40b06ae290ce7aa5f8ad326d
MD5 70789464231cacf08041bc44c87a21a7
BLAKE2b-256 1ec31b28b16b0e4e9153c7193303cf5bff3bbb0d363bcb350380dd6b2b24eb77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a192b78b95daffa4480aff512ecaa7be41a6c8a80ac19d43493e1840109c9ece
MD5 ba3cf10843f3b3d987360a7bc6a85b6d
BLAKE2b-256 2767bcc95c5df3f61367dea1d9f210880279ba64fa01c54d17db69dde636968c

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 2d1956fcfb33630e5dd8c8fdb7891cc9ce15b3ed07df4b5d97201852e36407d0
MD5 795d5424437facfdc8ae238732a17231
BLAKE2b-256 c0dd5ca9057be33f048795de823ad85b261e70acd3875dffef326ee457651bbe

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp310-cp310-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 81589f1f91fa145bb50e6222c4e3960794e8e5173ee669dd9db29a3164569256
MD5 7b3f6a977d20201af4146b0fb69628f7
BLAKE2b-256 0bef63dce24ff761325acbc6787d3c818835e4dbd46a38ee7adf45f203fb2280

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ff315a5fb8903fa502a1d74ec4842286b6c978ff404acd6315888207aadaec83
MD5 3036c0bc9e5b4b5efed712355bc61382
BLAKE2b-256 a9e4adaf2c3081c2a4a495075ad0c3a8634ed0f1904d0949f982e351d668929e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 080ada5657d925042d26134d6b428d1369b22ad13b4dcd01ab5f1ea8d4dee286
MD5 60a38afe7505b50e371d87fffb99fc25
BLAKE2b-256 c735060566aeda6cb6f0c97c06037edef4c77d91b65429001f76dedbf10add8d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 22dfce3f3906ab58a0c131d6801541d939e939a44c12be1cac0cf079f56d6300
MD5 3dbb71791c8739cc07aa68858732efaf
BLAKE2b-256 b863d7094ff3e41a8101ccf4510d0f979cbe4dbd430a91a53239fd1ed201de89

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 88692a669ce1d777ffc8aa4354971162b92887922439f6629183493e139f638f
MD5 f5a39a1ab392e7125a66b0acaf8f4e6c
BLAKE2b-256 08001160baf6869396dfe288f96f83c6df72d4c41ca020e73acea1c32057e35b

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp39-cp39-musllinux_1_1_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 3fbcf9b7e1bd5279de53b6b329a517f6f6e4aa7aba988a373a150ba8da53e820
MD5 10149c7fae1d8e31341e9f7b24577663
BLAKE2b-256 7b2ad1df2841f33b9b9e482177651d0ce75651da94069c3b1f1a601eb6f1b7de

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 814b6ebfdd9483aa263b029c9c64fb6500b0301fd2bda3d905932d3cbd6161dc
MD5 3815dcf98f6ab85874238a76b0d65571
BLAKE2b-256 3ed8f7419f7b7c2a4a4bf6bfef28f80c464a55193e1d9644a96e1e550465d459

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 5591cf417e68b40a52cda0b71c7873ac5f1caa2dd362f7ac2177571a641372bf
MD5 9d6c9b8d56b4494319dfbda4ccaddfef
BLAKE2b-256 28c1d5a11fd8008c07f53af289a4074fa4d1ca032d16a352a68d4ffa7edbf8d3

See more details on using hashes here.

File details

Details for the file mattersim-1.1.1-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mattersim-1.1.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 80744b380f0af78849c884971d894764063411ff4b714145b28923f3b37e601d
MD5 51d52a8a49dcfa9f5ba0f71cd796f9d4
BLAKE2b-256 162cf65de439cd77ee735865f10369c9aa50dc81afa996483cd503e6fdb8d373

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