surface-construct 0.9__tar.gz → 0.9.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.
- {surface_construct-0.9/surface_construct.egg-info → surface_construct-0.9.2}/PKG-INFO +16 -131
- {surface_construct-0.9 → surface_construct-0.9.2}/README.md +15 -130
- {surface_construct-0.9 → surface_construct-0.9.2}/setup.py +3 -3
- surface_construct-0.9.2/surface_construct/structures/__init__.py +54 -0
- surface_construct-0.9.2/surface_construct/structures/adsorbate.py +41 -0
- surface_construct-0.9.2/surface_construct/structures/surface.py +738 -0
- surface_construct-0.9.2/surface_construct/structures/surface_grid.py +1131 -0
- surface_construct-0.9.2/surface_construct/tasks/__init__.py +14 -0
- surface_construct-0.9.2/surface_construct/tasks/sitesampling.py +191 -0
- surface_construct-0.9.2/surface_construct/tasks/taskbase.py +43 -0
- surface_construct-0.9.2/surface_construct/tasks/terminations.py +0 -0
- surface_construct-0.9.2/surface_construct/utils/__init__.py +196 -0
- surface_construct-0.9.2/surface_construct/utils/atoms.py +567 -0
- surface_construct-0.9.2/surface_construct/utils/weight_functions.py +65 -0
- {surface_construct-0.9 → surface_construct-0.9.2/surface_construct.egg-info}/PKG-INFO +16 -131
- surface_construct-0.9.2/surface_construct.egg-info/SOURCES.txt +27 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/tests/test_surface_grid.py +6 -0
- surface_construct-0.9/surface_construct.egg-info/SOURCES.txt +0 -16
- {surface_construct-0.9 → surface_construct-0.9.2}/LICENSE +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/setup.cfg +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct/__init__.py +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct/db.py +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct/default_parameter.py +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct/sg_sampler.py +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct.egg-info/dependency_links.txt +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct.egg-info/requires.txt +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/surface_construct.egg-info/top_level.txt +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/tests/test_sampling1.py +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/tests/test_sampling2.py +0 -0
- {surface_construct-0.9 → surface_construct-0.9.2}/tests/test_task.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: surface_construct
|
|
3
|
-
Version: 0.9
|
|
3
|
+
Version: 0.9.2
|
|
4
4
|
Summary: Surface termination construction especially for complex model, such as oxides or carbides.
|
|
5
5
|
Home-page: https://gitee.com/pjren/surface_construct/
|
|
6
6
|
Author: ren
|
|
@@ -28,13 +28,15 @@ Dynamic: license-file
|
|
|
28
28
|
Dynamic: requires-dist
|
|
29
29
|
Dynamic: summary
|
|
30
30
|
|
|
31
|
-
#
|
|
31
|
+
# 催化剂表面位点和反应分子构象综合采样
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
催化剂构效关系是建立表面位点结构和反应过程势能面的关联关系,这依赖对表面上各种可能位点的充分分析和采样,找到这些位点对关键反应步骤的影响情况。从催化剂的角度看,研究的目标是从表面上存在的位点中找到表面最适合反应的位点,即使反应势能面最低的位点;从反应的角度看,研究目标是对于一系列反应通道,找到反应势能面上的卡点,找到能够突破卡点的催化环境。
|
|
34
34
|
|
|
35
|
+
本软件同时进行表面位点的构建、采样、计算、分析,和反应过程的分析采样,即过渡态和分子构象,由此可以实现分子在表面反应的全过程采样。其中的技术关键是采样的效率,我们针对性地使用综合使用了多样化的采样策略,保证表面各类型位点和关键位点的充分采样。
|
|
35
36
|
|
|
36
37
|
|
|
37
|
-
|
|
38
|
+
|
|
39
|
+
<img src="docs/birds_view.png" alt="表面位点全局分析" style="zoom:50%;" />
|
|
38
40
|
|
|
39
41
|
|
|
40
42
|
|
|
@@ -42,7 +44,7 @@ A Method with Stratified Sampling Strategy for Comprehensive Analysis of Catalys
|
|
|
42
44
|
|
|
43
45
|
|
|
44
46
|
|
|
45
|
-

|
|
46
48
|
|
|
47
49
|
## 重要的概念 Glossary
|
|
48
50
|
|
|
@@ -60,143 +62,23 @@ A Method with Stratified Sampling Strategy for Comprehensive Analysis of Catalys
|
|
|
60
62
|
|
|
61
63
|
* 当前我们使用多点定位 Multilateration 进行向量化
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
<img src="docs/multilateration.jpg" alt="multilateration" style="zoom:50%;" />
|
|
64
66
|
|
|
65
67
|
* 分层采样 Stratified sampling。根据“相似结构具有相似性质”的原理采样分层采样的策略对表面位点进行采样,降低计算量。
|
|
66
68
|
|
|
67
69
|

|
|
68
70
|
|
|
69
|
-
*
|
|
71
|
+
* 表面分子结构采样。表面的分子自由度分解为表面位点+分子姿态+分子內自由度。针对它们采用不同的采样策略。
|
|
70
72
|
|
|
71
|
-
|
|
73
|
+
<img src="docs/adsorption_structure.jpg" alt="adsorption structure" style="zoom:50%;" />
|
|
72
74
|
|
|
73
|
-
## 安装
|
|
75
|
+
## 安装 Installation
|
|
74
76
|
|
|
75
77
|
`pip install -U surface-construct`
|
|
76
78
|
|
|
77
|
-
##
|
|
78
|
-
|
|
79
|
-
python -m build
|
|
80
|
-
twine upload --verbose dist/*
|
|
81
|
-
|
|
82
|
-
## 使用方法 Manual
|
|
83
|
-
|
|
84
|
-
### 所需文件 Required Files
|
|
85
|
-
|
|
86
|
-
* `surface_reaction_sample.py`: 主流程文件
|
|
87
|
-
|
|
88
|
-
* `parameter.py`: 参数定义文件
|
|
89
|
-
|
|
90
|
-
* `POSCAR.0`: 表面结构文件
|
|
91
|
-
|
|
92
|
-
* 注意:名字可以修改,与 `parameter.py` 设置一致
|
|
93
|
-
* 设置需要固定的原子
|
|
94
|
-
|
|
95
|
-
* bsub 文件。在公司集群上提交,以下面的为例
|
|
96
|
-
|
|
97
|
-
```Bash
|
|
98
|
-
#/bin/bash
|
|
99
|
-
#BSUB -J Sampling
|
|
100
|
-
#BSUB -q short
|
|
101
|
-
#BSUB -n 28
|
|
102
|
-
#BSUB -o out.%J.txt
|
|
103
|
-
#BSUB -e error.%J.txt
|
|
104
|
-
#BSUB -R span[ptile=28]
|
|
105
|
-
module load old/intel18u4
|
|
106
|
-
export OMP_NUM_THREADS=1
|
|
107
|
-
export I_MPI_ADJUST_REDUCE=3
|
|
108
|
-
workdir=`pwd`
|
|
109
|
-
date
|
|
110
|
-
|
|
111
|
-
export PATH="/export/home/renpengju/miniconda3/bin:$PATH"
|
|
112
|
-
export VASP_PP_PATH=$HOME/vasp/mypps
|
|
113
|
-
export VASP_SCRIPT=$workdir/run_vasp.py
|
|
114
|
-
|
|
115
|
-
cat > run_vasp.py << EOF
|
|
116
|
-
import os
|
|
117
|
-
exitcode = os.system('mpirun -PSM2 /export/soft_old/vasp541/vasp.5.4.1/bin/vasp_gam')
|
|
118
|
-
EOF
|
|
119
|
-
|
|
120
|
-
python surface_reaction_sample.py > surface_reaction_sample.py.log
|
|
121
|
-
|
|
122
|
-
date
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
### 参数设置
|
|
126
|
-
|
|
127
|
-
注意:所有的参数均在 `parameter.py` 进行设置
|
|
128
|
-
|
|
129
|
-
```python
|
|
130
|
-
from ase.calculators.vasp import Vasp
|
|
131
|
-
import numpy as np
|
|
132
|
-
|
|
133
|
-
# 用户参数,以下参数必须设定,没有默认值
|
|
134
|
-
poscar = 'ru_0001_POSCAR'
|
|
135
|
-
atomnum = [7, 7] # 吸附的原子序号, 第一个原子靠近表面
|
|
136
|
-
bondlength = 1.65 # 初始的键长
|
|
137
|
-
angle = [np.pi / 2, 0.0] # 分子吸附的角度,[theta, phi_x]: [与 z 轴的角度,绕 z 轴的旋转角度(相对于x)]
|
|
138
|
-
|
|
139
|
-
# 以下参数可选,具有默认值
|
|
140
|
-
calc = Vasp(
|
|
141
|
-
xc='PBE',
|
|
142
|
-
gga='PE',
|
|
143
|
-
kpts=(1, 1, 1),
|
|
144
|
-
encut=400,
|
|
145
|
-
setups='recommended',
|
|
146
|
-
ncore=4,
|
|
147
|
-
gamma=True,
|
|
148
|
-
nelm=200,
|
|
149
|
-
algo='fast',
|
|
150
|
-
ismear=0,
|
|
151
|
-
sigma=0.05,
|
|
152
|
-
ibrion=-1, # 不使用 vasp 自身的优化,必须是 -1
|
|
153
|
-
ediff=1e-4,
|
|
154
|
-
prec='normal',
|
|
155
|
-
nsw=0, # 不使用 vasp 优化,必须是 0
|
|
156
|
-
lreal='Auto',
|
|
157
|
-
lwave=True, # 保存 WAVECAR 可以加速
|
|
158
|
-
lcharg=False,
|
|
159
|
-
ispin=1)
|
|
160
|
-
|
|
161
|
-
scan_type = 'transition_state' # 扫描类型:'optimization','transition_state'
|
|
162
|
-
grid_interval = 0.1 # angstrom, 格点的间距
|
|
163
|
-
Nsample = 5 # 第一次采样的点
|
|
164
|
-
Niter = 3 # 最大迭代次数
|
|
165
|
-
fmax = 0.1 # 结构优化 force 的收敛标准
|
|
166
|
-
max_error = 0.01 # 表面采样的收敛标准
|
|
167
|
-
radii_type = 'covalent_radii' # 半径选项:'vdw_radii','covalent_radii'
|
|
168
|
-
radii_factor = 1.1 # 原子半径系数
|
|
169
|
-
sampleproperty = {'phi_x': np.linspace(0, np.pi/3, 2, endpoint=False)}
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### 手动添加格点能量信息
|
|
173
|
-
|
|
174
|
-
通过脚本 `append_sample.py`实现,打开之后,修改以下信息
|
|
175
|
-
|
|
176
|
-
```python
|
|
177
|
-
pkl_filename = 'surface_grid.pkl'
|
|
178
|
-
keep_old_sample = True # 判断是否保留原有的采样的点
|
|
179
|
-
results = [
|
|
180
|
-
'0_opt.traj', # 支持 ase.traj, vasprun.xml 文件,仅读取最后优化后的结果
|
|
181
|
-
'1_opt.traj',
|
|
182
|
-
'2_opt.traj',
|
|
183
|
-
'3_opt.traj',
|
|
184
|
-
'4_opt.traj',
|
|
185
|
-
'5_opt.traj',
|
|
186
|
-
'6_opt.traj',
|
|
187
|
-
'7_opt.traj',
|
|
188
|
-
'8_opt.traj',
|
|
189
|
-
'9_opt.traj',
|
|
190
|
-
]
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
运行: `python append_sample.py`
|
|
194
|
-
|
|
195
|
-
注意:文件夹下必须有 `parameter.py` 和相应的表面结构文件
|
|
196
|
-
|
|
197
|
-
注意:为了避免失误,再运行前对 `surface_grid.pkl` 进行备份
|
|
198
|
-
|
|
79
|
+
## 使用方法 Tutorial
|
|
199
80
|
|
|
81
|
+
参考例子 CuO_Cu_interface_LASP
|
|
200
82
|
|
|
201
83
|
### [其他 ASE 优化算法](https://wiki.fysik.dtu.dk/ase/ase/optimize.html)
|
|
202
84
|
|
|
@@ -271,8 +153,11 @@ $$
|
|
|
271
153
|
* v 0.6: 新的高效表面格点构造,支持表面和团簇
|
|
272
154
|
* v 0.7: 新的 grid_sample 方法,包含 Hull.vertices VIP 位点。
|
|
273
155
|
* v 0.8: 孔材料体系格点构造
|
|
156
|
+
* v 0.9: 重新梳理软件的模块,优化软件使用逻辑
|
|
157
|
+
* v 0.9.2: debug 支持三斜晶系的表面格点化
|
|
274
158
|
|
|
275
159
|
**TODO**
|
|
160
|
+
|
|
276
161
|
* 表面位点数据库
|
|
277
162
|
* 多原子体系(内坐标受限体系)
|
|
278
163
|
* 完善用户界面、例子、教程
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 催化剂表面位点和反应分子构象综合采样
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
催化剂构效关系是建立表面位点结构和反应过程势能面的关联关系,这依赖对表面上各种可能位点的充分分析和采样,找到这些位点对关键反应步骤的影响情况。从催化剂的角度看,研究的目标是从表面上存在的位点中找到表面最适合反应的位点,即使反应势能面最低的位点;从反应的角度看,研究目标是对于一系列反应通道,找到反应势能面上的卡点,找到能够突破卡点的催化环境。
|
|
4
4
|
|
|
5
|
+
本软件同时进行表面位点的构建、采样、计算、分析,和反应过程的分析采样,即过渡态和分子构象,由此可以实现分子在表面反应的全过程采样。其中的技术关键是采样的效率,我们针对性地使用综合使用了多样化的采样策略,保证表面各类型位点和关键位点的充分采样。
|
|
5
6
|
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
|
|
9
|
+
<img src="docs/birds_view.png" alt="表面位点全局分析" style="zoom:50%;" />
|
|
8
10
|
|
|
9
11
|
|
|
10
12
|
|
|
@@ -12,7 +14,7 @@ A Method with Stratified Sampling Strategy for Comprehensive Analysis of Catalys
|
|
|
12
14
|
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-

|
|
16
18
|
|
|
17
19
|
## 重要的概念 Glossary
|
|
18
20
|
|
|
@@ -30,143 +32,23 @@ A Method with Stratified Sampling Strategy for Comprehensive Analysis of Catalys
|
|
|
30
32
|
|
|
31
33
|
* 当前我们使用多点定位 Multilateration 进行向量化
|
|
32
34
|
|
|
33
|
-
|
|
35
|
+
<img src="docs/multilateration.jpg" alt="multilateration" style="zoom:50%;" />
|
|
34
36
|
|
|
35
37
|
* 分层采样 Stratified sampling。根据“相似结构具有相似性质”的原理采样分层采样的策略对表面位点进行采样,降低计算量。
|
|
36
38
|
|
|
37
39
|

|
|
38
40
|
|
|
39
|
-
*
|
|
41
|
+
* 表面分子结构采样。表面的分子自由度分解为表面位点+分子姿态+分子內自由度。针对它们采用不同的采样策略。
|
|
40
42
|
|
|
41
|
-
|
|
43
|
+
<img src="docs/adsorption_structure.jpg" alt="adsorption structure" style="zoom:50%;" />
|
|
42
44
|
|
|
43
|
-
## 安装
|
|
45
|
+
## 安装 Installation
|
|
44
46
|
|
|
45
47
|
`pip install -U surface-construct`
|
|
46
48
|
|
|
47
|
-
##
|
|
48
|
-
|
|
49
|
-
python -m build
|
|
50
|
-
twine upload --verbose dist/*
|
|
51
|
-
|
|
52
|
-
## 使用方法 Manual
|
|
53
|
-
|
|
54
|
-
### 所需文件 Required Files
|
|
55
|
-
|
|
56
|
-
* `surface_reaction_sample.py`: 主流程文件
|
|
57
|
-
|
|
58
|
-
* `parameter.py`: 参数定义文件
|
|
59
|
-
|
|
60
|
-
* `POSCAR.0`: 表面结构文件
|
|
61
|
-
|
|
62
|
-
* 注意:名字可以修改,与 `parameter.py` 设置一致
|
|
63
|
-
* 设置需要固定的原子
|
|
64
|
-
|
|
65
|
-
* bsub 文件。在公司集群上提交,以下面的为例
|
|
66
|
-
|
|
67
|
-
```Bash
|
|
68
|
-
#/bin/bash
|
|
69
|
-
#BSUB -J Sampling
|
|
70
|
-
#BSUB -q short
|
|
71
|
-
#BSUB -n 28
|
|
72
|
-
#BSUB -o out.%J.txt
|
|
73
|
-
#BSUB -e error.%J.txt
|
|
74
|
-
#BSUB -R span[ptile=28]
|
|
75
|
-
module load old/intel18u4
|
|
76
|
-
export OMP_NUM_THREADS=1
|
|
77
|
-
export I_MPI_ADJUST_REDUCE=3
|
|
78
|
-
workdir=`pwd`
|
|
79
|
-
date
|
|
80
|
-
|
|
81
|
-
export PATH="/export/home/renpengju/miniconda3/bin:$PATH"
|
|
82
|
-
export VASP_PP_PATH=$HOME/vasp/mypps
|
|
83
|
-
export VASP_SCRIPT=$workdir/run_vasp.py
|
|
84
|
-
|
|
85
|
-
cat > run_vasp.py << EOF
|
|
86
|
-
import os
|
|
87
|
-
exitcode = os.system('mpirun -PSM2 /export/soft_old/vasp541/vasp.5.4.1/bin/vasp_gam')
|
|
88
|
-
EOF
|
|
89
|
-
|
|
90
|
-
python surface_reaction_sample.py > surface_reaction_sample.py.log
|
|
91
|
-
|
|
92
|
-
date
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### 参数设置
|
|
96
|
-
|
|
97
|
-
注意:所有的参数均在 `parameter.py` 进行设置
|
|
98
|
-
|
|
99
|
-
```python
|
|
100
|
-
from ase.calculators.vasp import Vasp
|
|
101
|
-
import numpy as np
|
|
102
|
-
|
|
103
|
-
# 用户参数,以下参数必须设定,没有默认值
|
|
104
|
-
poscar = 'ru_0001_POSCAR'
|
|
105
|
-
atomnum = [7, 7] # 吸附的原子序号, 第一个原子靠近表面
|
|
106
|
-
bondlength = 1.65 # 初始的键长
|
|
107
|
-
angle = [np.pi / 2, 0.0] # 分子吸附的角度,[theta, phi_x]: [与 z 轴的角度,绕 z 轴的旋转角度(相对于x)]
|
|
108
|
-
|
|
109
|
-
# 以下参数可选,具有默认值
|
|
110
|
-
calc = Vasp(
|
|
111
|
-
xc='PBE',
|
|
112
|
-
gga='PE',
|
|
113
|
-
kpts=(1, 1, 1),
|
|
114
|
-
encut=400,
|
|
115
|
-
setups='recommended',
|
|
116
|
-
ncore=4,
|
|
117
|
-
gamma=True,
|
|
118
|
-
nelm=200,
|
|
119
|
-
algo='fast',
|
|
120
|
-
ismear=0,
|
|
121
|
-
sigma=0.05,
|
|
122
|
-
ibrion=-1, # 不使用 vasp 自身的优化,必须是 -1
|
|
123
|
-
ediff=1e-4,
|
|
124
|
-
prec='normal',
|
|
125
|
-
nsw=0, # 不使用 vasp 优化,必须是 0
|
|
126
|
-
lreal='Auto',
|
|
127
|
-
lwave=True, # 保存 WAVECAR 可以加速
|
|
128
|
-
lcharg=False,
|
|
129
|
-
ispin=1)
|
|
130
|
-
|
|
131
|
-
scan_type = 'transition_state' # 扫描类型:'optimization','transition_state'
|
|
132
|
-
grid_interval = 0.1 # angstrom, 格点的间距
|
|
133
|
-
Nsample = 5 # 第一次采样的点
|
|
134
|
-
Niter = 3 # 最大迭代次数
|
|
135
|
-
fmax = 0.1 # 结构优化 force 的收敛标准
|
|
136
|
-
max_error = 0.01 # 表面采样的收敛标准
|
|
137
|
-
radii_type = 'covalent_radii' # 半径选项:'vdw_radii','covalent_radii'
|
|
138
|
-
radii_factor = 1.1 # 原子半径系数
|
|
139
|
-
sampleproperty = {'phi_x': np.linspace(0, np.pi/3, 2, endpoint=False)}
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### 手动添加格点能量信息
|
|
143
|
-
|
|
144
|
-
通过脚本 `append_sample.py`实现,打开之后,修改以下信息
|
|
145
|
-
|
|
146
|
-
```python
|
|
147
|
-
pkl_filename = 'surface_grid.pkl'
|
|
148
|
-
keep_old_sample = True # 判断是否保留原有的采样的点
|
|
149
|
-
results = [
|
|
150
|
-
'0_opt.traj', # 支持 ase.traj, vasprun.xml 文件,仅读取最后优化后的结果
|
|
151
|
-
'1_opt.traj',
|
|
152
|
-
'2_opt.traj',
|
|
153
|
-
'3_opt.traj',
|
|
154
|
-
'4_opt.traj',
|
|
155
|
-
'5_opt.traj',
|
|
156
|
-
'6_opt.traj',
|
|
157
|
-
'7_opt.traj',
|
|
158
|
-
'8_opt.traj',
|
|
159
|
-
'9_opt.traj',
|
|
160
|
-
]
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
运行: `python append_sample.py`
|
|
164
|
-
|
|
165
|
-
注意:文件夹下必须有 `parameter.py` 和相应的表面结构文件
|
|
166
|
-
|
|
167
|
-
注意:为了避免失误,再运行前对 `surface_grid.pkl` 进行备份
|
|
168
|
-
|
|
49
|
+
## 使用方法 Tutorial
|
|
169
50
|
|
|
51
|
+
参考例子 CuO_Cu_interface_LASP
|
|
170
52
|
|
|
171
53
|
### [其他 ASE 优化算法](https://wiki.fysik.dtu.dk/ase/ase/optimize.html)
|
|
172
54
|
|
|
@@ -241,8 +123,11 @@ $$
|
|
|
241
123
|
* v 0.6: 新的高效表面格点构造,支持表面和团簇
|
|
242
124
|
* v 0.7: 新的 grid_sample 方法,包含 Hull.vertices VIP 位点。
|
|
243
125
|
* v 0.8: 孔材料体系格点构造
|
|
126
|
+
* v 0.9: 重新梳理软件的模块,优化软件使用逻辑
|
|
127
|
+
* v 0.9.2: debug 支持三斜晶系的表面格点化
|
|
244
128
|
|
|
245
129
|
**TODO**
|
|
130
|
+
|
|
246
131
|
* 表面位点数据库
|
|
247
132
|
* 多原子体系(内坐标受限体系)
|
|
248
133
|
* 完善用户界面、例子、教程
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from setuptools import setup
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
2
|
|
|
3
3
|
with open("README.md", "r", encoding='utf-8') as f:
|
|
4
4
|
long_description = f.read()
|
|
@@ -15,8 +15,8 @@ install_requires = [
|
|
|
15
15
|
|
|
16
16
|
setup(
|
|
17
17
|
name='surface_construct',
|
|
18
|
-
version='0.9',
|
|
19
|
-
packages=
|
|
18
|
+
version='0.9.2',
|
|
19
|
+
packages=find_packages(),
|
|
20
20
|
url='https://gitee.com/pjren/surface_construct/',
|
|
21
21
|
license='GPL',
|
|
22
22
|
author='ren',
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
class AdsGridCombiner:
|
|
2
|
+
def __init__(self, sg_obj, ads_obj,
|
|
3
|
+
**kwargs):
|
|
4
|
+
"""
|
|
5
|
+
:param sg_obj: 表面格点
|
|
6
|
+
:param ads_obj: 吸附分子,包含Atoms,主轴,内坐标列表,根据这些参数可以得到分子坐标
|
|
7
|
+
:param kwargs:
|
|
8
|
+
"""
|
|
9
|
+
self.atoms = None
|
|
10
|
+
self.sg_obj = sg_obj
|
|
11
|
+
self.ads_obj = ads_obj
|
|
12
|
+
self.kwargs = kwargs
|
|
13
|
+
if self.sg_obj.atoms.calc is not None:
|
|
14
|
+
self.calc = self.sg_obj.atoms.calc
|
|
15
|
+
else:
|
|
16
|
+
if self.ads_obj.atoms.calc is not None:
|
|
17
|
+
self.calc = self.ads_obj.atoms.calc
|
|
18
|
+
else:
|
|
19
|
+
self.calc = None
|
|
20
|
+
|
|
21
|
+
def get_atoms(self, grid_idx=None,**kwargs):
|
|
22
|
+
"""
|
|
23
|
+
将分子放置于 grid_idx 格点上
|
|
24
|
+
:param grid_idx: 格点序号。默认是随机idx。
|
|
25
|
+
:return: 组合后的 Atoms
|
|
26
|
+
"""
|
|
27
|
+
attitude = kwargs.get('attitude') # 分子姿态,分子主轴的夹角
|
|
28
|
+
internal_coord = kwargs.get('internal_coord') # 分子内坐标
|
|
29
|
+
ads_atoms = self.ads_obj.atoms.copy()
|
|
30
|
+
# TODO: 先进行 rotate and 改变分子构象
|
|
31
|
+
site = self.sg_obj.points[grid_idx]
|
|
32
|
+
# TODO: get_z 去更新 site 的坐标
|
|
33
|
+
site = self._get_z(site, ads_atoms)
|
|
34
|
+
ads_atoms.set_positions(ads_atoms.get_positions() +
|
|
35
|
+
(site - ads_atoms.get_center_of_mass()))
|
|
36
|
+
|
|
37
|
+
atoms = self.sg_obj.atoms.copy()
|
|
38
|
+
atoms += ads_atoms
|
|
39
|
+
atoms.calc = self.calc
|
|
40
|
+
self.atoms = atoms
|
|
41
|
+
return atoms
|
|
42
|
+
|
|
43
|
+
def _get_z(self, xyz0, ads_atoms):
|
|
44
|
+
"""
|
|
45
|
+
由于分子可能会与表面冲突,调整分子的高度可以避免
|
|
46
|
+
事实上调整的是沿着格点法向向量的距离 xyz = xyz0 + r×d
|
|
47
|
+
:return:
|
|
48
|
+
"""
|
|
49
|
+
# 该方法仅仅适用于 slab 体系,不适合 cluster 体系
|
|
50
|
+
# 先找到grid 的最大值点,分子的最小值点,然后把分子的COM 移动到距离5A以上的点
|
|
51
|
+
# 根据 ads 不同的原子类型,计算每个原子需要移动的z值,取最小的值。
|
|
52
|
+
xyz = xyz0
|
|
53
|
+
move_z = 0
|
|
54
|
+
return xyz
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import numpy as np
|
|
2
|
+
from ase import Atoms
|
|
3
|
+
|
|
4
|
+
class Adsorbate:
|
|
5
|
+
"""
|
|
6
|
+
吸附分子的类,包含质心,内坐标,主轴
|
|
7
|
+
"""
|
|
8
|
+
def __init__(self, atoms, **kwargs):
|
|
9
|
+
# TODO:加上半径的参数,计算分子半径
|
|
10
|
+
self.atoms = atoms
|
|
11
|
+
self.internal_coords = dict()
|
|
12
|
+
self.kwargs = kwargs
|
|
13
|
+
self._rads = 0.76 # 默认是碳原子的共价半径
|
|
14
|
+
|
|
15
|
+
@property
|
|
16
|
+
def com(self):
|
|
17
|
+
return self.atoms.center_of_mass()
|
|
18
|
+
|
|
19
|
+
@property
|
|
20
|
+
def principal_axis(self):
|
|
21
|
+
# 分子主轴向量
|
|
22
|
+
evals, evecs = self.atoms.get_moments_of_inertia(vectors=True)
|
|
23
|
+
return evecs[np.argmin(np.abs(evals))]
|
|
24
|
+
|
|
25
|
+
@property
|
|
26
|
+
def rads(self):
|
|
27
|
+
# 分子的半径,sg_obj 构造时作为参考
|
|
28
|
+
# 思考:这是为了生成格点的半径,格点的位置是一种参考的位置,可以尽量接近真实的吸附结构。
|
|
29
|
+
# 因而使用吸附原子的半径作为半径比较好,而不是分子的质心。当然,这是对于比较平整的slab 模型而言,对于团簇而言,也是如此吗?
|
|
30
|
+
# 可以认为是的,到时候分子的质心沿着法向向量移动就可以了。
|
|
31
|
+
# TODO: 计算分子半径
|
|
32
|
+
return self._rads
|
|
33
|
+
|
|
34
|
+
@rads.setter
|
|
35
|
+
def rads(self, value):
|
|
36
|
+
self._rads = value
|
|
37
|
+
|
|
38
|
+
@property
|
|
39
|
+
def natoms(self):
|
|
40
|
+
return len(self.atoms)
|
|
41
|
+
|