HyperAI

VASP Combined With Phonopy to Calculate the Phonon Spectrum of Silicon

Vienna Ab initio Simulation Package (The VASP Manual – VASP Wiki) is a computer program for atomic-scale material modeling from first principles, such as electronic structure calculations and quantum mechanical molecular dynamics.

PhonopyWelcome to phonopy — Phonopy v.2.37.1) is a Python toolkit for computing phonon band structures, thermal properties, group velocities, and other phonon-related quantities at the harmonic and quasi-harmonic levels.

1. Tutorial Content

This tutorial will use an automated script to demonstrate the calculation process of phonopy. Through this tutorial, you will learn the basic process of phonon spectrum calculation:

  1. Prepare perturbation difference supercell structure
  2. Calculate the total energy of all structures
  3. Calculate the force constant matrix
  4. Calculate the phonon spectrum from the force constant matrix

2. Introduction to input files

The input file contains

├── POSCAR-unitcell
├── clean.sh
├── run.sh
└── run_vasp.sh
├── pt
│   ├── INCAR
│   ├── KPOINTS
│   └── POTCAR

POSCAR-unitcell

Si #硅结构
   5.38930000000000
     0.0000000000000000    0.5071343999939496    0.5071343999939496
     0.5071343999939496    0.0000000000000000    0.5071343999939496
     0.5071343999939496    0.5071343999939496    0.0000000000000000
   2
Direct
  0.8750000000000000  0.8750000000000000  0.8750000000000000
  0.1250000000000000  0.1250000000000000  0.1250000000000000

clean.sh

#!/bin/bash
rm -r *.yaml band.pdf band.yaml FORCE_SETS vasp poscar *out SPOSCAR 
# 删除不必要文件

run.sh

#!/bin/bash
rm -r vasp poscar

#准备微扰差分超胞结构
##########################
phonopy -d --dim 2 2 2 --pa auto -c POSCAR-unitcell
mkdir poscar
mv POSCAR-unitcell pp
mv POSCAR-* poscar/
##########################


#计算所有结构的总能
##########################
mkdir vasp
cd vasp
Pnum=$(ls -l ../poscar/  -IR | grep "^-" | wc | awk -F ' ' '{print $1}')
cp ../run_vasp.sh .

t_head="for i in {1.."
t_tail="}"
sed -i "3c ${t_head}${Pnum}${t_tail}"  run_vasp.sh #生成 vasp 计算脚本

./run_vasp.sh
##########################

cd ../


mv pp POSCAR-unitcell

#计算力常数矩阵
##########################
phonopy -f vasp/*/vasprun.xml > pfcout
##########################

#根据力常数矩阵计算声子谱
##########################
phonopy-load --band "0.0 0.0 0.0  0.5 0.0 0.5  0.625  0.25  0.625, 0.375 0.375 0.75  0.0 0.0 0.0  0.5 0.5 0.5" --band-connection   -p -s
##########################


run_vasp.sh

#!/bin/bash
#计算 vasp 流程自动脚本
for i in {1..8}
do
rm -r $i
mkdir $i
cd $i
ii=$(printf "%03d" $i)
cp ../../poscar/POSCAR-${ii} POSCAR
cp ../../pt/* .
mpirun -n 1 vasp_std
cd ../

done

Files in folder pt

INCAR standard static calculation

ISTART =  1            (若有波函数、读取波函数)
ISPIN  =  1            (非极化计算)

Static Calculation
ISMEAR =  0            (高斯占据)
SIGMA  =  0.05         (高斯展宽)
NELM   =  60           (最大电子步)
EDIFF  =  1E-08        (SCF 收敛精度)

KPOINTS

K-Spacing Value to Generate K-Mesh: 0.040
0
Gamma
   4   4   4
0.0  0.0  0.0

POTCAR

The pseudopotential combination of the corresponding elements of the system, here the pseudopotential of Si, can be usedOfficial website example.

Getting Started

1. Clone the container

Find the tutorial working directory and clone the container

2. Set up the container

2.1 Select 4090 — Pay as you go — vasp 6.3.0-cuda11.8 — Workspace

2

2.2 Open the workspace after loading

3

2.3 Open Terminal

4

2.4 Enter the directory

cd phonon_dft

Upload the prepared silicon pseudopotential

Can be usedOfficial website examplePut the pseudopotential POTCAR in the directory

5

3. Continue to enter the following command to install the phonopy environment

conda install -c conda-forge phonopy

Then enter y and press Enter to agree to the installation

6

4. Enter the following command to run the script

chmod 777 *.sh

./run.sh

5. View the phonon spectrum

View the file band.pdf

8