mdkits 1.0.0__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of mdkits might be problematic. Click here for more details.

Files changed (49) hide show
  1. mdkits-1.0.2/PKG-INFO +365 -0
  2. mdkits-1.0.2/README.md +338 -0
  3. {mdkits-1.0.0 → mdkits-1.0.2}/pyproject.toml +1 -1
  4. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/cli/extract.py +1 -1
  5. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/cp2k_input_parsing.py +5 -1
  6. mdkits-1.0.0/PKG-INFO +0 -333
  7. mdkits-1.0.0/README.md +0 -306
  8. {mdkits-1.0.0 → mdkits-1.0.2}/LICENSE +0 -0
  9. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/__init__.py +0 -0
  10. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/__init__.py +0 -0
  11. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/adsorbate.py +0 -0
  12. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/build_bulk.py +0 -0
  13. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/build_cli.py +0 -0
  14. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/build_interface.py +0 -0
  15. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/build_solution.py +0 -0
  16. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/build_surface.py +0 -0
  17. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/cut_surface.py +0 -0
  18. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/supercell.py +0 -0
  19. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/build_cli/water.xyz +0 -0
  20. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/cli/convert.py +0 -0
  21. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/cli/data.py +0 -0
  22. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/cli/plot.py +0 -0
  23. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/config/__init__.py +0 -0
  24. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/config/settings.yml +0 -0
  25. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/dft_cli/cube.py +0 -0
  26. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/dft_cli/dft_cli.py +0 -0
  27. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/dft_cli/pdos.py +0 -0
  28. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/angle.py +0 -0
  29. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/density.py +0 -0
  30. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/dipole.py +0 -0
  31. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/hb_distribution.py +0 -0
  32. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/md_cli.py +0 -0
  33. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/monitor.py +0 -0
  34. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/msd.py +0 -0
  35. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/rdf.py +0 -0
  36. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/setting.py +0 -0
  37. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/vac.py +0 -0
  38. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/md_cli/wrap.py +0 -0
  39. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/mdkits.py +0 -0
  40. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/.fig_operation.py.swp +0 -0
  41. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/__init__.py +0 -0
  42. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/arg_type.py +0 -0
  43. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/encapsulated_ase.py +0 -0
  44. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/encapsulated_mda.py +0 -0
  45. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/fig_operation.py +0 -0
  46. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/numpy_geo.py +0 -0
  47. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/os_operation.py +0 -0
  48. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/out_err.py +0 -0
  49. {mdkits-1.0.0 → mdkits-1.0.2}/src/mdkits/util/structure_parsing.py +0 -0
mdkits-1.0.2/PKG-INFO ADDED
@@ -0,0 +1,365 @@
1
+ Metadata-Version: 2.3
2
+ Name: mdkits
3
+ Version: 1.0.2
4
+ Summary: kits for md or dft
5
+ License: MIT
6
+ Keywords: molecular dynamics,density functional theory
7
+ Author: jxxcr
8
+ Author-email: jixxcr@qq.com
9
+ Requires-Python: >=3.11,<4.0
10
+ Classifier: License :: OSI Approved :: MIT License
11
+ Classifier: Operating System :: OS Independent
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Requires-Dist: Cp2kData (>=0.7.2,<0.8.0)
17
+ Requires-Dist: MDAnalysis (>=2.8.0,<3.0.0)
18
+ Requires-Dist: ase (>=3.22.1,<4.0.0)
19
+ Requires-Dist: click (>=8.1.3,<9.0.0)
20
+ Requires-Dist: julia (>=0.6.2,<0.7.0)
21
+ Requires-Dist: matplotlib (>=3.9.0,<4.0.0)
22
+ Requires-Dist: numpy (>=1.26.4,<2.0.0)
23
+ Requires-Dist: pyyaml (>=6.0.1,<7.0.0)
24
+ Requires-Dist: tidynamics (>=1.1.2,<2.0.0)
25
+ Project-URL: Repository, https://github.com/jxxcr/mdkits
26
+ Description-Content-Type: text/markdown
27
+
28
+ # mdkits
29
+ [中文文档](README_zh.md)
30
+
31
+ `mdkits` provides a variety of tools. Installation script:
32
+ ```bash
33
+ pip install mdkits --upgrade
34
+ ```
35
+
36
+ ## General Option Parameter Types
37
+
38
+ 1. `CELL TYPE`: Specifies lattice cell parameters, e.g., `10,10,10`, `10,10,10,90,90,90`, etc.
39
+ 2. `FRAME RANGE`: Specifies the frame range, e.g., `1`, `1:10:2`, etc.
40
+ 3. `--group` and `--surface`: Select analysis objects using [selection language](https://userguide.mdanalysis.org/stable/selections.html).
41
+ 4. `--update_water`, `--distance`, and `--angle`: Enable dynamic update of water molecule positions during trajectory analysis.
42
+
43
+ ## Trajectory File Processing Scripts
44
+
45
+ `md` is the trajectory file processing tool, which includes several processing utilities.
46
+
47
+ ### Density Distribution
48
+
49
+ `density` is used to analyze the density distribution of a specific element along the z-axis in a system. For example, to analyze the density distribution of the `O` element along the z-axis:
50
+ ```bash
51
+ mdkits md density [FILENAME] --group="name H" --cell [FILENAME]
52
+ ```
53
+ This will output a file named `density_name_H.dat`, where the first column is the z-axis coordinate and the second column is the density distribution in units of mol/L. To output the density distribution in units of $g/cm^3$, you can specify the `--atomic_mass` option, for example:
54
+ ```bash
55
+ mdkits md density [FILENAME] --group="name H" --cell [FILENAME] --atomic_mass=1.00784
56
+ ```
57
+ This will output the density distribution in units of $g/cm^3$. You can specify surface atoms to normalize the density distribution to the surface, for example:
58
+ ```bash
59
+ mdkits md density [FILENAME] --group="name O" --cell 10,10,10 --atomic_mass=18.01528 --surface="name Pt and name Ru"
60
+ ```
61
+ This will normalize the density distribution to the surface and analyze the density distribution of water molecules using the positions of O atoms as the reference for water molecules. For systems with $OH^-$ ions, you can use the `--update_water` option to update the positions of water molecules in each frame, without needing to specify an element explicitly, for example:
62
+ ```bash
63
+ mdkits md density [FILENAME] --update_water --cell 10,10,10 --atomic_mass=18.01528 --surface="name Pt and name Ru"
64
+ ```
65
+ The output file will be named `density_water.dat`.
66
+
67
+ ### Hydrogen Bonds
68
+
69
+ `hb` is used to analyze hydrogen bonds in a system, for example, to analyze the distribution of hydrogen bonds along the z-axis:
70
+ ```bash
71
+ mdkits md hb [FILENAME] --cell 10,10,40 --surface "prop z < 10" --update_water
72
+ ```
73
+ Or to analyze hydrogen bonds of a single water molecule:
74
+ ```bash
75
+ mdkits md hb [FILENAME] --cell 10,10,40 --index 15
76
+ ```
77
+
78
+ ### Angle
79
+
80
+ `angle` is used to analyze the abundance distribution of the angle between the bisector vector of a water molecule's OH bond and the surface normal. For example, to analyze the angle abundance distribution of water molecules within 5 Å of the surface:
81
+ ```bash
82
+ mdkits md angle [FILENAME] --cell 10,10,40 --surface "name Pt" --water_height 5
83
+ ```
84
+
85
+ ### Dipole Distribution
86
+
87
+ `diople` is used to analyze the dipole ($\cos \phi \rho_{H_2 O}$) distribution in a system. For example, to analyze the $\cos \phi \rho_{H_2 O}$ distribution in the system:
88
+ ```bash
89
+ mdkits md diople [FILENAME] --cell 10,10,40 --surface "name Pt"
90
+ ```
91
+
92
+ ### Radial Distribution Function (RDF)
93
+
94
+ `rdf` is used to analyze the radial distribution function between two `group`s. For example, to analyze the radial distribution function between `O` and `H` elements in the system:
95
+ ```bash
96
+ mdkits md rdf [FILENAME] --group "name O" "name H" --cell 10,10,40 --range 0.1 5
97
+ ```
98
+
99
+ ### Mean Squared Displacement (MSD)
100
+
101
+ `msd` is used to analyze the mean squared displacement of certain atoms in a system. For example, to analyze the MSD of `Li` atoms along the z-axis:
102
+ ```bash
103
+ mdkits md msd [FILENAME] z "name Li"
104
+ ```
105
+
106
+ ### Monitor
107
+
108
+ `monitor` is used to monitor changes in atom height, bond length, and bond angle in a system. For example, to monitor the height of the atom with `index` 0:
109
+ ```bash
110
+ mdkits md monitor [FILENAME] --cell 10,10,40 --surface "name Pt" -i 0
111
+ ```
112
+ This will output the height from the surface as a function of each frame. To monitor the bond length between atoms 0 and 1:
113
+ ```bash
114
+ mdkits md monitor [FILENAME] --cell 10,10,40 --surface "name Pt" -i 0 -i 1
115
+ ```
116
+ This will output the heights from the surface for atoms 0 and 1, and the bond length between 0 and 1 as a function of each frame. To monitor the bond angle of 1-0-2:
117
+ ```bash
118
+ mdkits md monitor [FILENAME] --cell 10,10,40 --surface "name Pt" -i 1 -i 0 -i 2
119
+ ```
120
+ This will output the heights from the surface for atoms 1, 0, and 2, the bond lengths between 1-0 and 0-2, and the bond angle 1-0-2 as a function of each frame. Note that atoms at the vertex of an angle should be placed in the middle.
121
+
122
+ ### Position Normalization
123
+
124
+ `wrap` is used to normalize the atomic positions in a trajectory file. For example, to normalize the atomic positions in `[FILENAME]` within the unit cell and output it as `wrapped.xyz`. By default, it reads `ABC` and `ALPHA_BETA_GAMMA` information from the `cp2k` output file `input_inp` as lattice cell parameters:
125
+ ```bash
126
+ mdkits md wrap [FILENAME]
127
+ ```
128
+ Or specify the `cp2k` input file:
129
+ ```bash
130
+ mdkits md wrap [FILENAME] --cp2k_input_file setting.inp
131
+ ```
132
+ Or specify the lattice cell parameters:
133
+ ```bash
134
+ mdkits md wrap [FILENAME] --cell 10,10,10
135
+ ```
136
+ The default `[FILENAME]` is `*-pos-1.xyz`.
137
+
138
+ ### Vibrational Density of States (VDOS)
139
+
140
+ `vac` is used to analyze the velocity autocorrelation function of a trajectory and compute the Fourier transform of the velocity autocorrelation function, which is the vibrational density of states (VDOS). For example, to analyze the VDOS of the system:
141
+ ```bash
142
+ mdkits md vac h2o-vel-1.xyz
143
+ ```
144
+ The default `[FILENAME]` is `*-vel-1.xyz`.
145
+
146
+ ## DFT Property Analysis Scripts
147
+
148
+ `dft` is the DFT property analysis tool, which includes several analysis utilities.
149
+
150
+ ### PDOS
151
+
152
+ `pdos` is used to analyze the PDOS of a system. To analyze the d-orbital DOS of `[FILENAME]`:
153
+ ```bash
154
+ mdkits dft pdos [FILENAME] -t d
155
+ ```
156
+
157
+ ### CUBE Files
158
+
159
+ `cube` is used to process files in [`cube` format](https://paulbourke.net/dataformats/cube/), averaging them along the z-axis:
160
+ ```bash
161
+ mdkits dft cube [FILENAME]
162
+ ```
163
+ The processed data will be output to `cube.out`. You can also calculate the average value within a specific region:
164
+ ```bash
165
+ mdkits dft cube [FILENAME] -b 1 2
166
+ ```
167
+ This will print the average value to the screen and also record it in the comment line of `cube.out`.
168
+
169
+ ## Modeling
170
+
171
+ `build` is the modeling tool, which includes several modeling utilities.
172
+
173
+ ### Building Bulk Models
174
+
175
+ `bulk` is used to build bulk models. For example, to build an `fcc` bulk model of `Pt`:
176
+ ```bash
177
+ mdkits build bulk Pt fcc
178
+ ```
179
+ To build as a conventional cell model:
180
+ ```bash
181
+ mdkits build bulk Pt fcc --cubic
182
+ ```
183
+ To build a `Caesium chloride` structure model:
184
+ ```bash
185
+ mdkits build bulk CsCl cesiumchloride -a 4.123
186
+ ```
187
+ To build a `fluorite` structure model:
188
+ ```bash
189
+ mdkits build bulk BaF2 fluorite -a 6.196
190
+ ```
191
+
192
+ ### Building Surface Models
193
+
194
+ `surface` is used to build common surface models. Usage:
195
+ ```bash
196
+ mdkits build surface [ELEMENT] [SURFACE_TYPE] [SIZE]
197
+ ```
198
+ For example, to build an `fcc111` surface model of `Pt`:
199
+ ```bash
200
+ mdkits build surface Pt fcc111 2 2 3 --vacuum 15
201
+ ```
202
+ To build a graphene surface:
203
+ ```bash
204
+ mdkits build surface C2 graphene 3 3 1 --vacuum 15
205
+ ```
206
+
207
+ ### Building Surface Models from Existing Structures
208
+
209
+ `cut` is used to build surface models from existing structures (the structure must be in a conventional cell). For example, to build an `fcc331` surface model from `Pt_fcc.cif`:
210
+ ```bash
211
+ mdkits build cut Pt_fcc.cif --face 3 3 1 --size 3 3 5 --vacuum 15
212
+ ```
213
+
214
+ ### Adding Adsorbates to Surface Structures
215
+
216
+ `adsorbate` is used to add adsorbates to surface structures. For example, to add an `H` atom to `surface.cif`:
217
+ ```bash
218
+ mdkits build adsorbate surface.cif H --select "index 0" --height 1
219
+ ```
220
+ Or to add an `H` atom with a coverage of 5 to `Pt_fcc111_335.cif`:
221
+ ```bash
222
+ mdkits build adsorbate Pt_fcc111_335.cif H --select "prop z > 16" --height 2 --cover 5
223
+ ```
224
+
225
+ ### Building Solution Phase Models
226
+
227
+ `solution` is used to build solution phase models. When using for the first time, you should install `juliaup`:
228
+ ```bash
229
+ mdkits build solution --install_julia
230
+ ```
231
+ Then install `Packmol`:
232
+ ```bash
233
+ mdkits build solution --install_packmol
234
+ ```
235
+ After successful installation, you can use the `solution` functionality. For example, to build a water box with 32 water molecules:
236
+ ```bash
237
+ mdkits build solution --water_number 32 --cell 9.86,9.86,9.86
238
+ ```
239
+ Or to build a solution containing ions:
240
+ ```bash
241
+ mdkits build solution li.xyz k.xyz --water_number 64 --tolerance 2.5 -n 25 -n 45 --cell 15,15,15
242
+ ```
243
+ Here, the number of `-n` arguments must match the number of specified solvent molecule types, used to specify the number of solvents to add, respectively. Alternatively, build a solution phase model from `packmol` input files:
244
+ ```bash
245
+ mdkits build solution input.pm input2.pm --infile
246
+ ```
247
+
248
+ ### Building Interface Models
249
+
250
+ `interface` is used to build interface models. For example, to build an interface model without vacuum:
251
+ ```bash
252
+ mdkits build interface --slab Pt_fcc100_555.cif --sol water_160.cif
253
+ ```
254
+ Or to build an interface with a gas phase model:
255
+ ```bash
256
+ mdkits build interface --slab Pt_fcc100_555.cif --sol water_160.cif --cap ne --vacuum 20
257
+ ```
258
+
259
+ ### Building Supercell Models
260
+
261
+ `supercell` is used to build supercell models:
262
+ ```bash
263
+ mdkits build supercell Li3PO4.cif 2 2 2
264
+ ```
265
+
266
+ ## Others
267
+
268
+ ### Trajectory Extraction
269
+
270
+ `extract` is used to extract specific frames from a trajectory file. For example, to extract frames from the 1000th to the 2000th frame from `frames.xyz` and output them to `1000-2000.xyz`. The parameters for the `-r` option are consistent with Python's slicing syntax:
271
+ ```bash
272
+ mdkits extract frames.xyz -r 1000:2000 -o 1000-2000.xyz
273
+ ```
274
+ Or to extract the last frame from the default trajectory file `*-pos-1.xyz` generated by `cp2k` and output it as `frames_-1.xyz` (which is the default behavior of `extract`):
275
+ ```bash
276
+ mdkits extract
277
+ ```
278
+ Or to output a structure every 50 frames into the `./coord` directory, while adjusting the output format to `cp2k`'s `@INCLUDE coord.xyz` format:
279
+ ```bash
280
+ mdkits extract -cr ::50
281
+ ```
282
+ To extract the positions of specific elements, for example, to extract the positions of `O` and `H` elements:
283
+ ```bash
284
+ mdkits extract --select "name O or name H"
285
+ ```
286
+
287
+ ### Structure File Conversion
288
+
289
+ `convert` is used to convert structure files from one format to another. For example, to convert `structure.xyz` to `out.cif` (default filename is `out`). For files that do not store periodic boundary conditions, you can use the `--cell` option to specify `PBC`:
290
+ ```bash
291
+ mdkits convert -c structure.xyz --cell 10,10,10
292
+ ```
293
+ To convert `structure.cif` to `POSCAR`:
294
+ ```bash
295
+ mdkits convert -v structure.cif
296
+ ```
297
+ To convert `structure.cif` to `structure_xyz.xyz`:
298
+ ```bash
299
+ mdkits convert -c structure.cif -o structure_xyz
300
+ ```
301
+
302
+ ### Data Processing
303
+
304
+ `data` is used for data processing, such as:
305
+ 1. `--nor`: Normalizes the data.
306
+ 2. `--gaus`: Applies Gaussian filtering to the data.
307
+ 3. `--fold`: Folds and averages stacked data.
308
+ 4. `--err`: Calculates error bars for the data.
309
+ And so on.
310
+
311
+ ### Plotting Tool
312
+
313
+ `plot` is used for plotting data. `plot` requires reading a YAML format configuration file for plotting. The YAML file format is as follows:
314
+ ```yaml
315
+ # plot mode 1
316
+ figure1:
317
+ data:
318
+ legend1: ./data1.dat
319
+ legend2: ./data2.dat
320
+ x:
321
+ 0: x-axis
322
+ y:
323
+ 1: y-axis
324
+ x_range:
325
+ - 5
326
+ - 15
327
+
328
+ # plot mode 2
329
+ figure2:
330
+ data:
331
+ y-xais: ./data.dat
332
+ x:
333
+ 0: x-axis
334
+ y:
335
+ 1: legend1
336
+ 2: legend2
337
+ 3: legend3
338
+ 4: legend4
339
+ 5: legend5
340
+ y_range:
341
+ - 0.5
342
+ - 6
343
+ legend_fontsize: 12
344
+
345
+ # plot mode error
346
+ 12_dp_e_error:
347
+ data:
348
+ legend: ./error.dat
349
+ x:
350
+ 0: x-axis
351
+ y:
352
+ 1: y-axis
353
+ fold: dp
354
+ legend_fontsize: 12
355
+ ```
356
+ The above illustrates three plotting modes supported by `plot`: `mode 1`, `mode 2`, and `mode error`. `mode 1` is used for comparing the same column data from multiple data files, `mode 2` is used for comparing different column data from the same data file, and `mode error` is used for plotting mean squared error plots.
357
+
358
+ `plot` can process multiple YAML files simultaneously. Each YAML file can contain multiple plotting configurations. Plotting configurations for `mode 1` and `mode 2` can be automatically recognized, but the `error` mode requires explicit specification, for example:
359
+ ```bash
360
+ mdkits plot *.yaml
361
+ ```
362
+ and:
363
+ ```bash
364
+ mdkits plot *.yaml --error
365
+ ```
mdkits-1.0.2/README.md ADDED
@@ -0,0 +1,338 @@
1
+ # mdkits
2
+ [中文文档](README_zh.md)
3
+
4
+ `mdkits` provides a variety of tools. Installation script:
5
+ ```bash
6
+ pip install mdkits --upgrade
7
+ ```
8
+
9
+ ## General Option Parameter Types
10
+
11
+ 1. `CELL TYPE`: Specifies lattice cell parameters, e.g., `10,10,10`, `10,10,10,90,90,90`, etc.
12
+ 2. `FRAME RANGE`: Specifies the frame range, e.g., `1`, `1:10:2`, etc.
13
+ 3. `--group` and `--surface`: Select analysis objects using [selection language](https://userguide.mdanalysis.org/stable/selections.html).
14
+ 4. `--update_water`, `--distance`, and `--angle`: Enable dynamic update of water molecule positions during trajectory analysis.
15
+
16
+ ## Trajectory File Processing Scripts
17
+
18
+ `md` is the trajectory file processing tool, which includes several processing utilities.
19
+
20
+ ### Density Distribution
21
+
22
+ `density` is used to analyze the density distribution of a specific element along the z-axis in a system. For example, to analyze the density distribution of the `O` element along the z-axis:
23
+ ```bash
24
+ mdkits md density [FILENAME] --group="name H" --cell [FILENAME]
25
+ ```
26
+ This will output a file named `density_name_H.dat`, where the first column is the z-axis coordinate and the second column is the density distribution in units of mol/L. To output the density distribution in units of $g/cm^3$, you can specify the `--atomic_mass` option, for example:
27
+ ```bash
28
+ mdkits md density [FILENAME] --group="name H" --cell [FILENAME] --atomic_mass=1.00784
29
+ ```
30
+ This will output the density distribution in units of $g/cm^3$. You can specify surface atoms to normalize the density distribution to the surface, for example:
31
+ ```bash
32
+ mdkits md density [FILENAME] --group="name O" --cell 10,10,10 --atomic_mass=18.01528 --surface="name Pt and name Ru"
33
+ ```
34
+ This will normalize the density distribution to the surface and analyze the density distribution of water molecules using the positions of O atoms as the reference for water molecules. For systems with $OH^-$ ions, you can use the `--update_water` option to update the positions of water molecules in each frame, without needing to specify an element explicitly, for example:
35
+ ```bash
36
+ mdkits md density [FILENAME] --update_water --cell 10,10,10 --atomic_mass=18.01528 --surface="name Pt and name Ru"
37
+ ```
38
+ The output file will be named `density_water.dat`.
39
+
40
+ ### Hydrogen Bonds
41
+
42
+ `hb` is used to analyze hydrogen bonds in a system, for example, to analyze the distribution of hydrogen bonds along the z-axis:
43
+ ```bash
44
+ mdkits md hb [FILENAME] --cell 10,10,40 --surface "prop z < 10" --update_water
45
+ ```
46
+ Or to analyze hydrogen bonds of a single water molecule:
47
+ ```bash
48
+ mdkits md hb [FILENAME] --cell 10,10,40 --index 15
49
+ ```
50
+
51
+ ### Angle
52
+
53
+ `angle` is used to analyze the abundance distribution of the angle between the bisector vector of a water molecule's OH bond and the surface normal. For example, to analyze the angle abundance distribution of water molecules within 5 Å of the surface:
54
+ ```bash
55
+ mdkits md angle [FILENAME] --cell 10,10,40 --surface "name Pt" --water_height 5
56
+ ```
57
+
58
+ ### Dipole Distribution
59
+
60
+ `diople` is used to analyze the dipole ($\cos \phi \rho_{H_2 O}$) distribution in a system. For example, to analyze the $\cos \phi \rho_{H_2 O}$ distribution in the system:
61
+ ```bash
62
+ mdkits md diople [FILENAME] --cell 10,10,40 --surface "name Pt"
63
+ ```
64
+
65
+ ### Radial Distribution Function (RDF)
66
+
67
+ `rdf` is used to analyze the radial distribution function between two `group`s. For example, to analyze the radial distribution function between `O` and `H` elements in the system:
68
+ ```bash
69
+ mdkits md rdf [FILENAME] --group "name O" "name H" --cell 10,10,40 --range 0.1 5
70
+ ```
71
+
72
+ ### Mean Squared Displacement (MSD)
73
+
74
+ `msd` is used to analyze the mean squared displacement of certain atoms in a system. For example, to analyze the MSD of `Li` atoms along the z-axis:
75
+ ```bash
76
+ mdkits md msd [FILENAME] z "name Li"
77
+ ```
78
+
79
+ ### Monitor
80
+
81
+ `monitor` is used to monitor changes in atom height, bond length, and bond angle in a system. For example, to monitor the height of the atom with `index` 0:
82
+ ```bash
83
+ mdkits md monitor [FILENAME] --cell 10,10,40 --surface "name Pt" -i 0
84
+ ```
85
+ This will output the height from the surface as a function of each frame. To monitor the bond length between atoms 0 and 1:
86
+ ```bash
87
+ mdkits md monitor [FILENAME] --cell 10,10,40 --surface "name Pt" -i 0 -i 1
88
+ ```
89
+ This will output the heights from the surface for atoms 0 and 1, and the bond length between 0 and 1 as a function of each frame. To monitor the bond angle of 1-0-2:
90
+ ```bash
91
+ mdkits md monitor [FILENAME] --cell 10,10,40 --surface "name Pt" -i 1 -i 0 -i 2
92
+ ```
93
+ This will output the heights from the surface for atoms 1, 0, and 2, the bond lengths between 1-0 and 0-2, and the bond angle 1-0-2 as a function of each frame. Note that atoms at the vertex of an angle should be placed in the middle.
94
+
95
+ ### Position Normalization
96
+
97
+ `wrap` is used to normalize the atomic positions in a trajectory file. For example, to normalize the atomic positions in `[FILENAME]` within the unit cell and output it as `wrapped.xyz`. By default, it reads `ABC` and `ALPHA_BETA_GAMMA` information from the `cp2k` output file `input_inp` as lattice cell parameters:
98
+ ```bash
99
+ mdkits md wrap [FILENAME]
100
+ ```
101
+ Or specify the `cp2k` input file:
102
+ ```bash
103
+ mdkits md wrap [FILENAME] --cp2k_input_file setting.inp
104
+ ```
105
+ Or specify the lattice cell parameters:
106
+ ```bash
107
+ mdkits md wrap [FILENAME] --cell 10,10,10
108
+ ```
109
+ The default `[FILENAME]` is `*-pos-1.xyz`.
110
+
111
+ ### Vibrational Density of States (VDOS)
112
+
113
+ `vac` is used to analyze the velocity autocorrelation function of a trajectory and compute the Fourier transform of the velocity autocorrelation function, which is the vibrational density of states (VDOS). For example, to analyze the VDOS of the system:
114
+ ```bash
115
+ mdkits md vac h2o-vel-1.xyz
116
+ ```
117
+ The default `[FILENAME]` is `*-vel-1.xyz`.
118
+
119
+ ## DFT Property Analysis Scripts
120
+
121
+ `dft` is the DFT property analysis tool, which includes several analysis utilities.
122
+
123
+ ### PDOS
124
+
125
+ `pdos` is used to analyze the PDOS of a system. To analyze the d-orbital DOS of `[FILENAME]`:
126
+ ```bash
127
+ mdkits dft pdos [FILENAME] -t d
128
+ ```
129
+
130
+ ### CUBE Files
131
+
132
+ `cube` is used to process files in [`cube` format](https://paulbourke.net/dataformats/cube/), averaging them along the z-axis:
133
+ ```bash
134
+ mdkits dft cube [FILENAME]
135
+ ```
136
+ The processed data will be output to `cube.out`. You can also calculate the average value within a specific region:
137
+ ```bash
138
+ mdkits dft cube [FILENAME] -b 1 2
139
+ ```
140
+ This will print the average value to the screen and also record it in the comment line of `cube.out`.
141
+
142
+ ## Modeling
143
+
144
+ `build` is the modeling tool, which includes several modeling utilities.
145
+
146
+ ### Building Bulk Models
147
+
148
+ `bulk` is used to build bulk models. For example, to build an `fcc` bulk model of `Pt`:
149
+ ```bash
150
+ mdkits build bulk Pt fcc
151
+ ```
152
+ To build as a conventional cell model:
153
+ ```bash
154
+ mdkits build bulk Pt fcc --cubic
155
+ ```
156
+ To build a `Caesium chloride` structure model:
157
+ ```bash
158
+ mdkits build bulk CsCl cesiumchloride -a 4.123
159
+ ```
160
+ To build a `fluorite` structure model:
161
+ ```bash
162
+ mdkits build bulk BaF2 fluorite -a 6.196
163
+ ```
164
+
165
+ ### Building Surface Models
166
+
167
+ `surface` is used to build common surface models. Usage:
168
+ ```bash
169
+ mdkits build surface [ELEMENT] [SURFACE_TYPE] [SIZE]
170
+ ```
171
+ For example, to build an `fcc111` surface model of `Pt`:
172
+ ```bash
173
+ mdkits build surface Pt fcc111 2 2 3 --vacuum 15
174
+ ```
175
+ To build a graphene surface:
176
+ ```bash
177
+ mdkits build surface C2 graphene 3 3 1 --vacuum 15
178
+ ```
179
+
180
+ ### Building Surface Models from Existing Structures
181
+
182
+ `cut` is used to build surface models from existing structures (the structure must be in a conventional cell). For example, to build an `fcc331` surface model from `Pt_fcc.cif`:
183
+ ```bash
184
+ mdkits build cut Pt_fcc.cif --face 3 3 1 --size 3 3 5 --vacuum 15
185
+ ```
186
+
187
+ ### Adding Adsorbates to Surface Structures
188
+
189
+ `adsorbate` is used to add adsorbates to surface structures. For example, to add an `H` atom to `surface.cif`:
190
+ ```bash
191
+ mdkits build adsorbate surface.cif H --select "index 0" --height 1
192
+ ```
193
+ Or to add an `H` atom with a coverage of 5 to `Pt_fcc111_335.cif`:
194
+ ```bash
195
+ mdkits build adsorbate Pt_fcc111_335.cif H --select "prop z > 16" --height 2 --cover 5
196
+ ```
197
+
198
+ ### Building Solution Phase Models
199
+
200
+ `solution` is used to build solution phase models. When using for the first time, you should install `juliaup`:
201
+ ```bash
202
+ mdkits build solution --install_julia
203
+ ```
204
+ Then install `Packmol`:
205
+ ```bash
206
+ mdkits build solution --install_packmol
207
+ ```
208
+ After successful installation, you can use the `solution` functionality. For example, to build a water box with 32 water molecules:
209
+ ```bash
210
+ mdkits build solution --water_number 32 --cell 9.86,9.86,9.86
211
+ ```
212
+ Or to build a solution containing ions:
213
+ ```bash
214
+ mdkits build solution li.xyz k.xyz --water_number 64 --tolerance 2.5 -n 25 -n 45 --cell 15,15,15
215
+ ```
216
+ Here, the number of `-n` arguments must match the number of specified solvent molecule types, used to specify the number of solvents to add, respectively. Alternatively, build a solution phase model from `packmol` input files:
217
+ ```bash
218
+ mdkits build solution input.pm input2.pm --infile
219
+ ```
220
+
221
+ ### Building Interface Models
222
+
223
+ `interface` is used to build interface models. For example, to build an interface model without vacuum:
224
+ ```bash
225
+ mdkits build interface --slab Pt_fcc100_555.cif --sol water_160.cif
226
+ ```
227
+ Or to build an interface with a gas phase model:
228
+ ```bash
229
+ mdkits build interface --slab Pt_fcc100_555.cif --sol water_160.cif --cap ne --vacuum 20
230
+ ```
231
+
232
+ ### Building Supercell Models
233
+
234
+ `supercell` is used to build supercell models:
235
+ ```bash
236
+ mdkits build supercell Li3PO4.cif 2 2 2
237
+ ```
238
+
239
+ ## Others
240
+
241
+ ### Trajectory Extraction
242
+
243
+ `extract` is used to extract specific frames from a trajectory file. For example, to extract frames from the 1000th to the 2000th frame from `frames.xyz` and output them to `1000-2000.xyz`. The parameters for the `-r` option are consistent with Python's slicing syntax:
244
+ ```bash
245
+ mdkits extract frames.xyz -r 1000:2000 -o 1000-2000.xyz
246
+ ```
247
+ Or to extract the last frame from the default trajectory file `*-pos-1.xyz` generated by `cp2k` and output it as `frames_-1.xyz` (which is the default behavior of `extract`):
248
+ ```bash
249
+ mdkits extract
250
+ ```
251
+ Or to output a structure every 50 frames into the `./coord` directory, while adjusting the output format to `cp2k`'s `@INCLUDE coord.xyz` format:
252
+ ```bash
253
+ mdkits extract -cr ::50
254
+ ```
255
+ To extract the positions of specific elements, for example, to extract the positions of `O` and `H` elements:
256
+ ```bash
257
+ mdkits extract --select "name O or name H"
258
+ ```
259
+
260
+ ### Structure File Conversion
261
+
262
+ `convert` is used to convert structure files from one format to another. For example, to convert `structure.xyz` to `out.cif` (default filename is `out`). For files that do not store periodic boundary conditions, you can use the `--cell` option to specify `PBC`:
263
+ ```bash
264
+ mdkits convert -c structure.xyz --cell 10,10,10
265
+ ```
266
+ To convert `structure.cif` to `POSCAR`:
267
+ ```bash
268
+ mdkits convert -v structure.cif
269
+ ```
270
+ To convert `structure.cif` to `structure_xyz.xyz`:
271
+ ```bash
272
+ mdkits convert -c structure.cif -o structure_xyz
273
+ ```
274
+
275
+ ### Data Processing
276
+
277
+ `data` is used for data processing, such as:
278
+ 1. `--nor`: Normalizes the data.
279
+ 2. `--gaus`: Applies Gaussian filtering to the data.
280
+ 3. `--fold`: Folds and averages stacked data.
281
+ 4. `--err`: Calculates error bars for the data.
282
+ And so on.
283
+
284
+ ### Plotting Tool
285
+
286
+ `plot` is used for plotting data. `plot` requires reading a YAML format configuration file for plotting. The YAML file format is as follows:
287
+ ```yaml
288
+ # plot mode 1
289
+ figure1:
290
+ data:
291
+ legend1: ./data1.dat
292
+ legend2: ./data2.dat
293
+ x:
294
+ 0: x-axis
295
+ y:
296
+ 1: y-axis
297
+ x_range:
298
+ - 5
299
+ - 15
300
+
301
+ # plot mode 2
302
+ figure2:
303
+ data:
304
+ y-xais: ./data.dat
305
+ x:
306
+ 0: x-axis
307
+ y:
308
+ 1: legend1
309
+ 2: legend2
310
+ 3: legend3
311
+ 4: legend4
312
+ 5: legend5
313
+ y_range:
314
+ - 0.5
315
+ - 6
316
+ legend_fontsize: 12
317
+
318
+ # plot mode error
319
+ 12_dp_e_error:
320
+ data:
321
+ legend: ./error.dat
322
+ x:
323
+ 0: x-axis
324
+ y:
325
+ 1: y-axis
326
+ fold: dp
327
+ legend_fontsize: 12
328
+ ```
329
+ The above illustrates three plotting modes supported by `plot`: `mode 1`, `mode 2`, and `mode error`. `mode 1` is used for comparing the same column data from multiple data files, `mode 2` is used for comparing different column data from the same data file, and `mode error` is used for plotting mean squared error plots.
330
+
331
+ `plot` can process multiple YAML files simultaneously. Each YAML file can contain multiple plotting configurations. Plotting configurations for `mode 1` and `mode 2` can be automatically recognized, but the `error` mode requires explicit specification, for example:
332
+ ```bash
333
+ mdkits plot *.yaml
334
+ ```
335
+ and:
336
+ ```bash
337
+ mdkits plot *.yaml --error
338
+ ```