phonon_dos¶
- py4vasp.calculation.phonon_dos¶
- class py4vasp.calculation._phonon_dos.PhononDos(data_context, **kwargs)¶
The phonon density of states (DOS) describes the number of modes per energy.
The phonon density of states (DOS) is a representation of the distribution of phonons in a material across different frequencies. It provides a histogram of the number of phonon states per frequency interval. Peaks and features in the DOS reveal the density of vibrational modes at specific frequencies. One can related these properties to study e.g. the heat capacity or the thermal conductivity.
Projecting the phonon density of states (DOS) onto specific atoms highlights the contribution of each atomic species to the vibrational spectrum. This analysis helps to understand the role of individual elements’ impact on the material’s thermal and mechanical properties. The projected phonon DOS can guide towards engineering these properties by substitution of specific atoms. Additionally, the atom-specific projection allows for the identification of localized modes or vibrations associated with specific atomic species.
- plot(*args, **kwargs)¶
Wrapper around the
to_graph()
function.This will merge multiple graphs if you specify different sources with the selection arguments. All arguments are passed to the wrapped function.
- print()¶
Print a string representation of this instance.
- read(*args, **kwargs)¶
Convenient wrapper around to_dict. Check that function for examples and optional arguments.
- selections()¶
Return a dictionary specifying which atoms and directions can be used as selection.
- to_csv(*args, filename=None, **kwargs)¶
Converts data to a csv file.
Writes out a csv file for data stored in a dataframe generated with the
to_frame()
method. Useful for creating external plots for further analysis.If no filename is provided a default filename is deduced from the name of the class.
Note that the filename must be a keyword argument, i.e., you explicitly need to write filename=”name_of_file” because the arguments are passed on to the
to_graph()
function. Please check the documentation of that function to learn which arguments are allowed.- Parameters:
filename (str | Path) – Name of the csv file which the data is exported to.
- to_dict(selection=None)¶
Read the phonon DOS into a dictionary.
- Parameters:
selection (str) –
A string specifying the projection of the phonon modes onto atoms and directions. Please specify selections using one of the following:
To specify the atom, you can either use its element name (Si, Al, …) or its index as given in the input file (1, 2, …). For the latter option it is also possible to specify ranges (e.g. 1:4).
To select a particular direction specify the Cartesian direction (x, y, z).
You separate multiple selections by commas or whitespace and can nest them using parenthesis, e.g. Sr(x) or z(1, 2). The order of the selections does not matter, but it is case sensitive to distinguish y (Cartesian direction) from Y (yttrium). You can also add or subtract different selections e.g. Sr - Ti.
If you are unsure what selections exist, please use the selections routine which will return all possibilities.
- Returns:
Contains the energies at which the phonon DOS was computed. The total DOS is returned and any possible projected DOS selected by the selection argument.
- Return type:
dict
- to_frame(*args, **kwargs)¶
Wrapper around the
to_frame()
function.Generates dataframes from the graph object. For information about parameters that can be passed to this method, look at
to_graph()
.- Returns:
Pandas dataframe corresponding to data in the graph
- Return type:
Dataframe
- to_graph(selection=None)¶
Generate a graph of the selected DOS.
- Parameters:
selection (str) –
A string specifying the projection of the phonon modes onto atoms and directions. Please specify selections using one of the following:
To specify the atom, you can either use its element name (Si, Al, …) or its index as given in the input file (1, 2, …). For the latter option it is also possible to specify ranges (e.g. 1:4).
To select a particular direction specify the Cartesian direction (x, y, z).
You separate multiple selections by commas or whitespace and can nest them using parenthesis, e.g. Sr(x) or z(1, 2). The order of the selections does not matter, but it is case sensitive to distinguish y (Cartesian direction) from Y (yttrium). You can also add or subtract different selections e.g. Sr - Ti.
If you are unsure what selections exist, please use the selections routine which will return all possibilities.
- Returns:
The graph contains the total DOS. If a selection is given, in addition the projected DOS is shown.
- Return type:
Graph
- to_image(*args, filename=None, **kwargs)¶
Read the data and generate an image writing to the given filename.
The filetype is automatically deduced from the filename; possible are common raster (png, jpg) and vector (svg, pdf) formats. If no filename is provided a default filename is deduced from the name of the class and the picture has png format.
Note that the filename must be a keyword argument, i.e., you explicitly need to write filename=”name_of_file” because the arguments are passed on to the
to_graph()
function. Please check the documentation of that function to learn which arguments are allowed.
- to_plotly(*args, **kwargs)¶
Convert the graph of this quantity to a plotly figure.
The arguments to this function are automatically passed on to the
to_graph()
function. Please check the documentation of that function to learn which arguments are allowed.