projection_phband

Module to plot atom-projected phonon band dispersion

Functions

main()

Main function to generate phonon projections and print ion-color associations.

parse_input(filename, nat, nqpt)

Function to parse eigenvector file in .eig format obtained from matdyn.x using matdyn.in.

print_to_file()

Function to save mode resolved projection in phonon-compound.prog.gp format.

projection(pol_q_mode, ion, indices)

Function to calculate atomic projection for mode nu and wavevector q.

reading_input(filename)

Function to read the 'phonproj.in' file.

write_phonproj_in(comp, nkpoint, filename[, ...])

Function to write the 'phonproj.in' file required for atomic projection.

projection_phband.write_phonproj_in(comp, nkpoint, filename, outfile='phonproj.in')[source]

Function to write the ‘phonproj.in’ file required for atomic projection.

This function generates the ‘phonproj.in’ file based on the provided compound name, the number of k-points, and the QE input scf.in file.

Parameters:

compstr

Compound name.

nkpointint

Number of k-points.

filenamestr

Path to the QE input scf.in file.

outfilestr, optional

Output file name for ‘phonproj.in’. Default is ‘phonproj.in’.

Returns:

None

projection_phband.reading_input(filename)[source]

Function to read the ‘phonproj.in’ file.

This function reads the ‘phonproj.in’ file and extracts relevant information such as the name of the .eig file, the number of atoms in the compound, the size of the q-point mesh, and a dictionary containing ions and their indices defining their position in the QE input file ‘scf.in’.

Parameters:

filenamestr

Path to the ‘phonproj.in’ file.

Returns:

eig_filestr

Name of the .eig file.

natint

Number of atoms in the compound.

nqptint

Size of the q-point mesh (nq, 3).

ionsdict

Dictionary with ions and indices defining their position in the ‘scf.in’ file.

projection_phband.parse_input(filename, nat, nqpt)[source]

Function to parse eigenvector file in .eig format obtained from matdyn.x using matdyn.in.

This function reads the eigenvector file and extracts the q-points, frequencies, and eigenvectors for each mode.

Parameters:

filenamestr

Path to the .eig file.

natint

Number of atoms.

nqptint

Number of q points.

Returns:

qlnumpy.ndarray

Array of q points.

freqnumpy.ndarray

Array of frequencies of 3*nat modes.

pol_q_modenumpy.ndarray

Array of eigenvectors of size (nqpt, 3*nat, nat, 3).

projection_phband.projection(pol_q_mode, ion, indices)[source]

Function to calculate atomic projection for mode nu and wavevector q.

This function computes the atomic projection for a given mode nu and wavevector q.

Parameters:

pol_q_modenumpy.ndarray

Array obtained from parse_input function containing eigenvectors.

ionstr

Type of atom.

indiceslist

Indices of an ion in the scf.in input file.

Returns:

proj_arraynumpy.ndarray

Array of projections of size (nq, 3*nat).

projection_phband.print_to_file()[source]

Function to save mode resolved projection in phonon-compound.prog.gp format.

This function reads the input file ‘phonproj.in’ to extract necessary information about the phonon modes and ions. It then calculates the mode-resolved projections for each ion and writes them to a file in the format ‘phonon-compound.proj.gp’.

Returns:

ions_listlist

List of ion names for which projections are calculated and saved.

projection_phband.main()[source]

Main function to generate phonon projections and print ion-color associations.

This function serves as the main entry point for generating phonon projections and printing ion-color associations based on the projections.

If ‘phonproj.in’ file is not found, it creates one. It then generates phonon projections for each ion and saves them to a file. Finally, it prints the association between ions and colors.