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.0.tar.gz (8.6 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.0-cp312-cp312-musllinux_1_1_x86_64.whl (717.3 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ x86-64

mattersim-1.1.0-cp312-cp312-musllinux_1_1_i686.whl (686.1 kB view details)

Uploaded CPython 3.12musllinux: musl 1.1+ i686

mattersim-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (711.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

mattersim-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (690.5 kB view details)

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

mattersim-1.1.0-cp312-cp312-macosx_11_0_arm64.whl (303.4 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mattersim-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl (717.7 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ x86-64

mattersim-1.1.0-cp311-cp311-musllinux_1_1_i686.whl (687.9 kB view details)

Uploaded CPython 3.11musllinux: musl 1.1+ i686

mattersim-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (717.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mattersim-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (699.7 kB view details)

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

mattersim-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (302.4 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mattersim-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl (680.2 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ x86-64

mattersim-1.1.0-cp310-cp310-musllinux_1_1_i686.whl (656.1 kB view details)

Uploaded CPython 3.10musllinux: musl 1.1+ i686

mattersim-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (679.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

mattersim-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (663.9 kB view details)

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

mattersim-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (302.5 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

mattersim-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl (682.7 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ x86-64

mattersim-1.1.0-cp39-cp39-musllinux_1_1_i686.whl (658.7 kB view details)

Uploaded CPython 3.9musllinux: musl 1.1+ i686

mattersim-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (683.1 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

mattersim-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (666.5 kB view details)

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

mattersim-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (303.1 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

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

File hashes

Hashes for mattersim-1.1.0.tar.gz
Algorithm Hash digest
SHA256 04625f7cf68801b394aaf2b933d25adbaf48c61af37fea4811cfc69121baa6ec
MD5 0fdb36ed1bdc5acf0b37fe3bb79ecd80
BLAKE2b-256 7dd322bcab6411f74b7713519a24135af0e8802c57fdf65ec8b258d3ac2c65f6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp312-cp312-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 c8436e7170e6e7d86e1e3f5d6b4f33c31fb349b5112737d1a2f5d66366edb2ea
MD5 3bec8bc8921ff5ce77eae098409e8755
BLAKE2b-256 8c530327398c89a53578c5ede806f235ae1638d24d44de08826d112a358fd78c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp312-cp312-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 d90c6355d2abf0c9a59e85d01160c63f2f3e792e120ce860c0f2d66e0f737321
MD5 a9794df18f10d63f2a4cd3380acdbbc8
BLAKE2b-256 b7ed350e88094dd3fcd7e2a495cf6dc8b1fd43885f89e69a32388f47370de389

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4f5c99174698305b18d024093d029f0f2f52129013dba87252304ee7e7e4066
MD5 5cc34046fb0fb756473b36e6036d2f68
BLAKE2b-256 be207777a1ad84e0d9d4c9c4513319441f37ca7fe23654428aafd5ef537ddf35

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 629b05423785e81d4de20c0c80f3cebce58dc3ad6ab3473ae56d3f96c0dbb60b
MD5 23df238d1f3bcdbdd94ea0d9fcd22319
BLAKE2b-256 fa4e5d2f1c63549c03bbf4e4bbe4a480fb1ca801bf5f6bfee3a81e1478c81d18

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 005c1a067aaf6be4bfa35dbfb4b3c6a827c6074465d18c5c8889d89adca07fa4
MD5 88bafc0d3c17103da7b72d37b1a726c0
BLAKE2b-256 680aa9156e92a54d94213c42aa226c745dba743163c5286af222334eda37aba8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 67880d736941ef7e2ccd916c52e452e223d24d4c20c8f39bb76f6a2db322d22b
MD5 90b6c20601a436bf6526400c9d25091d
BLAKE2b-256 1cae61f2a53f0449d810faee53aabe60376a7ca506b7b7119a39ad2d581038dc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp311-cp311-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 999b4018fefa457255089e6382ed1952001b65df8ce32bd36cd9210147fef631
MD5 fc350095cb07741cbfc1b4de895742f6
BLAKE2b-256 0d6cd81af6a4594a00a49fd3b171d01fd39fd11ce926ec51e14f8a2bc12216ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cc1525db8b2a60824f3d7ff65a1c5e3bffbe8cc0e5a462681d2580e33fee4689
MD5 15eee24984d0235cd597b147d511b7ce
BLAKE2b-256 b1d68ec0c0cb3c636a649a91a58d8cc51d9ad072aacd7441e03ac0afb1eaa0df

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 ea6705161198841c1dfca40305758e1e2df9be55591cea690bc7c1cef27c898b
MD5 269b29d5b0082d0d10bdac27d822aabe
BLAKE2b-256 c5aff43e89f9f8efa176b3335ec5f3ea0a79efa2b0ab43ee6f4ad104f2a9d3be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5e8fb42f08babeebb9fa3f3b50f3564fb80b76acc90aaba86d2782467642953b
MD5 4ff85b47d620beb1759beadbdc7a5f15
BLAKE2b-256 710affcb79aa3faf2047d3a40e2e73265e71bffe05a39ea283d2d44ff2d0e76b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 ed1305542f7190a35a0b98a4078c03d51eb2c885826193806a67ad7f30726082
MD5 56673abc4c05e2addb4129079f5e3ac7
BLAKE2b-256 da3feabc6cce6833e63159d4c097e97ab1f106843fc3ffad977db8ef45a907a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 1ecd95264499b519ab466492287cc77c3120f3cb6d4789b3b8dc0aabf8dd0f63
MD5 c88ba0a12999a4e272ed065cf52583d3
BLAKE2b-256 533784884efdf132ef27dacc9dffac3501b6669824bc4fb2b7543234b143b245

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc61c6ba207326237d9960580ade6defc5474ff78b00b0207b010800f43daee2
MD5 436bef149ee1ca646057b8dfd58ac4e5
BLAKE2b-256 a3608b4f93a758231a0decc75f4e1e2ec0598844799fa0ace7324358a7c26c37

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 bfbd52c99fb903af588fb04ebc214016470ed014d85352b2ec662e9addec6ab1
MD5 42cb233385dd5a1ef85c1e6735e2642b
BLAKE2b-256 fd9095643129cac292ca3178b20900b41658b31a8c749088ec23ad80549bc986

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2339abee845d270bf9834d8792b0a2090dfc3cd290b5c5b3accaa0135bd3018a
MD5 c2893846fbd991cb826851ccf239f9ac
BLAKE2b-256 97228af7150129a6975fd4f9d905a958e364a73fa65b6f7ed193aa9a4882e557

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 927228d2869f8fc5d7e94e7159831c12b1c00fd41aa5c13af5bd23cde4aefb60
MD5 aaa9967f17db43a9dd844f1cc551350e
BLAKE2b-256 6b05aba1ed16587c6ca24a2a04ef8adbf5cbcd9b75ee3b742faca0191832297f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm Hash digest
SHA256 0529d7adb0940ff986092fa0e7f1f246a4ee717dc0e3fe13386fbad7f85e3065
MD5 92fec7bf33433667858e454f3e2cdb0d
BLAKE2b-256 8f274dad31222d5e56d4aaf23ab5bfc9d92bc9bd7ef51821d375d36c195970cb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee10bfea34079f89f23d1ad97c098b5d7f870da7f65a858fbb37bab8d7897f14
MD5 88db92f20dfbea0bc92a22decd649099
BLAKE2b-256 a7bb03f3bf2db322ea306184bc5918dbd33d48cce213fbe05babaaf438eb5c88

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 b674041e307bebedf6664b7357e3728a6146a297cdcd56e8cddc700cc8e76344
MD5 96e61ff1255eb3fb9556274cec8e918e
BLAKE2b-256 9db54b7a262a422a3ed44088fe2b81ba68284f0bea17894a209cdb4d52b9ff34

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3565a70725fe512b39761897c06a51128f0341565bb0678de70555c0707e6785
MD5 da80d0b5a70aac390baba0c0c36f7bd3
BLAKE2b-256 93afd105715843386b161f0b4fe20c98d630fb7d55cf7aaf95ce9262dab35750

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