以Ammonia (N4H12) 為例。
第一步: 松弛結構/ Geometry Optimization
Input:
&control calculation = 'relax', nstep = 300, etot_conv_thr = 1.0d-4, forc_conv_thr = 2.0d-3, restart_mode = 'from_scratch', prefix = 'ammonia', outdir = 'Waves', pseudo_dir = '/home/z8j/svn_personal/qe/pp' / &system ibrav = 0, ntyp = 2, nat = 16, occupations = 'fixed', ecutwfc = 80 / &electrons mixing_beta = 0.7, conv_thr = 1.d-8, electron_maxstep = 1000, startingwfc = 'atomic+random' / &ions ion_positions = "default" / ATOMIC_SPECIES H 1.000 H.pbe-rrkjus.UPF N 14.000 N.pbe-rrkjus.UPF CELL_PARAMETERS angstrom 5.1305 0.0000 0.0000 0.0000 5.1305 0.0000 0.0000 0.0000 5.1305 K_POINTS automatic 4 4 4 1 1 1 ATOMIC_POSITIONS angstrom N 1.0789441 1.0789441 1.0789441 N 1.4863058 4.0515558 3.6441941 N 3.6441941 1.4863058 4.0515558 N 4.0515558 3.6441941 1.4863058 H 1.9095721 1.3477823 0.5710246 H 1.9942253 3.2209279 3.9130323 H 3.1362746 0.6556779 3.7827176 H 4.5594753 4.4748221 1.2174676 H 1.3477823 0.5710246 1.9095721 H 1.2174676 4.5594753 4.4748221 H 3.2209279 3.9130323 1.9942253 H 0.5710246 1.9095721 1.3477823 H 0.6556779 3.7827176 3.1362746 H 4.4748221 1.2174676 4.5594753 H 3.9130323 1.9942253 3.2209279 H 3.7827176 3.1362746 0.6556779
然后Run pw.x:
PBS file:
1 #!/bin/bash 2 3 #PBS -A sns 4 #PBS -q long 5 #PBS -m ea 6 #PBS -M 123123@foxmail.com 7 #PBS -j oe 8 #PBS -l qos=condo 9 #PBS -W group_list=cades-virtues 10 #PBS -l walltime=50:30:00 11 #PBS -l nodes=4:ppn=32 12 #PBS -N ammonia-rlx-qe@/lustre/or-hydra/cades-virtues/z8j/run/rmg_test_ORNL/Ammonia/qe 13 14 module load /software/tools/modules/env/cades-virtues 15 module load /software/tools/modules/compilers/intel/2016.1 16 module load /software/tools/modules/utils/intel/mkl/2016.1 17 module load /software/tools/modules/mpi/openmpi/intel/1.10.2 18 module load /software/user_tools/current/modules/cades-virtues/env/intel 19 module load /software/user_tools/current/modules/cades-virtues/espresso/5.4.0 20 module list 21 22 export OMP_NUM_THREADS=1 23 24 cd /lustre/or-hydra/cades-virtues/z8j/run/rmg_test_ORNL/Ammonia/qe 25 26 date 27 28 mpirun -np 128 --bind-to none --map-by ppr:32:node:pe=1 /software/user_tools/current/cades-virtues/apps/quantum-espresso/intel/espresso/5.4.0/pw.x < qe.in > qe.00.out 29 30 date
第二步: 寫好用來構建超胞用的單胞/Prepare unit cell file for supercell building
這一步比較簡單,直接從第一步的output file里讀取出現成的原子位置即可,然后修改下必要的參數,如名字 Kpoint mesh。有一點需要注意,phonopy只支持crystal 的原子位置類型,所以需要自己轉換一下。
&control calculation = 'scf', nstep = 300, etot_conv_thr = 1.0d-4, forc_conv_thr = 2.0d-3, restart_mode = 'from_scratch', prefix = 'ammonia', outdir = 'Waves', pseudo_dir = '/home/z8j/svn_personal/qe/pp' / &system ibrav = 0 ntyp = 2, nat = 16, occupations = 'fixed', ecutwfc = 80 / &electrons mixing_beta = 0.7, conv_thr = 1.d-8, electron_maxstep = 1000, startingwfc = 'atomic+random' / ATOMIC_SPECIES H 1.000 H.pbe-rrkjus.UPF N 14.000 N.pbe-rrkjus.UPF CELL_PARAMETERS angstrom 5.1305 0.0000 0.0000 0.0000 5.1305 0.0000 0.0000 0.0000 5.1305 K_POINTS automatic 4 4 4 1 1 1 ATOMIC_POSITIONS (crystal) N 0.208255064 0.208255064 0.208255064 N 0.291744916 0.791744916 0.708255064 N 0.708255064 0.291744916 0.791744916 N 0.791744916 0.708255064 0.291744916 H 0.373650671 0.263677961 0.110622992 H 0.389376988 0.626349329 0.763677961 H 0.610622992 0.126349329 0.736322020 H 0.889376988 0.873650671 0.236322020 H 0.263677961 0.110622992 0.373650671 H 0.236322020 0.889376988 0.873650671 H 0.626349329 0.763677961 0.389376988 H 0.110622992 0.373650671 0.263677961 H 0.126349329 0.736322020 0.610622992 H 0.873650671 0.236322020 0.889376988 H 0.763677961 0.389376988 0.626349329 H 0.736322020 0.610622992 0.126349329
這一步不用運行,只是為下一步做准備。
第三步: 用Phonopy構建超胞/ Build supercells with displaced atoms by Phonopy
將上一步的input 拷出來並命名為qe.in,然后運行Phonoy(如果想省略掉-c選項的話,重命名為unitcell.in):
python /home/zjyx/softwares/phonopy-1.10.10/bin/phonopy --pwscf -d --dim="4 4 4" -c qe.in
這樣當前目錄下會出現若干個supercell-???.in文件。這些文件都是帶有微擾的超胞,需要在下一步中用來做電子自洽計算。另外這些文件都只含有結構信息,缺少設置信息,需要把下面的信息添加為每個supercel.???.in的開頭部分:
&control calculation = 'scf', nstep = 300, etot_conv_thr = 1.0d-4, forc_conv_thr = 2.0d-3, tprnfor = .true. tstress = .true. restart_mode = 'from_scratch', prefix = 'ammonia', outdir = 'Waves', pseudo_dir = '/u/sciteam/zhang7/svn_personal/qe/pp' / &system ibrav = 0 ntyp = 2, nat = 1024, occupations = 'fixed', ecutwfc = 80 / &electrons diagonalization = 'david', mixing_beta = 0.7, conv_thr = 1.d-8, electron_maxstep = 1000, startingwfc = 'atomic+random' / K_POINTS automatic 1 1 1 0 0 0
與前面的輸入文件相比,這兒多了這兩個選項:tprnfor = .true. 和 tstress = .true.。這樣的話才會在電子自洽計算完成后輸出每個原子的受力情況,用以構建后來的Force constant matrix.
第四步: 超胞的電子自洽計算/Electron SCF calculation of supercells
依次運行pw.x < supercell-???.in即可。
第五步: 用Phonopy計算