当前位置: 代码迷 >> 综合 >> Quantum Espresso Hands-On实战训练(一)——DFT能带计算
  详细解决方案

Quantum Espresso Hands-On实战训练(一)——DFT能带计算

热度:54   发布时间:2024-02-13 06:40:16.0

文章目录

    • 计算步骤
    • scf-bands获得能带结构
    • scf直接获得能带

计算步骤

一般来说有以下过程

  1. scf自洽
  2. nscf (bands)计算
  3. 后处理
    前两步的主要区别在网格选取,第一步主要采用非密集网格,诸如
K_POINTS automatic 5 5 5   1 1 1

第二步主要采用K点路径,诸如VASPKIT杂化泛函产生的Kpoints,以及Seek-Path等

K_POINTS crystal 
202 0.000000000    0.000000000    0.000000000      1.000000000 0.011111111    0.000000000    0.011111111      1.000000000 0.022222222    0.000000000    0.022222222      1.000000000 0.033333333    0.000000000    0.033333333      1.000000000 0.044444444    0.000000000    0.044444444      1.000000000 0.055555556    0.000000000    0.055555556      1.000000000 0.066666667    0.000000000    0.066666667      1.000000000 0.077777778    0.000000000    0.077777778      1.000000000 0.088888889    0.000000000    0.088888889      1.000000000 0.100000000    0.000000000    0.100000000      1.000000000 0.111111111    0.000000000    0.111111111      1.000000000 0.122222222    0.000000000    0.122222222      1.000000000 0.133333333    0.000000000    0.133333333      1.000000000 0.144444444    0.000000000    0.144444444      1.000000000 0.155555556    0.000000000    0.155555556      1.000000000 0.166666667    0.000000000    0.166666667      1.000000000 0.177777778    0.000000000    0.177777778      1.000000000 0.188888889    0.000000000    0.188888889      1.000000000 0.200000000    0.000000000    0.200000000      1.000000000 0.211111111    0.000000000    0.211111111      1.000000000 0.222222222    0.000000000    0.222222222      1.000000000 0.233333333    0.000000000    0.233333333      1.000000000 0.244444444    0.000000000    0.244444444      1.000000000 0.255555556    0.000000000    0.255555556      1.000000000 0.266666667    0.000000000    0.266666667      1.000000000 0.277777778    0.000000000    0.277777778      1.000000000 0.288888889    0.000000000    0.288888889      1.000000000 0.300000000    0.000000000    0.300000000      1.000000000 0.311111111    0.000000000    0.311111111      1.000000000 0.322222222    0.000000000    0.322222222      1.000000000 0.333333333    0.000000000    0.333333333      1.000000000 0.344444444    0.000000000    0.344444444      1.000000000 0.355555556    0.000000000    0.355555556      1.000000000 0.366666667    0.000000000    0.366666667      1.000000000 0.377777778    0.000000000    0.377777778      1.000000000 0.388888889    0.000000000    0.388888889      1.000000000 0.400000000    0.000000000    0.400000000      1.000000000 0.411111111    0.000000000    0.411111111      1.000000000 0.422222222    0.000000000    0.422222222      1.000000000 0.433333333    0.000000000    0.433333333      1.000000000 0.444444444    0.000000000    0.444444444      1.000000000 0.455555556    0.000000000    0.455555556      1.000000000 0.466666667    0.000000000    0.466666667      1.000000000 0.477777778    0.000000000    0.477777778      1.000000000 0.488888889    0.000000000    0.488888889      1.000000000 0.500000000    0.000000000    0.500000000      1.000000000 0.508333333    0.016666667    0.508333333      1.000000000 0.516666667    0.033333333    0.516666667      1.000000000 0.525000000    0.050000000    0.525000000      1.000000000 0.533333333    0.066666667    0.533333333      1.000000000 0.541666667    0.083333333    0.541666667      1.000000000 0.550000000    0.100000000    0.550000000      1.000000000 0.558333333    0.116666667    0.558333333      1.000000000 0.566666667    0.133333333    0.566666667      1.000000000 0.575000000    0.150000000    0.575000000      1.000000000 0.583333333    0.166666667    0.583333333      1.000000000 0.591666667    0.183333333    0.591666667      1.000000000 0.600000000    0.200000000    0.600000000      1.000000000 0.608333333    0.216666667    0.608333333      1.000000000 0.616666667    0.233333333    0.616666667      1.000000000 0.625000000    0.250000000    0.625000000      1.000000000 0.375000000    0.375000000    0.750000000      1.000000000 0.367187500    0.367187500    0.734375000      1.000000000 0.359375000    0.359375000    0.718750000      1.000000000 0.351562500    0.351562500    0.703125000      1.000000000 0.343750000    0.343750000    0.687500000      1.000000000 0.335937500    0.335937500    0.671875000      1.000000000 0.328125000    0.328125000    0.656250000      1.000000000 0.320312500    0.320312500    0.640625000      1.000000000 0.312500000    0.312500000    0.625000000      1.000000000 0.304687500    0.304687500    0.609375000      1.000000000 0.296875000    0.296875000    0.593750000      1.000000000 0.289062500    0.289062500    0.578125000      1.000000000 0.281250000    0.281250000    0.562500000      1.000000000 0.273437500    0.273437500    0.546875000      1.000000000 0.265625000    0.265625000    0.531250000      1.000000000 0.257812500    0.257812500    0.515625000      1.000000000 0.250000000    0.250000000    0.500000000      1.000000000 0.242187500    0.242187500    0.484375000      1.000000000 0.234375000    0.234375000    0.468750000      1.000000000 0.226562500    0.226562500    0.453125000      1.000000000 0.218750000    0.218750000    0.437500000      1.000000000 0.210937500    0.210937500    0.421875000      1.000000000 0.203125000    0.203125000    0.406250000      1.000000000 0.195312500    0.195312500    0.390625000      1.000000000 0.187500000    0.187500000    0.375000000      1.000000000 0.179687500    0.179687500    0.359375000      1.000000000 0.171875000    0.171875000    0.343750000      1.000000000 0.164062500    0.164062500    0.328125000      1.000000000 0.156250000    0.156250000    0.312500000      1.000000000 0.148437500    0.148437500    0.296875000      1.000000000 0.140625000    0.140625000    0.281250000      1.000000000 0.132812500    0.132812500    0.265625000      1.000000000 0.125000000    0.125000000    0.250000000      1.000000000 0.117187500    0.117187500    0.234375000      1.000000000 0.109375000    0.109375000    0.218750000      1.000000000 0.101562500    0.101562500    0.203125000      1.000000000 0.093750000    0.093750000    0.187500000      1.000000000 0.085937500    0.085937500    0.171875000      1.000000000 0.078125000    0.078125000    0.156250000      1.000000000 0.070312500    0.070312500    0.140625000      1.000000000 0.062500000    0.062500000    0.125000000      1.000000000 0.054687500    0.054687500    0.109375000      1.000000000 0.046875000    0.046875000    0.093750000      1.000000000 0.039062500    0.039062500    0.078125000      1.000000000 0.031250000    0.031250000    0.062500000      1.000000000 0.023437500    0.023437500    0.046875000      1.000000000 0.015625000    0.015625000    0.031250000      1.000000000 0.007812500    0.007812500    0.015625000      1.000000000 0.000000000    0.000000000    0.000000000      1.000000000 0.012820513    0.012820513    0.012820513      1.000000000 0.025641026    0.025641026    0.025641026      1.000000000 0.038461539    0.038461539    0.038461539      1.000000000 0.051282051    0.051282051    0.051282051      1.000000000 0.064102564    0.064102564    0.064102564      1.000000000 0.076923077    0.076923077    0.076923077      1.000000000 0.089743590    0.089743590    0.089743590      1.000000000 0.102564103    0.102564103    0.102564103      1.000000000 0.115384615    0.115384615    0.115384615      1.000000000 0.128205128    0.128205128    0.128205128      1.000000000 0.141025641    0.141025641    0.141025641      1.000000000 0.153846154    0.153846154    0.153846154      1.000000000 0.166666667    0.166666667    0.166666667      1.000000000 0.179487180    0.179487180    0.179487180      1.000000000 0.192307692    0.192307692    0.192307692      1.000000000 0.205128205    0.205128205    0.205128205      1.000000000 0.217948718    0.217948718    0.217948718      1.000000000 0.230769231    0.230769231    0.230769231      1.000000000 0.243589744    0.243589744    0.243589744      1.000000000 0.256410256    0.256410256    0.256410256      1.000000000 0.269230769    0.269230769    0.269230769      1.000000000 0.282051282    0.282051282    0.282051282      1.000000000 0.294871795    0.294871795    0.294871795      1.000000000 0.307692308    0.307692308    0.307692308      1.000000000 0.320512821    0.320512821    0.320512821      1.000000000 0.333333333    0.333333333    0.333333333      1.000000000 0.346153846    0.346153846    0.346153846      1.000000000 0.358974359    0.358974359    0.358974359      1.000000000 0.371794872    0.371794872    0.371794872      1.000000000 0.384615385    0.384615385    0.384615385      1.000000000 0.397435897    0.397435897    0.397435897      1.000000000 0.410256410    0.410256410    0.410256410      1.000000000 0.423076923    0.423076923    0.423076923      1.000000000 0.435897436    0.435897436    0.435897436      1.000000000 0.448717949    0.448717949    0.448717949      1.000000000 0.461538461    0.461538461    0.461538461      1.000000000 0.474358974    0.474358974    0.474358974      1.000000000 0.487179487    0.487179487    0.487179487      1.000000000 0.500000000    0.500000000    0.500000000      1.000000000 0.500000000    0.491935484    0.508064516      1.000000000 0.500000000    0.483870968    0.516129032      1.000000000 0.500000000    0.475806452    0.524193548      1.000000000 0.500000000    0.467741935    0.532258065      1.000000000 0.500000000    0.459677419    0.540322581      1.000000000 0.500000000    0.451612903    0.548387097      1.000000000 0.500000000    0.443548387    0.556451613      1.000000000 0.500000000    0.435483871    0.564516129      1.000000000 0.500000000    0.427419355    0.572580645      1.000000000 0.500000000    0.419354839    0.580645161      1.000000000 0.500000000    0.411290323    0.588709677      1.000000000 0.500000000    0.403225807    0.596774194      1.000000000 0.500000000    0.395161290    0.604838710      1.000000000 0.500000000    0.387096774    0.612903226      1.000000000 0.500000000    0.379032258    0.620967742      1.000000000 0.500000000    0.370967742    0.629032258      1.000000000 0.500000000    0.362903226    0.637096774      1.000000000 0.500000000    0.354838710    0.645161290      1.000000000 0.500000000    0.346774193    0.653225806      1.000000000 0.500000000    0.338709677    0.661290323      1.000000000 0.500000000    0.330645161    0.669354839      1.000000000 0.500000000    0.322580645    0.677419355      1.000000000 0.500000000    0.314516129    0.685483871      1.000000000 0.500000000    0.306451613    0.693548387      1.000000000 0.500000000    0.298387097    0.701612903      1.000000000 0.500000000    0.290322581    0.709677419      1.000000000 0.500000000    0.282258065    0.717741935      1.000000000 0.500000000    0.274193548    0.725806452      1.000000000 0.500000000    0.266129032    0.733870968      1.000000000 0.500000000    0.258064516    0.741935484      1.000000000 0.500000000    0.250000000    0.750000000      1.000000000 0.500000000    0.238636364    0.738636364      1.000000000 0.500000000    0.227272727    0.727272727      1.000000000 0.500000000    0.215909091    0.715909091      1.000000000 0.500000000    0.204545455    0.704545454      1.000000000 0.500000000    0.193181818    0.693181818      1.000000000 0.500000000    0.181818182    0.681818182      1.000000000 0.500000000    0.170454545    0.670454546      1.000000000 0.500000000    0.159090909    0.659090909      1.000000000 0.500000000    0.147727273    0.647727273      1.000000000 0.500000000    0.136363636    0.636363636      1.000000000 0.500000000    0.125000000    0.625000000      1.000000000 0.500000000    0.113636364    0.613636364      1.000000000 0.500000000    0.102272727    0.602272727      1.000000000 0.500000000    0.090909091    0.590909091      1.000000000 0.500000000    0.079545455    0.579545454      1.000000000 0.500000000    0.068181818    0.568181818      1.000000000 0.500000000    0.056818182    0.556818182      1.000000000 0.500000000    0.045454545    0.545454546      1.000000000 0.500000000    0.034090909    0.534090909      1.000000000 0.500000000    0.022727273    0.522727273      1.000000000 0.500000000    0.011363636    0.511363636      1.000000000 0.500000000    0.000000000    0.500000000      1.000000000

有时候偷懒,对于LDA和GGA泛函,计算量比较小,可直接采用nscf或bands的K点,进行scf计算后直接得到能带结构。

scf-bands获得能带结构

  1. scf自洽
 &CONTROLtitle = 'LDA.inp' ,calculation = 'scf' ,restart_mode = 'from_scratch' ,pseudo_dir = '/home/flyingd/Desktop/LDA/pseorsu/' ,/&SYSTEMibrav = 0,nat = 2,ntyp = 1,ecutwfc = 50 ,ecutrho = 200 ,nbnd = 8,occupations = 'smearing' ,degauss = 1d-9 ,smearing = 'gaussian' ,/&ELECTRONS/
CELL_PARAMETERS angstrom -0.000000000    2.681233128    2.681233128 2.681233128   -0.000000000    2.681233128 2.681233128    2.681233128    0.000000000 
ATOMIC_SPECIESSi   28.08550  Si.pz-n-rrkjus_psl.1.0.0.UPF 
ATOMIC_POSITIONS crystal Si      0.000000000    0.000000000    0.000000000    Si      0.250000000    0.250000000    0.250000000    
K_POINTS automatic 5 5 5   1 1 1
  1. nscf或bands
 &CONTROLtitle = 'LDA.inp' ,calculation = 'bands' ,pseudo_dir = '/home/flyingd/Desktop/LDA/pseorsu/' ,/&SYSTEMibrav = 0,nat = 2,ntyp = 1,ecutwfc = 50 ,ecutrho = 200 ,nbnd = 8,nosym = .false. ,occupations = 'smearing' ,degauss = 1d-9 ,smearing = 'gaussian' ,/&ELECTRONS/
CELL_PARAMETERS angstrom -0.000000000    2.681233128    2.681233128 2.681233128   -0.000000000    2.681233128 2.681233128    2.681233128    0.000000000 
ATOMIC_SPECIESSi   28.08550  Si.pz-n-rrkjus_psl.1.0.0.UPF 
ATOMIC_POSITIONS crystal Si      0.000000000    0.000000000    0.000000000    Si      0.250000000    0.250000000    0.250000000    
K_POINTS crystal 
202 0.000000000    0.000000000    0.000000000      1.000000000 0.011111111    0.000000000    0.011111111      1.000000000 0.022222222    0.000000000    0.022222222      1.000000000 0.033333333    0.000000000    0.033333333      1.000000000 0.044444444    0.000000000    0.044444444      1.000000000 
  1. 后处理及能带可视化
    新建bands.inp作为bands.x的输入文件
&bands
prefix='pwscf',
outdir='./'
filband='bd.dat'
lp=.true.
/
bands.x -i bands.inp

得到bd.dat.gnu文件,gnuplot

gnuplot
plot "bd.dat.gnu"

或直接运行脚本(nscf+后处理)

#!/bin/bash
read -p "input file(scf/band/nscf/etc.pw.in) :" filename
mpirun -np 2 pw.x < $filename > $filename.out
sleep 2
while truedoprocess=`pgrep pw.x`if [ "$process" == "" ]; thenecho "pw.x ending, start bands.x/gnuplot";bands.x -i bands.inp		gnuplot -persist <<EOFset term x11plot "bd.dat.gnu" EOFbreak;elseecho "process exsits";fidone

即可得到能带图
LDA计算的硅的能带

scf直接获得能带

  1. Kpath自定义
VASPKIT产生Kpath,修改Kpath为自己想用的。
通过251命令产生Kpoints,删除有权重的k点,将权重0的点改为权重为1的点。
或者采用Seek-Path
K_POINTS crystal 
1270.50000000000000    0.50000000000000    0.50000000000000     10.48437500000000    0.48437500000000    0.48437500000000     10.46875000000000    0.46875000000000    0.46875000000000     10.45312500000000    0.45312500000000    0.45312500000000     10.43750000000000    0.43750000000000    0.43750000000000     10.42187500000000    0.42187500000000    0.42187500000000     10.40625000000000    0.40625000000000    0.40625000000000     10.39062500000000    0.39062500000000    0.39062500000000     10.37500000000000    0.37500000000000    0.37500000000000     10.35937500000000    0.35937500000000    0.35937500000000     10.34375000000000    0.34375000000000    0.34375000000000     10.32812500000000    0.32812500000000    0.32812500000000     10.31250000000000    0.31250000000000    0.31250000000000     10.29687500000000    0.29687500000000    0.29687500000000     10.28125000000000    0.28125000000000    0.28125000000000     10.26562500000000    0.26562500000000    0.26562500000000     10.25000000000000    0.25000000000000    0.25000000000000     10.23437500000000    0.23437500000000    0.23437500000000     10.21875000000000    0.21875000000000    0.21875000000000     10.20312500000000    0.20312500000000    0.20312500000000     10.18750000000000    0.18750000000000    0.18750000000000     10.17187500000000    0.17187500000000    0.17187500000000     10.15625000000000    0.15625000000000    0.15625000000000     10.14062500000000    0.14062500000000    0.14062500000000     10.12500000000000    0.12500000000000    0.12500000000000     10.10937500000000    0.10937500000000    0.10937500000000     10.09375000000000    0.09375000000000    0.09375000000000     10.07812500000000    0.07812500000000    0.07812500000000     10.06250000000000    0.06250000000000    0.06250000000000     10.04687500000000    0.04687500000000    0.04687500000000     10.03125000000000    0.03125000000000    0.03125000000000     10.01562500000000    0.01562500000000    0.01562500000000     10.00000000000000    0.00000000000000    0.00000000000000     10.00000000000000    0.00000000000000    0.00000000000000     10.01351351351351    0.00000000000000    0.01351351351351     10.02702702702703    0.00000000000000    0.02702702702703     10.04054054054054    0.00000000000000    0.04054054054054     10.05405405405405    0.00000000000000    0.05405405405405     10.06756756756757    0.00000000000000    0.06756756756757     10.08108108108108    0.00000000000000    0.08108108108108     10.09459459459459    0.00000000000000    0.09459459459459     10.10810810810811    0.00000000000000    0.10810810810811     10.12162162162162    0.00000000000000    0.12162162162162     10.13513513513514    0.00000000000000    0.13513513513514     10.14864864864865    0.00000000000000    0.14864864864865     10.16216216216216    0.00000000000000    0.16216216216216     10.17567567567568    0.00000000000000    0.17567567567568     10.18918918918919    0.00000000000000    0.18918918918919     10.20270270270270    0.00000000000000    0.20270270270270     10.21621621621622    0.00000000000000    0.21621621621622     10.22972972972973    0.00000000000000    0.22972972972973     10.24324324324324    0.00000000000000    0.24324324324324     10.25675675675676    0.00000000000000    0.25675675675676     10.27027027027027    0.00000000000000    0.27027027027027     10.28378378378378    0.00000000000000    0.28378378378378     10.29729729729730    0.00000000000000    0.29729729729730     10.31081081081081    0.00000000000000    0.31081081081081     10.32432432432432    0.00000000000000    0.32432432432432     10.33783783783784    0.00000000000000    0.33783783783784     10.35135135135135    0.00000000000000    0.35135135135135     10.36486486486486    0.00000000000000    0.36486486486486     10.37837837837838    0.00000000000000    0.37837837837838     10.39189189189189    0.00000000000000    0.39189189189189     10.40540540540541    0.00000000000000    0.40540540540541     10.41891891891892    0.00000000000000    0.41891891891892     10.43243243243243    0.00000000000000    0.43243243243243     10.44594594594595    0.00000000000000    0.44594594594595     10.45945945945946    0.00000000000000    0.45945945945946     10.47297297297297    0.00000000000000    0.47297297297297     10.48648648648649    0.00000000000000    0.48648648648649     10.50000000000000    0.00000000000000    0.50000000000000     10.50000000000000    0.00000000000000    0.50000000000000     10.51041666666667    0.02083333333333    0.51041666666667     10.52083333333333    0.04166666666667    0.52083333333333     10.53125000000000    0.06250000000000    0.53125000000000     10.54166666666667    0.08333333333333    0.54166666666667     10.55208333333333    0.10416666666667    0.55208333333333     10.56250000000000    0.12500000000000    0.56250000000000     10.57291666666667    0.14583333333333    0.57291666666667     10.58333333333333    0.16666666666667    0.58333333333333     10.59375000000000    0.18750000000000    0.59375000000000     10.60416666666667    0.20833333333333    0.60416666666667     10.61458333333333    0.22916666666667    0.61458333333333     10.62500000000000    0.25000000000000    0.62500000000000     10.37500000000000    0.37500000000000    0.75000000000000     10.36538461538462    0.36538461538462    0.73076923076923     10.35576923076923    0.35576923076923    0.71153846153846     10.34615384615385    0.34615384615385    0.69230769230769     10.33653846153846    0.33653846153846    0.67307692307692     10.32692307692308    0.32692307692308    0.65384615384615     10.31730769230769    0.31730769230769    0.63461538461538     10.30769230769231    0.30769230769231    0.61538461538462     10.29807692307692    0.29807692307692    0.59615384615385     10.28846153846154    0.28846153846154    0.57692307692308     10.27884615384615    0.27884615384615    0.55769230769231     10.26923076923077    0.26923076923077    0.53846153846154     10.25961538461538    0.25961538461538    0.51923076923077     10.25000000000000    0.25000000000000    0.50000000000000     10.24038461538462    0.24038461538462    0.48076923076923     10.23076923076923    0.23076923076923    0.46153846153846     10.22115384615385    0.22115384615385    0.44230769230769     10.21153846153846    0.21153846153846    0.42307692307692     10.20192307692308    0.20192307692308    0.40384615384615     10.19230769230769    0.19230769230769    0.38461538461538     10.18269230769231    0.18269230769231    0.36538461538462     10.17307692307692    0.17307692307692    0.34615384615385     10.16346153846154    0.16346153846154    0.32692307692308     10.15384615384615    0.15384615384615    0.30769230769231     10.14423076923077    0.14423076923077    0.28846153846154     10.13461538461538    0.13461538461538    0.26923076923077     10.12500000000000    0.12500000000000    0.25000000000000     10.11538461538462    0.11538461538462    0.23076923076923     10.10576923076923    0.10576923076923    0.21153846153846     10.09615384615385    0.09615384615385    0.19230769230769     10.08653846153846    0.08653846153846    0.17307692307692     10.07692307692308    0.07692307692308    0.15384615384615     10.06730769230769    0.06730769230769    0.13461538461538     10.05769230769231    0.05769230769231    0.11538461538462     10.04807692307692    0.04807692307692    0.09615384615385     10.03846153846154    0.03846153846154    0.07692307692308     10.02884615384615    0.02884615384615    0.05769230769231     10.01923076923077    0.01923076923077    0.03846153846154     10.00961538461538    0.00961538461538    0.01923076923077     10.00000000000000    0.00000000000000    0.00000000000000     10.50000000000000    0.25000000000000    0.75000000000000     10.50000000000000    0.25000000000000    0.75000000000000     10.50000000000000    0.25000000000000    0.75000000000000     1 
  1. pw输入文件
 &CONTROLtitle = 'LDA.inp' ,calculation = 'scf' ,pseudo_dir = '/home/flyingd/Desktop/LDA1/pseorsu/' ,/&SYSTEMibrav = 0,nat = 2,ntyp = 1,ecutwfc = 50 ,ecutrho = 200 ,nbnd = 8,occupations = 'smearing' ,degauss = 1d-9 ,smearing = 'gaussian' ,/&ELECTRONS/
CELL_PARAMETERS angstrom -0.000000000    2.681233128    2.681233128 2.681233128   -0.000000000    2.681233128 2.681233128    2.681233128    0.000000000 
ATOMIC_SPECIESSi   28.08550  Si.pz-n-rrkjus_psl.1.0.0.UPF 
ATOMIC_POSITIONS crystal Si      0.000000000    0.000000000    0.000000000    Si      0.250000000    0.250000000    0.250000000  
  1. 计算成功后后处理。bands.x产生bd.dat后
  2. 运行,依次输入
plotband.x
bd.dat
-10,20
xmgr
z.ps
6
1,6
  1. 得到能带图

在这里插入图片描述

  相关解决方案