0% found this document useful (0 votes)
29 views

Version 2

sss
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Version 2

sss
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 52

Introduction to phonopy

Installation
● Download phonopy
– http://sourceforge.net/projects/phonopy/
● Install Python libraries that phonopy relies
● Install phonopy
% sudo apt-get install python-dev python-numpy \
python-matplotlib python-tk python-lxml python-yaml

% tar xvfz phonopy-0.9.3.tar.gz


% cd phonopy-0.9.3
% python setup.py install –home=.

● Add the phonopy library directory


(e.g., ~/phonopy-0.9.3/lib/python) to
PYTHONPATH, maybe in .bashrc, .zshenv, etc.
export PYTHONPATH=$PYTHONPATH:~/phonopy-0.9.3/lib/python
Run examples
Suppose phonopy's /bin is in the list of the execution path.

Examples are found at


http://phonopy.sourceforge.net/examples.html

% cd example/Si % cd example/NaCl
% phonopy -p % phonopy -p –-nac
Phonopy is
● A phonon calculation toolbox and toolkit
● Easily installed on Ubuntu (or recent distributions)
– Currently Windows and Mac OS X are out of consideration.
– Windows and Mac users are encouraged to boot Ubuntu on a
virtual machine (e.g. VMware, Virtualbox)
● Phonopy requires force calculators, e.g., it work
togather with first-principles calculations, or any
calculation that can calculate forces on atoms.
● Processes of phonopy and force calculations are
completely separated. Therefore phonopy can be
applied to any force calculator with small effort.
● Written mainly in Python
– Phonopy Python module is prepared.
Calculation steps

A supercell with a displacement


1. Prepare a unit cell
2. Relax the structure
3. Build a set of supercells with
displacements

4. Calculate forces on atoms of


the set of supercells

5. Collect sets of forces


Forces 6. Calculate phonon frequencies
Displacement
Work flow of phonopy
● Prepare a crystal structure at equilibrium in VASP
POSCAR format
● Create supercells with displacements
● Force calculation by a force calculator, e.g. VASP
● Force collection
– Collect sets of forces on atoms of the supercells
● Phonon analysis
– Density of states, Band structure, Thermal properties, etc.
● Further analysis from a set of phonon calculations
– Thermal expansion, etc.
Pre-process & Force collection

Pre-process Force collection


● Input structure (POSCAR) ● DISP and vasprun.xml's
● Supercell size (--dim) ● Supercell size (--dim)

% phonopy -d –-dim=”2 2 2” % phonopy –-dim=”2 2 2” \


-f ALL_vapsrun.xml_FILES
(supercell size = 2x2x2)

● Output files ● Output file


- Supercell with – Sets of forces (FORCES)
displacements (POSCAR-*)
for a post-process input.
- Displacement directions
(DISP)
POSCAR
NDIM tag Phonopy
process

SPOSCAR, POSCAR-*
DISP

VASP calculations VASP DFPT calculations


Post process
● A file containing sets of forces and atomic
displacements (FORCES) is transformed to supercell
force constants.
● Dynamical matrices at arbitrary q-point are built from
the supercell force constants.
● Dynamical matrices are solved, and phonon frequency
and polarization vectors are obtained.
● DOS, PDOS, band structure, and thermal properties at
constant volume are obtained following a setting file
(INPHON) and command-line options.
% cat INPHON
NDIM = 2 2 2
MP = 20 20 20 ← Thermal properties are plotted.
% phonopy -p -t
Phonopy post-process

NDIM or MATDIM tag FORCES or


POSCAR or --dim option FORCE_CONSTANTS PRIMITIVE_AXIS tag

band.yaml mesh.yaml

thermal_properties.yaml total_dos.dat partial_dos.dat


Computing system

Ask force calculation


PC Cluster

Ask phonon analysis


Plot (via X forwarding)

Work station

Recent PCs are enough strong that usually PC can be Work station.
Tips of force calculation in VASP
INCAR of phonon calculation
PREC = Accurate
LREAL = .FALSE.
ADDGRID = .TRUE.
EDIFF = 1.0e-08
Geometry optimization of unit cell
Set EDIFFG = -1.0e-08
and relax as much as possible watching the recidual forces
Recidual forces of ~1e-4 eV/Å may be acceptable, but depends on systems.
Maybe IBRION = 2; ISIF = 3

Force calculations of supercells


Set IBRION = -1
i.e. no relaxation is allowed.
An example set of INCARs
Geometry optimization Force calculation

PREC = Accurate PREC = Accurate


ENCUT = 500 ENCUT = 500
IBRION = 2 IBRION = -1
ISIF = 3 NELMIN = 5
NSW = 20 EDIFF = 1.0e-08
NELMIN = 5 IALGO = 38
EDIFF = 1.0e-08 ISMEAR = 0; SIGMA = 0.1
EDIFFG = -1.0e-08 LREAL = .FALSE.
IALGO = 38 ADDGRID = .TRUE.
ISMEAR = 0; SIGMA = 0.1 LWAVE = .FALSE.
LREAL = .FALSE. LCHARG = .FALSE.
ADDGRID = .TRUE.
LWAVE = .FALSE.
LCHARG = .FALSE.

You may need to relax several times


by mv CONTCAR POSCAR.
Tips of k-point sampling mesh in
electronic structure calculations
Real space Reciprocal space

Unit
cell

2×2
½×½
supercell
Brief introduction to phonon theory
Harmonic oscillator
Harmonic potential well V

Spring constant k

Mass m x
x
Equation of motion

F=ma=-kx
A solution is
frequency
1D-lattice connected with N.N.
Nearest neighbor

a
Mass m
n-1 n n+1 n+2

un-1 un un+1 un+2

Let displacement be superposition of traveling waves


Dispersion relation

Solving equation of motion, frequency is


Transverse wave

Atomic modulation is orthogonal to wave vector.


Longitudinal wave

Atomic modulation is parallel to wave vector.


Interaction among atoms


… …

We don't know how far it reaches and how strong it is.


Furthermore interaction is not only in pairs.
Potential energy expansion

Hamiltonian = kinetic + potential

Potential energy is expaned with respect to


atomic displacements (U).

(Monatomic unit cell)


: Force constants i, j, k, … : Cartesian components
(FCs) M, N, P, … : Lattice points
Phonon from classical mechanics
Omit higher terms than 3nd order → Harmonic approximation

Phonon is found to diagonalize harmonic Hamiltonian:

Diagonalization is needed.
Multiple atoms in a unit cell are considered.
Indices μνπ... are used for internal atomic labeling.

This is reduced to eigenvalue problem of dynamical matrix.

* M: mass, N0: number of atoms, R: positon vector


Phonon frequencies are obtained as square roots of
eigenvalues of the dynamical matrix.
Diagonalization using computer

D: dynamical matrix, w: eigenvector, s: band index

It is convenient for solving eigenvalue problem using computer to


construct a matrix of in the form like (two atom in unit cell):

eigvals, eigvecs = numpy.linalg.eigh( dynmat )


Eigenvector w

Orthonormality

Completeness

*Here indices i, j run over the Catesian components and atom indices.

w(qs) are eigenvectors in the output files of phonopy.


Imaginary mode

Imaginary frequency appears when crystal structure


is dynamically unstable through the imaginary mode.
Sometimes it relates to phase transition, or may be
used to check if virtual crystal structure is stable or not.
*In phonopy output, imaginary frequency is given as negative frequency.

(a>0, b<0)

Normal mode coordinate


Supercell approach
Assume interaction range is confined in supercell size.

… …… …

E.g., 2x2 supercell is used to calculate force constans.


Finite difference method
Displace one atom, and measure forces on all atoms

Force on an atom (Fi)


Atomic displacement (Δrj)
Thermal properties
Thermal properties are calculated from frequencies.
Quantum mechanics is necessary to derive them.

Helmholtz free energy

Entropy

Heat capacity at constant volume


Crystal symmetry
Crystal symmetry
Crystal structure has to be correctly symmetrized
according to the space group type.
Crystal symmetry gives high quality results and reduces
computational demands.

CIF database may have small number of decimals


e.g. 1/3 → 0.3333

VASP geometry optimization may result in breaking symmetry


in hexagonal case, etc.

Detailed crystal symmetry is checked by


% phonopy –-symmetry --tolerance=1e-8
Centrings of crystals
In space group type names in international table,
starting with F, I, C, A, and B means that
crystal has centring.

F: face centre
I: body centre
C, A, B: base centre

In these cases, the conventional unit cell is 1-, 2-, or


4-fold larger than the primitive cell.

Lattice parameters of the conventional and primitive


cells are related by transformation matrix.
(ITA2002 Sec. 5.1) *ITA: International table volume A
Fm3m (e.g. Silicon)

Conventional unit cell to


primitive cell

PRIMITIVE_AXIS = 0 0.5 0.5 0.5 0 0.5 0.5 0.5 0


Brillouin zones for space groups

Go to http://www.cryst.ehu.es/

click
Brillouin zone of Fm3m

Coordinates wrt. reciprocal


primitive lattice vectors
This is to be written in QI and QF tags.
More on phonopy
Running modes of phonopy

Band structure
Sample q-points along specified paths

Mesh sampling
Sample q-points on a uniform mesh

Calculations of DOS, PDOS, thermal propertiesblong to this mode.

List of q-points
Sample q-points listed in QPOINTS file
Band structure mode
q-point sampling paths:

QI = 0.0 0.0 0.0 0.5 0.0 0.0 0.5 0.5 0.0


(1) (2) (3)
QF = 0.5 0.0 0.0 0.5 0.5 0.0 0.0 0.0 0.0

Number of sampling paths:


ND = 3

Number of sampling points in a path:


NPOINTS = 51 *End points are counted.

The output file is band.yaml.


bandplot

Re-plot band structure from band.yaml by

% bandplot

Command options can be shown by


% bandplot -h

To print out frequencies in gnuplot data format


% bandplot --gnuplot

If you want to cut below 0,


% bandplot --fmin=0
Mesh sampling mode
Reciprocal lattice are sampled by a uniform mesh.

MP = 10 10 10

In phonopy, a mesh point samples the Γ-point when the


number is odd. Optionally, the sampling mesh can be
shifted with respect to grid space.

MP_shift = 0.5 0.5 0.5

When MP_SHIFT is 0 or 0.5, the symmetrization of the


grid points is fast, which may be important when the
mesh is quite dense.

The output file is mesh.yaml.


Mesh sampling/DOS

n: number of calculated q-points, g: function used for broadening

DOS is obtained by

% phonopy --dos or % phonopy -p


(without plot) (with plot)

The broadening function is the Gaussian function.


(Lorentzian is in the code, but no phonopy user interface is implemented. )
Smearing width is controlled by
% phonopy –sigma=0.1

The output file is total_dos.dat.


Mesh sampling/PDOS

Partial DOS is obtained by


PDOS = 1 2, 3 4 5 6 and % phonopy

As well as total DOS, smearing is controlled by --sigma.


With -p option, PDOS is plotted.

The output files is partial_dos.dat, and reploted by

% pdosplot -i “1 2 4 5, 3 6”
Where numbers for -i option correspond to
1x, 1y, 1z, 2x, 2y, 2z, … (numbers are atom indices.)
DOS/Thermal properties
Helmholtz free energy, entropy, heat capacity at constant
volume are calculated from phonon frequencies by

% phonopy -t

With -p option, the resutls are plotted.


Options --tmax,--tmin,--tstep may be used together.

The output file is thermal_properties.yaml.

Thermal properties are re-plotted by

% propplot –cv (or –-fe, --entropy)


(--gnuplot option is dummy....)
Non-analytical term correction
Dynamical matrix at q → 0 are corrected by non-
analytical term correction. R. M. Pick et al., PRB 1, 910, (1970)

*Z: Born effective charge tensor, ε: dielectric tensor

At general q-points, force constants are corrected by


interpolation scheme of Wang et al. (J. Phys.: Condens.
Matter. 22, 202201 (2010))

% phonopy --nac

Born effective charge and dielectric tensors are


necessary to use this option and those are
summarized in BORN file.
BORN file
14.400 Unit conversion factor
2.00 0.00 0.00 0.00 2.00 0.00 0.00 0.00 2.00 ε
1.98 0.00 0.00 0.00 1.98 0.00 0.00 0.00 1.98
-0.99 0.00 0.00 0.00 -0.99 0.00 0.00 0.00 -0.99 Z
...

*Only Z for independent atoms have to be written. Independent


atoms are found atom_mapping of output of % phonopy --symmetry

These values may be obtained by VASP 5 by setting


LEPSILON = .TRUE.

VASP results are found in OUTCAR around:


BORN EFFECTIVE CHARGES (in e, cummulative output)

MACROSCOPIC STATIC DIELECTRIC TENSOR (including local field


effects in DFT)
Quasi-harmonic approximation
(QHA)
QHA: Frequencies at volumes

% phonopy-qha -p -s v-e.dat \
thermal_properties_yaml_of_volume1 \
thermal_properties_yaml_of_volume2 \
thermal_properties_yaml_of_volume3 ...

The file v-e.dat contains volumes and


electronic total energies U(V) of unit cells.
140.030000 -42.132246
144.500000 -42.600974
149.060000 -42.949142
...
V U
Thermal expansion of Silicon by
QHA

Origin of thermal expansion is


volume dependence of frequency.
Volume dependence of frequency
of Silicon

This point
Animation for v_sim and else

For v_sim ANIME = 0.5 0.5 0.5


q-point

For gdis, etc, at only Γ-point


Number of pictures
Amplitude Shift

ANIME = 4 5 20 0.25 0.25 0.25

Band index (from the bottom)


Eigenvector to displacement

Displaced structure along an eigenvector is created by

ANIME_TYPE = POSCAR
ANIME = 1 5 4

POSCAR-001 or POSCAR-003 is the structure that we want.


Finite displacements
Amplitude
Default value is 0.01 Å.
Too small value enhances error of forces.
Too large value induces anharmonic contribution.

Plus-minus displacement
Take plus-minus as default
This often also compensates residual forces.
Only plus when symmetric (automatically searched from crystal symmetry)

Combination of these defaults and high enough


energy convergence criteria in force calculation is
expected to give uniform results.
Books and a reference

● Introduction to Lattice Dynamics (Martin T. Dove)


● Physical Properties of Crystals (J. F. Nye)
● Thermodynamics of Crystals (Duane C. Wallace)
● Thermodynamics and an Introduction to
Thermostatistics (Herbert B. Callen)
● Electrons and Phonons (J. M. Ziman)
● Principles of Quantum Mechanics (R. Shankar)

● From ultrasoft pseudopotentials to the projector


augmented-wave method, G. Kresse, D. Joubert, PRB
59, 1758 (1999)

You might also like