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.1.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.1-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.1-cp313-cp313-musllinux_1_2_i686.whl (707.6 kB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

mattersim-1.2.1-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.1-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.1-cp313-cp313-macosx_11_0_arm64.whl (308.0 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

mattersim-1.2.1-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.1-cp312-cp312-musllinux_1_2_i686.whl (720.1 kB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ i686

mattersim-1.2.1-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.1-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.1-cp312-cp312-macosx_11_0_arm64.whl (308.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

mattersim-1.2.1-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.1-cp311-cp311-musllinux_1_2_i686.whl (719.4 kB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

mattersim-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (719.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

mattersim-1.2.1-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.1-cp311-cp311-macosx_11_0_arm64.whl (308.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

mattersim-1.2.1-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.1-cp310-cp310-musllinux_1_2_i686.whl (695.9 kB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ i686

mattersim-1.2.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: mattersim-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 70c72fac35cf773a3ebd9eafeb860a4d3b69ff28ccb51227c12d0da9221ecc0e
MD5 795c3063e201394d8c4442ce00a3f495
BLAKE2b-256 ef8e98133681e319c4da1ff6562d21b7cfce64981f1472787c907967cfdbde5d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3ea62b1ea69f77f7666c668de1a5f7337633ac236914c609e7ad83bf15ad2d1a
MD5 7d0aa5cf3e09fb97865ca9873b734ee2
BLAKE2b-256 541c9fc4eb996ab40457927dc6e2f84fbbc42c907aa4fe76a867aa6a6ca820ac

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 4f93c3456d10168358b9bd6c57416b1b4eb76de422b0b2f96e3039152117cdee
MD5 a34123c1872087b3ae307f47288b333c
BLAKE2b-256 9f756a0dcaab67eff0f50c554ff99f159aff0f6beff3e31fa95c3c1de40328d5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09bccd06f81747d938948e32ebdd852a68282b0690c36aa88f29436ed61ea61d
MD5 81bd20829c3104fff8576f25a0030715
BLAKE2b-256 1f302eb5c4f1e2030d30ec1078c0d953ac5b966694283e114c7c69499e457866

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 27be925dfe435b1cd2e1931e93ee730ee5dd9e75576a15d540acd7a96ac880c7
MD5 ac0753da6bd2e45a889dbaf944794b7a
BLAKE2b-256 fa0abe1f7f8fec49a74f3591db6cd996450f1a16a0167712a34bd888374ef474

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6679e91e18534af4ef74bddf3259fbe5d06c5d883d918574994ff89b53566990
MD5 1ba6f14de62be89a79dcc6c9fb94eead
BLAKE2b-256 45e34e6333bd0f9962509d1c8ac410eaa543b4eb9d48bb6cf45fd7bdf280cc71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 38e7598eb5dab27d5c972856ae655e75ab52701e12e91c9d74c7182a789e8364
MD5 a61293bb8e6bbb85e860b83571a18449
BLAKE2b-256 765d1e809ae84f58896e5dd9c3668d274ba0459b149d2ac67a9f587d7976f3e4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp312-cp312-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 7b8b093e2555d7a844c9bbcae9368a86ceb8a3099081495a16f5b4a688530f48
MD5 fff3229edd4936f19813d6f1d457c503
BLAKE2b-256 c4c1616e13658d07a40b00d42a25ca5fdc67e7379b409176049ccadfc2198c2b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 09ebab6a09aebee2dff4ae09ea173764ad220e84b15b76da090f363e5236b757
MD5 845402ca10366621e28d3d22bf49bb1e
BLAKE2b-256 389de82e070b42f56fc662f6dfb172513196682687cb7e0c9cd26a352077e604

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 028e6fc81c9e07acdec1dd7639e68f00ad7dcf80e24d9497268aa3f6a9530d69
MD5 efb71ed3ff6f6dfca3886f9a3ceaa436
BLAKE2b-256 e0fd05ce28e4ff03ebb1cdf8a666909cfe13a398abc8e96f072c0aeeb8df4951

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8eb2dafb536e70e1007c0a0a4bc4dcadd72e7fb0bdc23dfbc4f1ec55b89f37df
MD5 9892b6091097281896c8e0b4d8b0f365
BLAKE2b-256 b5832a58373227cb2eb9bc25590b6e5797fa43fe5acc0b1a699becfee9698edf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9676c376814c116057b869eaa6d01e4fb6ea697ae1a59f78dd436a2e0914dc96
MD5 b2d26f33c7726265adbc960ef1f47d78
BLAKE2b-256 66dc54ac9a0e529b1dad08055ca13d8ac49ae6c886c8cdfae73f7cf42a0b2117

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 262ef3fb60f3b7c297c46df224cb7db0c834da8f63df44de2b711a94ca1c5678
MD5 871aeee223e3dee299ad1ed0cae9db16
BLAKE2b-256 2d8a19bd3f8595b74b5fcd7b371524d529b3d1652e2acf1492c21c0f0c1d7426

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a384a583e8f268b6dac9538bda55d14267095dc2085b0661e85dd0c2f41e0c4c
MD5 e3b5c76f2fa1a610bc4f6d1a27740132
BLAKE2b-256 bf111cc0e843fe0cbbff7966b1c65f600699a505f8c3a3e9fe3b53827a0444be

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 fcd98df39adc896941d4a875496c76c6925d5a2fe60881cb45130db19946afd7
MD5 f2e294b8ff5bb311576c2ff628bccafb
BLAKE2b-256 0c99e96ad98027bfbdf92c70cd3c98d397f7a46c5fb465d5f1075d1052af2756

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7c43ea93c23f0cbdc675477a795594f018e3cbbc3e94db570d2701b8de6b80d7
MD5 98442b01616f0f77c9ec8eb1de0af8ae
BLAKE2b-256 94241272a6386f77fc2dbf6790be93b6ab5fdc150527c97ca19914d598d39531

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f573d56e41d162541f2d5ea0d9f78b57eb685c37c898d5784b03f288e10e7b7f
MD5 8af09b1da9051fc20ddba1ae4ebc9de6
BLAKE2b-256 b10ea3c3d73f68c65d3977ed149a5da1a8df96d28f36b738ab1a0d926d33dfbe

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp310-cp310-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 b8078499bb31866fec983693c38f959db46f8148419febf0e153c35c35b4a29e
MD5 b7d0a3e4c968d9c32e93289e75e65e50
BLAKE2b-256 91b2c32307149de9e38dce49197f44ef9ac71c37dd2ca36e39d15ecf87a2ffe9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 9f7e36d3c3af0b1436c091d79b23b0895c811a14a2cc310cbf5874cdff83cc4f
MD5 1a55503e74f9331b444d13438bf5875f
BLAKE2b-256 4f9b2c7d60ab3fb6b65d9345f964928043f3200e4e8414203a012a1a61608b03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 6ab6d478319b6751d4722b8a5a1b0d2c061564bfac86d9a6fadaeae186cb307a
MD5 8e99329784dba8aa6ad80d45c2a55c16
BLAKE2b-256 27fec63bd057ea103c58a9a00f089856f676ac574412113994d148670de56dde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mattersim-1.2.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2fbd6ddad10f29195cebffe121502c1df1c7b6afc1d06ea576986732e5936c7d
MD5 4e4b6076dcaf4db39e97c5da2ba6465f
BLAKE2b-256 bb0d9e248652820d67ccb3123f52fedd8ee95ba76b482c64f0a4f165dbe19bf6

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