Skip to content

Commit 875569d

Browse files
authored
Merge branch 'main' into pet-nc
2 parents a331a35 + 3a7f5c4 commit 875569d

File tree

3 files changed

+10
-23
lines changed

3 files changed

+10
-23
lines changed

examples/periodic-hamiltonian/environment.yml

+1-7
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,7 @@ dependencies:
1111
- ase==3.22.1
1212
- seekpath
1313
- requests
14-
- metatensor
15-
- metatensor-core
16-
- metatensor-learn
17-
- metatensor-operations
18-
- metatensor-torch
19-
- --extra-index-url https://download.pytorch.org/whl/cpu
20-
- rascaline-torch @ git+https://github.com/luthaf/rascaline@3450bc4d609aee87ab73648b059536baa97d15ac#subdirectory=python/rascaline-torch
14+
- --extra-index-url https://download.pytorch.org/whl/cpu
2115
- lightning
2216
- xitorch
2317
- keras_core

examples/pet-mad/environment.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ channels:
44
dependencies:
55
- python=3.12
66
- lammps-metatensor=*=cpu*nompi*
7-
- libtorch=*=cpu*mkl*
87
- pet-mad
98
- pip
109
- pip:
1110
- ase
12-
- ipi>=3.1.r21
11+
- ipi>=3.1.2
1312
- chemiscope>=0.8.4
1413
- matplotlib

examples/pet-mad/pet-mad.py

+8-14
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,13 @@
140140

141141
calculator = PETMADCalculator(version="latest", device="cpu")
142142

143+
# %%
144+
#
145+
# The model can also be exported in a format that can be used with
146+
# external MD engines. This is done by saving the model to a file,
147+
# which includes the model architecture and weights.
148+
149+
calculator.model.save("pet-mad-latest.pt")
143150

144151
# %%
145152
#
@@ -380,19 +387,6 @@
380387
# without having to introduce vacancies or wait for the
381388
# very long time scale needed for diffusion.
382389

383-
# %%
384-
#
385-
# Before starting the simulations with MD engines, it is important
386-
# to export the model to a format that can be used by the engine.
387-
# This is done by saving the model to a file, which includes the
388-
# model weights and the compiled extensions. We use the ``collect_extensions``
389-
# argument to save the compiled extensions to disk. These extensions ensure that
390-
# the model remains self-contained and can be executed without requiring the
391-
# original Python or C++ source code. In particular, this is necessary for
392-
# the LAMMPS interface to work because it has no access to the Python code.
393-
394-
calculator.model.save("pet-mad-latest.pt", collect_extensions="extensions")
395-
396390

397391
# %%
398392
#
@@ -513,7 +507,7 @@
513507

514508
ase.io.write("al6xxx-o2.data", al_surface, format="lammps-data", masses=True)
515509

516-
subprocess.check_call(["lmp_serial", "-in", "data/al6xxx-o2.in"])
510+
subprocess.check_call(["lmp", "-in", "data/al6xxx-o2.in"])
517511

518512
# %%
519513
#

0 commit comments

Comments
 (0)