mdkits 0.1.2__tar.gz → 0.1.4__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.
- {mdkits-0.1.2 → mdkits-0.1.4}/PKG-INFO +24 -1
- {mdkits-0.1.2 → mdkits-0.1.4}/README.md +23 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/pyproject.toml +1 -1
- mdkits-0.1.4/src/mdkits/cli/build_bulk.py +35 -0
- mdkits-0.1.4/src/mdkits/cli/pdos.py +37 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/mdkits.py +4 -0
- mdkits-0.1.2/src/mdkits/cli/build_bulk.py +0 -55
- mdkits-0.1.2/src/mdkits/cli/pdos.py +0 -36
- {mdkits-0.1.2 → mdkits-0.1.4}/LICENSE +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/__init__.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/,hb_distribution_down.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/adsorbate.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/build_interface.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/build_surface.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/convert.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/cube.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/cut_surface.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/data.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/density.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/extract.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/hartree_potential.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/hartree_potential_ave.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/hb.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/hb_distribution.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/packmol_input.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/plot.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/supercell.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/cli/wrap.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/config/__init__.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/config/settings.yml +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/__init__.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/arg_type.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/cp2k_input_parsing.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/encapsulated_ase.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/encapsulated_mda.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/fig_operation.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/numpy_geo.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/os_operation.py +0 -0
- {mdkits-0.1.2 → mdkits-0.1.4}/src/mdkits/util/structure_parsing.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mdkits
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: tools for md or dft
|
|
5
5
|
License: MIT
|
|
6
6
|
Keywords: molecular dynamics,density functional theory
|
|
@@ -81,6 +81,10 @@ mdkits wrap [FILENAME] --cell 10,10,10
|
|
|
81
81
|
|
|
82
82
|
## DFT 性质分析脚本
|
|
83
83
|
### PDOS
|
|
84
|
+
`pdos`用于分析体系中的pdos, 分析[FILENAME]的d轨道的dos:
|
|
85
|
+
```bash
|
|
86
|
+
mdkits pdos [FILENAME] -t d
|
|
87
|
+
```
|
|
84
88
|
|
|
85
89
|
### CUBE 文件
|
|
86
90
|
`cube`用于处理[`cube`格式](https://paulbourke.net/dataformats/cube/)的文件, 将其在z轴上进行平均:
|
|
@@ -93,6 +97,25 @@ mdkits cube [FILENAME] -b 1 2
|
|
|
93
97
|
```
|
|
94
98
|
会将平均值打印在屏幕上, 同时记录在`cube.out`中的注释行.
|
|
95
99
|
|
|
100
|
+
## 建模
|
|
101
|
+
### 构建体相模型
|
|
102
|
+
`build_bulk`用于构建体相模型, 如构建`Pt`的`fcc`体相模型:
|
|
103
|
+
```bash
|
|
104
|
+
mdkits build_bulk Pt fcc
|
|
105
|
+
```
|
|
106
|
+
构建为常胞模型:
|
|
107
|
+
```bash
|
|
108
|
+
mdkits build_bulk Pt fcc --cubic
|
|
109
|
+
```
|
|
110
|
+
构建一个`Caesium chloride`结构的模型:
|
|
111
|
+
```bash
|
|
112
|
+
mdkits build_bulk CsCl cesiumchloride -a 4.123
|
|
113
|
+
```
|
|
114
|
+
构建一个`fluorite `结构的模型:
|
|
115
|
+
```bash
|
|
116
|
+
mdkits build_bulk BaF2 fluorite -a 6.196
|
|
117
|
+
```
|
|
118
|
+
|
|
96
119
|
## 其他
|
|
97
120
|
### 轨迹提取
|
|
98
121
|
`extract`用于提取轨迹文件中的特定的帧, 如从`frames.xyz`中提取第 1000 帧到第 2000 帧的轨迹文件, 并输出为`1000-2000.xyz`, `-r`选项的参数与`Python`的切片语法一致:
|
|
@@ -56,6 +56,10 @@ mdkits wrap [FILENAME] --cell 10,10,10
|
|
|
56
56
|
|
|
57
57
|
## DFT 性质分析脚本
|
|
58
58
|
### PDOS
|
|
59
|
+
`pdos`用于分析体系中的pdos, 分析[FILENAME]的d轨道的dos:
|
|
60
|
+
```bash
|
|
61
|
+
mdkits pdos [FILENAME] -t d
|
|
62
|
+
```
|
|
59
63
|
|
|
60
64
|
### CUBE 文件
|
|
61
65
|
`cube`用于处理[`cube`格式](https://paulbourke.net/dataformats/cube/)的文件, 将其在z轴上进行平均:
|
|
@@ -68,6 +72,25 @@ mdkits cube [FILENAME] -b 1 2
|
|
|
68
72
|
```
|
|
69
73
|
会将平均值打印在屏幕上, 同时记录在`cube.out`中的注释行.
|
|
70
74
|
|
|
75
|
+
## 建模
|
|
76
|
+
### 构建体相模型
|
|
77
|
+
`build_bulk`用于构建体相模型, 如构建`Pt`的`fcc`体相模型:
|
|
78
|
+
```bash
|
|
79
|
+
mdkits build_bulk Pt fcc
|
|
80
|
+
```
|
|
81
|
+
构建为常胞模型:
|
|
82
|
+
```bash
|
|
83
|
+
mdkits build_bulk Pt fcc --cubic
|
|
84
|
+
```
|
|
85
|
+
构建一个`Caesium chloride`结构的模型:
|
|
86
|
+
```bash
|
|
87
|
+
mdkits build_bulk CsCl cesiumchloride -a 4.123
|
|
88
|
+
```
|
|
89
|
+
构建一个`fluorite `结构的模型:
|
|
90
|
+
```bash
|
|
91
|
+
mdkits build_bulk BaF2 fluorite -a 6.196
|
|
92
|
+
```
|
|
93
|
+
|
|
71
94
|
## 其他
|
|
72
95
|
### 轨迹提取
|
|
73
96
|
`extract`用于提取轨迹文件中的特定的帧, 如从`frames.xyz`中提取第 1000 帧到第 2000 帧的轨迹文件, 并输出为`1000-2000.xyz`, `-r`选项的参数与`Python`的切片语法一致:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
import click
|
|
4
|
+
from ase.build import bulk
|
|
5
|
+
import numpy as np
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@click.command(name='build_bulk')
|
|
9
|
+
@click.argument('symbol', type=str)
|
|
10
|
+
@click.argument('cs', type=click.Choice(['sc', 'fcc', 'bcc', 'tetragonal', 'bct', 'hcp', 'rhombohedral', 'orthorhombic', 'mcl', 'diamond', 'zincblende', 'rocksalt', 'cesiumchloride', 'fluorite', 'wurtzite']))
|
|
11
|
+
@click.option('-a', type=float, help='designate lattice constant a')
|
|
12
|
+
@click.option('-b', type=float, help='designate lattice constant b. if only a and b is given, b will be interpreted as c instead')
|
|
13
|
+
@click.option('-c', type=float, help='designate lattice constant c')
|
|
14
|
+
@click.option('--alpha', type=float, help='angle in degrees for rhombohedral lattice')
|
|
15
|
+
@click.option('--covera', type=float, help='c/a ratio used for hcp. Default is ideal ratio: sqrt(8/3)', default=np.sqrt(8/3), show_default=True)
|
|
16
|
+
@click.option('-u', type=float, help='internal coordinate for Wurtzite structure')
|
|
17
|
+
@click.option('--orth', is_flag=True, help='construct orthorhombic unit cell instead of primitive cell which is the default')
|
|
18
|
+
@click.option('--cubic', is_flag=True, help='construct cubic unit cell if possible')
|
|
19
|
+
def main(symbol, cs, a, b, c, alpha, covera, u, orth, cubic):
|
|
20
|
+
"""
|
|
21
|
+
build a bulk structure
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
#if args.primitve:
|
|
25
|
+
# a = args.a * 0.7071 * 2
|
|
26
|
+
#else:
|
|
27
|
+
# a = args.a
|
|
28
|
+
atoms = bulk(symbol, cs, a=a, b=b, c=c, alpha=alpha, covera=covera, u=u, orthorhombic=orth, cubic=cubic)
|
|
29
|
+
|
|
30
|
+
atoms.write(f"{symbol}_{cs}.cif", format='cif')
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
if __name__ == '__main__':
|
|
34
|
+
main()
|
|
35
|
+
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
|
|
3
|
+
from cp2kdata import Cp2kPdos
|
|
4
|
+
import click
|
|
5
|
+
import numpy as np
|
|
6
|
+
from mdkits.util import os_operation
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# set argument
|
|
10
|
+
@click.command(name='pdos')
|
|
11
|
+
@click.argument('filename', type=list, default=os_operation.default_file_name('*-k*.pdos'))
|
|
12
|
+
@click.option('-t', '--type', type=str, default='total', show_default=True)
|
|
13
|
+
@click.option('-c', '--clos', type=tuple)
|
|
14
|
+
def main(filename, type, clos):
|
|
15
|
+
if type == 'total':
|
|
16
|
+
dos_obj = Cp2kPdos(filename[0])
|
|
17
|
+
dos, ener = dos_obj.get_raw_dos(dos_type=type)
|
|
18
|
+
print(f"analysis of total dos is done")
|
|
19
|
+
np.savetxt('total.pdos', np.column_stack((ener, dos)), header='energy\tdos')
|
|
20
|
+
else:
|
|
21
|
+
if type:
|
|
22
|
+
for file in filename:
|
|
23
|
+
dos_obj = Cp2kPdos(file)
|
|
24
|
+
dos, ener = dos_obj.get_raw_dos(dos_type=type)
|
|
25
|
+
print(f"analysis of {file}'s {type} dos is done")
|
|
26
|
+
np.savetxt(f'{dos_obj.read_dos_element()}_{type}.pdos', np.column_stack((ener, dos)), header='energy\tdos')
|
|
27
|
+
|
|
28
|
+
if clos:
|
|
29
|
+
for file in filename:
|
|
30
|
+
dos_obj = Cp2kPdos(file)
|
|
31
|
+
dos, ener = dos_obj.get_raw_dos(usecols=clos)
|
|
32
|
+
print(f"analysis of {file}'s {type} dos is done")
|
|
33
|
+
np.savetxt(f'{dos_obj.read_dos_element()}_{"_".join(clos)}.pdos', np.column_stack((ener, dos)), header='energy\tdos')
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if __name__ == '__main__':
|
|
37
|
+
main()
|
|
@@ -7,6 +7,8 @@ from mdkits.cli import (
|
|
|
7
7
|
plot,
|
|
8
8
|
density,
|
|
9
9
|
cube,
|
|
10
|
+
pdos,
|
|
11
|
+
build_bulk,
|
|
10
12
|
)
|
|
11
13
|
|
|
12
14
|
|
|
@@ -25,6 +27,8 @@ cli.add_command(data.main)
|
|
|
25
27
|
cli.add_command(plot.main)
|
|
26
28
|
cli.add_command(density.main)
|
|
27
29
|
cli.add_command(cube.main)
|
|
30
|
+
cli.add_command(pdos.main)
|
|
31
|
+
cli.add_command(build_bulk.main)
|
|
28
32
|
|
|
29
33
|
|
|
30
34
|
if __name__ == '__main__':
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3
|
|
2
|
-
|
|
3
|
-
import argparse
|
|
4
|
-
from ase.build import bulk
|
|
5
|
-
from ase.geometry import cell_to_cellpar
|
|
6
|
-
from ase.io import write
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
def parse_size(s):
|
|
10
|
-
return [int(x) for x in s.replace(',', ' ').split()]
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
def parse_argument():
|
|
14
|
-
parser = argparse.ArgumentParser(description='build a surface structure of matel')
|
|
15
|
-
parser.add_argument('symbol', type=str, help='designate the symbol of matel')
|
|
16
|
-
parser.add_argument('--crystal', type=str, help='designate the crystal of structure')
|
|
17
|
-
parser.add_argument('--orth', help='outpue orthorhombic crystal', action='store_true')
|
|
18
|
-
parser.add_argument('-a', type=float, help='designate a lattice constant')
|
|
19
|
-
parser.add_argument('--primitve', help='designate a lattice constant of real', action='store_true')
|
|
20
|
-
parser.add_argument('-o', type=str, help='output structure name', default='bulk.xyz')
|
|
21
|
-
parser.add_argument('-c', help='output coord.xyz and cell.inc', action='store_true')
|
|
22
|
-
parser.add_argument('-k', help='output kpoint.inc', action='store_true')
|
|
23
|
-
|
|
24
|
-
return parser.parse_args()
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def main():
|
|
28
|
-
args = parse_argument()
|
|
29
|
-
if args.primitve:
|
|
30
|
-
a = args.a * 0.7071 * 2
|
|
31
|
-
else:
|
|
32
|
-
a = args.a
|
|
33
|
-
atoms = bulk(args.symbol, args.crystal, a=a, orthorhombic=args.orth)
|
|
34
|
-
if args.c:
|
|
35
|
-
atoms.write('coord.xyz', format='xyz')
|
|
36
|
-
with open('coord.xyz', 'r') as f:
|
|
37
|
-
lines = f.readlines()[2:]
|
|
38
|
-
with open('coord.xyz', 'w') as f:
|
|
39
|
-
f.writelines(lines)
|
|
40
|
-
with open('cell.inc', 'w') as f:
|
|
41
|
-
cell = list(cell_to_cellpar(atoms.cell))
|
|
42
|
-
f.write('ABC [angstrom] ' + str(cell[0]) + ' ' + str(cell[1]) + ' ' + str(cell[2]) + ' ' + '\n')
|
|
43
|
-
f.write('ALPHA_BETA_GAMMA ' + str(cell[3]) + ' ' + str(cell[4]) + ' ' + str(cell[5]) + '\n')
|
|
44
|
-
if args.k:
|
|
45
|
-
with open('kpoint.inc', 'w') as f:
|
|
46
|
-
if True:
|
|
47
|
-
if True:
|
|
48
|
-
f.write(f"SCHEME MONKHORST-PACK {int(round(30/cell[0]))} {int(round(30/cell[1]))} {int(round(30/cell[2]))}" + "\n")
|
|
49
|
-
else:
|
|
50
|
-
atoms.write(args.o)
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
if __name__ == '__main__':
|
|
54
|
-
main()
|
|
55
|
-
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env python3.9
|
|
2
|
-
|
|
3
|
-
# caculate pdos
|
|
4
|
-
|
|
5
|
-
from cp2kdata import Cp2kPdos
|
|
6
|
-
import argparse
|
|
7
|
-
import numpy as np
|
|
8
|
-
from util import os_operation
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
def to_file(filename, ener, dos):
|
|
12
|
-
to_file = np.column_stack((ener, dos))
|
|
13
|
-
np.savetxt(filename, to_file, delimiter=" ")
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
# set argument
|
|
17
|
-
parser = argparse.ArgumentParser(description='calculate pdos')
|
|
18
|
-
parser.add_argument('filename', type=str, nargs='?', default=os_operation.default_file_name('*-k*.pdos'))
|
|
19
|
-
parser.add_argument('--type', type=str, default='total')
|
|
20
|
-
args = parser.parse_args()
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# pdos
|
|
24
|
-
#dos_types = ['0']
|
|
25
|
-
#for dos_type in dos_types:
|
|
26
|
-
# for atom_type in range(1, args.type_number+1):
|
|
27
|
-
# dos_obj = Cp2kPdos(f'{args.project_name}-k{atom_type}-1_{args.run_step}.pdos')
|
|
28
|
-
# dos, ener = dos_obj.get_raw_dos()
|
|
29
|
-
# to_file(f"{dos_obj.read_dos_element()}_{dos_type}.pdos", ener, dos)
|
|
30
|
-
|
|
31
|
-
# total dos
|
|
32
|
-
print(args.filename)
|
|
33
|
-
for file in args.filename:
|
|
34
|
-
dos_obj = Cp2kPdos(file)
|
|
35
|
-
dos, ener = dos_obj.get_raw_dos(dos_type=args.type)
|
|
36
|
-
to_file(f'{dos_obj.read_dos_element()}_{args.type}.pdos', ener, dos)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|