File size: 1,113 Bytes
d32c769
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
license: mit
---

# EScAIP: Efficiently Scaled Attention Interatomic Potential

## Installation

First, clone the FAIR Chem repo with allscaip branch:

```bash
git clone -b allscaip https://github.com/EricZQu/fairchem.git
cd fairchem
```

Then, create a conda environment and install the dependencies:

```bash
conda create -n allscaip python=3.12
conda activate allscaip
pip install -e packages/fairchem-core[dev]
```

## Inference

You can use the `FAIRChemCalculator` to load a pretrained EScAIP model and perform inference. Here's an example:

```python
from ase import units
from ase.io import Trajectory
from ase.md.langevin import Langevin
from ase.build import molecule
from fairchem.core import pretrained_mlip, FAIRChemCalculator

calc = FAIRChemCalculator.from_model_checkpoint("/path/to/your/checkpoint.pt", task_name="omol")

atoms = molecule("H2O")
atoms.calc = calc

dyn = Langevin(
    atoms,
    timestep=0.1 * units.fs,
    temperature_K=400,
    friction=0.001 / units.fs,
)
trajectory = Trajectory("my_md.traj", "w", atoms)
dyn.attach(trajectory.write, interval=1)
dyn.run(steps=1000)
```