VASPBERRY程序可以使用VASP计算得到的WAVECAR,计算体系在布里渊区的贝里曲率,使用方法非常简单,参数很少,
使用方法和绘图代码参考:
vaspberry,拓扑以及谷电子学神器!
准备工作
软件下载
https://github.com/Infant83/VASPBERRY编译
Serial version :ifort -fpp -assume byterecl -mkl -o vaspberry vaspberry.fMulticore version :mpif90 -DMPI_USE -mkl -fpp -assume byterecl -o vaspberry vaspberry.fNote for gfortran: For gfortran, please use vaspberry_gfortran_serial.f for the compilation. This only support non-parallel calculations. For the compilation, for examplegfortran -L/usr/local/lib/lapack/ -l lapack -o vaspberry vaspberry_gfortran_serial.f
完成后写环境变量
VASP计算,INCAR内必须加SOC
Global ParametersISTART = 1 (Read existing wavefunction, if there)ISPIN = 1 (Non-Spin polarised DFT)# ICHARG = 11 (Non-self-consistent: GGA/LDA band structures)LREAL = .FALSE. (Projection operators: automatic)ENCUT = 400 (Cut-off energy for plane wave basis set, in eV)# PREC = Accurate (Precision level: Normal or Accurate, set Accurate when perform structure lattice relaxation calculation)LWAVE = .TRUE. (Write WAVECAR ornot)LCHARG = .TRUE. (Write CHGCAR ornot)ADDGRID= .TRUE. (Increase grid, helps GGA convergence)LASPH = .TRUE. (Give more accurate total energies and band structure calculations)PREC = Accurate (Accurate strictly avoids any aliasing or wrap around errors)Static CalculationISMEAR = 0 (gaussian smearing method)SIGMA = 0.05 (please check the width of the smearing)LORBIT = 11 (PAW radii for projected DOS)NEDOS = 2001 (DOSCAR points)NELM = 60 (Max electronic SCF steps)EDIFF = 1E-08 (SCF energy convergence, in eV)Spin-Orbit Coupling CalculationLSORBIT = .TRUE. (Activate SOC)GGA_COMPAT = .FALSE. (Apply spherical cutoff on gradient field)VOSKOWN = 1 (Enhances the magnetic moments and the magnetic energies)LMAXMIX = 4 (For d elements increase LMAXMIX to 4, f: LMAXMIX = 6)ISYM = -1 (Switch symmetry off)# SAXIS = 001 (Direction of the magnetic field)# MAGMOM = 003 (Set this parameters manually, Local magnetic moment parallel to SAXIS, 3*NIONS*1.0for non-collinear magnetic systems)# NBANDS = (Set this parameters manually, 2 * number of bands of collinear-run)
注:SOC要根据体系增加NABDS(脚本会自动读取)
KPOINTS根据体系设定(脚本会自动读取)
K-Spacing Value to Generate K-Mesh: 0.0400Gamma15 15 10.0 0.0 0.0
数据处理脚本
#!/bin/bash#========= 0. 环境 =========set -e # 遇错即停module purge 2>/dev/null # 如用集群,自行加 module 加载行#========= 1. 读 NBANDS ======NBANDS=$(grep -m1 NBANDS OUTCAR | awk '{print $NF}')[[ -z "$NBANDS" ]] && { echo " 找不到 NBANDS"; exit1; }echo " NBANDS = $NBANDS"#========= 2. 读 K 网格 ======#read kx ky kz < <(awk 'NR==4{print $1,$2,$3}' KPOINTS)#echo " k-grid = $kx $ky $kz"# 改成兼容写法kx=$(awk 'NR==4{print $1}' KPOINTS)ky=$(awk 'NR==4{print $2}' KPOINTS)kz=$(awk 'NR==4{print $3}' KPOINTS)echo "k-grid = $kx $ky $kz"#========= 3. 生成画图脚本 ==cat > BC.py <<'EOF'#!/usr/bin/env pythonimport numpy as npimport matplotlib.pyplot as pltfrom scipy.interpolate import griddataimport osfilein = 'BERRYCURV.dat'fileou = 'BERRYCURV.pdf'data = np.loadtxt(filein)x, y, z = data[:,0], data[:,1], data[:,3]nx = ny = 600xi = np.linspace(x.min(), x.max(), nx)yi = np.linspace(y.min(), y.max(), ny)zi = griddata((x, y), z, (xi[None,:], yi[:,None]))levels = np.linspace(z.min(), z.max(), 51)plt.contourf(xi, yi, zi, levels=levels, cmap='coolwarm', alpha=0.75)plt.colorbar(format='%4.3f')plt.axis('equal')plt.axis('off')plt.savefig(fileou, bbox_inches='tight', pad_inches=0, transparent=True)plt.close()EOFecho bands Chern Number >>Chern_Number.dat#========= 4. 主循环 ========for i in $(seq 1 $NBANDS); doecho ">>> 计算 band $i ..."mkdir -p band-$i# 单带 Berry 曲率vaspberry -kx $kx -ky $ky -is $i >& log# 画图python BC.py# 归档mv BERRYCURV.pdf BERRYCURV.dat log band-$iC=$(grep "Chern Number =" band-$i/BERRYCURV.dat | awk -F'=' '{printf"%12.6f\n", $2}')echo band-$i $C >>Chern_Number.datdone
保存脚本重命名为vaspberry.sh
然后运行
sh vaspberry.sh$ cat Chern_Number.datbands Chern Numberband-1-1.000000band-21.000000band-33.000000band-4-3.000000band-5-1.000000band-61.000000band-7-2.000000band-82.000000band-9-3.000000band-103.000000band-111.000000band-12-1.000000band-134.000000band-14-4.000000band-15-2.000000band-162.000000band-170.000000band-18-0.000000band-192.000000band-20-0.000000band-21-2.000000band-224.000000band-23-2.000000band-24-1.000000
绘图效果