使用 QE 进行自洽能量计算
pw.x 处理的计算包括七种类型,在输入文件中通过 calculation 指定:
'scf':自洽场(SCF)计算,迭代求解微分积分 Kohn-Sham 方程。当电荷密度变化足够小时达到收敛,得到自洽电荷。'nscf':非自洽计算,通常在更密的 k 空间网格上进行,用于态密度(DOS)等积分。使用自洽电荷,计算额外 k 点的性质。'bands':另一种非自洽计算,k 点沿三维 k 空间中的特定路径取值。'relax':基于 Hellman-Feynman 力的一系列 SCF 计算,优化原子坐标以最小化力,保持晶胞不变。'vc-relax':类似 relax,但允许晶胞根据应力计算变化。'md':分子动力学模拟,将离子-电子相互作用作为离子运动的势,求解离子的经典运动方程。'vc-md':带晶胞变化的分子动力学。
输入文件
在 QE 输入文件中,包含 NAMELISTS 和 INPUT_CARDS。
PWscf 需要三个必需的 NAMELISTS:
&CONTROL:指定计算流程。&SYSTEM:描述系统。&ELECTRONS:定义求解 Kohn-Sham 方程的算法。
两个额外的 NAMELISTS:&IONS 和 &CELLS 用于特定计算。
PWscf 的三个必需 INPUT_CARDS 为 ATOMIC_SPECIES、ATOMIC_POSITIONS 和 K_POINTS。根据计算类型可能需要其他信息。
示例:硅的自洽计算(pw.scf.silicon.in)
&CONTROL
calculation='scf', # 自洽场计算
prefix='silicon', # 输出文件前缀
pseudo_dir='./pseudo/', # 赝势目录
outdir='./out/', # 输出文件目录
/
&SYSTEM
ibrav=2, # 布拉维晶格类型(FCC)
celldm(1)=10.2625, # 晶格常数(单位 Bohr,1 Bohr = 0.529 Å)
nat=2, # 原子数
ntyp=1, # 原子类型数
ecutwfc=60.0, # 波函数截断能(单位 Ry,1 Ry = 13.606 eV)
ecutrho=720.0, # 电荷密度截断能
/
&ELECTRONS
mixing_beta=0.7, # 电荷密度混合比(默认 0.7)
conv_thr=1d-8, # SCF 收敛阈值(默认 1d-6)
/
ATOMIC_SPECIES
Si 28.0855 Si.pbe-rrkj.UPF # 赝势
ATOMIC_POSITIONS (alat) # 原子坐标(alat = 晶格参数)
Si 0.00 0.00 0.00
Si 0.25 0.25 0.25
K_POINTS automatic # 自动 k 点网格
4 4 4 1 1 1
ibrav:1–14 对应 14 种布拉维晶格;0 为自由晶格。ecutwfc:建议值取决于所使用的赝势。ecutrho:与ecutwfc相关:- NC 赝势:4×
ecutwfc。 - US 赝势:8–12×
ecutwfc。 - PAW 赝势:4×
ecutwfc。
- NC 赝势:4×
- 文件保存为
pw.scf.silicon.in。 - 建议设置:
occupations='smearing', smearing='gaussian', degauss=1d-9使用高斯展宽。
详见 PWscf 用户手册。
执行
mpirun -np 4 pw.x -inp pw.scf.silicon.in > pw.scf.silicon.out
输出文件
检查输出文件 pw.scf.silicon.out 中的收敛信息:
grep -e 'total energy' -e estimate pw.scf.silicon.out
示例:
Self-consistent Calculation
iteration # 1 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 1.00E-02, avg # of iterations = 2.0
Threshold (ethr) on eigenvalues was too large:
Diagonalizing with lowered threshold
Davidson diagonalization with overlap
ethr = 6.93E-04, avg # of iterations = 1.0
total cpu time spent up to now is 0.3 secs
total energy = -15.83539933 Ry
estimated scf accuracy < 0.06071141 Ry
iteration # 2 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 7.59E-04, avg # of iterations = 1.0
total cpu time spent up to now is 0.4 secs
total energy = -15.83851631 Ry
estimated scf accuracy < 0.00218630 Ry
iteration # 3 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 2.73E-05, avg # of iterations = 2.3
total cpu time spent up to now is 0.4 secs
total energy = -15.83897965 Ry
estimated scf accuracy < 0.00007075 Ry
iteration # 4 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 8.84E-07, avg # of iterations = 2.6
total cpu time spent up to now is 0.4 secs
total energy = -15.83900178 Ry
estimated scf accuracy < 0.00000211 Ry
iteration # 5 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 2.64E-08, avg # of iterations = 3.6
total cpu time spent up to now is 0.4 secs
total energy = -15.83900299 Ry
estimated scf accuracy < 0.00000012 Ry
iteration # 6 ecut= 16.00 Ry beta= 0.70
Davidson diagonalization with overlap
ethr = 1.46E-09, avg # of iterations = 2.7
total cpu time spent up to now is 0.4 secs
End of self-consistent calculation
注意:
- 总能量取决于所选赝势。
- 6 次迭代达到收敛。
! total energy = -15.83900302 Ry
estimated scf accuracy < 3.2E-10 Ry
The total energy is the sum of the following terms:
one-electron contribution = 4.79863652 Ry
hartree contribution = 1.07565897 Ry
xc contribution = -4.81353993 Ry
ewald contribution = -16.89975858 Ry
convergence has been achieved in 6 iterations
提示
- 出现振荡收敛时减小
mixing_beta。 - 增大截断能(
ecutwfc、ecutrho)。 - 使用推荐的赝势。
conv_thr建议值:- 能量和本征值(SCF):1.0d-7 Ry。
- 力(relax):1.0e-8 Ry。
- 应力(vc-relax):1.0d-9 Ry。
补充信息
- 计算中使用的交换关联泛函:
Exchange-correlation= SLA PZ NOGX NOGC
- 使用的总平面波数(如 1067):
sticks: dense smooth PW G-vecs: dense smooth PW
Sum 433 433 139 5961 5961 1067
- Kohn-Sham 态数目:
number of electrons = 8.00
number of Kohn-Sham states= 8