Skip to content

Commit f108922

Browse files
committed
add doc for md without output
1 parent 2f73303 commit f108922

1 file changed

Lines changed: 23 additions & 4 deletions

File tree

docs/dpdata_plugin.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
# CP2KData Plugin for dpdata
1+
# CP2KData plugin for dpdata
22

33
`CP2KData` supports a plugin for `dpdata`. When you install `CP2KData` using `pip`, the plugin for `dpdata` is automatically installed as well.
44

55
For instructions on how to use `dpdata`, please refer to the official repository: https://github.com/deepmodeling/dpdata.
66

77
In the following, we provide two exmples that demonstrate how to use `Cp2kData` with `dpdata` to parse data from CP2K simulations in specified formats.
88

9+
## Parse Energy_Force
910
Currently, `CP2KData` supports two formats for use with `dpdata`:
1011

1112
1. `cp2kdata/e_f` format for parsing `ENERGY_FORCE` outputs.
@@ -70,7 +71,9 @@ Currently, `CP2KData` supports two formats for use with `dpdata`:
7071

7172
```
7273

73-
2. `cp2kdata/md` format for parsing `MD` outputs.
74+
## Parse MD
75+
### MD including CP2K output/log files
76+
`cp2kdata/md` format for parsing `MD` outputs.
7477

7578
Example for parsing `MD` outputs:
7679
```python
@@ -87,7 +90,7 @@ Currently, `CP2KData` supports two formats for use with `dpdata`:
8790
@SET frequency 100
8891
&FORCE_EVAL
8992
# if stress tensor is not need to computed, comment out the below line.
90-
STRESS_TENSOR ANALYTICAL
93+
STRESS_TENSOR ANALYTICAL
9194
&PRINT
9295
# if stress tensor is not need to computed, comment out the below line
9396
&STRESS_TENSOR ON
@@ -131,8 +134,24 @@ Currently, `CP2KData` supports two formats for use with `dpdata`:
131134
&END MOTION
132135
```
133136

137+
### MD without CP2K output/log files
138+
In some cases, users only keep `*-pos-*.xyz` and `*-frc-*.xyz` files. To convert the CP2K files into dpdata, users must explicitly tells dpdata the cell and ensemble information.
139+
140+
```python
141+
import dpdata
142+
import numpy as np
143+
144+
cp2kmd_dir = "./test/"
145+
cp2kmd_output_name = None
146+
147+
cells = np.array([[8.66,0,0],
148+
[0,8.66,0],
149+
[0,0,22.83]])
150+
dp = dpdata.LabeledSystem(cp2kmd_dir, cp2k_output_name=cp2kmd_output_name, cells=cells, ensemble_type="NVT", fmt="cp2kdata/md")
151+
```
134152

135-
In some cases, cp2k md simulations are restarted from `-1.restart` file in which the initial structure will not be evaluated again.
153+
### MD missing restart information in header
154+
In some cases, CP2K md simulations are restarted from `-1.restart` file in which the initial structure will not be evaluated again.
136155
Therefore, the initial cell information should not be parsed again. Otherwise, the number of frames for cells is inconsistent with those for `poses`, `forces`, and `energies`.
137156
Cp2kdata can automatically check whether the simulations are restarted or not through the header information of output:
138157
```

0 commit comments

Comments
 (0)