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 docs and tutorial #16

Merged
merged 1 commit into from
Nov 22, 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
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<h1>
<p align="center">
<img src="docs/_static/mattersim.png" alt="MatterSim logo" width="200"/>
<img src="docs/_static/mattersim-banner.jpg" alt="MatterSim logo" width="600"/>
</p>
</h1>

<h1 align="center">MatterSim</h1>
<!-- <h1 align="center">MatterSim</h1> -->

<h4 align="center">

Expand Down
Binary file added docs/_static/mattersim-banner.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
84 changes: 44 additions & 40 deletions docs/examples/phonon_example.ipynb

Large diffs are not rendered by default.

20 changes: 17 additions & 3 deletions docs/examples/relax_example.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ Import the necessary modules

import numpy as np
from ase.build import bulk
from ase.units import GPa
from mattersim.forcefield.potential import Potential
from mattersim.forcefield.potential import DeepCalculator
from mattersim.applications.relax import Relaxer

Set up the structure to relax
-----------------------------
Expand All @@ -28,12 +30,24 @@ Set up the structure to relax
potential = Potential.load(load_path="/path/to/checkpoint", device="cuda:0")

# create a calculator from the model
calculator = DeepCalculator(potential=potential)
calc = DeepCalculator(potential=potential, stress_weight=GPa)

# attach the calculator to the atoms object
si.calc = calculator
si.calc = calc

Create the optimizer
Run the relaxation
--------------------

MatterSim implements a built-in relaxation class to support the relaxation of ase atoms.

.. code-block:: python

# initialize the relaxation object
relaxer = Relaxer(
optimizer="BFGS", # the optimization method
filter="ExpCellFilter", # filter to apply to the cell
constrain_symmetry=True, # whether to constrain the symmetry
)

relaxed_structure = relaxer.run(si, steps=500)

4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Pre-trained Models

We currently offer two pre-trained versions of MatterSim with **M3GNet** architecture:

1. **mattersim-mini-v1.0.0**: A mini version of the model that is faster to run.
2. **mattersim-medium-v1.0.0**: A medium version of the model that is more accurate.
1. **mattersim-v1.0.0-1M**: A mini version of the model that is faster to run.
2. **mattersim-v1.0.0-5M**: A medium version of the model that is more accurate.

These models have been trained using the data generated through the workflows
introduced in the `MatterSim <https://arxiv.org/abs/2405.04967>`_ manuscript, which provides an in-depth
Expand Down
3 changes: 2 additions & 1 deletion docs/user_guide/getting_started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ MatterSim provides an interface to the Atomic Simulation Environment (ASE) to fa
:linenos:

from ase.build import bulk
from ase.units import GPa
from mattersim.forcefield.potential import DeepCalculator

# same as before
Expand All @@ -50,7 +51,7 @@ MatterSim provides an interface to the Atomic Simulation Environment (ASE) to fa
calculator = DeepCalculator(
potential=potential,
# important! convert GPa to eV/Angstrom^3
stress_weight=1 / 160.21766208,
stress_weight=GPa,
)

si.calc = calculator
Expand Down
1 change: 0 additions & 1 deletion docs/user_guide/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ Install from source code
Requirements:

* Python == 3.9
* PyTorch == 1.11.0

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

Expand Down
Loading