cndaqiang Web Linux DFT

Learn QE2 原子结构相关:结构优化,MD,NEB

2020-03-07
cndaqiang
 
RSS

本学习教程内容主要来自互联网,个人学习记录,仅供参考。
代码仓库LearnQE@cndaqiang

参考

Summer School on Advanced Materials and Molecular Modelling
GitLab for qe2019

示例

结构优化

Graphane relax

relax计算 calculation = 'relax',,添加&IONS原子收敛参数

&IONS
!都有默认值
		!ion_dynamics="bfgs" !relax: bfgs,damp ; md: verlet langevin, langevin-smc....
/

运行

cd LearnQE/DOC/material-for-ljubljana-qe-summer-school-master/Day-2/example1.relax
mpirun -np 4 pw.x -i pw.graphane.relax.in | tee graphane.relax.out
xcrysden  --pwo graphane.relax.out 

xcrysden打开后,可以选择Display All Coordinates as Animation
然后显示不同原子步的结构,分别测量,C-H键长变化:0.9851Ang->1.1083Ang

hcp-Zinc vc-relax

vc-relax,变cell结构优化,要加上&CELL

 &IONS
 /
 &CELL
 /

运行

mpirun -np 4 pw.x -i pw.Zn.vc-relax.in | tee Zn.vc-relax.out
xcrysden --pwo  Zn.vc-relax.out

MD分子动力学[略]

与结构优化类似,添加步长dt和总步数nstep,

&CONTROL
	  calculation="md" !scf nscf 
      nstep=68
      dt=4
/
&IONS
!tempw起始温度
!		tempw = 0.1
!系综,verlet(NVE)
		ion_dynamics="verlet"
/
&CELL
/

NEB计算

输入文件结构示例

BEGIN

BEGIN_PATH_INPUT
&PATH
nstep_path = 200 !最大步数
num_of_images = 7
!默认pwscf_1 pwscf_N仅计算一次,只有2-N1共N-2个image参与后续的迭代
!设置first_last_opt = .True. 1,N也参与迭代
!first_last_opt = .False.
/
END_PATH_INPUT

BEGIN_ENGINE_INPUT
!各个图像的计算参数,把pw.x的输入复制过来,
!仅不包含原子结构ATOMIC_POSITIONS,其他的如晶格参数,赝势依旧在此处填写
&CONTROL
pseudo_dir = './'
/
&SYSTEM
  ibrav = 0
  A =    1.00000000000000
  nat = 3
  ntyp = 3

  ecutwfc = 30 
!  	kinetic energy cutoff (Ry) for wavefunctions
  ecutrho = 200 !4*ecutwfc

/
&ELECTRONS
/

CELL_PARAMETERS {alat}
  20.0000000000000000   0.0000000000000000   0.0000000000000000
   0.0000000000000000  20.0000000000000000   0.0000000000000000
   0.0000000000000000   0.0000000000000000  20.0000000000000000
ATOMIC_SPECIES
  C 12.0107 C_ONCV_PBE_fr.upf
  N 14.0067 N_ONCV_PBE_fr.upf
  H 1.00794 H_ONCV_PBE_fr.upf
K_POINTS {automatic}
1 1 1  0 0 0

BEGIN_POSITIONS
!初始IMAGE,终止IMAGE
FIRST_IMAGE
ATOMIC_POSITIONS {crystal}
  C   0.4999025166406645 0.5000000000000000 0.5000000000000000
  N   0.5578501003511457 0.5000000000000000 0.5000000000000000
  H   0.4462473830081877 0.5000000000000000 0.5000000000000000 
LAST_IMAGE
ATOMIC_POSITIONS {crystal}
  C   0.5000000000000000 0.5000000000000000 0.4414141678546500
  N   0.5000000000000000 0.5000000000000000 0.5001920800889998
  H   0.5000000000000000 0.5000000000000000 0.5503937520563474
END_POSITIONS
   
END_ENGINE_INPUT
END

运行

  • 默认的计算方式,创建pwscf_[1-N],然后分别进入到相应的文件夹进行计算
    可以看到开始时只有pwscf_1中有输出,随后其他文件夹内以此出现输出文件
    mpirun -np 4 neb.x -i neb.in | tee neb.out
    
  • 使用image并行(-ni n),可以同时开始好几个pwscf_的计算,如下,有四个image同时计算
    image并行的image数量小于等于neb的image-2,因为初始和最终的image不参与后续的计算
    如果设置first_last_opt = .True.,初始,最终的image也参与计算,此时image并行的image数量小于等于neb的image
    mpirun -np 4 neb.x -ni 4  -i neb.in | tee neb.out
    

xcrysden 可以根据neb.in生成变化动图,如下例

HCN 转换为 CNH 的过程

工作路径

LearnQE/DOC/material-for-ljubljana-qe-summer-school-master/Day-2/example3.neb/HCN_CNH

之前使用VASP+VTST的计算结果DFT-EXERCISES中的6.5节

计算输出

运行

EXEC=/public/home/chendq/soft/intel17/qe-6.4.1/bin/neb.x
srun --mpi=pmi2 $EXEC -ni 5 -i neb.in | tee result

下面的输出,是我中途kill了neb.x的结果,不是最终收敛的结果

  • neb.dat 是输入neb.in中的&PATH的备份
  • pw_1.in pw_2.in 是neb.in中的初态,末态scf计算的参数和坐标
  • pwscf_i 各个image的运行目录,与正常的scf计算相同,pwscf_i/PW.out是标准输出
  • pwscf.int ??
  • pwscf.dat中[反应坐标,相对能量,error]与标准输出中的一致,用于画反应势能面
        image        energy (eV)        error (eV/A)        frozen
    
           1       -455.0343548            3.837393            T
           2       -454.1570363           17.615266            F
           3       -453.7100989           11.466074            F
           4       -453.2121126            3.452926            F
           5       -453.9481453            0.191098            F
           6       -453.7209844           14.164421            F
           7       -454.3738303            3.409830            T
    
  • pwscf.pathI 每次迭代的反应路径
C_ONCV_PBE_fr.upf  pwscf.dat     pwscf.path26  pwscf.path46
H_ONCV_PBE_fr.upf  pwscf.int     pwscf.path27  pwscf.path47
neb.dat            pwscf.path    pwscf.path28  pwscf.path48
neb.in             pwscf.path0   pwscf.path29  pwscf.path49
N_ONCV_PBE_fr.upf  pwscf.path1   pwscf.path3   pwscf.path5
out.1_0            pwscf.path10  pwscf.path30  pwscf.path50
out.2_0            pwscf.path11  pwscf.path31  pwscf.path51
out.3_0            pwscf.path12  pwscf.path32  pwscf.path52
out.4_0            pwscf.path13  pwscf.path33  pwscf.path53
out.5_0            pwscf.path14  pwscf.path34  pwscf.path54
out.6_0            pwscf.path15  pwscf.path35  pwscf.path55
pw_1.in            pwscf.path16  pwscf.path36  pwscf.path6
pw_2.in            pwscf.path17  pwscf.path37  pwscf.path7
pwscf_1            pwscf.path18  pwscf.path38  pwscf.path8
pwscf_2            pwscf.path19  pwscf.path39  pwscf.path9
pwscf_3            pwscf.path2   pwscf.path4   pwscf.xyz
pwscf_4            pwscf.path20  pwscf.path40  result
pwscf_5            pwscf.path21  pwscf.path41  run-qe-sslab.sh
pwscf_6            pwscf.path22  pwscf.path42  run-qe-sslab.sh.e1010102
pwscf_7            pwscf.path23  pwscf.path43  run-qe-sslab.sh.o1010102
pwscf.axsf         pwscf.path24  pwscf.path44
pwscf.crd          pwscf.path25  pwscf.path45

结果等待SSLAB中

分子振荡频率

参考

利用xcryden画出振动模式图

#自洽计算
mpirun -np 20 pw.x -i input.in | tee scf.result
#ph.x
mpirun -np 20 ph.x   -i ph.in | tee ph.result
#dynmat.x用于展示
dynmat.x -i dynmat.in | tee dynmat.result

ph.in全部使用默认参数

&INPUTPH
!fildyn='matdyn'!保存用于后处理文件

/
0.0 0.0 0.0

dynmat.in全部使用默认参数

&INPUT
!fildyn='matdyn'
!filxsf='dynmat.axsf'!输出展示文件
/

ph.result中会有计算的频率,如

     Number of q in the star =    1
     List of q in the star:
          1   0.000000000   0.000000000   0.000000000

     Diagonalizing the dynamical matrix

     q = (    0.000000000   0.000000000   0.000000000 )

 **************************************************************************
     freq (    1) =     -14.644218 [THz] =    -488.478526 [cm-1]
     freq (    2) =      -8.140480 [THz] =    -271.537168 [cm-1]
     freq (    3) =      -5.368949 [THz] =    -179.088847 [cm-1]
     freq (    4) =       0.895710 [THz] =      29.877684 [cm-1]
     freq (    5) =       2.499426 [THz] =      83.371887 [cm-1]
     freq (    6) =       2.853039 [THz] =      95.167128 [cm-1]
     freq (    7) =       3.711773 [THz] =     123.811432 [cm-1]
     freq (    8) =       8.804024 [THz] =     293.670634 [cm-1]
     freq (    9) =       8.912682 [THz] =     297.295054 [cm-1]
     freq (   10) =       9.407098 [THz] =     313.787011 [cm-1]
     freq (   11) =      10.295129 [THz] =     343.408541 [cm-1]
     freq (   12) =      10.601502 [THz] =     353.628028 [cm-1]
     freq (   13) =      14.074680 [THz] =     469.480774 [cm-1]
     freq (   14) =      14.668879 [THz] =     489.301137 [cm-1]
!...

matdyn中存着动力学矩阵和

Dynamical matrix file
default
  2   26  0  1.8897261  0.0000000  0.0000000  0.0000000  0.0000000  0.0000000
Basis vectors
     15.000000000    0.000000000    0.000000000
      0.000000000   15.000000000    0.000000000
      0.000000000    0.000000000   15.000000000
           1  'C   '    10947.083358978085
           2  'H   '    918.68110941480279
    1    1      8.9620845000      7.5901125000      6.9474930000
    2    1      6.8089410000      6.2131635000      6.9404790000
    3    1      7.5377250000      7.4348655000      9.0629715000
    4    1      6.6948120000      8.7634470000      7.0483335000
!...
    Diagonalizing the dynamical matrix

     q = (    0.000000000   0.000000000   0.000000000 )

 **************************************************************************
     freq (    1) =     -14.644218 [THz] =    -488.478526 [cm-1]
 ( -0.101213  0.000000 -0.044156  0.000000  0.008792 -0.000000 )
 (  0.047068 -0.000000  0.120832 -0.000000  0.020473 -0.000000 )
 (  0.002552 -0.000000  0.027146 -0.000000 -0.109307  0.000000 )
 (  0.069089 -0.000000 -0.110032  0.000000  0.011473 -0.000000 )
 ( -0.077319  0.000000  0.104654 -0.000000  0.003597 -0.000000 )
 ( -0.120746  0.000000 -0.024960  0.000000 -0.086464  0.000000 )
 ( -0.036260  0.000000 -0.114091  0.000000  0.041932 -0.000000 )

使用xcrysden打开dynmat.axsf,display显示受力,Modify可以修改里的显示方式 提取matdyn中的频率画图,
下图为$NH_3$的振动频率和使用VASP计算:5.2 NH3 振动频率的结果一致

./matdyn.py

附录

xcrysden help

       --xsf file
           Load structure from XCrySDen's-Structure-File (XSF) formatted file.

       --cube file
       --gXX_cube file
       --g98_cube file
           Load  structure  from  Gaussian cube file. The cube file should be produced with the Cube=Cards option. Only scalar cube files are supported, that
           is, Cube=(Cards,Density) or Cube=(Cards,Orbitals) or Cube=(Cards,Potential). Refer to GAUSSIAN manual for the meaning of this keywords.

       --pwi
       --pw_inp file
           Load structure from pw.x input file. pw.x is a  pseudopotential  planewave  program  of  the  Quantum-ESPRESSO  distribution  (http://www.quantum-
           espresso.org/).

       --pwo
       --pw_out file
           Load  structure  from  pw.x  output  file.  pw.x  is a pseudopotential planewave program of the Quantum-ESPRESSO distribution (http://www.quantum-
           espresso.org/).

       -s script
       --script script
           Load script from file containing Tcl script.

本文首发于我的博客@cndaqiang.
本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!



评论


广告

目录

广告
访客数据