@@ -51,6 +51,34 @@ The labels provided in the `OUTCAR`, i.e. energies, forces and virials (if any),
51
51
52
52
The ` System ` or ` LabeledSystem ` can be constructed from the following file formats with the ` format key ` in the table passed to argument ` fmt ` :
53
53
54
+ | Software| format | multi frames | labeled | class | format key |
55
+ | ------- | :--- | :---: | :---: | :--- | :--- |
56
+ | vasp | poscar | False | False | System | 'vasp/poscar' |
57
+ | vasp | outcar | True | True | LabeledSystem | 'vasp/outcar' |
58
+ | vasp | xml | True | True | LabeledSystem | 'vasp/xml' |
59
+ | lammps | lmp | False | False | System | 'lammps/lmp' |
60
+ | lammps | dump | True | False | System | 'lammps/dump' |
61
+ | deepmd | raw | True | False | System | 'deepmd/raw' |
62
+ | deepmd | npy | True | False | System | 'deepmd/npy' |
63
+ | deepmd | raw | True | True | LabeledSystem | 'deepmd/raw' |
64
+ | deepmd | npy | True | True | LabeledSystem | 'deepmd/npy' |
65
+ | gaussian| log | False | True | LabeledSystem | 'gaussian/log'|
66
+ | gaussian| log | True | True | LabeledSystem | 'gaussian/md' |
67
+ | siesta | output | False | True | LabeledSystem | 'siesta/output'|
68
+ | siesta | aimd_output | True | True | LabeledSystem | 'siesta/aimd_output' |
69
+ | cp2k | output | False | True | LabeledSystem | 'cp2k/output' |
70
+ | cp2k | aimd_output | True | True | LabeledSystem | 'cp2k/aimd_output' |
71
+ | QE | log | False | True | LabeledSystem | 'qe/pw/scf' |
72
+ | QE | log | True | False | System | 'qe/cp/traj' |
73
+ | QE | log | True | True | LabeledSystem | 'qe/cp/traj' |
74
+ | quip/gap| xyz| True| True| MultiSystems| 'quip/gap/xyz'|
75
+ | PWmat | atom.config | False | False | System | 'pwmat/atom.config' |
76
+ | PWmat | movement | True | True | LabeledSystem | 'pwmat/movement' |
77
+ | PWmat | OUT.MLMD | True | True | LabeledSystem | 'pwmat/out.mlmd' |
78
+ | Amber | multi | True | True | LabeledSystem | 'amber/md' |
79
+ | Gromacs | gro | False | False | System | 'gromacs/gro' |
80
+
81
+
54
82
The Class ` dpdata.MultiSystems ` can read data from a dir which may contains many files of different systems, or from single xyz file which contains different systems.
55
83
56
84
Use ` dpdata.MultiSystems.from_dir ` to read from a directory, ` dpdata.MultiSystems ` will walk in the directory
@@ -82,35 +110,8 @@ xyz_multi_systems.systems['B1C9'].to_deepmd_raw('./my_work_dir/B1C9_raw')
82
110
83
111
# dump all systems
84
112
xyz_multi_systems.to_deepmd_raw(' ./my_deepmd_data/' )
85
-
86
-
87
113
```
88
114
89
- | Software| format | multi frames | labeled | class | format key |
90
- | ------- | :--- | :---: | :---: | :--- | :--- |
91
- | vasp | poscar | False | False | System | 'vasp/poscar' |
92
- | vasp | outcar | True | True | LabeledSystem | 'vasp/outcar' |
93
- | vasp | xml | True | True | LabeledSystem | 'vasp/xml' |
94
- | lammps | lmp | False | False | System | 'lammps/lmp' |
95
- | lammps | dump | True | False | System | 'lammps/dump' |
96
- | deepmd | raw | True | False | System | 'deepmd/raw' |
97
- | deepmd | npy | True | False | System | 'deepmd/npy' |
98
- | deepmd | raw | True | True | LabeledSystem | 'deepmd/raw' |
99
- | deepmd | npy | True | True | LabeledSystem | 'deepmd/npy' |
100
- | gaussian| log | False | True | LabeledSystem | 'gaussian/log'|
101
- | gaussian| log | True | True | LabeledSystem | 'gaussian/md' |
102
- | siesta | output | False | True | LabeledSystem | 'siesta/output'|
103
- | siesta | aimd_output | True | True | LabeledSystem | 'siesta/aimd_output' |
104
- | cp2k | output | False | True | LabeledSystem | 'cp2k/output' |
105
- | cp2k | aimd_output | True | True | LabeledSystem | 'cp2k/aimd_output' |
106
- | QE | log | False | True | LabeledSystem | 'qe/pw/scf' |
107
- | QE | log | True | False | System | 'qe/cp/traj' |
108
- | QE | log | True | True | LabeledSystem | 'qe/cp/traj' |
109
- | quip/gap| xyz| True| True| MultiSystems| 'quip/gap/xyz'|
110
- | PWmat | atom.config | False | False | System | 'pwmat/atom.config' |
111
- | PWmat | movement | True | True | LabeledSystem | 'pwmat/movement' |
112
- | PWmat | OUT.MLMD | True | True | LabeledSystem | 'pwmat/out.mlmd' |
113
- | Amber | multi | True | True | LabeledSystem | 'amber/md' |
114
115
## Access data
115
116
These properties stored in ` System ` and ` LabeledSystem ` can be accessed by operator ` [] ` with the key of the property supplied, for example
116
117
``` python
@@ -130,7 +131,6 @@ Available properties are (nframe: number of frames in the system, natoms: total
130
131
| 'virials' | np.ndarray | nframes x 3 x 3 | True | The virial tensor of each frame
131
132
132
133
133
-
134
134
## Dump data
135
135
The data stored in ` System ` or ` LabeledSystem ` can be dumped in 'lammps/lmp' or 'vasp/poscar' format, for example:
136
136
``` python
@@ -142,7 +142,6 @@ d_outcar.to('vasp/poscar', 'POSCAR', frame_idx=-1)
142
142
```
143
143
The last frames of ` d_outcar ` will be dumped to 'POSCAR'.
144
144
145
-
146
145
The data stored in ` LabeledSystem ` can be dumped to deepmd-kit raw format, for example
147
146
``` python
148
147
d_outcar.to(' deepmd/raw' , ' dpmd_raw' )
@@ -157,13 +156,15 @@ dpdata.LabeledSystem('OUTCAR').sub_system([0,-1]).to('deepmd/raw', 'dpmd_raw')
157
156
```
158
157
by which only the first and last frames are dumped to ` dpmd_raw ` .
159
158
159
+
160
160
## replicate
161
161
dpdata will create a super cell of the current atom configuration.
162
162
``` python
163
163
dpdata.System(' ./POSCAR' ).replicate((1 ,2 ,3 ,) )
164
164
```
165
165
tuple(1,2,3) means don't copy atom configuration in x direction, make 2 copys in y direction, make 3 copys in z direction.
166
166
167
+
167
168
## perturb
168
169
By the following example, each frame of the original system (` dpdata.System('./POSCAR') ` ) is perturbed to generate three new frames. For each frame, the cell is perturbed by 5% and the atom positions are perturbed by 0.6 Angstrom. ` atom_pert_style ` indicates that the perturbation to the atom positions is subject to normal distribution. Other available options to ` atom_pert_style ` are` uniform ` (uniform in a ball), and ` const ` (uniform on a sphere).
169
170
``` python
0 commit comments