目录

QEtool

misaraty 更新 | 2024-09-26
前言
  • 一款用于生成Quantum Espresso输入文件、数据处理与绘图的自动化工具。

  • 发布更新于Github

  • 亦可参考本站之前发布的《Quantum Espresso》

准备

QE路径

  • 修改QEtool.py中的路径,
1
qe_bin = '/opt/ohpc/pub/apps/qe-7.3/bin'

赝势路径

1
2
3
4
5
6
7
8
9
if upf_type == 'sssp_precision':
    upf_files = {line.split()[0]: line.split()[1] for line in upf_files_sssp_precision.strip().split('\n')}
    pseudo_dir = '/opt/ohpc/pub/apps/sssp/precision/'
elif upf_type == 'sssp_efficiency':
    upf_files = {line.split()[0]: line.split()[1] for line in upf_files_sssp_efficiency.strip().split('\n')}
    pseudo_dir = '/opt/ohpc/pub/apps/sssp/efficiency/'
elif upf_type == 'pslibrary':
    upf_files = {line.split()[0]: line.split()[1] for line in upf_files_pslibrary.strip().split('\n')}
    pseudo_dir = '/opt/ohpc/pub/apps/pslibrary.1.0.0/pbe/PSEUDOPOTENTIALS/'

提供POSCAR

  • 示例采用的文件为cdte.vasp

relax

  • 修改QEtool.py中的计算类型,
1
calculation_type = 'relax' # 'relax' | 'vc-relax' | 'scf' | 'nscf' | 'dos_plot'
  • 运行QEtool.py,生成relax.in文件。
1
python QEtool.py
  • 修改集群提交脚本job.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/bash
#SBATCH --job-name=qe_test
#SBATCH --partition=cpu3_q
#SBATCH --output=%j.out
#SBATCH --error=%j.err
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=32
							  
qe='mpirun /opt/ohpc/pub/apps/qe-7.3/bin/pw.x'

$qe <relax.in> relax.out
# $qe <vc-relax.in> vc-relax.out
# $qe <scf.in> scf.out
# $qe <nscf.in> nscf.out
  • 提交集群计算,生成relax.out文件和./out文件夹。
1
sbatch job.sh # or qsub job.sh
  • 查看relax.out以确定优化后的原子坐标。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
ATOMIC_POSITIONS (crystal)
Cd               0.0000000000        0.0000000000        0.0000000000
Cd               0.0000000000        0.5000000000        0.5000000000
Cd               0.5000000000        0.0000000000        0.5000000000
Cd               0.5000000000        0.5000000000        0.0000000000
Te               0.2500000000        0.2500000000        0.2500000000
Te               0.7500000000        0.7500000000        0.2500000000
Te               0.7500000000        0.2500000000        0.7500000000
Te               0.2500000000        0.7500000000        0.7500000000
End final coordinates

vc-relax

  • 修改QEtool.py中的计算类型,
1
calculation_type = 'vc-relax' # 'relax' | 'vc-relax' | 'scf' | 'nscf' | 'dos_plot'
  • 运行QEtool.py,生成vc-relax.in文件。
1
python QEtool.py
  • 修改集群提交脚本job.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/bash
#SBATCH --job-name=qe_test
#SBATCH --partition=cpu3_q
#SBATCH --output=%j.out
#SBATCH --error=%j.err
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=32
							  
qe='mpirun /opt/ohpc/pub/apps/qe-7.3/bin/pw.x'

# $qe <relax.in> relax.out
$qe <vc-relax.in> vc-relax.out
# $qe <scf.in> scf.out
# $qe <nscf.in> nscf.out
  • 提交集群计算,生成 vc-relax.out 文件和 ./out 文件夹。
1
sbatch job.sh # or qsub job.sh
  • 查看 vc-relax.out 以确认优化后的晶胞大小和原子坐标。
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
Begin final coordinates
     new unit-cell volume =   1882.60412 a.u.^3 (   278.97315 Ang^3 )
     density =      5.71449 g/cm^3

CELL_PARAMETERS (angstrom)
   6.534125441   0.000000000   0.000000000
   0.000000000   6.534125441   0.000000000
   0.000000000   0.000000000   6.534125441

ATOMIC_POSITIONS (crystal)
Cd               0.0000000000        0.0000000000        0.0000000000
Cd               0.0000000000        0.5000000000        0.5000000000
Cd               0.5000000000        0.0000000000        0.5000000000
Cd               0.5000000000        0.5000000000        0.0000000000
Te               0.2499998757        0.2499998757        0.2499998757
Te               0.7500001243        0.7500001243        0.2499998757
Te               0.7500001243        0.2499998757        0.7500001243
Te               0.2499998757        0.7500001243        0.7500001243
End final coordinates

scf

  • 修改QEtool.py中的计算类型,
1
calculation_type = 'scf' # 'relax' | 'vc-relax' | 'scf' | 'nscf' | 'dos_plot'
  • 运行QEtool.py,生成scf.in文件。
1
python QEtool.py
注意
  • QEtool.py会自动根据vc-relax.out替换优化后的晶胞大小和原子坐标;

  • 若无vc-relax.out但有relax.out,则会自动替换优化后的原子坐标;

  • 若两者均无,则使用cdte.vasp的晶胞大小和原子坐标。

  • 修改集群提交脚本job.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/bash
#SBATCH --job-name=qe_test
#SBATCH --partition=cpu3_q
#SBATCH --output=%j.out
#SBATCH --error=%j.err
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=32
							  
qe='mpirun /opt/ohpc/pub/apps/qe-7.3/bin/pw.x'

# $qe <relax.in> relax.out
# $qe <vc-relax.in> vc-relax.out
$qe <scf.in> scf.out
# $qe <nscf.in> nscf.out
  • 提交集群计算,生成scf.out文件和./out文件夹。
1
sbatch job.sh # or qsub job.sh

dos

  • 修改QEtool.py中的计算类型,
1
calculation_type = 'nscf' # 'relax' | 'vc-relax' | 'scf' | 'nscf' | 'dos_plot'
  • 运行QEtool.py,生成nscf.in文件。
1
python QEtool.py
注意
  • QEtool.py会自动根据vc-relax.out替换优化后的晶胞大小和原子坐标;

  • 若无vc-relax.out但有relax.out,则会自动替换优化后的原子坐标;

  • 若两者均无,则使用cdte.vasp的晶胞大小和原子坐标。

  • 修改集群提交脚本job.sh
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
#!/bin/bash
#SBATCH --job-name=qe_test
#SBATCH --partition=cpu3_q
#SBATCH --output=%j.out
#SBATCH --error=%j.err
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=32
							  
qe='mpirun /opt/ohpc/pub/apps/qe-7.3/bin/pw.x'

# $qe <relax.in> relax.out
# $qe <vc-relax.in> vc-relax.out
# $qe <scf.in> scf.out
$qe <nscf.in> nscf.out
  • 提交集群计算,生成nscf.out文件和./out文件夹。
1
sbatch job.sh # or qsub job.sh

dos_plot

  • 修改QEtool.py
1
calculation_type = 'dos_plot' # 'relax' | 'vc-relax' | 'scf' | 'nscf' | 'dos_plot'
  • 运行QEtool.py时,脚本首先生成pdos.in,然后调用projwfc.x命令生成qe.pdos_tot及一系列文件,如qe.pdos_atm#1(Cd)_wfc#1(s)。接着,脚本调用sumpdos.x根据元素种类自动生成Cd.datTe.dat,读取nscf.out中的费米能量,最终生成dos.jpg
1
python QEtool.py

./dos.jpg