phonons & phonopy: pro tips (2015)
TRANSCRIPT
Phonons & Phonopy: “Pro Tips”
J. M. Skelton
Bath CompChem 14th April 2015
[Version 2.0]
Phonons and La*ce Dynamics
Crystallography is generally concerned with the sta3c proper3es of crystals, describing features such as the average posi3ons of atoms and the symmetry of a crystal. Solid state physics takes a similar line as far as elementary electronic proper3es are concerned. We know, however, that atoms actually move around inside the crystal structure, since it is these mo3ons that give the concept of temperature […]. The sta3c laBce model, which is only concerned with the average posi3ons of atoms and neglects their mo3ons, can explain a large number of material features […]. There are, however, a number of proper3es that cannot be explained by a sta3c model…
MarEn Dove, “IntroducEon to LaNce Dynamics”
Bath CompChem, April 2015 | Slide 2
What Can Phonopy Do?
“Anharmonicity” Proper:es
phonopy
phonopy-gruneisen
phonopy-qha
phono3py
Bath CompChem, April 2015 | Slide 3
Overview • “PracEcal” Theory
• phonopy
§ Workflow/setup
§ CalculaEng forces: opEons and “gotchas” § Post processing § Input/output files; using phonopy with other force-‐constant calculators
• phonopy-qha
§ Workflow and post-‐processing § Example applicaEons: which DFT funcEonal?
• phono3py
§ Workflow, setup and post processing § Examples
• Some current developments
• Summary
Bath CompChem, April 2015 | Slide 4
“Prac:cal” Theory
Bath CompChem, April 2015 | Slide 5
Force-‐constant matrix:
From finite differences:
Dynamical matrix:
A_er diagonalisaEon:
“Prac:cal” Theory
Bath CompChem, April 2015 | Slide 6
phonopy: Workflow
Input Structure
Create Displacements
Calculate Forces
Extract Forces
Post-‐Process
phonopy -d [--dim=“1 1 1”]
phonopy -f vasprun-{001..XXX}.xml
phonopy --fc vasprun.xml
phonopy [-t] [-p] [-s] Settings.conf
Bath CompChem, April 2015 | Slide 7
phonopy: Setup
phonopy -d [--dim=“1 1 1”] [--tolerance=1e-5] [-c POSCAR]
Set up the calculaEons on an XxYxZ supercell
PosiEon tolerance for symmetry detecEon
Path to POSCAR-‐format structure (“cell”), if not “POSCAR”
disp.yaml POSCAR-001 POSCAR-002 POSCAR-003 ... SPOSCAR
POSCAR files containing single atomic displacements
“Unperturbed” supercell for DFPT phonon calculaEon
InformaEon about the structure, supercell and displaced atoms
Bath CompChem, April 2015 | Slide 8
phonopy: Calcula:ng Forces
ADDGRID = .TRUE. EDIFF = 1E-8 ENCUT = 500-800 eV LREAL = .FALSE. PREC = High | Accurate
ADDGRID = .TRUE. EDIFF = 1E-8 ENCUT = 500-800 eV IBRION = 5|6|7|8 LREAL = .FALSE. NSW = 1 PREC = High | Accurate
• Accurate forces are essenEal -‐> crank the standard seNngs right up
• LREAL = .FALSE. is essenEal, unless you manually adjust ROPT
• ADDGRID = .TRUE. doesn’t seem to be essenEal, but doesn’t cost much either
• For finite-‐difference/DFPT phonon calculaEons in VASP, set NSW = 1
Sample finite-‐displacement INCAR: Sample VASP force-‐constants INCAR:
Bath CompChem, April 2015 | Slide 9
phonopy: Calcula:ng Forces (PbTe) ADDGRID = .FALSE.
LREAL = Auto
ADDGRID = .FALSE.
LREAL = .FALSE.
ADDGRID = .TRUE.
LREAL = Auto
ADDGRID = .TRUE.
LREAL = .FALSE.
Bath CompChem, April 2015 | Slide 10
phonopy: Calcula:ng Forces (ZnS)
Bath CompChem, April 2015 | Slide 11
phonopy: Calcula:ng Forces (ZnS)
Bath CompChem, April 2015 | Slide 12
• Symmetrising the force constants during the post processing with phonopy corrects the PBE dispersion
• SymmetrisaEon enforces the acousEc-‐sum rule in the TPSS dispersion, but does not remove the artefacts away from Γ
• Symmetrising within phonopy gives the same result as calcula3ng the force constants with the VASP internal DFPT/finite-‐displacement rou3nes -‐ as with most codes, VASP enforces symmetry by default
phonopy: Calcula:ng Forces (ZnS)
Bath CompChem, April 2015 | Slide 13
phonopy: Calcula:ng Forces
Bath CompChem, April 2015 | Slide 14
phonopy: Calcula:ng Forces
Bath CompChem, April 2015 | Slide 15
phonopy: A Few “Top Tips”
If using VASP FD/DFPT, set NWRITE = 3 in the INCAR file, and you can run this bash script on the OUTCAR to obtain a simulated IR spectrum “for free”: hrp://homepage.univie.ac.at/david.karhanek/downloads.html#Entry02
If using DFPT with an LDA/GGA funcEonal, set LEPSILON = .TRUE. in the INCAR file to obtain the staEc dielectric constant, in parEcular the ionic-‐relaxaEon part, for a small added cost
When using FD/DFPT, VASP tries to change the k-‐point set internally, which requires NPAR = #Cores to be set in the INCAR file; seNng ISYM = -1 avoids this, and although the number of displacements which need to be evaluated may increase, the performance gained by using band parallelism can quite easily offset this for low-‐symmetry systems (!)
Bath CompChem, April 2015 | Slide 16
phonopy: Post Processing
phonopy -p -s Settings.conf
“Plot” “Save”
SeNngs file
DIM = 4 4 4 MP = 48 48 48 GAMMA_CENTER = .TRUE.
Sample phonon DOS se*ngs file: PbTe
Bath CompChem, April 2015 | Slide 17
phonopy: Post Processing
phonopy -p -s Settings.conf
“Plot” “Save”
SeNngs file
DIM = 4 4 4 MP = 48 48 48 GAMMA_CENTER = .TRUE. EIGENVECTORS = .TRUE. PDOS = 1, 2
Sample phonon DOS se*ngs file: PbTe
Bath CompChem, April 2015 | Slide 18
phonopy: Post Processing
“[Calculate] thermal properEes”
DIM = 4 4 4 MP = 48 48 48 GAMMA_CENTER = .TRUE.
Sample phonon DOS se*ngs file:
phonopy -p -s -t Settings.conf
“Plot” “Save”
SeNngs file
PbTe
Bath CompChem, April 2015 | Slide 19
phonopy: Post Processing
phonopy -p -s Settings.conf
“Plot” “Save”
SeNngs file
DIM = 4 4 4 BAND = 0.0 0.0 0.0 0.5 0.25 0.75 0.5 0.0 0.5 0.0 0.0 0.0 0.5 0.5 0.5 BAND_POINTS = 101 BAND_LABELS = \Gamma W X \Gamma L [EIGENVECTORS = .TRUE.]
Sample phonon band structure se*ngs file: PbTe
Bath CompChem, April 2015 | Slide 20
phonopy: Post Processing
phonopy -p -s Settings.conf
“Plot” “Save”
SeNngs file
DIM = 4 4 4 BAND = 0.0 0.0 0.0 0.5 0.25 0.75 0.5 0.0 0.5 0.0 0.0 0.0 0.5 0.5 0.5 BAND_POINTS = 101 BAND_LABELS = \Gamma W X \Gamma L BAND_CONNECTION = .TRUE.
Sample phonon band structure se*ngs file: PbTe
Bath CompChem, April 2015 | Slide 21
phonopy: Non-‐Analy:cal Correc:ons
EDIFF = 1E-8 ENCUT = 500-800 eV LEPSILON = .TRUE. LREAL = .FALSE. NSW = 0 PREC = High | Accurate
INCAR for Born charges using DFPT:
EDIFF = 1E-8 ENCUT = 500-800 eV LCALCEPS = .TRUE. LREAL = .FALSE. NSW = 0 PREC = High | Accurate [EFIELD_PEAD = Ex Ey Ez]
INCAR for Born charges using LCALCEPS:
• To apply a non-‐analyEcal correcEon (LO/TO spliNng) to the phonon frequencies, phonopy needs the Born effecEve charges and electronic-‐polarisaEon contribuEon to the macroscopic dielectric constant
• In VASP, for LDA/GGA funcEonals these can be computed using DFPT; for others, they need to be computed from the response to an electric field
Bath CompChem, April 2015 | Slide 22
phonopy: Non-‐Analy:cal Correc:ons
outcar-born > BORN
<Conversion Factor> εxx εxy εxz εyx εyy εyz εzx εzy εzz Zxx Zxy Zxz Zyx Zyy Zyz Zzx Zzy Zzz Zxx Zxy Zxz Zyx Zyy Zyz Zzx Zzy Zzz
Dielectric tensor
Born charge tensors for unique atoms
Sample BORN file:
• CorrecEons are enabled by seNng NAC = .TRUE. in the configuraEon file, or passing --nac as a command-‐line argument
• When this opEon is used, phonopy expects to find a BORN file in the working directory
Bath CompChem, April 2015 | Slide 23
phonopy: Non-‐Analy:cal Correc:ons
PbTe
NAC = .FALSE. NAC = .TRUE.
Bath CompChem, April 2015 | Slide 24
phonopy: Force-‐Constant Symmetrisa:on
FC_SYMMETRY = 0 FC_SYMMETRY = 1
• Force-‐constant symmetrisaEon is enabled by seNng FC_SYMMETRY = > 0 in the configuraEon file
ZnS
Bath CompChem, April 2015 | Slide 25
phonopy: Output Files
mesh: [ mx, my, mz ] nqpoint: 32000 natom: 8 phonon: - q-position: [ qx, qy, qz ] weight: w1 band: - # 1 frequency: ω1 ...
Sample mesh.yaml file:
nqpoint: 808 npath: 8 natom: 8 phonon: - q-position: [ qx, qy, qz ] distance: d1 band: - # 1 frequency: ω1 ...
Sample band.yaml file:
• If EIGENVECTORS = .TRUE. is set in the configuraEon file, the mode eigenvectors will also appear in these files
• With BAND_CONNECTION = .TRUE., the frequencies for each band in band.yaml are ordered so that they connect across the band structure
Bath CompChem, April 2015 | Slide 26
phonopy: Output Files
# Sigma = 0.053821 -0.5372... 0.0000... -0.5103... 0.0000... -0.4834... 0.0000... -0.4564... 0.0000... -0.4295... 0.0000... -0.4026... 0.0000... -0.3757... 0.0000... -0.3488... 0.0000... -0.3219... 0.0000... ...
Sample total_dos.dat file:
unit: temperature: K ... natom: 8 zero_point_energy: 18.9108676 high_T_entropy: 847.3220815 thermal_properties: - temperature: 0.0000000 - free_energy: 18.9108676 - entropy: 0.0000000 - heat_capacity: 0.0000000 - energy: 18.9108676 ...
Sample thermal_proper:es.yaml file:
• The “parEal_dos.dat” file generated with EIGENVECTORS = .TRUE. contains one column for each atom in the primiEve cell
Bath CompChem, April 2015 | Slide 27
phonopy: Force-‐Constant Calculators
128 2 1 d1x d1y d1z F1x F1y F1z F2x F2y F2z ... 2 d2x d2y d2z F1x F1y F1z F2x F2y F2z ...
Sample FORCE_SETS file:
128 1 1 Φxx Φxy Φxz Φyx Φyy Φyz Φzx Φzy Φzz 1 2 Φxx Φxy Φxz Φyx Φyy Φyz Φzx Φzy Φzz ...
Sample FORCE_CONSTANTS file:
Bath CompChem, April 2015 | Slide 28
IRMOF-‐10
Bath CompChem, April 2015 | Slide 29
phonopy: Force-‐Constant Calculators
*Tinker calculaEons by J. K. Bristow and D. Tiana
phonopy-qha: Workflow
EoS Curve
Harmonic Phonopy
Thermal ProperEes
Post-‐Process
phonopy -d --dim=“...”
phonopy -f vasprun-{001..XXX}.xml
phonopy -t -p -s Settings.conf
E/V curve -‐> “e-‐v.dat”
phonopy-qha e-v.dat thermal_properties-{001..XXX}.yaml --tmax=980 [--tstep=10] [--pressure=<p/GPa>] [-p] [-s]
Needs to be two points smaller than the maximum temperature in the YAML files
Bath CompChem, April 2015 | Slide 30
phonopy-qha: Output
Bath CompChem, April 2015 | Slide 31
*J. M. Skelton et al., Phys. Rev. B 89, 205203 (2014)
phonopy-qha: Output
bulk_modulus-‐temperature.dat
Cp-‐temperature.dat
Cp-‐temperature_polyfit.dat
Cv-‐volume.dat
dsdv-‐temperature.dat
entropy-‐volume.dat
gibbs-‐temperature.dat
gruneisen-‐temperature.dat
helmholtz-‐volume.dat
thermal_expansion.dat
volume_expansion.dat
volume-‐temperature.dat
<-‐ B is temperature dependent(!)
<-‐ CV at each volume, at each temperature
<-‐ SV at each volume, at each temperature
<-‐ Average Gruneisen parameter (?)
<-‐ A at each volume, at each temperature
Bath CompChem, April 2015 | Slide 32
phonopy-qha: Examples
Bath CompChem, April 2015 | Slide 33
*J. M. Skelton et al., in preparaEon
phonopy-qha: Examples
Bath CompChem, April 2015 | Slide 34
*J. M. Skelton et al., in preparaEon
phonopy-qha: Examples
Bath CompChem, April 2015 | Slide 35
*J. M. Skelton et al., in preparaEon
phonopy-qha: Examples
Bath CompChem, April 2015 | Slide 36
~4 K
~105 K
~150 K
300-‐310 K
450-‐475 K
550-‐600 K
*J. M. Skelton et al., Phys. Rev. B 89, 205203 (2014)
phonopy-qha: Examples
SnS: 10 K -‐ 350 K
PbTe: 0 K -‐ 600 K
Bath CompChem, April 2015 | Slide 37
*PbTe: J. M. Skelton et al., Phys. Rev. B 89, 205203 (2014)
phono3py: Workflow
Input Structure
Create Displacements
Calculate Forces
Extract Forces
Post-‐Process
phono3py -d --dim=“2 2 2”
phono3py --cf3 vasprun-{001..XXX}.xml
phono3py --tmax=1000 --tstep=10 --fc2 --fc3 --dim=“2 2 2” -v --mesh=“24 24 24” --br --sigma=“0.1”
phono3py --dim=“2 2 2”
Bath CompChem, April 2015 | Slide 38
phono3py: Setup
phono3py -d --dim=“...” [--cutoff_pair=4] [--dim_fc2=“4 4 4”]
phono3py --cf3 vasprun-{001..XXX}.xml
phono3py --dim=“...” [--dim_fc2...]
Extract forces from VASP output
The --cutoff_pair tag uses the same numbering for the displaced POSCAR files as the full calculaEon; this means the cutoff can be increased, and the extra displacements added, systemaEcally, to converge w.r.t. the interacEon range
Bath CompChem, April 2015 | Slide 39
phono3py: Post Processing
phono3py --tmax=1000 --tstep=10 --fc2 --fc3 --dim=“...” -v --mesh=“24 24 24” --br --sigma=“0.1” [--nac] [--dim2=“...”/--dim_fc2=“...”]
• The post-‐processing (mainly the phonon-‐lifeEme calculaEons) takes a very long Eme for large supercells/large or low-‐symmetry structures
• It is possible to run the calculaEon on (ranges of) q-‐points separately, and then combine them a_erwards
• Various post-‐processing tags can be applied, e.g. to incorporate isotope effects
Read in pre-‐calculated force constants
# of interacEons per q-‐point becomes larger with mesh size; cannot easily “max out” as for DOS calculaEons, but needs to be converged
Bath CompChem, April 2015 | Slide 40
phono3py: Examples
Bath CompChem, April 2015 | Slide 41
*J. M. Skelton et al., APL Materials 3, 041102 (2015)
phono3py: Examples
Bath CompChem, April 2015 | Slide 42
Simulated IR/Raman spectra with…
• 10 K linewidths • 300 K linewidths
… and an instrument broadening of 3.5 cm-‐1, compared to expt.
*J. M. Skelton et al., APL Materials 3, 041102 (2015)
Some Current Developments
Bath CompChem, April 2015 | Slide 43
*E. L. da Silva et al., Phys. Rev. B 91, 144107 (2015)
A Few Closing Remarks
Bath CompChem, April 2015 | Slide 44