# pymatgen.io.phonopy module¶

eigvec_to_eigdispl(v, q, frac_coords, mass)[source]

Converts a single eigenvector to an eigendisplacement in the primitive cell according to the formula: exp(2*pi*i*(frac_coords dot q) / sqrt(mass) * v Compared to the modulation option in phonopy, here all the additional multiplicative and phase factors are set to 1. :param v: the vector that should be converted. A 3D complex numpy array. :param q: the q point in fractional coordinates :param frac_coords: the fractional coordinates of the atom :param mass: the mass of the atom

get_complete_ph_dos(partial_dos_path, phonopy_yaml_path)[source]

Creates a pymatgen CompletePhononDos from a partial_dos.dat and phonopy.yaml files. The second is produced when generating a Dos and is needed to extract the structure.

Parameters: partial_dos_path – path to the partial_dos.dat file. phonopy_yaml_path – path to the phonopy.yaml file.
get_ph_bs_symm_line(bands_path, has_nac=False, labels_dict=None)[source]

Creates a pymatgen PhononBandStructure from a band.yaml file. The labels will be extracted from the dictionary, if present. If the ‘eigenvector’ key is found the eigendisplacements will be calculated according to the formula: exp(2*pi*i*(frac_coords dot q) / sqrt(mass) * v

and added to the object.
Parameters: bands_path – path to the band.yaml file has_nac – True if the data have been obtained with the option –nac option. Default False. labels_dict – dict that links a qpoint in frac coords to a label.
get_ph_bs_symm_line_from_dict(bands_dict, has_nac=False, labels_dict=None)[source]

Creates a pymatgen PhononBandStructure object from the dictionary extracted by the band.yaml file produced by phonopy. The labels will be extracted from the dictionary, if present. If the ‘eigenvector’ key is found the eigendisplacements will be calculated according to the formula: exp(2*pi*i*(frac_coords dot q) / sqrt(mass) * v and added to the object.

Parameters: bands_dict – the dictionary extracted from the band.yaml file has_nac – True if the data have been obtained with the option –nac option. Default False. labels_dict – dict that links a qpoint in frac coords to a label. Its value will replace the data contained in the band.yaml.
get_ph_dos(total_dos_path)[source]

Creates a pymatgen PhononDos from a total_dos.dat file.

Parameters: total_dos_path – path to the total_dos.dat file.
get_structure_from_dict(d)[source]

Extracts a structure from the dictionary extracted from the output files of phonopy like phonopy.yaml or band.yaml. Adds “phonopy_masses” in the site_properties of the structures. Compatible with older phonopy versions.