-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add init-reaction docs and args (#758)
* add init-reaction docs and args The commit includes: - add docs - add detailed arguments - add strict argument checking - strict check the init-reaction example * init-reaction -> init_reaction * fix links * add the example to doc * add Geom=PrintInputOrient to keywords
- Loading branch information
Showing
8 changed files
with
132 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
dpgen init_reaction parameters | ||
====================================== | ||
|
||
.. dargs:: | ||
:module: dpgen.data.arginfo | ||
:func: init_reaction_jdata_arginfo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# init_reaction | ||
|
||
`dpgen init_reaction` is a workflow to initilize data for reactive systems of small gas-phase molecules. The workflow was introduced in the "Initialization" section of [Energy & Fuels, 2021, 35 (1), 762–769](https://10.1021/acs.energyfuels.0c03211). | ||
|
||
To start the workflow, one needs a box containing reactive systems. The following packages are required for each of the step: | ||
- Exploring: [LAMMPS](https://github.com/lammps/lammps) | ||
- Sampling: [MDDatasetBuilder](https://github.com/tongzhugroup/mddatasetbuilder) | ||
- Labeling: [Gaussian](https://gaussian.com/) | ||
|
||
The Exploring step uses LAMMPS [pair_style reaxff](https://docs.lammps.org/latest/pair_reaxff.html) to run a short ReaxMD NVT MD simulation. In the Sampling step, molecular clusters are taken and k-means clustering algorithm is applied to remove the redundancy, which is described in [Nature Communications, 11, 5713 (2020)](https://doi.org/10.1038/s41467-020-19497-z). The Labeling step calculates energies and forces using the Gaussian package. | ||
|
||
An example of `reaction.json` is given below: | ||
|
||
```{literalinclude} ../../examples/init/reaction.json | ||
:language: json | ||
:linenos: | ||
``` | ||
|
||
For detailed parameters, see [parametes](init-reaction-jdata.rst) and [machine parameters](init-reaction-mdata.rst). | ||
|
||
The genereated data can be used to continue DP-GEN concurrent learning workflow. Read [Energy & Fuels, 2021, 35 (1), 762–769](https://10.1021/acs.energyfuels.0c03211) for details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""This module ensures input in the examples directory | ||
could pass the argument checking. | ||
""" | ||
import unittest | ||
import json | ||
from pathlib import Path | ||
|
||
from dpgen.util import normalize | ||
from dpgen.data.arginfo import ( | ||
init_reaction_jdata_arginfo, | ||
) | ||
|
||
init_reaction_jdata = init_reaction_jdata_arginfo() | ||
|
||
# directory of examples | ||
p_examples = Path(__file__).parent.parent / "examples" | ||
|
||
# input_files : tuple[tuple[Argument, Path]] | ||
# tuple of example list | ||
input_files = ( | ||
(init_reaction_jdata, p_examples / "init" / "reaction.json"), | ||
) | ||
|
||
|
||
class TestExamples(unittest.TestCase): | ||
def test_arguments(self): | ||
for arginfo, fn in input_files: | ||
fn = str(fn) | ||
with self.subTest(fn=fn): | ||
with open(fn) as f: | ||
data = json.load(f) | ||
normalize(arginfo, data) |