lammps/examples/mliap
rohskopf 16751b06b3 Add os env vars to allow more MPI procs 2023-05-26 12:52:51 -06:00
..
jax Add os env vars to allow more MPI procs 2023-05-26 12:52:51 -06:00
Cu.nn.mliap.model Rearranged nn file locations and names 2021-03-03 11:38:05 -07:00
Cu.snap.mliap.descriptor Rearranged nn file locations and names 2021-03-03 11:38:05 -07:00
InP_JCPA2020.mliap move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
InP_JCPA2020.mliap.descriptor move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
InP_JCPA2020.mliap.model move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
Ni_Mo.data update 2021-06-09 16:59:59 -07:00
Ni_Mo.mliap.descriptor update 2021-06-09 16:59:59 -07:00
Ni_Mo.mliap.model update 2021-06-09 16:59:59 -07:00
README remove hippynn examples 2022-09-26 19:56:00 -04:00
Si.nn.mliap.descriptor update 2021-06-09 16:59:59 -07:00
Si.nn.mliap.model update 2021-06-09 16:59:59 -07:00
Ta06A.mliap move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
Ta06A.mliap.descriptor move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
Ta06A.mliap.model move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
Ta06A.nn.mliap more rearranging, tried to elimiante unnecessary name elements 2021-03-03 11:55:26 -07:00
Ta06A.nn.mliap.model Rearranged nn file locations and names 2021-03-03 11:38:05 -07:00
Ta06A.pytorch.mliap Cleaned up names of PyTorch files 2021-03-03 12:07:45 -07:00
W.quadratic.mliap move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
W.quadratic.mliap.descriptor move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
W.quadratic.mliap.model move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
WBe_Wood_PRB2019.mliap move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
WBe_Wood_PRB2019.mliap.descriptor move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
WBe_Wood_PRB2019.mliap.model move MLIAP potential files to potentials folder and replace with symlinks 2020-06-23 09:34:34 -04:00
compute.mliap.descriptor Tweaked input to match snap/in.snap.compute 2020-07-01 17:06:55 -06:00
compute.quadratic.gg0.dat update 2021-06-09 16:59:59 -07:00
compute.quadratic.gg1.dat update 2021-06-09 16:59:59 -07:00
compute.snap.gg0.dat update 2021-06-09 16:59:59 -07:00
compute.snap.gg1.dat update 2021-06-09 16:59:59 -07:00
convert_mliap_Ta06A.py Changes to MLIAP python 2020-12-21 11:51:10 -07:00
in.mliap.nn.Cu more rearranging, tried to elimiante unnecessary name elements 2021-03-03 11:55:26 -07:00
in.mliap.nn.Ta06A more rearranging, tried to elimiante unnecessary name elements 2021-03-03 11:55:26 -07:00
in.mliap.pytorch.Ta06A Cleaned up names of PyTorch files 2021-03-03 12:07:45 -07:00
in.mliap.pytorch.relu1hidden Added a simple neural network potential 2020-12-15 12:14:03 -07:00
in.mliap.quadratic.compute Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
in.mliap.snap.Ta06A Edits to README 2020-12-09 16:51:36 -07:00
in.mliap.snap.WBe.PRB2019 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
in.mliap.snap.chem Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
in.mliap.snap.compute Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
in.mliap.snap.quadratic Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
in.mliap.so3.Ni_Mo updated log files from the latested run 2021-06-14 11:40:45 -07:00
in.mliap.so3.nn.Si update log files. make Si example (much) smaller 2021-06-13 17:40:00 -04:00
in.mliap.unified.lj.Ar refactor unified LJ example input to embed the python code into the input 2022-09-24 21:08:43 -04:00
log.03Jul20.mliap.quadratic.compute.g++.1 Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
log.03Jul20.mliap.quadratic.compute.g++.4 Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
log.03Jul20.mliap.snap.compute.g++.1 Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
log.03Jul20.mliap.snap.compute.g++.4 Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
log.04Dec20.mliap.pytorch.Ta06A.g++.1 Cleaned up names of PyTorch files 2021-03-03 12:07:45 -07:00
log.04Dec20.mliap.pytorch.Ta06A.g++.4 Cleaned up names of PyTorch files 2021-03-03 12:07:45 -07:00
log.14Jun21.mliap.nn.Cu.g++.1 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.nn.Cu.g++.4 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.nn.Ta06A.g++.1 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.nn.Ta06A.g++.4 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.so3.Ni_Mo.g++.1 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.so3.Ni_Mo.g++.4 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.so3.nn.Si.g++.1 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.14Jun21.mliap.so3.nn.Si.g++.4 updated log files from the latested run 2021-06-14 11:40:45 -07:00
log.21Jun20.mliap.snap.Ta06A.g++.1 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
log.21Jun20.mliap.snap.Ta06A.g++.4 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
log.21Jun20.mliap.snap.WBe.PRB2019.g++.1 Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
log.21Jun20.mliap.snap.WBe.PRB2019.g++.4 Finished cleaning up and testing. MLIAPData class is now fully integrated with ComputeMLIAP and PairMLIAP 2020-07-11 19:01:16 -06:00
log.21Jun20.mliap.snap.chem.g++.1 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
log.21Jun20.mliap.snap.chem.g++.4 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
log.21Jun20.mliap.snap.quadratic.g++.1 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
log.21Jun20.mliap.snap.quadratic.g++.4 Merged MLIAP package into latest LAMMPS created SNAP, quadratic SNAP, and ChemSNAP examples 2020-06-21 18:05:34 -06:00
log.23Sep22.mliap.unified.lj.Ar.g++.1 refactor unified LJ example input to embed the python code into the input 2022-09-24 21:08:43 -04:00
log.23Sep22.mliap.unified.lj.Ar.g++.4 refactor unified LJ example input to embed the python code into the input 2022-09-24 21:08:43 -04:00
mliap_numpy_Ta06A.py close and finalize LAMMPS instance in MLIAP example python scripts 2023-04-06 12:58:30 -04:00
mliap_pytorch_Ta06A.py close and finalize LAMMPS instance in MLIAP example python scripts 2023-04-06 12:58:30 -04:00
mliap_pytorch_Ta06A_kokkos.py close and finalize LAMMPS instance in MLIAP example python scripts 2023-04-06 12:58:30 -04:00
mliap_unified_lj_Ar.py close and finalize LAMMPS instance in MLIAP example python scripts 2023-04-06 12:58:30 -04:00
relu1hidden.mliap.pytorch Updated PyTorch ReLU example to latest 2020-12-23 12:22:44 -07:00
relu1hidden.mliap.pytorch.model.pt Updated PyTorch ReLU example to latest 2020-12-23 12:22:44 -07:00

README

This directory contains multiple examples of
machine-learning potentials defined using the
ML-IAP package in LAMMPS. The input files
are described below.

in.mliap.snap.Ta06A
-------------------
Run linear SNAP, equivalent to examples/snap/in.snap.Ta06A

in.mliap.snap.WBe.PRB2019
-------------------------
Run linear SNAP, equivalent to examples/snap/in.snap.WBe.PRB2019

in.mliap.snap.quadratic
-----------------------
Run quadratic SNAP

in.mliap.snap.chem
------------------
Run EME-SNAP, equivalent to examples/snap/in.snap.InP.JCPA2020

in.mliap.snap.compute
---------------------
Generate the A matrix, the gradients (w.r.t. coefficients)
of total potential energy, forces, and stress tensor for
linear SNAP, equivalent to in.snap.compute

in.mliap.quadratic.compute
--------------------------
Generate the A matrix, the gradients (w.r.t. coefficients)
of total potential energy, forces, and stress tensor for
for quadratic SNAP, equivalent to in.snap.compute.quadratic

in.mliap.pytorch.Ta06A
-----------------------
This reproduces the output of in.mliap.snap.Ta06A above,
but using the Python coupling to PyTorch.

This example can be run in two different ways:

1: Running a LAMMPS executable: in.mliap.pytorch.Ta06A

First run ``python convert_mliap_Ta06A.py``. It creates
a PyTorch energy model that replicates the
SNAP Ta06A potential and saves it in the file
"Ta06A.mliap.pytorch.model.pt".

You can then run the example as follows

`lmp -in in.mliap.pytorch.Ta06A -echo both`

The resultant log.lammps output should be identical to that generated
by in.mliap.snap.Ta06A.

If this fails, see the instructions for building the ML-IAP package
with Python support enabled. Also, confirm that the
LAMMPS Python embedded Python interpreter is
working by running ../examples/in.python.

2: Running a Python script: mliap_pytorch_Ta06A.py

Before testing this, ensure that the previous method
(running a LAMMPS executable) works.

You can run the example in serial:

`python mliap_pytorch_Ta06A.py`

or in parallel:

`mpirun -np 4 python mliap_pytorch_Ta06A.py`

The resultant log.lammps output should be identical to that generated
by in.mliap.snap.Ta06A and in.mliap.pytorch.Ta06A.

Not all Python installations support this mode of operation.
It requires that the Python interpreter be initialized. If not,
the script will exit with an error message.

in.mliap.pytorch.relu1hidden
----------------------------
This example demonstrates a simple neural network potential
using PyTorch and SNAP descriptors.

`lmp -in in.mliap.pytorch.relu1hidden -echo both`

It was trained on just the energy component (no forces) of
the data used in the original SNAP Ta06A potential for
tantalum (Thompson, Swiler, Trott, Foiles, Tucker,
J Comp Phys, 285, 316 (2015).). Because of the very small amount
of energy training data, it uses just 1 hidden layer with
a ReLU activation function. It is not expected to be
very accurate for forces.

NOTE: Unlike the previous example, this example uses
a pre-built PyTorch file `Ta06A.mliap.pytorch.model.pt`.
It is read using `torch.load`,
which implicitly uses the Python `pickle` module.
This is known to be insecure. It is possible to construct malicious
pickle data that will execute arbitrary code during unpickling. Never
load data that could have come from an untrusted source, or that
could have been tampered with. Only load data you trust.

in.mliap.nn.Ta06A
-------------------
Run linear SNAP using the "nn" model style, equivalent to examples/snap/in.snap.Ta06A

in.mliap.nn.cu
-------------------------
Run a neural network potential for Cu, a combination of SNAP descriptors and the "nn" model style

in.mliap.unified.lj.Ar
-----------------------
This reproduces the output of examples/melt/in.melt,
but using the ``unified`` keyword and
the Python coupling to PyTorch.

This example can be run in two different ways:

1: Running a LAMMPS executable: in.mliap.unified.lj.Ar

You can run the example as follows

`lmp -in in.mliap.unified.lj.Ar -echo both`

The resultant thermo output should be identical to that generated
by in.melt.

The input first runs some python code that creates an ML-IAP unified model
that replicates the ``lj/cut`` pair style with parameters as defined in
examples/melt/in/melt and saves it in the file "mliap_unified_lj_Ar.pkl".

If this fails, see the instructions for building the ML-IAP package
with Python support enabled. Also, confirm that the LAMMPS Python
embedded Python interpreter is working by running ../examples/in.python
and that the LAMMPS python module is installed and working.

2: Running a Python script: mliap_unified_lj_Ar.py

Before testing this, ensure that the previous method
(running a LAMMPS executable) works.

You can run the example in serial:

`python mliap_unified_lj_Ar.py`

or in parallel:

`mpirun -np 4 python mliap_unified_lj_Ar.py`

The resultant log.lammps output should be identical to that generated
by in.melt and in.mliap.unified.lj.Ar.

in.mliap.so3.Ni_Mo
------------------

Example of linear model with SO3 descriptors for Ni/Mo

in.mliap.so3.nn.Si
------------------

Example of NN model with SO3 descriptors for Si