Skip to content

Commit da834e5

Browse files
Merge pull request #27 from microsoft/hanyang/update-docs-1
Doc: update installation instruction
2 parents 39a550e + 3fc36b3 commit da834e5

File tree

2 files changed

+53
-10
lines changed

2 files changed

+53
-10
lines changed

README.md

+36-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,45 @@
1717
MatterSim is a deep learning atomistic model across elements, temperatures and pressures.
1818

1919
## Installation
20+
### Install from PyPI
21+
> [!TIP]
22+
> 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:
23+
>
24+
> ```bash
25+
> # create the environment
26+
> conda create -n mattersim python=3.9
27+
>
28+
> # activate the environment
29+
> conda activate mattersim
30+
> ```
31+
>
32+
33+
To install MatterSim, run the following command:
34+
```bash
35+
pip install mattersim
36+
```
37+
38+
In case you want to install the package with the latest version, you can run the following command:
39+
40+
```bash
41+
pip install git+https://github.com/microsoft/mattersim.git
42+
```
43+
2044
### Install from source code
45+
1. Download the source code of MatterSim and change to the directory
46+
47+
```bash
48+
git clone [email protected]:microsoft/mattersim.git
49+
cd mattersim
50+
```
51+
52+
2. Install MatterSim
53+
2154
> [!WARNING]
2255
> 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.
2356
2457
To install the package, run the following command under the root of the folder:
58+
2559
```bash
2660
mamba env create -f environment.yaml
2761
mamba activate mattersim
@@ -37,11 +71,11 @@ from ase.build import bulk
3771
from ase.units import GPa
3872
from mattersim.forcefield import MatterSimCalculator
3973

40-
device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
74+
device = "cuda" if torch.cuda.is_available() else "cpu"
4175
print(f"Running MatterSim on {device}")
4276

4377
si = bulk("Si", "diamond", a=5.43)
44-
si.calc = MatterSimCalculator()
78+
si.calc = MatterSimCalculator(device=device)
4579
print(f"Energy (eV) = {si.get_potential_energy()}")
4680
print(f"Energy per atom (eV/atom) = {si.get_potential_energy()/len(si)}")
4781
print(f"Forces of first atom (eV/A) = {si.get_forces()[0]}")

docs/user_guide/installation.rst

+17-8
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,25 @@
22
Installation
33
============
44

5+
Install from PyPI
6+
-----------------
7+
8+
To install the package, run the following command:
9+
10+
.. code-block:: console
11+
12+
pip install mattersim
13+
14+
In case you want to install the package with the latest version, you can run the following command:
15+
16+
.. code-block:: console
17+
18+
pip install git+https://github.com/microsoft/mattersim.git
19+
520
Install from source code
621
------------------------
722

8-
Requirements:
923

10-
* Python == 3.9
1124

1225
To install the package, run the following command under the root of the folder:
1326

@@ -17,11 +30,7 @@ To install the package, run the following command under the root of the folder:
1730
conda activate mattersim
1831
pip install -e .
1932
20-
Obtain the model checkpoints
33+
Model checkpoints
2134
----------------------------
2235

23-
You may obtain our model checkpoints from
24-
25-
.. code-block:: console
26-
27-
# link to somewhere
36+
The currently available model checkpoints can be found in the `MatterSim GitHub repository <https://github.com/microsoft/mattersim/tree/main/src/mattersim/pretrained_models>`_.

0 commit comments

Comments
 (0)