Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update github workflows and update installation instruction in readme #21

Merged
merged 10 commits into from
Nov 27, 2024
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<h1>
<p align="center">
<img src="docs/_static/mattersim-banner.jpg" alt="MatterSim logo" width="600"/>
<img src="docs/_static/mattersim-banner.png" alt="MatterSim logo" width="600"/>
</p>
</h1>

Expand All @@ -18,27 +18,32 @@ MatterSim is a deep learning atomistic model across elements, temperatures and p

## Installation
### Install from source code
Requirements:
- Python == 3.9
> [!WARNING]
> We strongly recommend that users install MatterSim using [mamba or micromamba](https://mamba.readthedocs.io/en/latest/index.html), 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:
```bash
conda env create -f environment.yaml
conda activate mattersim
mamba env create -f environment.yaml
mamba activate mattersim
pip install -e .
python setup.py build_ext --inplace
```

## Usage
### A minimal test
```python
import torch
from ase.build import bulk
from mattersim.forcefield.potential import Potential
from mattersim.datasets.utils.build import build_dataloader

potential = Potential.load(load_path="/path/to/checkpoint", device="cuda:0")
from ase.build import bulk
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
print(f"Running MatterSim on {device}")

potential = Potential.load(load_path="pretrained_models/mattersim-v1.0.0-1M.pth", device=device)
si = bulk("Si", "diamond", a=5.43)
dataloader = build_dataloader([si], only_inference=True, model_type=model_name)
dataloader = build_dataloader([si], only_inference=True)

predictions = potential.predict_properties(dataloader, include_forces=True, include_stresses=True)
print(predictions)
```
Expand Down
Binary file removed docs/_static/mattersim-banner.jpg
Binary file not shown.
Binary file added docs/_static/mattersim-banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "mattersim"
version = "1.0"
version = "1.0.0"
description = "MatterSim: A Deep Learning Atomistic Model Across Elements, Temperatures and Pressures."
authors = [
{name = "Han Yang", email = "hanyang@microsoft.com"},
Expand Down