forked from deepmodeling/deepmd-kit
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from deepmodeling/devel
Devel update
- Loading branch information
Showing
76 changed files
with
4,336 additions
and
653 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
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,41 @@ | ||
# Data | ||
|
||
|
||
In this example we will convert the DFT labeled data stored in VASP `OUTCAR` format into the data format used by DeePMD-kit. The example `OUTCAR` can be found in the directory. | ||
```bash | ||
$deepmd_source_dir/examples/data_conv | ||
``` | ||
|
||
|
||
## Definition | ||
|
||
The DeePMD-kit organize data in **`systems`**. Each `system` is composed by a number of **`frames`**. One may roughly view a `frame` as a snap short on an MD trajectory, but it does not necessary come from an MD simulation. A `frame` records the coordinates and types of atoms, cell vectors if the periodic boundary condition is assumed, energy, atomic forces and virial. It is noted that the `frames` in one `system` share the same number of atoms with the same type. | ||
|
||
|
||
|
||
## Data conversion | ||
|
||
It is conveninent to use [dpdata](https://github.com/deepmodeling/dpdata) to convert data generated by DFT packages to the data format used by DeePMD-kit. | ||
|
||
To install one can execute | ||
```bash | ||
pip install dpdata | ||
``` | ||
|
||
An example of converting data [VASP](https://www.vasp.at/) data in `OUTCAR` format to DeePMD-kit data can be found at | ||
``` | ||
$deepmd_source_dir/examples/data_conv | ||
``` | ||
|
||
Switch to that directory, then one can convert data by using the following python script | ||
```python | ||
import dpdata | ||
dsys = dpdata.LabeledSystem('OUTCAR') | ||
dsys.to('deepmd/npy', 'deepmd_data', set_size = dsys.get_nframes()) | ||
``` | ||
|
||
`get_nframes()` method gets the number of frames in the `OUTCAR`, and the argument `set_size` enforces that the set size is equal to the number of frames in the system, viz. only one `set` is created in the `system`. | ||
|
||
The data in DeePMD-kit format is stored in the folder `deepmd_data`. | ||
|
||
A list of all [supported data format](https://github.com/deepmodeling/dpdata#load-data) and more nice features of `dpdata` can be found at the [official website](https://github.com/deepmodeling/dpdata). |
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,25 @@ | ||
# Train a Deep Potential model using descriptor `"hybrid"` | ||
|
||
This descriptor hybridize multiple descriptors to form a new descriptor. For example we have a list of descriptor denoted by D_1, D_2, ..., D_N, the hybrid descriptor this the concatenation of the list, i.e. D = (D_1, D_2, ..., D_N). | ||
|
||
To use the descriptor in DeePMD-kit, one firstly set the `type` to `"hybrid"`, then provide the definitions of the descriptors by the items in the `list`, | ||
```json= | ||
"descriptor" :{ | ||
"type": "hybrid", | ||
"list" : [ | ||
{ | ||
"type" : "se_e2_a", | ||
... | ||
}, | ||
{ | ||
"type" : "se_e2_r", | ||
... | ||
} | ||
] | ||
}, | ||
``` | ||
|
||
A complete training input script of this example can be found in the directory | ||
```bash | ||
$deepmd_source_dir/examples/water/hybrid/input.json | ||
``` |
Oops, something went wrong.