You are on page 1of 52

Introduction to phonopy

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
% phonopy -p mesh.conf

% cd example/NaCl
% phonopy -p -nac band.conf

Installation

Download phonopy

http://sourceforge.net/projects/phonopy/

Install phonopy
% sudo apt-get install python-dev python-numpy \
python-matplotlib python-tk python-lxml python-yaml
% tar xvfz phonopy-1.1.tar.gz
% cd phonopy-1.1
% python setup.py install home=.

Add the phonopy library directory


(e.g., ~/phonopy-1.1/lib/python) to
maybe in .bashrc, .zshenv, etc.

PYTHONPATH,

export PYTHONPATH=$PYTHONPATH:~/phonopy-1.1/lib/python

Phonopy is

A phonon calculation toolbox

Easily installed on recent systems

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
Displacement

6. Calculate phonon frequencies

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

Phonon analysis

Collect sets of forces on atoms of the supercells


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.yaml

Supercell size (--dim)

vasprun.xml's

% phonopy -d -dim=2 2 2

% phonopy -f ALL_vapsrun.xml

(supercell size = 2x2x2)

Output files
- Supercell with

displacements (POSCAR-*)
- Displacement directions

(disp.yaml)

Output file

Sets of forces (FORCE_SETS)


used in the post-process.

POSCAR
DIM tag

Phonopy
process

SPOSCAR, POSCAR-*
disp.yaml
VASP calculations

VASP DFPT calculations

Post process

A file containing sets of forces and atomic


displacements (FORCE_SETS) 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
(xxx.conf) and command-line options.
% cat mesh.conf
DIM = 2 2 2
MP = 20 20 20
% phonopy -p -t mesh.conf

Thermal properties are


calculated and plotted.

Phonopy post-process
POSCAR

DIM tag or
--dim option

band.yaml

FORCE_SETS or
FORCE_CONSTANTS

PRIMITIVE_AXIS tag

mesh.yaml

thermal_properties.yaml total_dos.dat partial_dos.dat

Computing system

PC

Plot

Ask force calculation

Cluster

Ask phonon analysis


(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
PREC
ENCUT
IBRION
ISIF
NSW
NELMIN
EDIFF
EDIFFG
IALGO
ISMEAR
LREAL
ADDGRID
LWAVE
LCHARG

=
=
=
=
=
=
=
=
=
=
=
=
=
=

Accurate
500
2
3
20
5
1.0e-08
-1.0e-08
38
0; SIGMA = 0.1
.FALSE.
.TRUE.
.FALSE.
.FALSE.

You may need to relax several times


by, mv CONTCAR POSCAR.

Force calculation
PREC
ENCUT
IBRION
NELMIN
EDIFF
IALGO
ISMEAR
LREAL
ADDGRID
LWAVE
LCHARG

=
=
=
=
=
=
=
=
=
=
=

Accurate
500
-1
5
1.0e-08
38
0; SIGMA = 0.1
.FALSE.
.TRUE.
.FALSE.
.FALSE.

Tips of k-point sampling mesh in


electronic structure calculations
Real space

Reciprocal space

Unit
cell

22
supercell

Brief introduction to phonon theory

Harmonic oscillator
Harmonic potential well

Spring constant
Mass

k
m

x
x

Equation of motion

F=ma=-kx
A solution is

frequency

1D-lattice connected with N.N.


Nearest neighbor

Mass

n-1

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
q

Atomic modulation is orthogonal to wave vector.

Longitudinal wave
q

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
(FCs)

i, j, k, : Cartesian components
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 1/2 1/2 1/2 0 1/2 1/2 1/2 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 properties belong to this mode.

List of q-points
Sample q-points listed in QPOINTS file

Band structure mode


q-point sampling paths:
BAND = 0 0 0

1/2 0 0

1/2 1/2 0

(2)

(3)

(1)

Number of sampling points in a path:


BAND_POINTS = 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 nonanalytical 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
Unit conversion factor
14.400
2.00 0.00 0.00
0.00 2.00 0.00
1.98 0.00 0.00
0.00 1.98 0.00
-0.99 0.00 0.00
0.00 -0.99 0.00
...

0.00
0.00
0.00

0.00 2.00
0.00 1.98
0.00 -0.99

*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 e-v.dat \
thermal_properties_yaml_of_volume1 \
thermal_properties_yaml_of_volume2 \
thermal_properties_yaml_of_volume3 ...
The file e-v.dat contains volumes and
electronic total energies U(V) of unit cells.
140.030000
144.500000
149.060000
...
V

-42.132246
-42.600974
-42.949142
U

Thermal expansion of Silicon by


QHA
Supercell sizes

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 Atomic position 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


MODULATION = 0 0 0 1 1 1, 4 1
MPOSCAR-001 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