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

Doc: update installation instruction #27

Merged
merged 9 commits into from
Nov 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 36 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,45 @@
MatterSim is a deep learning atomistic model across elements, temperatures and pressures.

## Installation
### 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:
>
> ```bash
> # create the environment
> conda create -n mattersim python=3.9
>
> # activate the environment
> conda activate mattersim
> ```
>

To install MatterSim, run the following command:
```bash
pip install mattersim
```

In case you want to install the package with the latest version, you can run the following command:

```bash
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

```bash
git clone [email protected]:microsoft/mattersim.git
cd mattersim
```

2. Install MatterSim

> [!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
mamba env create -f environment.yaml
mamba activate mattersim
Expand All @@ -37,11 +71,11 @@ from ase.build import bulk
from ase.units import GPa
from mattersim.forcefield import MatterSimCalculator

device = "cuda" if torch.cuda.is_available() else "mps" if torch.backends.mps.is_available() else "cpu"
device = "cuda" if torch.cuda.is_available() else "cpu"
print(f"Running MatterSim on {device}")

si = bulk("Si", "diamond", a=5.43)
si.calc = MatterSimCalculator()
si.calc = MatterSimCalculator(device=device)
print(f"Energy (eV) = {si.get_potential_energy()}")
print(f"Energy per atom (eV/atom) = {si.get_potential_energy()/len(si)}")
print(f"Forces of first atom (eV/A) = {si.get_forces()[0]}")
Expand Down
25 changes: 17 additions & 8 deletions docs/user_guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,25 @@
Installation
============

Install from PyPI
-----------------

To install the package, run the following command:

.. code-block:: console

pip install mattersim

In case you want to install the package with the latest version, you can run the following command:

.. code-block:: console

pip install git+https://github.com/microsoft/mattersim.git

Install from source code
------------------------

Requirements:

* Python == 3.9

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

Expand All @@ -17,11 +30,7 @@ To install the package, run the following command under the root of the folder:
conda activate mattersim
pip install -e .

Obtain the model checkpoints
Model checkpoints
----------------------------

You may obtain our model checkpoints from

.. code-block:: console

# link to somewhere
The currently available model checkpoints can be found in the `MatterSim GitHub repository <https://github.com/microsoft/mattersim/tree/main/src/mattersim/pretrained_models>`_.