Upload
tranminh
View
345
Download
12
Embed Size (px)
Citation preview
Introduction to phonopy
Installation● Download phonopy
– http://sourceforge.net/projects/phonopy/
● Install Python libraries that phonopy relies● Install phonopy
● Add the phonopy library directory(e.g., ~/phonopy-0.9.3/lib/python) to PYTHONPATH, maybe in .bashrc, .zshenv, etc.
% 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=.
export PYTHONPATH=$PYTHONPATH:~/phonopy-0.9.3/lib/python
Run examplesSuppose phonopy's /bin is in the list of the execution path.
Examples are found athttp://phonopy.sourceforge.net/examples.html
% cd example/NaCl% phonopy -p –-nac
% cd example/Si% phonopy -p
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
Forces
Displacement
A supercell with a displacement1. 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
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
– 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
● Input structure (POSCAR)
● Supercell size (--dim)
● Output files- Supercell with
displacements (POSCAR-*)
- Displacement directions (DISP)
● DISP and vasprun.xml's
● Supercell size (--dim)
● Output file– Sets of forces (FORCES)
for a post-process input.
Pre-process
% phonopy -d –-dim=”2 2 2”
(supercell size = 2x2x2)
Force collection
% phonopy –-dim=”2 2 2” \-f ALL_vapsrun.xml_FILES
POSCAR
SPOSCAR, POSCAR-*DISP
Phonopyprocess
NDIM tag
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 INPHONNDIM = 2 2 2MP = 20 20 20% phonopy -p -t
← Thermal properties are plotted.
Phonopy post-process
thermal_properties.yaml total_dos.dat partial_dos.dat
mesh.yamlband.yaml
POSCAR
NDIM or MATDIM tagor --dim option PRIMITIVE_AXIS tag
FORCES or FORCE_CONSTANTS
Computing system
PC ClusterAsk force calculation
Work station
Ask phonon analysis(via X forwarding)
Recent PCs are enough strong that usually PC can be Work station.
Plot
Tips of force calculation in VASP
Geometry optimization of unit cell
EDIFFG = -1.0e-08Set
and relax as much as possible watching the recidual forces
Recidual forces of ~1e-4 eV/Å may be acceptable, but depends on systems.
Force calculations of supercellsIBRION = -1Set
PREC = AccurateLREAL = .FALSE.ADDGRID = .TRUE.EDIFF = 1.0e-08
INCAR of phonon calculation
i.e. no relaxation is allowed.
IBRION = 2; ISIF = 3Maybe
An example set of INCARs
PREC = Accurate ENCUT = 500 IBRION = 2 ISIF = 3 NSW = 20 NELMIN = 5 EDIFF = 1.0e-08 EDIFFG = -1.0e-08 IALGO = 38 ISMEAR = 0; SIGMA = 0.1 LREAL = .FALSE. ADDGRID = .TRUE. LWAVE = .FALSE. LCHARG = .FALSE.
PREC = Accurate ENCUT = 500 IBRION = -1 NELMIN = 5 EDIFF = 1.0e-08 IALGO = 38 ISMEAR = 0; SIGMA = 0.1 LREAL = .FALSE. ADDGRID = .TRUE. LWAVE = .FALSE. LCHARG = .FALSE.
Geometry optimization Force calculation
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
2×2supercell
Unitcell
½×½
Brief introduction to phonon theory
Harmonic oscillator
Harmonic potential well V
m
k
frequency
Mass
Spring constant
F=ma=-kx
x
x
Equation of motion
A solution is
1D-lattice connected with N.N.
n n+1 n+2n-1
Nearest neighbor
un-1 un un+1 un+2
aMass m
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
Atomic modulation is parallel to wave vector.
q
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).
i, j, k, … : Cartesian componentsM, N, P, … : Lattice points
(Monatomic unit cell)
: Force constants (FCs)
Phonon from classical mechanics
Omit higher terms than 3nd order → Harmonic approximation
Diagonalization is needed.
Phonon is found to diagonalize harmonic Hamiltonian:
This is reduced to eigenvalue problem of dynamical matrix.
* M: mass, N0: number of atoms, R: positon vector
Multiple atoms in a unit cell are considered.Indices μνπ... are used for internal atomic labeling.
Phonon frequencies are obtained as square roots of eigenvalues of the dynamical matrix.
It is convenient for solving eigenvalue problem using computer to construct a matrix of in the form like (two atom in unit cell):
Diagonalization using computer
eigvals, eigvecs = numpy.linalg.eigh( dynmat )
D: dynamical matrix, w: eigenvector, s: band index
Eigenvector w
*Here indices i, j run over the Catesian components and atom indices.
w(qs) are eigenvectors in the output files of phonopy.
Orthonormality
Completeness
Imaginary mode
(a>0, b<0)
Sometimes it relates to phase transition, or may be used to check if virtual crystal structure is stable or not.
Normal mode coordinate
Imaginary frequency appears when crystal structure is dynamically unstable through the imaginary mode.
*In phonopy output, imaginary frequency is given as negative frequency.
Supercell approach
… ……
…
Assume interaction range is confined in supercell size.
E.g., 2x2 supercell is used to calculate force constans.
Finite difference method
Force on an atom (Fi)
Atomic displacement (Δrj)
Displace one atom, and measure forces on all atoms
Thermal properties
Helmholtz free energy
Thermal properties are calculated from frequencies.
Entropy
Heat capacity at constant volume
Quantum mechanics is necessary to derive them.
Crystal symmetry
Crystal symmetry
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.
Crystal symmetry gives high quality results and reduces computational demands.
% phonopy –-symmetry --tolerance=1e-8
Detailed crystal symmetry is checked by
Crystal structure has to be correctly symmetrized according to the space group type.
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 centreI: body centreC, 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 toprimitive 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
Mesh sampling
List of q-points
Sample q-points along specified paths
Sample q-points on a uniform mesh
Sample q-points listed in QPOINTS file
Calculations of DOS, PDOS, thermal propertiesblong to this mode.
Band structure mode
q-point sampling paths:
Number of sampling paths:
Number of sampling points in a path:
QI = 0.0 0.0 0.0 0.5 0.0 0.0 0.5 0.5 0.0
QF = 0.5 0.0 0.0 0.5 0.5 0.0 0.0 0.0 0.0
ND = 3
NPOINTS = 51 *End points are counted.
(1) (2) (3)
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
% phonopy --dos % phonopy -por
(without plot) (with plot)
The output file is total_dos.dat.
The broadening function is the Gaussian function.
DOS is obtained by
(Lorentzian is in the code, but no phonopy user interface is implemented. )
% phonopy –sigma=0.1
Smearing width is controlled by
Mesh sampling/PDOS
Partial DOS is obtained by
PDOS = 1 2, 3 4 5 6
As well as total DOS, smearing is controlled by --sigma.
% phonopy
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 to1x, 1y, 1z, 2x, 2y, 2z, … (numbers are atom indices.)
and
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)
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.
*Z: Born effective charge tensor, ε: dielectric tensor
BORN file
LEPSILON = .TRUE.
BORN EFFECTIVE CHARGES (in e, cummulative output)
MACROSCOPIC STATIC DIELECTRIC TENSOR (including local field effects in DFT)
VASP results are found in OUTCAR around:
14.400 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...
Unit conversion factorε
Z
These values may be obtained by VASP 5 by setting
*Only Z for independent atoms have to be written. Independent atoms are found atom_mapping of output of % phonopy --symmetry
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.132246144.500000 -42.600974149.060000 -42.949142...
V U
Thermal expansion of Silicon by QHA
Origin of thermal expansion isvolume dependence of frequency.
Volume dependence of frequency of Silicon
This point
Animation for v_sim and else
ANIME = 0.5 0.5 0.5
ANIME = 4 5 20 0.25 0.25 0.25
For v_sim
For gdis, etc, at only Γ-point
Band index (from the bottom)
q-point
Amplitude
Number of pictures
Shift
Eigenvector to displacement
ANIME_TYPE = POSCARANIME = 1 5 4
Displaced structure along an eigenvector is created by
POSCAR-001 or POSCAR-003 is the structure that we want.
Finite displacements
AmplitudeDefault 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
Only plus when symmetric (automatically searched from crystal symmetry)
This often also compensates residual forces.
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)