Note

PHONON package: This package calculates the vibrational frequencies of atomic surfaces, interfaces, or molecules using finite displacement methodology. All the input files are automatically generated from the QE input files.

esta.phonon package#

Submodules#

esta.phonon.atm_displacements module#

esta.phonon.atm_displacements.gen_disp(posfile, qe_part_file)#
generate set of displacement of atoms in +ve and - directions by delta_x = 0.04 Ang

(this parameter may be varied according to need and physical requirements )

input:

poscar file; string

output:
set of files named:

positions_01_0 and like that fist integer is atom index; –> 0, 1, 2 … N-1 (N=no of atoms) second intege is positon index; i.e. x , y, and z –> 0,1,2 last integer is for -ve and +disp –> 0,1 [0/1] at the end means displacement along +ve and -ve directions respectively

esta.phonon.atm_displacements_selective module#

esta.phonon.atm_displacements_selective.gen_disp(posfile, qe_part_file, disp_value=None)#
generate set of displacement of atoms in +ve and - directions by delta_x = 0.04 Ang

(this parameter may be varied according to need and physical requirements )

input:

poscar file; string qe_part_file: part of qe part witout atomic postions part (ATOMIC_POSITIONS (angstrom) tag present) disp_value: scalar for atm displacement in Ang.

output:
set of files named:

positions_01_0 and like that fist integer is atom index; –> 0, 1, 2 … N-1 (N=no of atoms) second intege is positon index; i.e. x , y, and z –> 0,1,2 last integer is for -ve and +disp –> 0,1 [0/1] at the end means displacement along +ve and -ve directions respectively

NOTE: both atomic position outputs: qe and poscar are implemented

esta.phonon.atm_displacements_selective_general_disp module#

esta.phonon.atm_displacements_selective_general_disp.gen_disp(posfile, qe_part_file, val_displacement)#

generate set of displacement of atoms in +ve and - directions by val_displacement (e.g. earlier it was delta_x = 0.04 Ang; this parameter may be varied according to need and physical requirements )

input:

poscar file; string

output:
set of files named:

positions_01_0 and like that fist integer is atom index; –> 0, 1, 2 … N-1 (N=no of atoms) second intege is positon index; i.e. x , y, and z –> 0,1,2 last integer is for -ve and +disp –> 0,1 [0/1] at the end means displacement along +ve and -ve directions respectively

NOTE: both atomic position outputs: qe and poscar are implemented NOTE: Generally val_displacement should be 0.04 ang for bulk materials

for surface or surface species involved during chemical reactions, it to be 0.02 angstrom.

: Sept, 2019

email: sonukumar.physics@gmail.com

esta.phonon.fc_and_freq_selected_atoms module#

esta.phonon.fc_and_freq_selected_atoms.get_asr(fcMatrix, atommove)#

apply accoustic sum rule on the force constant matrix

see Xavier gonze PRB paper:

XAVIER GONZE AND CHANGYOL LEE PHYSICAL REVIEW B VOLUME 55, NUMBER 16 15 APRIL 1997-I

specifically see equations: 44 and 45.. good luck ..read whole paper..sk!!

WARNING: asr is applied only on the part of the force constant matrix

defined by the list of moving atoms .. is it ok? .. sk!

esta.phonon.fc_and_freq_selected_atoms.get_dynamical_matrix(atommove, sqrt_mass_array, forceconstant)#

getting dynamical matrix from force constant matrix at q=0 point

NOTE: for q=0

  1. dynmat = fc matric/ sqrt(mass1)/ sqrt(mass2)

  2. dynmat in q space = dynmat in R space; see equation 7 in

    paper of Ab initio calculation of phonon dispersions in semiconductors prb. Paolo Giannozzi et al. 1991

esta.phonon.fc_and_freq_selected_atoms.get_eigen(dynamatical_matrix)#

dynamical matrix is hermitian matrix .. try taking it Hermitian matrix instead of general matrix

array: array of rank 2 of shape (3*natoms, 3*natoms)

array: 1d array of size 3natoms; it is eigen value array: 2d array of shape (natoms, 3natoms); it is eigen

vector for each eigval

esta.phonon.fc_and_freq_selected_atoms.get_eigen_(dynamatical_matrix)#

dynamical matrix is hermitian matrix .. try taking it Hermitian matrix instead of general matrix

array: array of rank 2 of shape (3*natoms, 3*natoms)

array: 1d array of size 3natoms; it is eigen value array: 2d array of shape (natoms, 3natoms); it is eigen

vector for each eigval

esta.phonon.fc_and_freq_selected_atoms.get_forceconstant_matrix(atommove, forces, deltax, sign_deltax='plus')#
esta.phonon.fc_and_freq_selected_atoms.get_forces_central(force_c0, force_c1)#

Note: difference of force4 +ve disp and force4 -ve disp, and then divide to get the average

sum of forces cannot be taken because that way you are cancelling the forces bcz one force is almost equal but negative of other

esta.phonon.fc_and_freq_selected_atoms.get_forces_dict(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.fc_and_freq_selected_atoms.get_forces_dict_parta(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.fc_and_freq_selected_atoms.get_forces_minus(atommove, forces_dict, atom_direction_shift)#

extract forces from forces_dict for minus (id=0) displacement

esta.phonon.fc_and_freq_selected_atoms.get_forces_plus(atommove, forces_dict, atom_direction_shift)#

extract forces from forces_dict for plus (id=1) displacement

esta.phonon.fc_and_freq_selected_atoms.get_idatm_iddir_iddispl(atommove)#
get a list of ‘idatm-iddir-iddispl’

idatm: atom id iddir : atom move direction index iddispl: + or - shift of atoms

atom_direction_shift ==> id atom, id direction, id shift

esta.phonon.fc_and_freq_selected_atoms.get_sqrt_mass_array(label)#

for given atomic symbols, return correspoinding masses in amu

esta.phonon.fc_and_freq_selected_atoms.get_symmetrized_force_constant_matrix(fcMatrx, atommove)#

symmetrize force constant matrix fc(iat, ia, jat, ja)

return

(fc(iat, ia, jat, ja) + fc(jat, ja, iat, ia))/2

esta.phonon.fc_and_freq_selected_atoms.reshape_dyn(dynmatrix, atommove)#

reshape dynamical matrix

esta.phonon.fc_and_freq_selected_atoms.write_forces(force_row, ldisp)#

may be you need to add … atoms parameter in the call ..

write forces rows to a file NOTE: only for - and + displacement

todo : for writing central diff force constant .. no need of ldisp tag

esta.phonon.force_constant_and_frequencies_selective_subspace_ module#

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_asr(fcMatrix, atommove)#

apply accoustic sum rule on the force constant matrix

see Xavier gonze PRB paper:

XAVIER GONZE AND CHANGYOL LEE PHYSICAL REVIEW B VOLUME 55, NUMBER 16 15 APRIL 1997-I

specifically see equations: 44 and 45.. good luck ..read whole paper..sk!!

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_dynamical_matrix(atommove, sqrt_mass_array, forceconstant)#

getting dynamical matrix from force constant matrix at q=0 point

NOTE: for q=0

  1. dynmat = fc matric/ sqrt(mass1)/ sqrt(mass2)

  2. dynmat in q space = dynmat in R space; see equation 7 in

    paper of Ab initio calculation of phonon dispersions in semiconductors prb. Paolo Giannozzi et al. 1991

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_eigen(dynamatical_matrix)#

dynamical matrix is hermitian matrix .. try taking it Hermitian matrix instead of general matrix

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_forceconstant_matrix(atommove, forces, deltax, sign_deltax='plus')#
esta.phonon.force_constant_and_frequencies_selective_subspace_.get_forces_central(force_c0, force_c1)#
esta.phonon.force_constant_and_frequencies_selective_subspace_.get_forces_dict(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_forces_dict_parta(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_forces_minus(atommove, forces_dict, atom_direction_shift)#

extract forces from forces_dict for minus (id=0) displacement

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_forces_plus(atommove, forces_dict, atom_direction_shift)#

extract forces from forces_dict for plus (id=1) displacement

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_idatm_iddir_iddispl(atommove)#
get a list of ‘idatm-iddir-iddispl’

idatm: atom id iddir : atom move direction index iddispl: + or - shift of atoms

atom_direction_shift ==> id atom, id direction, id shift

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_sqrt_mass_array(label)#

for given atomic symbols, return correspoinding masses in amu

esta.phonon.force_constant_and_frequencies_selective_subspace_.get_symmetrized_force_constant_matrix(fcMatrx, atommove)#

symmetrize force constant matrix fc(iat, ia, jat, ja)

return

(fc(iat, ia, jat, ja) + fc(jat, ja, iat, ia))/2

esta.phonon.force_constant_and_frequencies_selective_subspace_.reshape_dyn(dynmatrix, atommove)#
esta.phonon.force_constant_and_frequencies_selective_subspace_.write_forces(force_row, ldisp)#

may be you need to add … atoms parameter in the call ..

write forces rows to a file NOTE: only for - and + displacement

todo : for writing central diff force constant .. no need of ldisp tag

esta.phonon.force_constant_and_frequencies_selective_subspace_general module#

esta.phonon.force_constant_and_frequencies_selective_subspace_general_adv module#

esta.phonon.forces module#

esta.phonon.forces.get_dynamical_matrix(natoms, sqrt_mass_array, forceconstant)#

getting dynamical matrix from force constant matrix at q=0 point

NOTE: for q=0

  1. dynmat = fc matric/ sqrt(mass1)/ sqrt(mass2)

  2. dynmat in q space = dynmat in R space; see equation 7 in

    paper of Ab initio calculation of phonon dispersions in semiconductors prb. Paolo Giannozzi et al. 1991

esta.phonon.forces.get_eigen(dynamatical_matrix)#

dynamical matrix is hermitian matrix .. try taking it Hermitian matrix instead of general matrix

esta.phonon.forces.get_forceconstant_matrix(natoms, forces, deltax=0.04, sign_deltax='plus')#
esta.phonon.forces.get_forces_central(force_c0, force_c1)#
esta.phonon.forces.get_forces_dict(natoms)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.forces.get_forces_minus(natoms, forces_dict, atom_direction_shift)#

extract forces from forces_dict for minus (id :0) displacement

esta.phonon.forces.get_forces_plus(natoms, forces_dict, atom_direction_shift)#

extract forces from forces_dict for plus (id :1) displacement

esta.phonon.forces.get_idatm_iddir_iddispl(natoms)#
get a list of ‘idatm-iddir-iddispl’

idatm: atom id iddir : atom move direction index iddispl: + or - shift of atoms

atom_direction_shift ==> id atom, id direction, id shift

esta.phonon.forces.get_sqrt_mass_array(label)#

for given atomic symbols, return correspoinding masses in amu

esta.phonon.forces.get_symmetrized_force_constant_matrix(fcMatrx, natoms)#

symmetrize force constant matrix fc(iat, ia, jat, ja)

return

(fc(iat, ia, jat, ja) + fc(jat, ja, iat, ia))/2

esta.phonon.forces.reshape_dyn(dynmatrix, natoms)#
esta.phonon.forces.write_forces(force_row, ldisp)#

write forces rows to a file NOTE: only for - and + displacement

todo : sfor writing central diff force constant .. no need of ldisp tag

esta.phonon.forces_selective module#

esta.phonon.forces_selective.get_dynamical_matrix(natoms, sqrt_mass_array, forceconstant)#

getting dynamical matrix from force constant matrix at q=0 point

NOTE: for q=0

  1. dynmat = fc matric/ sqrt(mass1)/ sqrt(mass2)

  2. dynmat in q space = dynmat in R space; see equation 7 in

    paper of Ab initio calculation of phonon dispersions in semiconductors prb. Paolo Giannozzi et al. 1991

esta.phonon.forces_selective.get_eigen(dynamatical_matrix)#

dynamical matrix is hermitian matrix .. try taking it Hermitian matrix instead of general matrix

esta.phonon.forces_selective.get_forceconstant_matrix(natoms, forces, deltax=0.04, sign_deltax='plus')#
esta.phonon.forces_selective.get_forces_central(force_c0, force_c1)#
esta.phonon.forces_selective.get_forces_dict(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.forces_selective.get_forces_minus(natoms, forces_dict, atom_direction_shift)#

extract forces from forces_dict for minus (id :0) displacement

esta.phonon.forces_selective.get_forces_plus(natoms, forces_dict, atom_direction_shift)#

extract forces from forces_dict for plus (id :1) displacement

esta.phonon.forces_selective.get_idatm_iddir_iddispl(atommove)#
get a list of ‘idatm-iddir-iddispl’

idatm: atom id iddir : atom move direction index iddispl: + or - shift of atoms

atom_direction_shift ==> id atom, id direction, id shift

esta.phonon.forces_selective.get_sqrt_mass_array(label)#

for given atomic symbols, return correspoinding masses in amu

esta.phonon.forces_selective.get_symmetrized_force_constant_matrix(fcMatrx, natoms)#

symmetrize force constant matrix fc(iat, ia, jat, ja)

return

(fc(iat, ia, jat, ja) + fc(jat, ja, iat, ia))/2

esta.phonon.forces_selective.reshape_dyn(dynmatrix, natoms)#
esta.phonon.forces_selective.write_forces(force_row, ldisp)#

write forces rows to a file NOTE: only for - and + displacement

todo : sfor writing central diff force constant .. no need of ldisp tag

esta.phonon.sum_freq_and_zpe module#

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace module#

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_asr(fcMatrix, atommove)#

apply accoustic sum rule on the force constant matrix

see Xavier gonze PRB paper:

XAVIER GONZE AND CHANGYOL LEE PHYSICAL REVIEW B VOLUME 55, NUMBER 16 15 APRIL 1997-I

specifically see equations: 44 and 45.. good luck ..read whole paper..sk!!

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_dynamical_matrix(atommove, sqrt_mass_array, forceconstant)#

getting dynamical matrix from force constant matrix at q=0 point

NOTE: for q=0

  1. dynmat = fc matric/ sqrt(mass1)/ sqrt(mass2)

  2. dynmat in q space = dynmat in R space; see equation 7 in

    paper of Ab initio calculation of phonon dispersions in semiconductors prb. Paolo Giannozzi et al. 1991

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_eigen(dynamatical_matrix)#

dynamical matrix is hermitian matrix .. try taking it Hermitian matrix instead of general matrix

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_forceconstant_matrix(atommove, forces, deltax, sign_deltax='plus')#
esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_forces_central(force_c0, force_c1)#
esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_forces_dict(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_forces_dict_parta(atommove)#

get forces fron qe output files with + and - displacements and store them in dictionary with indices indication atoms moving index, atom shift index, and displacemet(+ or -)

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_forces_minus(atommove, forces_dict, atom_direction_shift)#

extract forces from forces_dict for minus (id=0) displacement

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_forces_plus(atommove, forces_dict, atom_direction_shift)#

extract forces from forces_dict for plus (id=1) displacement

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_idatm_iddir_iddispl(atommove)#
get a list of ‘idatm-iddir-iddispl’

idatm: atom id iddir : atom move direction index iddispl: + or - shift of atoms

atom_direction_shift ==> id atom, id direction, id shift

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_sqrt_mass_array(label)#

for given atomic symbols, return correspoinding masses in amu

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.get_symmetrized_force_constant_matrix(fcMatrx, atommove)#

symmetrize force constant matrix fc(iat, ia, jat, ja)

return

(fc(iat, ia, jat, ja) + fc(jat, ja, iat, ia))/2

esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.reshape_dyn(dynmatrix, atommove)#
esta.phonon.x_error_force_constant_and_frequencies_selective_subspace.write_forces(force_row, ldisp)#

may be you need to add … atoms parameter in the call ..

write forces rows to a file NOTE: only for - and + displacement

todo : for writing central diff force constant .. no need of ldisp tag

esta.phonon.yaml_read_band module#

read band.yaml file output from the phonopy code and write the specific phonon q point freqency in cm^{-1}.

esta.phonon.yaml_read_band.read_yaml_band(filename=None, qpt_index=None, outfile=None)#
Parameters
  • filename (str) – name of the filename containing band data in yaml format, default is band.yaml

  • qpt_index (integer) – qpt index for which frequency data to be read, default is first qpoint.

  • outfie (str) – outfile is name of the output file, default is band_cmii.dat

Returns

freq – vibration frequencies in cm-1

Return type

array of reals

Module contents#