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.0.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.0-cp313-cp313-musllinux_1_2_x86_64.whl (733.8 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

mattersim-1.2.0-cp313-cp313-musllinux_1_2_i686.whl (716.7 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

mattersim-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (713.9 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

mattersim-1.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (693.2 kB view details)

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

mattersim-1.2.0-cp313-cp313-macosx_11_0_arm64.whl (306.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mattersim-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl (741.2 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

mattersim-1.2.0-cp312-cp312-musllinux_1_2_i686.whl (720.5 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

mattersim-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (722.6 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mattersim-1.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (698.8 kB view details)

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

mattersim-1.2.0-cp312-cp312-macosx_11_0_arm64.whl (307.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mattersim-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl (742.0 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

mattersim-1.2.0-cp311-cp311-musllinux_1_2_i686.whl (726.9 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

mattersim-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (725.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mattersim-1.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (707.2 kB view details)

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

mattersim-1.2.0-cp311-cp311-macosx_11_0_arm64.whl (307.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mattersim-1.2.0-cp310-cp310-musllinux_1_2_x86_64.whl (713.5 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

mattersim-1.2.0-cp310-cp310-musllinux_1_2_i686.whl (702.0 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

mattersim-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (694.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mattersim-1.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (678.2 kB view details)

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

mattersim-1.2.0-cp310-cp310-macosx_11_0_arm64.whl (307.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for mattersim-1.2.0.tar.gz
Algorithm Hash digest
SHA256 bd345cd1805927f29e2d1af0b2bf75e88bcf71d6f092e07eb6b95889c8e4b0f0
MD5 c102a0004b549a20904029c573234fcf
BLAKE2b-256 7c9a0d64b8ad7966bba8a18d1b7226e4017e802bc83fdb2cb1663998d32866bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 464d9b8e8487e2f9b7daeaddd1917cd71cfa5746febfa834c72e3ff3452d921e
MD5 c5e7f7940fd0e5c3392df8fa47ee5b34
BLAKE2b-256 5a371392a21ed57ce52e9c1a85bbd94fd585a15be275ac683de0567a1f4e7074

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 77752538e7edefab37ea15b583ad35ee4579051bfb3fdaf53d62a775b3ede07d
MD5 52927c9c2a656ce68efacfcb6d2ad528
BLAKE2b-256 0b84e328b6d58babc18cf156225c00d233b3d174c79f9d99fddc54454e3d7012

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc6056784348b142109560605fe3ec794604f4d3468d22455205e69f83bf57a1
MD5 83ad92d855a92b829859fa04ec8dfbd9
BLAKE2b-256 c38185c9a109a89069394bef07f297a05ec57a2975193d7b174ba0de61858026

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 102dcd1015c2c765d3365c8d88cc685e061cde8936510828ad81264df5240ed6
MD5 8a5ac90be85071675543e2114f4b0a59
BLAKE2b-256 c99f16bf815d2d5e0f972bf5873315e79f8f45bd103481cfdf865a05f809c140

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c94d2b0abe9f98a8b2abcbe8e5aeea2d74819521a39dd2530778a829d4273c6a
MD5 3efc317c34e484ffbcc96c92b7262054
BLAKE2b-256 33104e9354fc272e1d6e237210652a5e8ad00dfaa3b00ada23199abf9f11415e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c284353c80e02f2be23ea872d1a0d608d89fd5110e313e773b933f19519e92d5
MD5 9b1de1f52c0c58435fd711a5bade2bd0
BLAKE2b-256 8705950dd2fef711b7a1e2e0788dc7fc4f45364ac858ba06742f0803876ce634

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ffdef8fbb3f17fa6f10f96e458589c7da21eeabdce6f46082280aa2e77bed5e5
MD5 cb3dc4f0e6ff68949cfa0ce112490804
BLAKE2b-256 b9cc14e99ae483766179be9f6bd9d3ec8db752afe9d1f2733f8e617671e32e40

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d04e389349f813392bd90c6aa8bcc31a09e53c3aa2ac00e445c4ef7b7fecf1f0
MD5 e78de649c59ec5b14a0092f43fcb352b
BLAKE2b-256 0767c04f23f3afaa80cdf87adae09ff4b3db9579fedde95b8c8ae4fe5bbd6b4a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b94cd0b1d7018d6abb9c2e2386d57208badad0d4c4306c3ab50d5ffeb165eaaa
MD5 5cebb7e9d03da3e7b9e91e0bd746b834
BLAKE2b-256 1b3824032c949dba17a9b31738c66e2cfede3c4a86eed7f0d06dd09a3be06195

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a3761872da107b403220a3a6dc48f7af927e51d49a83d53f35ddb0e86b1d964f
MD5 955aff40a75fd8c56b20bf000070680c
BLAKE2b-256 7e1a2b9aa5a9195509d62168f49d46d7363dfb657fcc398d8b26c0ce3b1e1b0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3336364e159b0a953ece74da120d09f4ed058f5a38e527e06a398131f3c61fc5
MD5 757f6d2383eef3ac9f80c4df2698488e
BLAKE2b-256 7c3a73af370e38d9d8934f284d75f5e9402277a1bcf16408b49092383a26a4e6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 6b4ce68270d84e7260f318e11eeed10bcb37e98430b0096b1264e2cc4ca978d6
MD5 660bbf06c6e27b17f73b15d7f1f309cf
BLAKE2b-256 9fa9cc2f84bc9623549f13d16d7ea2a7f3f5a9483db91c527f922ab351c5869a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b7e32aa7279d39652084b5afca989c66748126e9f6ec4b7f41c09c7350fb6337
MD5 fa408d7986a83fedf543fd40e3e0faa9
BLAKE2b-256 c3f244a03acfd04902dc546d04b0a2611945263d6ff6895abfa1f2f1b8ccb719

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 61a5c5ef82851d1896c85a81b0243a208dda301f8f644dffcd509772150090bf
MD5 4088144a54114bf2865a445221c78a24
BLAKE2b-256 ea964f24c01f70f4c9574a2beec2c2b50b950ff5bebfe0b8ca174bb030dd030d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 49cb15c72b7614f9b8b5415db80b20d90d9d6b2676ced00b37fd05f50343a4e1
MD5 5bf8f7361209cf60c35d772362c2836b
BLAKE2b-256 ee1485d438e06fd690728ddfdf755e0a9349a40ed7fc00059b61c52761cd1ad6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9a4a5e0443a1bba3b6109b711943cd9207eba7a2b3281c035dbd553b80fc6049
MD5 77a03ba6518a9daa8d17376b73cd64c4
BLAKE2b-256 278edd2d590393d3ac09d93ef515555dfa57a4634f34592ad1816069023afadb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c1801c55b86216d076eabafb2b2d55b12b78583966c1b604426e7ca3de301c17
MD5 57656f54e80de166fd3bbbb507ec46d9
BLAKE2b-256 bfefe3f5adc106bf4a6af6ecbe80f64ee6a727a548b0a5ca16c0bf8c0f74ea54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 39049053979f60219c930c17f837e0bb68fa37f7224a15d02a83bfa9267a43fe
MD5 0ecd3d0b6b971560115934b192cf4870
BLAKE2b-256 b9ae0fecad851fd84ee8d97b5ee13af0f172dabae0b1a094bc17fe27a69e2737

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 09a250569cb10246c52a80c57bde4cbf04c78409af684116f78648bbe30dabca
MD5 a433618b8bfc20f3b38ef4e0899acac5
BLAKE2b-256 bc4a8f828d860a1f74bbba3fb19afe16281cc981fc89b5333ca18dd67c7d1f15

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2d57c69eb81c4d0a16aea737f8e0f5502c1da552bbf3744fb1737cb0cdfe314b
MD5 8db756b0e02cbfa26963c39837cd8f42
BLAKE2b-256 63437caff5b74f8a67691dfcb7a3b2ea1f260f247420fe9d78c25f6e4e58223c

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