参考与说明:
1.VASP_能带反折叠计算
2.能带反折叠计算
3.关于含缺陷的supercell的能带反折叠的问题
4.vaspkit版本:vaspkit.1.4.0,版本不能过低,要大于1.2.3
1.基本步骤
1.准备 POSCAR 文件,原胞或者晶胞/超胞都可以(推荐用原胞,以防第3步程序不能正确将晶胞、超胞生成原胞)
2.根据维度,执行 vaspkit -task 302/303
会生成 KPATH.in(后续用于能带反折叠的计算)和 PRIMCELL.vasp(即原胞,也就是第一步的POSCAR文件不管是不是原胞,到了这一步会生成原胞)
3.执行 cp PRIMCELL.vasp POSCAR
,对原胞进行结构优化,我认为可以不用对原胞结构进行优化,原胞主要是用来构建超胞的,关系应该不大,优化结束执行 cp CONTCAR POSCAR
4.准备矩阵变换文件 TRANSMAT.in 用于生成所需的超胞结构
5.执行 vaspkit -task 400
程序会读取经过优化后的 POSCAR 文件与矩阵变换文件 TRANSMAT.in 生成超胞结构 SUPERCELL.vasp,可以对超胞文件进行修改构造缺陷,执行 cp SUPERCELL.vasp POSCAR
6.新建一个目录 rel,对超胞进行结构优化,优化结束,cp CONTCAR POSCAR
7.新建一个目录 banduf 进行能带反折叠计算,准备 INCAR,优化后的超胞结构 POSCAR,拷贝之前的 KPATH.in 和 TRANSMAT.in 到该目录下,执行 vaspkit -task 281
生成用于能带反折叠计算得 KPOINTS 文件与 POTCAR 文件,进行静态计算。如果只有超胞的 POSCAR,没有 TRANSMAT.in,在第2步执行之后执行 cp PRIMCELL.vasp PRIMCELL.in
,然后再执行 vaspkit -task 281
,程序会读取超胞的 POSCAR 和原胞的 PRIMCELL.in 生成 TRANSMAT.in 文件。
8.运行结束,执行 vaspkit -task 282
生成有效能带(Effective Band Structure)数据文件 EBS.dat,画法类似于投影能带,或者用eps_plot.py 脚本进行绘图(脚本的路径:vaspkit.1.4.0/examples/band_unfolding/);另外执行 vasp -task 284
可以得到投影到元素以及元素轨道的能带数据 PEBS_Element.dat,然后自行画图,画法类似于投影能带。
9.另一种后处理方式是运用 Matlab 画图(画的图比较好看,也比较方便,推荐这一种方式),得到总的贡献的能带图(Total),需要执行 vaspkit -> 28 -> 285 -> 1 -> all(所有原子) -> all(所有轨道),这一过程会读取相应的文件除了基本的输出文件,还有前面生成的 KPOINTS_MAPPING_TABLE.in 以及 KPATH.in 文件;之后会生成用于 Matlab 画图的四个文件分别是 ENERGY.grd(能量)、 MOMENTUM.grd(动量,K点)、WEIGHT.grd(权重)以及 KLABELS(高对称点)。此外生成的 SELECTED_ATOMS_LIST 以及 SELECTED_ORBITALS_LIST 可用来验证是否是所选的元素或轨道,而 PEBS_SUM.dat 文件则可用来自己画图。要得到某一元素贡献的能带图(以Mo为例),需要执行 vaspkit -> 28 -> 285 -> 1 -> Mo(Mo原子) -> all(所有轨道),其它元素同理,不同原子、不同轨道各种组合也都可以,得到的关于Mo的 PEBS_SUM.dat 与 PEBS_Mo.dat 的数据应该是差不多的(理论上是一致的)。
2.实例演示
2.1 目录层级关系图
2.2 计算步骤
1.在MoS2目录下准备MoS2的原胞文件 POSCAR,以及矩阵转换文件 TRANSMAT.in
POSCAR
MoS2-H.POSCAR
1.00000000000000000
3.1904063769892548 0.0000000000000000 0.0000000000000000
-1.5952031884946274 2.7629729709066906 0.0000000000000000
0.0000000000000000 0.0000000000000000 17.6585355706663840
Mo S
1 2
Direct
0.3333333429999996 0.6666666870000029 0.5000000000000000
0.6666666870000029 0.3333333429999996 0.4117002781430051
0.6666666870000029 0.3333333429999996 0.5882996918569924
TRANSMAT.in
Read transformation matrix from the TRANSMAT.in file if it exists. 第一行是注释行
3 0 0 # must be three integers
0 3 0 # must be three integers
0 0 1 # must be three integers
2.执行 vaspkit -task 302
会生成 KPATH.in,可做根据需要进行适当修改
KPATH.in
K-Path Generated by VASPKIT.
20
Line-Mode
Reciprocal
0.0000000000 0.0000000000 0.0000000000 Gamma
0.5000000000 0.0000000000 0.0000000000 M
0.5000000000 0.0000000000 0.0000000000 M
0.3333333333 0.3333333333 0.0000000000 K
0.3333333333 0.3333333333 0.0000000000 K
0.0000000000 0.0000000000 0.0000000000 Gamma
3.执行 vaspkit -task 400
得到 SUPERCELL.vasp
SUPERCELL.vasp
SUPERCELL file generated by VASPKIT
1.000000
9.5712191309677639 0.0000000000000000 0.0000000000000000
-4.7856095654838819 8.2889189127200709 0.0000000000000000
0.0000000000000000 0.0000000000000000 17.6585355706663840
Mo S
9 18
Direct
0.1111111143333332 0.2222222290000010 0.5000000000000000 Mo1
0.1111111143333332 0.5555555623333344 0.5000000000000000 Mo2
0.1111111143333332 0.8888888956666676 0.5000000000000000 Mo3
0.4444444476666666 0.2222222290000010 0.5000000000000000 Mo4
0.4444444476666666 0.5555555623333344 0.5000000000000000 Mo5
0.4444444476666666 0.8888888956666676 0.5000000000000000 Mo6
0.7777777809999999 0.2222222290000010 0.5000000000000000 Mo7
0.7777777809999999 0.5555555623333344 0.5000000000000000 Mo8
0.7777777809999999 0.8888888956666676 0.5000000000000000 Mo9
0.2222222290000010 0.1111111143333332 0.4117002781430050 S1
0.2222222290000010 0.4444444476666666 0.4117002781430050 S2
0.2222222290000010 0.7777777809999999 0.4117002781430050 S3
0.5555555623333344 0.1111111143333332 0.4117002781430050 S4
0.5555555623333344 0.4444444476666666 0.4117002781430050 S5
0.5555555623333344 0.7777777809999999 0.4117002781430050 S6
0.8888888956666676 0.1111111143333332 0.4117002781430050 S7
0.8888888956666676 0.4444444476666666 0.4117002781430050 S8
0.8888888956666676 0.7777777809999999 0.4117002781430050 S9
0.2222222290000010 0.1111111143333332 0.5882996918569924 S10
0.2222222290000010 0.4444444476666666 0.5882996918569924 S11
0.2222222290000010 0.7777777809999999 0.5882996918569924 S12
0.5555555623333344 0.1111111143333332 0.5882996918569924 S13
0.5555555623333344 0.4444444476666666 0.5882996918569924 S14
0.5555555623333344 0.7777777809999999 0.5882996918569924 S15
0.8888888956666676 0.1111111143333332 0.5882996918569924 S16
0.8888888956666676 0.4444444476666666 0.5882996918569924 S17
0.8888888956666676 0.7777777809999999 0.5882996918569924 S18
4.首先对没有S空位的完美超胞进行结构优化,在 perfect\rel 下准备输入文件 INCAR
INCAR
SYSTEM = MoS2-perfect-rel
ISTART = 0
ICHARG = 2
#NPAR = 6
NCORE = 6
PREC = Accurate
ALGO = Fast
ENCUT = 450 #1.5*ENMAX
EDIFF = 1E-5
EDIFFG = -0.005
ISMEAR = 0
SIGMA = 0.05
IBRION = 2
ISIF = 3
POTIM = 0.01
NSW = 100
NELMIN = 4
NELM = 60
LWAVE = F
LCHARG = F
LREAL = Auto
ISYM = -1
执行 vaspkit -task 301
采用 0.03 的精度得到 KPOINTS 文件和 POTCAR 文件
KPOINTS
KPT-Resolved Value to Generate K-Mesh: 0.030
0
Gamma
4 4 1
0.0 0.0 0.0
将 SUPERCELL.vasp 复制到该目录下,执行 cp SUPERCELL.vasp POSCAR
,进行结构优化
5.优化结束复制 CONTCAR 和 POTCAR 文件到 banduf 目录下,执行 cp CONTCAR POSCAR
POSCAR
SUPERCELL file generated by VASPKIT
1.00000000000000
9.5474206078998716 0.0000000833979941 -0.0000001454447699
-4.7737102311440376 8.2683092082672740 -0.0000000464218956
-0.0000002678877675 -0.0000002539991884 17.6857378913827432
Mo S
9 18
Direct
0.1111138208773417 0.2222276111890522 0.4999999984383789
0.1111152818331586 0.5555575896466104 0.4999999841377049
0.1111138310297925 0.8888862381219294 0.4999999882009388
0.4444370776860641 0.2222185311536776 0.4999999849283832
0.4444423211017812 0.5555576088163326 0.4999999796679670
0.4444423594866043 0.8888847174435046 0.4999999878336213
0.7777814882618073 0.2222185374759189 0.4999999762741637
0.7777814531027695 0.5555628593644530 0.4999999865991365
0.7777724269718531 0.8888862232631928 0.4999999920745162
0.2221984955598983 0.1110993236346936 0.4115946865939695
0.2222293810135103 0.4444588737717834 0.4115880472420791
0.2222294879644823 0.7777705722318045 0.4115879994495082
0.5555512965468634 0.1111025290781608 0.4115902632561945
0.5555513070017336 0.4444487498780297 0.4115903320937505
0.5555409988736049 0.7777705096582155 0.4115880307078115
0.8889008188085888 0.1110994693381805 0.4115946905702111
0.8888974455824348 0.4444486166380375 0.4115902881225514
0.8889007378547460 0.7778013861548950 0.4115946958702506
0.2221985725761136 0.1110993967274859 0.5884053050692101
0.2222294382928334 0.4444589416839277 0.5884119319074773
0.2222295625720394 0.7777705727897688 0.5884119970721132
0.5555514245996522 0.1111025538613926 0.5884097111150909
0.5555513195519888 0.4444487358037657 0.5884096415384132
0.5555409549827934 0.7777705825028102 0.5884119250645202
0.8889007028704584 0.1110993807242657 0.5884052929087332
0.8888974403035205 0.4444486908155573 0.5884096943976459
0.8889007056935818 0.7778013172325613 0.5884053188656365
准备 INCAR 文件,要得到投影能带图以及投影到具体元素轨道需要设置参数 LORBIT = 11
INCAR
SYSTEM = MoS2-perfect-banduf
ISTART = 1
#NPAR = 6
NCORE = 6
PREC = N
ALGO = Fast
ENCUT = 450 #1.5*ENMAX
EDIFF = 1E-5
EDIFFG = -0.005
ISMEAR = 0
SIGMA = 0.05
IBRION = -1
ISIF = 3
#POTIM = 0.01
NSW = 0
NELMIN = 4
NELM = 60
LWAVE = T
LCHARG = F
LREAL = Auto
LORBIT = 11
NEDOS = 1001
执行 cp …/…/KPATH.in ./
以及 cp …/…/TRANSMAT.in ./
,执行 vaspkit -task 281
生成 KPOINTS 文件与 KPOINTS_MAPPING_TABLE.in 文件
KPOINTS
0.040 3 3 1 3 0.040 76 3 28 16 32 # Parameters to Generate KPOINTS (Don't Edit This Line)
79
Reciprocal lattice
0.00000000000000 0.00000000000000 0.00000000000000 1
0.33333333333333 0.00000000000000 0.00000000000000 6
0.33333333333333 0.33333333333333 0.00000000000000 2
0.00000000000000 0.00000000000000 0.00000000000000 0
0.05555555555556 0.00000000000000 0.00000000000000 0
0.11111111111111 0.00000000000000 0.00000000000000 0
0.16666666666667 0.00000000000000 0.00000000000000 0
0.22222222222222 0.00000000000000 0.00000000000000 0
0.27777777777778 0.00000000000000 0.00000000000000 0
0.33333333333333 0.00000000000000 0.00000000000000 0
0.38888888888889 0.00000000000000 0.00000000000000 0
0.44444444444444 0.00000000000000 0.00000000000000 0
-0.50000000000000 0.00000000000000 0.00000000000000 0
-0.44444444444444 0.00000000000000 0.00000000000000 0
-0.38888888888889 0.00000000000000 0.00000000000000 0
-0.33333333333333 0.00000000000000 0.00000000000000 0
-0.27777777777778 0.00000000000000 0.00000000000000 0
-0.22222222222222 0.00000000000000 0.00000000000000 0
-0.16666666666667 0.00000000000000 0.00000000000000 0
-0.11111111111111 0.00000000000000 0.00000000000000 0
-0.05555555555556 0.00000000000000 0.00000000000000 0
0.00000000000000 0.00000000000000 0.00000000000000 0
0.05555555555556 0.00000000000000 0.00000000000000 0
0.11111111111111 0.00000000000000 0.00000000000000 0
0.16666666666667 0.00000000000000 0.00000000000000 0
0.22222222222222 0.00000000000000 0.00000000000000 0
0.27777777777778 0.00000000000000 0.00000000000000 0
0.33333333333333 0.00000000000000 0.00000000000000 0
0.38888888888889 0.00000000000000 0.00000000000000 0
0.44444444444444 0.00000000000000 0.00000000000000 0
-0.50000000000000 0.00000000000000 0.00000000000000 0
-0.50000000000000 0.00000000000000 0.00000000000000 0
0.46666666666000 0.06666666666000 0.00000000000000 0
0.43333333332000 0.13333333332000 0.00000000000000 0
0.39999999998000 0.19999999998000 0.00000000000000 0
0.36666666664000 0.26666666664000 0.00000000000000 0
0.33333333330000 0.33333333330000 0.00000000000000 0
0.29999999996000 0.39999999996000 0.00000000000000 0
0.26666666662000 0.46666666662000 0.00000000000000 0
0.23333333328000 -0.46666666672000 0.00000000000000 0
0.19999999994000 -0.40000000006000 0.00000000000000 0
0.16666666660000 -0.33333333340000 0.00000000000000 0
0.13333333326000 -0.26666666674000 0.00000000000000 0
0.09999999992000 -0.20000000008000 0.00000000000000 0
0.06666666658000 -0.13333333342000 0.00000000000000 0
0.03333333324000 -0.06666666676000 0.00000000000000 0
-0.00000000010000 -0.00000000010000 0.00000000000000 0
-0.00000000010000 -0.00000000010000 0.00000000000000 0
-0.03225806461290 -0.03225806461290 0.00000000000000 0
-0.06451612912581 -0.06451612912581 0.00000000000000 0
-0.09677419363871 -0.09677419363871 0.00000000000000 0
-0.12903225815161 -0.12903225815161 0.00000000000000 0
-0.16129032266452 -0.16129032266452 0.00000000000000 0
-0.19354838717742 -0.19354838717742 0.00000000000000 0
-0.22580645169032 -0.22580645169032 0.00000000000000 0
-0.25806451620323 -0.25806451620323 0.00000000000000 0
-0.29032258071613 -0.29032258071613 0.00000000000000 0
-0.32258064522903 -0.32258064522903 0.00000000000000 0
-0.35483870974194 -0.35483870974194 0.00000000000000 0
-0.38709677425484 -0.38709677425484 0.00000000000000 0
-0.41935483876774 -0.41935483876774 0.00000000000000 0
-0.45161290328065 -0.45161290328065 0.00000000000000 0
-0.48387096779355 -0.48387096779355 0.00000000000000 0
0.48387096769355 0.48387096769355 0.00000000000000 0
0.45161290318065 0.45161290318065 0.00000000000000 0
0.41935483866774 0.41935483866774 0.00000000000000 0
0.38709677415484 0.38709677415484 0.00000000000000 0
0.35483870964194 0.35483870964194 0.00000000000000 0
0.32258064512903 0.32258064512903 0.00000000000000 0
0.29032258061613 0.29032258061613 0.00000000000000 0
0.25806451610323 0.25806451610323 0.00000000000000 0
0.22580645159032 0.22580645159032 0.00000000000000 0
0.19354838707742 0.19354838707742 0.00000000000000 0
0.16129032256452 0.16129032256452 0.00000000000000 0
0.12903225805161 0.12903225805161 0.00000000000000 0
0.09677419353871 0.09677419353871 0.00000000000000 0
0.06451612902581 0.06451612902581 0.00000000000000 0
0.03225806451290 0.03225806451290 0.00000000000000 0
0.00000000000000 0.00000000000000 0.00000000000000 0
KPOINTS_MAPPING_TABLE.in
Unfolded K-Points in Primitive-Cell Folded K-Points in Super-Cell G-vectors for Super-Cell
0.000000000000 0.000000000000 0.000000000000 0.000000000000 0.000000000000 0.000000000000 0 0 0
0.018518518519 0.000000000000 0.000000000000 0.055555555556 0.000000000000 0.000000000000 0 0 0
0.037037037037 0.000000000000 0.000000000000 0.111111111111 0.000000000000 0.000000000000 0 0 0
0.055555555556 0.000000000000 0.000000000000 0.166666666667 0.000000000000 0.000000000000 0 0 0
0.074074074074 0.000000000000 0.000000000000 0.222222222222 0.000000000000 0.000000000000 0 0 0
0.092592592593 0.000000000000 0.000000000000 0.277777777778 0.000000000000 0.000000000000 0 0 0
0.111111111111 0.000000000000 0.000000000000 0.333333333333 0.000000000000 0.000000000000 0 0 0
0.129629629630 0.000000000000 0.000000000000 0.388888888889 0.000000000000 0.000000000000 0 0 0
0.148148148148 0.000000000000 0.000000000000 0.444444444444 0.000000000000 0.000000000000 0 0 0
0.166666666667 0.000000000000 0.000000000000 -0.500000000000 0.000000000000 0.000000000000 1 0 0
0.185185185185 0.000000000000 0.000000000000 -0.444444444444 0.000000000000 0.000000000000 1 0 0
0.203703703704 0.000000000000 0.000000000000 -0.388888888889 0.000000000000 0.000000000000 1 0 0
0.222222222222 0.000000000000 0.000000000000 -0.333333333333 0.000000000000 0.000000000000 1 0 0
0.240740740741 0.000000000000 0.000000000000 -0.277777777778 0.000000000000 0.000000000000 1 0 0
0.259259259259 0.000000000000 0.000000000000 -0.222222222222 0.000000000000 0.000000000000 1 0 0
0.277777777778 0.000000000000 0.000000000000 -0.166666666667 0.000000000000 0.000000000000 1 0 0
0.296296296296 0.000000000000 0.000000000000 -0.111111111111 0.000000000000 0.000000000000 1 0 0
0.314814814815 0.000000000000 0.000000000000 -0.055555555556 0.000000000000 0.000000000000 1 0 0
0.333333333333 0.000000000000 0.000000000000 0.000000000000 0.000000000000 0.000000000000 1 0 0
0.351851851852 0.000000000000 0.000000000000 0.055555555556 0.000000000000 0.000000000000 1 0 0
0.370370370370 0.000000000000 0.000000000000 0.111111111111 0.000000000000 0.000000000000 1 0 0
0.388888888889 0.000000000000 0.000000000000 0.166666666667 0.000000000000 0.000000000000 1 0 0
0.407407407407 0.000000000000 0.000000000000 0.222222222222 0.000000000000 0.000000000000 1 0 0
0.425925925926 0.000000000000 0.000000000000 0.277777777778 0.000000000000 0.000000000000 1 0 0
0.444444444444 0.000000000000 0.000000000000 0.333333333333 0.000000000000 0.000000000000 1 0 0
0.462962962963 0.000000000000 0.000000000000 0.388888888889 0.000000000000 0.000000000000 1 0 0
0.481481481481 0.000000000000 0.000000000000 0.444444444444 0.000000000000 0.000000000000 1 0 0
0.500000000000 0.000000000000 0.000000000000 -0.500000000000 0.000000000000 0.000000000000 2 0 0
0.500000000000 0.000000000000 0.000000000000 -0.500000000000 0.000000000000 0.000000000000 2 0 0
0.488888888887 0.022222222220 0.000000000000 0.466666666660 0.066666666660 0.000000000000 1 0 0
0.477777777773 0.044444444440 0.000000000000 0.433333333320 0.133333333320 0.000000000000 1 0 0
0.466666666660 0.066666666660 0.000000000000 0.399999999980 0.199999999980 0.000000000000 1 0 0
0.455555555547 0.088888888880 0.000000000000 0.366666666640 0.266666666640 0.000000000000 1 0 0
0.444444444433 0.111111111100 0.000000000000 0.333333333300 0.333333333300 0.000000000000 1 0 0
0.433333333320 0.133333333320 0.000000000000 0.299999999960 0.399999999960 0.000000000000 1 0 0
0.422222222207 0.155555555540 0.000000000000 0.266666666620 0.466666666620 0.000000000000 1 0 0
0.411111111093 0.177777777760 0.000000000000 0.233333333280 -0.466666666720 0.000000000000 1 1 0
0.399999999980 0.199999999980 0.000000000000 0.199999999940 -0.400000000060 0.000000000000 1 1 0
0.388888888867 0.222222222200 0.000000000000 0.166666666600 -0.333333333400 0.000000000000 1 1 0
0.377777777753 0.244444444420 0.000000000000 0.133333333260 -0.266666666740 0.000000000000 1 1 0
0.366666666640 0.266666666640 0.000000000000 0.099999999920 -0.200000000080 0.000000000000 1 1 0
0.355555555527 0.288888888860 0.000000000000 0.066666666580 -0.133333333420 0.000000000000 1 1 0
0.344444444413 0.311111111080 0.000000000000 0.033333333240 -0.066666666760 0.000000000000 1 1 0
0.333333333300 0.333333333300 0.000000000000 -0.000000000100 -0.000000000100 0.000000000000 1 1 0
0.333333333300 0.333333333300 0.000000000000 -0.000000000100 -0.000000000100 0.000000000000 1 1 0
0.322580645129 0.322580645129 0.000000000000 -0.032258064613 -0.032258064613 0.000000000000 1 1 0
0.311827956958 0.311827956958 0.000000000000 -0.064516129126 -0.064516129126 0.000000000000 1 1 0
0.301075268787 0.301075268787 0.000000000000 -0.096774193639 -0.096774193639 0.000000000000 1 1 0
0.290322580616 0.290322580616 0.000000000000 -0.129032258152 -0.129032258152 0.000000000000 1 1 0
0.279569892445 0.279569892445 0.000000000000 -0.161290322665 -0.161290322665 0.000000000000 1 1 0
0.268817204274 0.268817204274 0.000000000000 -0.193548387177 -0.193548387177 0.000000000000 1 1 0
0.258064516103 0.258064516103 0.000000000000 -0.225806451690 -0.225806451690 0.000000000000 1 1 0
0.247311827932 0.247311827932 0.000000000000 -0.258064516203 -0.258064516203 0.000000000000 1 1 0
0.236559139761 0.236559139761 0.000000000000 -0.290322580716 -0.290322580716 0.000000000000 1 1 0
0.225806451590 0.225806451590 0.000000000000 -0.322580645229 -0.322580645229 0.000000000000 1 1 0
0.215053763419 0.215053763419 0.000000000000 -0.354838709742 -0.354838709742 0.000000000000 1 1 0
0.204301075248 0.204301075248 0.000000000000 -0.387096774255 -0.387096774255 0.000000000000 1 1 0
0.193548387077 0.193548387077 0.000000000000 -0.419354838768 -0.419354838768 0.000000000000 1 1 0
0.182795698906 0.182795698906 0.000000000000 -0.451612903281 -0.451612903281 0.000000000000 1 1 0
0.172043010735 0.172043010735 0.000000000000 -0.483870967794 -0.483870967794 0.000000000000 1 1 0
0.161290322565 0.161290322565 0.000000000000 0.483870967694 0.483870967694 0.000000000000 0 0 0
0.150537634394 0.150537634394 0.000000000000 0.451612903181 0.451612903181 0.000000000000 0 0 0
0.139784946223 0.139784946223 0.000000000000 0.419354838668 0.419354838668 0.000000000000 0 0 0
0.129032258052 0.129032258052 0.000000000000 0.387096774155 0.387096774155 0.000000000000 0 0 0
0.118279569881 0.118279569881 0.000000000000 0.354838709642 0.354838709642 0.000000000000 0 0 0
0.107526881710 0.107526881710 0.000000000000 0.322580645129 0.322580645129 0.000000000000 0 0 0
0.096774193539 0.096774193539 0.000000000000 0.290322580616 0.290322580616 0.000000000000 0 0 0
0.086021505368 0.086021505368 0.000000000000 0.258064516103 0.258064516103 0.000000000000 0 0 0
0.075268817197 0.075268817197 0.000000000000 0.225806451590 0.225806451590 0.000000000000 0 0 0
0.064516129026 0.064516129026 0.000000000000 0.193548387077 0.193548387077 0.000000000000 0 0 0
0.053763440855 0.053763440855 0.000000000000 0.161290322565 0.161290322565 0.000000000000 0 0 0
0.043010752684 0.043010752684 0.000000000000 0.129032258052 0.129032258052 0.000000000000 0 0 0
0.032258064513 0.032258064513 0.000000000000 0.096774193539 0.096774193539 0.000000000000 0 0 0
0.021505376342 0.021505376342 0.000000000000 0.064516129026 0.064516129026 0.000000000000 0 0 0
0.010752688171 0.010752688171 0.000000000000 0.032258064513 0.032258064513 0.000000000000 0 0 0
0.000000000000 0.000000000000 0.000000000000 0.000000000000 0.000000000000 0.000000000000 0 0 0
6.计算结束,一种后处理方式是执行 vaspkit -task 282
之后会生成 KLABELS、FERMI_ENERGY、EBS.dat 文件,执行 python eps_plot.py
得到能带图(这个只能得到总的);另外执行 vasp -task 284
可以得到投影的能带数据 PEBS_Mo.dat 和 PEBS_S.dat,此时只能自行画图。(注意 vaspkit 的版本不能过低)
eps_plot.py
#!/usr/bin/python
# -*- coding:utf-8 -*-
import numpy as np
import matplotlib as mpl
mpl.use('Agg') #silent mode
font = {'family' : 'arial',
'color' : 'black',
'weight' : 'normal',
'size' : 16.0,
}
from matplotlib import pyplot as plt
import matplotlib.ticker as ticker
hsp=np.loadtxt("KLABELS", dtype=np.string_,skiprows=1,usecols = (0,1))
group_labels = hsp[:-1,0].tolist()
group_labels = [i.decode('utf-8','ignore') for i in group_labels]
for index in range(len(group_labels)):
if group_labels[index]=="GAMMA":
group_labels[index]=u"Γ"
x = [float(i) for i in hsp[:-1,1].tolist()]
lwd=0.2
op=0.8
fig= plt.figure(figsize=(3.5,5))
data=np.loadtxt("EBS.dat")
kpt=data[:,0] # kpath
eng=data[:,1] # energy level
wgt=data[:,2]*20 # weight, 20 is enlargement factor
ax = fig.add_subplot(111)
ax.scatter(kpt,eng,wgt,edgecolor = 'blue',alpha=op)
ax.yaxis.set_minor_locator(ticker.MultipleLocator(0.40))
ax.set_ylim(-2,2)
ytick=np.arange(-2, 2.1, 1)
a=int(len(ytick)/2)
plt.yticks(np.insert(ytick,a,0))
ax.set_xticks(x)
plt.yticks(fontsize=16,fontname='arial')
ax.set_xticklabels(group_labels, rotation=0,fontsize=10,fontname='arial')
ax.axhline(y=0, xmin=0, xmax=1,linestyle= '-',linewidth=0.5,color='0.5')
ax.set_ylabel(r'$\mathrm{E}$-$\mathrm{E_{F}}$ (eV)',fontdict=font)
for i in x[1:-1]:
ax.axvline(x=i, ymin=0, ymax=1,linestyle= '-',linewidth=0.5,color='0.5')
ax.set_xlim((x[0], x[-1]))
#plt.show()
plt.savefig('EBS.png',dpi=1000)
7.另一种后处理方式是使用 Matlab 画图(画的图比较好看,也比较方便,推荐这一种方式),得到总的贡献的能带图(Total),需要执行 vaspkit -> 28 -> 285 -> 1 -> all(所有原子) -> all(所有轨道),这一过程会读取相应的文件除了基本的输出文件,还有前面生成的KPOINTS_MAPPING_TABLE.in 以及 KPATH.in 文件;之后会生成下面绿线所示的文件用于 Matlab 画图分别是 ENERGY.grd(能量)、MOMENTUM.grd(动量,K点)、WEIGHT.grd(权重),以及 KLABELS(高对称点)。此外生成的 SELECTED_ATOMS_LIST 以及 SELECTED_ORBITALS_LIST 可用来验证是否是所选的元素或轨道,而 PEBS_SUM.dat 文件则可用来自己画图。
8.要得到某一元素贡献的能带图(以Mo为例),需要执行 vaspkit -> 28 -> 285 -> 1 -> Mo(Mo原子) -> all(所有轨道),其它元素同理,不同原子、不同轨道各种组合也都可以,得到的关于Mo的 PEBS_SUM.dat 与 PEBS_Mo.dat 的数据应该是差不多的。
9.Matlab画图流程,将前面三个 .grd 文件以及 KLABELS 移到本地(如果服务器安装了Matlab应该也可以,没试过),放到一个文件夹中以 Total 为例,在Total文件夹下放置这四个文件同时复制 ebs_k_resolved_dos_plot_matlalb(路径:vaspkit.1.4.0/examples/band_unfolding/)文件到此文件夹,此程序的内容如下:
function plot_band
% First run vaspkit (version => 1.2.3) with task 216, 257 or 285 to get MOMENTUM.grd, ENERGY.grd and WEIGHT.grd
clc
clear
momentum=load('MOMENTUM.grd');
energy=load('ENERGY.grd');
weight=load('WEIGHT.grd');
momentum_min = min(momentum(:));
momentum_max = max(momentum(:));
energy_min = min(energy(:));
energy_max = max(energy(:));
colormap('jet') %可修改 colormap('hot'),这两种颜色比较好看
set(gca,'Fontsize',20)
fig = pcolor(momentum, energy, weight);
shading interp;
set(fig, 'LineStyle', 'none')
title('Total') %title(fig_title)
ylabel('Energy (eV)')
ylim([-6 4]); %纵坐标范围
set(gca,'ytick',-6:2:4)
set(gca, 'XTickLabel', {'\Gamma', 'M', 'K', '\Gamma'}, 'XTick', [momentum_min 1.140 1.798 momentum_max],'Fontsize',20) % '\Gamma', 'M', 'K', '\Gamma', 1.137 and 1.793 is read from KLABEL file
line([momentum_min momentum_max], [0 0], 'LineStyle', '--', 'Color', 'w', 'LineWidth',1)
line([1 1]*1.140, [energy_min energy_max], 'LineStyle', '--', 'Color', 'w', 'LineWidth',1) % 1.137 is read from KLABEL file,
line([1 1]* 1.798, [energy_min energy_max], 'LineStyle', '--', 'Color', 'w', 'LineWidth',1) % 1.793 is read from KLABEL file
colorbar %自己加的显示颜色柱
%caxis([0,max(weight(:))]); %设置颜色柱的范围,默认的效果和此行代码一致
主要需要修改的就是第21-24行的内容(坐标范围不合适也需要修改),不同的高对称点名称可以根据 KPOINTS 文件修改,而高对称点的坐标比如M点坐标需要查看 KLABELS 文件,以 Total 为例,M 点坐标为 1.140 和原来的 1.137 比较接近(因为本身就是参考的官网MoS2的例子,其它晶体结构就要大幅修改了):
KPOINTS
K-Label K-Coordinate in band-structure plots
Gamma 0.000
M 1.140
K 1.798
Gamma 3.114
* Give the label for each high symmetry point in KPOINTS (KPATH.in) file. Otherwise, they will be identified as 'Undefined' in KLABELS file
10.S空位的计算流程与上边一样,需要对超胞结构移除一个或多个S原子,这里移除一个S原子,晶体结构如图所示:
11.计算结果
Python绘图
完美晶体EBS
一个S空位EBS
Matlab绘图
完美晶体
一个S空位
汇总对比
12.有时候出来的图可能展宽比较大,导致比较模糊,vaspkit 的默认的是 EMIN,EMAX,SIGMA and NEDOS:-20 20 0.1 2001,可以通过修改 ~/.vaspkit 文件来调整,比如将展宽调小一些。下面第20-28行的内容,没有可自行添加。
.vaspkit
# cp how_to_set_environment_variable ~/.vaspkit and modify the ~/.vaspkit file based on your settings!
VASP5 .TRUE. # .TRUE. or .FALSE.; Set .FALSE. if you are using vasp.4.x
LDA_PATH ~/paw/LDA # Path of LDA potential.
PBE_PATH ~/paw/PBE # Path of PBE potential.
PW91_PATH ~/POTCAR/PW91 # Path of PW91 potential.
POTCAR_TYPE PBE # PBE, PW91 or LDA; Set PBE if you want to make PBE-POTCAR file
GW_POTCAR .FALSE. # .TRUE. or .FALSE.; For example, H_GW, O_GW will be chose when POTCAR_GW = .TRUE.
RECOMMENDED_POTCAR .TRUE. # .TRUE. or .FALSE.; The recommended PAW potential will be chose when RECOMMENDED_POTCAR = .TRUE.
SET_FERMI_ENERGY_ZERO .TRUE. # .TRUE. or .FALSE.; The Fermi Energy will be set to zero eV when SET_FERMI_ENERGY_ZERO = .TRUE.
MINI_INCAR .FALSE. # .TRUE. or .FALSE.; A simplified INCAR will be written when MINI_INCAR = .TRUE.
USER_DEFINED_INCAR .TRUE. # .TRUE. or .FALSE.; whether to use embedded INCAR templates or user defined INCAR templates
WRITE_SELECTIVE_DYNAMICS .FALSE. # .TRUE. or .FALSE.; whether the selective dymanics set will be forced to write when SET_SELECTIVE_DYNAMICS_MODE = .FALSE.
PYTHON_BIN ~/anaconda3/bin/python3 # Python executable program with its installation path. I recommend you install anaconda package for Python data science
PYTHON_VERSION 3 # Python version is 2. SET it 3 if your python environment is python3
PLOT_MATPLOTLIB .FALSE. # .TRUE. or .FALSE.; Set .TRUE. if you want to generate Graphs. (Matplotlib and Numpy packages MUST be embedded in Python)
VASPKIT_UTILITIES_PATH /home/sqw/soft/vaspkit.1.4.0/utilities
ADVANCED_USER .TRUE. # .TRUE. or .FALSE.; Please fill in your settings in the block 'USER_DEFINED' if you want vaspkit to integrate your own scripts in the 'UTILITIES' file.
SET_INCAR_WRITE_MODE OVERRIDE # OVERRIDE, APPEND, BACK-UP-OLD,BACK-UP-NEW; "Customize INCAR File" whether to override existing INCAR/appending existing INCAR/backup existing INCAR to INCAR.old && write into INCAR/write into INCAR.new
# Reset the default values of variables in here
SYMPREC 1E-5 # Distance tolerance in Cartesian coordinates to find crystal symmetry (default value: 1E-5)
EMIN -20.0 # Minimum energy for evaluation of DOS (default value: -20.0 eV)
EMAX 20.0 # Maximum energy for evaluation of DOS (default value: 20.0 eV)
NEDOS 2001 # Number of grid points in DOS (default value: 2001)
GAMMA_CENTERED .TRUE. # .TRUE. or .FALSE.; (default value: .TRUE.)
VACUUM_THICKNESS 15.0 # The thickness of vacuum to build slab or 2D materials (default value: 10 angstrom)
CENTER_SLAB .TRUE. # Center the slab in the z direction; (default value: .TRUE.)
SIGMA 0.1 # (default value: 0.1)
#USER_DEFINED
#Synopsis:The first parameter is the command-id,starting with 'u'; the second is the interpreter, like 'python/bash/perl'(Please left it blank if you are using an executive binary); the third is the name of a script or an executive binary; the fourth one is a switch, if any extra argv is needed, please set if .TRUE. ; the last on is the description, MUST use '_' as delimiter.
# id interpreter script argv description
#Example1 'u1 python get_entropy.py .TRUE. get_entropy'
#Example2 'u2 hello.exe .FALSE. ls '
u1 python get_entropy.py .TRUE. get_entropy_for_adsorbate
u2 python bader2pqr.py .FALSE. bader2pqr
#END_USER_DEFINED
13.需要留意一些 colorbar 的范围,可以看到S空位会导致在原本的能隙之间产生了缺陷态,而且主要有Mo原子贡献,在计算含有S空位时发现,生成的 EBS.dat 与所有原子所有轨道所得到的的 PEBS_SUM.dat 差别较大,下面展示了能带1的差别,根据 EBS.dat 画出来的数据如上面 一个S空位EBS 所示,虽然可以通过倍数相乘扩展到 KLABELS 范围,但是为什么会出现这种情况,我还不知道,所以推荐用 vaspkit的285功能。
EBS.dat
#K-Path(1/A) Energy(eV) Weight
# Band-Index 1
0.0000 -14.4249 0.9623
0.0103 -14.4223 0.9622
0.0207 -14.4147 0.9620
0.0310 -14.4021 0.9617
0.0414 -14.3845 0.9612
0.0517 -14.3621 0.9604
0.0621 -14.3349 0.9593
0.0724 -14.3031 0.9575
0.0828 -14.2670 0.9544
0.0931 -14.2269 0.9486
0.1034 -14.1838 0.9348
0.1138 -14.1397 0.8895
0.1241 -14.1053 0.6660
0.1345 -14.1140 0.2031
0.1448 -14.1542 0.0650
0.1552 -14.1984 0.0318
0.1655 -14.2407 0.0199
0.1758 -14.2795 0.0142
0.1862 -14.3142 0.0111
0.1965 -14.3445 0.0092
0.2069 -14.3701 0.0080
0.2172 -14.3909 0.0071
0.2276 -14.4069 0.0064
0.2379 -14.4178 0.0060
0.2483 -14.4237 0.0056
0.2586 -14.4246 0.0053
0.2689 -14.4204 0.0051
0.2793 -14.4111 0.0049
0.2896 -14.3968 0.0047
0.3000 -14.3776 0.0046
0.3103 -14.3535 0.0045
0.3207 -14.3248 0.0044
0.3310 -14.2915 0.0042
0.3413 -14.2540 0.0041
0.3517 -14.2128 0.0038
0.3620 -14.1690 0.0033
0.3724 -14.1260 0.0022
0.3827 -14.1020 0.0006
0.3827 -14.1020 0.0006
0.3932 -14.0996 0.0006
0.4038 -14.0924 0.0006
0.4143 -14.0805 0.0006
0.4248 -14.0641 0.0006
0.4353 -14.0436 0.0006
0.4458 -14.0209 0.0006
0.4564 -14.0055 0.0003
0.4669 -14.0285 0.0006
0.4774 -14.0753 0.0015
0.4879 -14.1254 0.0020
0.4985 -14.1741 0.0024
0.5090 -14.2196 0.0027
0.5195 -14.2613 0.0028
0.5300 -14.2988 0.0029
0.5405 -14.3317 0.0030
0.5511 -14.3599 0.0030
0.5616 -14.3831 0.0031
0.5721 -14.4013 0.0031
0.5826 -14.4144 0.0031
0.5931 -14.4222 0.0031
0.6037 -14.4249 0.0031
0.6037 -14.4249 0.0031
0.6139 -14.4224 0.0031
0.6242 -14.4149 0.0031
0.6345 -14.4024 0.0031
0.6448 -14.3850 0.0031
0.6550 -14.3629 0.0031
0.6653 -14.3360 0.0031
0.6756 -14.3046 0.0030
0.6859 -14.2688 0.0030
0.6962 -14.2289 0.0029
0.7064 -14.1854 0.0028
0.7167 -14.1387 0.0025
0.7270 -14.0901 0.0021
0.7373 -14.0427 0.0012
0.7475 -14.0087 0.0002
0.7578 -14.0120 0.0007
0.7681 -14.0330 0.0011
0.7784 -14.0539 0.0014
0.7887 -14.0715 0.0016
0.7989 -14.0849 0.0019
0.8092 -14.0940 0.0022
0.8195 -14.0986 0.0027
0.8298 -14.0986 0.0034
0.8400 -14.0940 0.0045
0.8503 -14.0849 0.0063
0.8606 -14.0715 0.0096
0.8709 -14.0539 0.0168
0.8811 -14.0330 0.0371
0.8914 -14.0120 0.1248
0.9017 -14.0087 0.5243
0.9120 -14.0427 0.8254
0.9223 -14.0901 0.9052
0.9325 -14.1387 0.9328
0.9428 -14.1854 0.9451
0.9531 -14.2289 0.9516
0.9634 -14.2688 0.9554
0.9736 -14.3046 0.9578
0.9839 -14.3360 0.9594
0.9942 -14.3629 0.9604
1.0045 -14.3850 0.9612
1.0148 -14.4024 0.9617
1.0250 -14.4149 0.9620
1.0353 -14.4224 0.9622
1.0456 -14.4249 0.9623
PEBS_SUM.dat
#K-Path Energy Orbital-Weight
# NKPTS & NBANDS: 104 96
# Band-Index 1
0.0000 -14.4249 0.6717
0.0310 -14.4223 0.6716
0.0621 -14.4147 0.6725
0.0931 -14.4021 0.6713
0.1241 -14.3845 0.6709
0.1552 -14.3621 0.6694
0.1862 -14.3349 0.6667
0.2172 -14.3031 0.6702
0.2483 -14.2670 0.6652
0.2793 -14.2269 0.6602
0.3103 -14.1838 0.6478
0.3413 -14.1397 0.6235
0.3724 -14.1053 0.4675
0.4034 -14.1140 0.1426
0.4344 -14.1542 0.0452
0.4655 -14.1984 0.0222
0.4965 -14.2407 0.0139
0.5275 -14.2795 0.0099
0.5586 -14.3142 0.0078
0.5896 -14.3445 0.0064
0.6206 -14.3701 0.0056
0.6517 -14.3909 0.0049
0.6827 -14.4069 0.0045
0.7137 -14.4178 0.0042
0.7448 -14.4237 0.0039
0.7758 -14.4246 0.0037
0.8068 -14.4204 0.0035
0.8379 -14.4111 0.0034
0.8689 -14.3968 0.0033
0.8999 -14.3776 0.0032
0.9309 -14.3535 0.0031
0.9620 -14.3248 0.0030
0.9930 -14.2915 0.0030
1.0240 -14.2540 0.0028
1.0551 -14.2128 0.0027
1.0861 -14.1690 0.0023
1.1171 -14.1260 0.0015
1.1482 -14.1020 0.0004
1.1482 -14.1020 0.0004
1.1797 -14.0996 0.0004
1.2113 -14.0924 0.0004
1.2429 -14.0805 0.0004
1.2744 -14.0641 0.0004
1.3060 -14.0436 0.0004
1.3375 -14.0209 0.0004
1.3691 -14.0055 0.0002
1.4007 -14.0285 0.0005
1.4322 -14.0753 0.0010
1.4638 -14.1254 0.0014
1.4954 -14.1741 0.0017
1.5269 -14.2196 0.0019
1.5585 -14.2613 0.0020
1.5900 -14.2988 0.0020
1.6216 -14.3317 0.0021
1.6532 -14.3599 0.0021
1.6847 -14.3831 0.0021
1.7163 -14.4013 0.0022
1.7479 -14.4144 0.0022
1.7794 -14.4222 0.0022
1.8110 -14.4249 0.0022
1.8110 -14.4249 0.0022
1.8418 -14.4224 0.0022
1.8726 -14.4149 0.0022
1.9035 -14.4024 0.0022
1.9343 -14.3850 0.0021
1.9651 -14.3629 0.0021
1.9960 -14.3360 0.0021
2.0268 -14.3046 0.0021
2.0576 -14.2688 0.0021
2.0885 -14.2289 0.0020
2.1193 -14.1854 0.0019
2.1501 -14.1387 0.0018
2.1810 -14.0901 0.0015
2.2118 -14.0427 0.0009
2.2426 -14.0087 0.0002
2.2735 -14.0120 0.0005
2.3043 -14.0330 0.0008
2.3351 -14.0539 0.0009
2.3660 -14.0715 0.0011
2.3968 -14.0849 0.0013
2.4276 -14.0940 0.0016
2.4585 -14.0986 0.0019
2.4893 -14.0986 0.0024
2.5201 -14.0940 0.0031
2.5509 -14.0849 0.0044
2.5818 -14.0715 0.0067
2.6126 -14.0539 0.0117
2.6434 -14.0330 0.0259
2.6743 -14.0120 0.0871
2.7051 -14.0087 0.3670
2.7359 -14.0427 0.5745
2.7668 -14.0901 0.6391
2.7976 -14.1387 0.6520
2.8284 -14.1854 0.6578
2.8593 -14.2289 0.6652
2.8901 -14.2688 0.6688
2.9209 -14.3046 0.6685
2.9518 -14.3360 0.6687
2.9826 -14.3629 0.6685
3.0134 -14.3850 0.6680
3.0443 -14.4024 0.6713
3.0751 -14.4149 0.6715
3.1059 -14.4224 0.6716
3.1368 -14.4249 0.6717
评论区