dielectric_function¶
- py4vasp.calculation.dielectric_function¶
- class py4vasp.calculation._dielectric_function.DielectricFunction(data_context, **kwargs)¶
The dielectric function describes the material response to an electric field.
The dielectric function is a fundamental concept that describes how a material responds to an external electric field. It is a frequency-dependent complex-valued 3x3 matrix that relates the polarization of a material to the applied electric field. The dielectric function is essential in understanding optical properties, such as refractive index and absorption.
There are many different ways to compute dielectric functions with VASP. This class provides a common interface to all of them. You can pass a selection argument to any of the methods of this class to select which dielectric function you are interested in. Please make sure the INCAR file you use is compatible with the setup.
The 3x3 matrix is symmetric so for the plotting routines, py4vasp uses only the six distinct components (xx, yy, zz, xy, xz, yz). The default is the isotropic dielectric function but you can also select specific components by providing one of the six components as selection.
- 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()¶
Returns a dictionary of possible selections for component, direction, and complex value.
- 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()¶
Read the data into a dictionary.
- Returns:
Contains the energies at which the dielectric function was evaluated and the dielectric tensor (3x3 matrix) at these energies.
- 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)¶
Read the data and generate a figure with the selected directions.
- Parameters:
selection (str) – Specify along which directions and which components of the dielectric function you want to plot. Defaults to isotropic and both the real and the complex part. You can use the selections routine if you are not sure which options are available.
- Returns:
figure containing the dielectric function for the selected directions and components.
- 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.