Phonopy code is developped to calculate the phonon and thermal properties plus some other functionalities.
To install the code click on the following link:
How to install Phonopy Code to calculate Phonon and Thermal properties
We will calculate the Band structure of NaCl. We need the input files, the pseudopotentials and a script
NaCl.in
&control
calculation = 'scf'
tprnfor = .true.
tstress = .true.
pseudo_dir = '/home/togo/espresso/pseudo/'
/
&system
ibrav = 0
nat = 8
ntyp = 2
ecutwfc = 70.0
/
&electrons
diagonalization = 'david'
conv_thr = 1.0d-9
/
ATOMIC_SPECIES
Na 22.98976928 Na.pbe-spn-kjpaw_psl.1.0.0.UPF
Cl 35.453 Cl.pbe-n-rrkjus_psl.0.1.UPF
ATOMIC_POSITIONS crystal
Na 0.0000000000000000 0.0000000000000000 0.0000000000000000
Na 0.0000000000000000 0.5000000000000000 0.5000000000000000
Na 0.5000000000000000 0.0000000000000000 0.5000000000000000
Na 0.5000000000000000 0.5000000000000000 0.0000000000000000
Cl 0.5000000000000000 0.5000000000000000 0.5000000000000000
Cl 0.5000000000000000 0.0000000000000000 0.0000000000000000
Cl 0.0000000000000000 0.5000000000000000 0.0000000000000000
Cl 0.0000000000000000 0.0000000000000000 0.5000000000000000
CELL_PARAMETERS angstrom
5.6903014761756712 0 0
0 5.6903014761756712 0
0 0 5.6903014761756712
K_POINTS automatic
8 8 8 1 1 1
Pseudopotentials
Na.pbe-spn-kjpaw_psl.1.0.0.UPF
To download the PP click on the right of the mouse and choose Save Page As
Script ph.sh
#!/bin/bash
# Creating different directories for different displacements
N=$(ls NaCl-*.in | wc -l)
echo $N
for s in $(eval echo "{001..$N}")
do
d=${s%%.in}
mkdir disp-$d
(
cd disp-$d
cp ../NaCl-$d.in NaCl-$d.in
cp ../Na.pbe-spn-kjpaw_psl.1.0.0.UPF Na.pbe-spn-kjpaw_psl.1.0.0.UPF
cp ../Cl.pbe-n-rrkjus_psl.0.1.UPF Cl.pbe-n-rrkjus_psl.0.1.UPF
#mpirun -np 4 pw.x -i NaCl-$d.in |& tee NaCl-$d.out # for parallel calculation
pw.x -i NaCl-$d.in |& tee NaCl-$d.out # for serial calculation
cd ..
)
done
Calculation
1- Creation of displacement Struct files
% conda activate phonopy
(phonopy) % phonopy --qe -c NaCl.in -d --dim="2 2 2"
In this example, 2x2x2 supercells are created. supercell.in
and
supercell-xxx.in
(xxx
are numbers) give the perfect
supercell and supercells with displacements, respectively. In the
case of the NaCl example, two files supercell-001.in
and
supercell-002.in
are created. In these supercell files, lines
only relevant to crystal structures are
given. phonopy_disp.yaml
is also generated, which contains
information about supercell and displacements.
supercell-xxx.in
files, e.g., by:
(phonopy) % for i in {001,002};do cat header.in supercell-$i.in >| NaCl-$i.in; done
where header.in
is specially made for this NaCl example. This
setting is of course dependent on systems and has to be written for
each interested system. Note that supercells with displacements
must not be relaxed in the force calculations, because atomic
forces induced by a small atomic displacement are what we need for
phonon calculation.
header.in
&control
calculation = 'scf'
tprnfor = .true.
tstress = .true.
pseudo_dir = '/home/togo/espresso/pseudo/'
disk_io = 'none'
/
&system
ibrav = 0
nat = 64
ntyp = 2
ecutwfc = 70.0
/
&electrons
diagonalization = 'david'
conv_thr = 1.0d-9
/
K_POINTS automatic
2 2 2 1 1 1
2- Phonon calculations
chmod +x ph.sh
./ph.sh
3- Calculation of sets of forces
(phonopy) % phonopy --qe -f disp-001/NaCl-001.out disp-002/NaCl-002.out
Here .out files are the output of the PW calculations and are supposed to contain the forces on atoms calculated by PW. The disp.yaml file has to be put in the current directory.
Post-process
In the post-process,
Force constants are calculated from the sets of forces
A part of dynamical matrix is built from the force constants
Phonon frequencies and eigenvectors are calculated from the dynamical matrices with the specified q-points.
Band structure is calculated with the following setting file named, e.g., band.conf by:
DIM = 2 2 2
PRIMITIVE_AXIS = 0.0 0.5 0.5 0.5 0.0 0.5 0.5 0.5 0.0
BAND = 0.0 0.0 0.0 0.5 0.0 0.0 0.5 0.5 0.0 0.0 0.0 0.0 0.5 0.5 0.5
The band structure is plotted by:
(phonopy) % phonopy --qe -c NaCl.in -p band.conf
Non-analytical term correction (Optional)
To activate non-analytical term correction, BORN (optional) is required. This file contains the information of Born effective charge and dielectric constant.
BORN
default value
2.472958201 0 0 0 2.472958201 0 0 0 2.472958201
1.105385 0 0 0 1.105385 0 0 0 1.105385
-1.105385 0 0 0 -1.105385 0 0 0 -1.105385
Non-analytical term correction can be applied using --nac option by
% phonopy --qe --nac -c NaCl.in -p band.conf
BORN file is created running DFPT calculation using ph.x (phonon) code in the quantum espresso package. The details of howto are found in the phonopy documentation. The input and output files of the ph.x DFPT calculation are NaCl.ph.in and NaCl.ph.out.
0 Comments