Purpose of matdyn.x:

This program calculates the phonon frequencies for a list of generic q vectors starting from the interatomic force constants generated from the dynamical matrices as written by DFPT phonon code through the companion program q2r.x

matdyn.x can generate a supercell of the original cell for mass approximation calculation. If supercell data are not specified in input, the unit cell, lattice vectors, atom types and positions are read from the force constant file.

Input data format: [ ] = it depends

Structure of the input data: ========================================================================

&INPUT ...specs of the namelist variables... /

[ X(1) Y(1) Z(1) ityp(1) ... X(nat) Y(nat) Z(nat) ityp(nat) ]

[ nq q_x(1) q_y(1) q_x(1) [ nptq(1) ] ... q_x(nq) q_y(nq) q_x(nq) [ nptq(1) ] ]
File produced by q2r containing force constants (needed) It is the same as in the input of q2r.x (+ the .xml extension if the dynamical matrices produced by ph.x were in xml format). No default value: must be specified.
'no'
Indicates the type of Acoustic Sum Rule imposed.

Allowed values:
no Acoustic Sum Rules imposed (default)
previous implementation of the asr used (3 translational asr imposed by correction of the diagonal elements of the force constants matrix)
3 translational asr imposed by optimized correction of the force constants (projection)
3 translational asr + 3 rotational asr + 15 Huang conditions for vanishing stress tensor, imposed by optimized correction of the force constants (projection). Remember to set write_lr = .true. to write long-range force constants into file when running q2r and set read_lr = .true. when running matdyn in the case of infrared-active solids. (See npj Comput Mater 8, 236 (2022))
3 translational asr + 1 rotational asr imposed by optimized correction of the dyn. mat. (the rotation axis is the direction of periodicity; it will work only if this axis considered is one of the Cartesian axis).
3 translational asr + 3 rotational asr imposed by optimized correction of the dyn. mat.
Note that in certain cases, not all the rotational asr can be applied (e.g. if there are only 2 atoms in a molecule or if all the atoms are aligned, etc.). In these cases the supplementary asr are cancelled during the orthonormalization procedure (see below).
.true.
if .true. 15 Huang conditions for vanishing stress tensor are included in asr = 'all'.
if .true. calculate phonon Density of States (DOS) using tetrahedra and a uniform q-point grid (see below) NB: may not work properly in noncubic materials

if .false. calculate phonon bands from the list of q-points supplied in input (default)
uniform q-point grid for DOS calculation (includes q=0) (must be specified if dos = .true., ignored otherwise)
energy step, in cm-1, for DOS calculation: from min to max phonon energy (default: 1 cm-1 if ndos, see below, is not specified)
number of energy steps for DOS calculations (default: calculated from deltaE if not specified)
DOS broadening in cm-1

Default: 0 - meaning use tetrahedra
output file for dos (default: 'matdyn.dos') the dos is in states/cm-1 plotted vs omega in cm(-1) and is normalised to 3*nat, i.e. the number of phonons
output file for frequencies (default: 'matdyn.freq')
output file for normalized phonon displacements (default: 'matdyn.modes'). The normalized phonon displacements are the eigenvectors divided by the square root of the mass, then normalized. As such they are not orthogonal.
output file for phonon eigenvectors (default: 'matdyn.eig') The phonon eigenvectors are the eigenvectors of the dynamical matrix. They are orthogonal.
output file for dynamical matrix (default: ' ' i.e. not written)
supercell lattice vectors - must form a superlattice of the original lattice (default: use original cell)
supercell lattice vectors are original cell vectors times l1, l2, l3 respectively (default: 1, ignored if at specified)
number of atom types in the supercell (default: ntyp of the original cell)
masses of atoms in the supercell (a.m.u.), one per atom type (default: use masses read from file flfrc)
read atomic positions of the supercell from input (used to specify different masses) (default: .false.)
write atomic positions of the supercell to file fltau (default: fltau = ' ', do not write)
if .true. interpolates also the el-ph coefficients
if .true. the q points are given in band form: only the first and last point of one or more lines are given. See below. (default: .false.).
if .true. input q points are in crystalline coordinates (default: .false.)
use similarity of the displacements to order frequencies (default: .false.)

NB: You cannot use this option with the symmetry analysis of the modes.
if .true. the ifc come from the finite displacement calculation
add non analitic contributions to the interatomic force constants if finite displacement method is used (as in Wang et al. PRB 85, 224303 (2012)) [to be used in conjunction with fd.x]
if .true., no symmetry and no time reversal are imposed
set to .true. to activate two-dimensional treatment of LO-TO splitting
if .true. do not apply LO-TO splitting for q=0 (default: .false.)
.false.
if .true. read also long-range force constants when they exist in force constant file. This is required when enforcing asr = 'all' for infrared-active solids.
.false.
if .true. write force constants with asr imposed into file. The filename would be flfrc+".matdyn". The long-range part of force constants will be not written.
if (readtau) atomic positions must be specified as follows:

X, Y, Z atomic positions
index of the atomic type

if (q_in_band_form .and. .not.dos) q-points must be specified as follows:
number of q points

The format of the q-points specification is:

(q(i,n),i=1,3), nptq

nptq is the number of points between this point and the next. These points are automatically generated. the q points are given in Cartesian coordinates, 2pi/a units (a = lattice parameters)
coordinates of the Q point
The number of points between this point and the next.

nptq
is the number of points between this point and the next. These points are automatically generated. the q points are given in Cartesian coordinates, 2pi/a units (a = lattice parameters)

if (.not. dos) q-points must be specified as follows:
number of q points

The format of the q-points specification is:

((q(i,n),i=1,3), n=1,nq)
q-points in cartesian coordinates, 2pi/a units (a = lattice parameters)

# Notes

If q = 0, the direction qhat (q=>0) for the non-analytic part is extracted from the sequence of q-points as follows:

qhat = q(n) - q(n-1) or qhat = q(n) - q(n+1)

depending on which one is available and nonzero.

For low-symmetry crystals, specify twice q = 0 in the list if you want to have q = 0 results for two different directions