Phonon calculation for NaCl using Phonopy and Quantum ESPRESSO
Last Update:2024/10/04
1. Introduction
Phonopy is a post-processing program for extracting phonon properties in combination with first-principles calculation software. It supports VASP, WIEN2k, Quantum ESPRESSO, and so on. Here, we use the docker version of MateriApps LIVE! to show an example of phonon calculation for NaCl using Phonopy and Quantum ESPRESSO. For instructions on how to install and use, see here.
2. Preparation
First, log in to Docker and install Phonopy.
pip3 install phonopy
The path of Phonopy is set.
export PATH=$PATH:$HOME/.local/bin/
In order to use the sample input files, download the source code. (No compilation is required.)
git clone https://github.com/phonopy/phonopy.git
Create a working directory and enter it.
mkdir phonopy_test cd phonopy_test
Copy sample input files to the working directory.
cp ../phonopy/example/NaCl-QE/NaCl.in . cp ../phonopy/example/NaCl-QE/header.in . cp ../phonopy/example/NaCl-QE/band.conf .
3. Electronic-state calculation and phonon dispersion
Perform an electronic state calculation using Quantum ESPRESSO. First, you need to modify the file copied as header.in. The revised part is as follows.
1. In &control section, change the line including pseudo_dir = ‘…’ as pseudo_dir = ‘./’.
Make the same modifications for NaCl.in. Next, create an input file with a lattice structure that slightly changes the atomic arrangement of the crystal. First, run phonopy.
phonopy --qe -d --dim="2 2 2" -c NaCl.in
Using the header file, header.in, prepare the input files for quantum ESPRESSO.
for i in {001,002};do cat header.in supercell-$i.in >| NaCl-$i.in; done
Please download the pseudopotential files before the calculation. Take Na.pbe-spn-kjpaw_psl.0.2.UPF from here and Cl.pbe-n-kjpaw_psl.0.1.UPF from here. You can share files with Docker by creating the directory named “share” (see here). After downloading outside of Docker, you can move the file to share directory and then move it to your working directory. Then, run Quantum ESPRESSO:
mpirun -np (# of parallel computation) pw.x -i NaCl-001.in |& tee NaCl-001.out mpirun -np (# of parallel computation) pw.x -i NaCl-002.in |& tee NaCl-002.out
The maximum number of parallels depends on the computing environment. The higher the number of parallels, the faster the calculation. If the calculation successfully finishs, the results are outputed in the files, NaCl-001.out and NaCl-002.out. Use them to create the input file FORCE_SETS for phonopy.
phonopy -f NaCl-001.out NaCl-002.out
Once you generate FORCE_SETS, you can perform various calculations by Phonopy. For example, to display a phonon band diagram, run the following command:
phonopy --qe -c NaCl.in -p band.conf
If the caluculation is successful, the following phonon band diagram will be outputed.
4. Corrections due to long-range interaction
The above calculations do not fully incorporate the effects of Coulomb interactions between distant atoms. Especially in ionic crystals such as NaCl, the band of optical phonons near the gamma point is affected when long-range interactions are properly taken into account (this is because long-wavelength optical phonons produce electrical polarization, and the resulting long-range Coulomb interaction energy has a large effect on the phonon energy). To take this effect into account, you must perform the usual Quantum ESPRESSO calculation to determine the ion’s effective charge and dielectric constant. First, calculate the electronic state using Quantum ESPRESSO.
mpirun -np (# of parallel compuation) pw.x < NaCl.in |& tee NaCl.out
Next, the input file, NaCl.ph.in, is copied from the sample directory in Phonopy.
cp ../phonopy/example/NaCl-QE/NaCl.ph.in .
The content of this file is as follows:
&inputph tr2_ph = 1.0d-14, epsil = .true. / 0 0 0
Using this input file, perform ph.x in Quantum ESPREESO.
mpirun -np (# of parallel compuation) ph.x -i NaCl.ph.in |& tee NaCl.ph.out
This calculation takes time (about a few hours). When you’re done, look inside NaCl.ph.out.
cat NaCl.ph.out
The output file should contain output items such as “Dielectric constant” and “Effective charges”.
Dielectric constant in cartesian axis ( 2.472962895 0.000000000 0.000000000 ) ( 0.000000000 2.472962895 0.000000000 ) ( 0.000000000 0.000000000 2.472962895 ) (....) Effective charges (d Force / dE) in cartesian axis without acoustic sum rule applied (asr) atom 1 Na Mean Z*: 1.09891 Ex ( 1.09891 0.00000 0.00000 ) Ey ( 0.00000 1.09891 0.00000 ) Ez ( 0.00000 0.00000 1.09891 ) (....) atom 5 Cl Mean Z*: -1.10236 Ex ( -1.10236 0.00000 0.00000 ) Ey ( 0.00000 -1.10236 0.00000 ) Ez ( 0.00000 0.00000 -1.10236 )
Prepare the file, BORN, based on this result. For example, you start emacs as
emacs BORN
type the following lines manually, and exit emacs.
default value 2.472962895 0 0 0 2.472962895 0 0 0 2.472962895 1.10 0 0 0 1.10 0 0 0 1.10 -1.10 0 0 0 -1.10 0 0 0 -1.10
Once you have made this file, run phonopy with the –nac option.
phonopy --qe --nac -c NaCl.in -p band.conf
If you get the following graph, you are successful. You can see that the optical phonon band around the Γ point has changed.