electron_phonon.transport¶
(
- data_context,
- **kwargs
)
chemical_potential_mu_tag
tuple[str, ndarray]
Retrieves the INCAR tag that was used to set the chemical potential as well as its values.
Returns
tuple[str, ndarray]- The INCAR tag name and its corresponding value as set in the calculation. Possible tags are ‘selfen_carrier_den’, ‘selfen_mu’, or ‘selfen_carrier_per_cell’.
count
integer -- return number of occurrences of value
index
integer -- return first index of value.
Raises ValueError if the value is not present.
Supporting start and stop arguments is optional, but recommended.
path
plot
Almost same as the to_graph() function.
All arguments will be passed to to_graph. If the to_graph() would
produce multiple graphs this method will merge them into a single one.
read
select
str) → List[TransportInstance]
Return a list of ElectronPhononSelfEnergyInstance objects matching the selection.
Parameters
- selection:
str - A string specifying which instances we would like to select. You specify a particular string like “nbands_sum=800” to select all instances that were run with that setup. If you provide multiple selections the results will be merged.
Returns
List[TransportInstance]- Instances that match the selection criteria.
Examples
To select all instances with a sum of 800 bands, you can use:
>>> calculation.electron_phonon.transport.select("nbands_sum=800")
To select instances with a specific scattering approximation, such as SERTA:
>>> calculation.electron_phonon.transport.select("selfen_approx=SERTA")
You can also combine multiple selection criteria. For example, to select instances with a sum of 800 bands and a delta value of 0.1:
>>> calculation.electron_phonon.transport.select("nbands_sum=800(selfen_delta=0.1)")
selections
Dict[str, Any]
Return a dictionary describing what options are available to read the transport.
Returns
Dict[str, Any]- Dictionary containing available selection options with their possible values. Keys include selection criteria like “nbands_sum”, “selfen_approx”, “selfen_delta”.
to_csv
(
- *args,
- filename:
str | Path= None, - **kwargs
)
Writes the 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() method. Please check the documentation of that
method to learn which arguments are allowed.
Parameters
- filename:
str | Path= None - Name of the csv file which the data is exported to.
to_dict
Dict[str, Any]
Return a dictionary that lists how many accumulators are available
Returns
Dict[str, Any]- Dictionary containing information about the available accumulators.
to_frame
Dataframe
Convert data to pandas dataframe.
This will first convert use the to_graph() method to convert to a
Graph. All arguments are passed to that method. The resulting graph is then
converted to a dataframe.
Returns
Dataframe- Pandas dataframe corresponding to data in the graph
to_graph
str) → Graph
Plot a particular transport coefficient as a function of the chemical potential tag.
Parameters
- selection:
str - Use this string to specify what you want to plot. You must always specify a transport quantity like “mobility” or “seebeck”. You can optionally also specify a direction like “xx” or “isotropic”. If you do not specify a direction, the isotropic average will be used. You can also specify a particular temperature by adding “T=300” to the selection. If you do not specify a temperature, results for all temperatures will be plotted. Finally, you can also filter the instances that are used for plotting by adding criteria like “nbands_sum=800” or “selfen_delta=0.1”.
Returns
Graph- A graph object containing the requested data. Each series corresponds to one temperature and plots the requested transport quantity as a function of the chemical potential tag. If the instances share the same metadata, the series is connected with a line.
Examples
To plot the mobility as a function of the chemical potential tag for all available temperatures, you can use:
>>> calculation.electron_phonon.transport.to_graph("mobility")
To plot the Seebeck coefficient in the xx direction at a specific temperature of 300K, you can use:
>>> calculation.electron_phonon.transport.to_graph("seebeck(xx(T=300))")
You can also filter the instances used for plotting. For example, to plot the electronic conductivity for instances with a sum of 800 bands and a delta value of 0.1, you can use:
>>> calculation.electron_phonon.transport.to_graph("electronic_conductivity(nbands_sum=800(selfen_delta=0.1))")
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() method. Please check the documentation of that
method to learn which arguments are allowed.
to_plotly
Produces a graph and convertes it to a plotly figure.
The arguments to this function are passed on to the to_graph() method.
Takes the resulting graph and converts it to a plotly figure.
units
Dict[str, str]
Return a dictionary with the physical units for each transport quantity.
Returns
-- Dictionary containing transport quantities as keys and their corresponding physical units as values.
TransportInstance ¶
(
- parent,
- index
)
Represents a single instance of electron-phonon transport calculations.
This class provides access to various transport properties computed from electron-phonon interactions, such as conductivity, mobility, Seebeck and Peltier coefficients, and thermal conductivity. It allows for data extraction, selection, and visualization of transport properties for a given calculation index.
electronic_conductivity
ndarray | Dict[str, ndarray]
Returns the electronic conductivity for the selected direction.
Parameters
- selection = ''
- A string specifying the direction for which to retrieve the electronic conductivity. Options include “xx”, “yy”, “zz”, “xy”, “xz”, “yz”, or “isotropic”. If no direction is specified, the isotropic average is returned.
Returns
ndarray | Dict[str, ndarray]- A numpy array of electronic conductivity values in S/m for the specified direction, or a dictionary of arrays if multiple directions are selected.
Examples
To get the isotropic average of the electronic conductivity of the first instance:
>>> calculation.electron_phonon.transport[0].electronic_conductivity()
To get the electronic conductivity in the xx direction of all instances
>>> [
... instance.electronic_conductivity("xx")
... for instance in calculation.electron_phonon.transport
... ]
electronic_thermal_conductivity
ndarray | Dict[str, ndarray]
Returns the electronic thermal conductivity for the selected direction.
Parameters
- selection = ''
- A string specifying the direction for which to retrieve the electronic thermal conductivity. Options include “xx”, “yy”, “zz”, “xy”, “xz”, “yz”, or “isotropic”. If no direction is specified, the isotropic average is returned.
Returns
ndarray | Dict[str, ndarray]- A numpy array of electronic thermal conductivity values in W/(m.K) for the specified direction, or a dictionary of arrays if multiple directions are selected.
Examples
To get the isotropic average of the electronic thermal conductivity of the first instance:
>>> calculation.electron_phonon.transport[0].electronic_thermal_conductivity()
To get the electronic thermal conductivity in the xx direction of all instances
>>> [
... instance.electronic_thermal_conductivity("xx")
... for instance in calculation.electron_phonon.transport
]
figure_of_merit
float | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None = None) → ndarray
Returns the dimensionless figure of merit ZT for this instance.
The figure of merit is calculated as ZT = S^2 * σ * T / κ, where S is the Seebeck coefficient, σ is the electronic conductivity, T is the temperature, and κ is the electronic thermal conductivity.
Parameters
- kappa_lattice:
float | Buffer | _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | complex | bytes | str | _NestedSequence[complex | bytes | str] | None= None - The lattice thermal conductivity in W/(m.K). This can be a single float value or an array-like object with the same length as the number of temperatures. If an array is provided, it allows for temperature-dependent calculations. If None, only the electronic contribution to the figure of merit is considered.
Returns
ndarray- A numpy array of dimensionless figure of merit values at each temperature.
Examples
To get the figure of merit of the first instance:
>>> calculation.electron_phonon.transport[0].figure_of_merit()
mobility
ndarray | Dict[str, ndarray]
Returns the mobility for the selected direction.
Parameters
- selection = ''
- A string specifying the direction for which to retrieve the mobility. Options include “xx”, “yy”, “zz”, “xy”, “xz”, “yz”, or “isotropic”. If no direction is specified, the isotropic average is returned.
Returns
ndarray | Dict[str, ndarray]- A numpy array of mobility values in cm^2/(V.s) for the specified direction, or a dictionary of arrays if multiple directions are selected.
Examples
To get the isotropic average of the mobility of the first instance:
>>> calculation.electron_phonon.transport[0].mobility()
To get the mobility in the xx direction of all instances
>>> [
... instance.mobility("xx")
... for instance in calculation.electron_phonon.transport
... ]
peltier
ndarray | Dict[str, ndarray]
Returns the Peltier coefficient for the selected direction.
Parameters
- selection = ''
- A string specifying the direction for which to retrieve the Peltier coefficient. Options include “xx”, “yy”, “zz”, “xy”, “xz”, “yz”, or “isotropic”. If no direction is specified, the isotropic average is returned.
Returns
ndarray | Dict[str, ndarray]- A numpy array of Peltier coefficient values in V for the specified direction, or a dictionary of arrays if multiple directions are selected.
Examples
To get the isotropic average of the Peltier coefficient of the first instance:
>>> calculation.electron_phonon.transport[0].peltier()
To get the Peltier coefficient in the xx direction of all instances
>>> [
... instance.peltier("xx")
... for instance in calculation.electron_phonon.transport
... ]
plot
Almost same as the to_graph() function.
All arguments will be passed to to_graph. If the to_graph() would
produce multiple graphs this method will merge them into a single one.
read
read_metadata
Dict[str, Any]
Read metadata for this instance.
The metadata contains information about the settings used for this instance, such as the number of bands included in the summation, the delta value used for the self-energy calculation, and the scattering approximation employed.
Returns
Dict[str, Any]- A dictionary containing the metadata for this instance. The keys correspond to settings in the INCAR file, and the values are the respective settings used.
seebeck
ndarray | Dict[str, ndarray]
Returns the Seebeck coefficient for the selected direction.
Parameters
- selection = ''
- A string specifying the direction for which to retrieve the Seebeck coefficient. Options include “xx”, “yy”, “zz”, “xy”, “xz”, “yz”, or “isotropic”. If no direction is specified, the isotropic average is returned.
Returns
ndarray | Dict[str, ndarray]- A numpy array of Seebeck coefficient values in V/K for the specified direction, or a dictionary of arrays if multiple directions are selected.
Examples
To get the isotropic average of the Seebeck coefficient of the first instance:
>>> calculation.electron_phonon.transport[0].seebeck()
To get the Seebeck coefficient in the xx direction of all instances
>>> [
... instance.seebeck("xx")
... for instance in calculation.electron_phonon.transport
... ]
selections
temperatures
ndarray
Returns the temperatures at which transport properties are computed.
Returns
ndarray- A numpy array of temperatures in Kelvin.
to_csv
(
- *args,
- filename:
str | Path= None, - **kwargs
)
Writes the 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() method. Please check the documentation of that
method to learn which arguments are allowed.
Parameters
- filename:
str | Path= None - Name of the csv file which the data is exported to.
to_dict
Dict[str, Any]
Returns a dictionary with selected transport properties for this instance.
Returns
Dict[str, Any]- A dictionary containing:
- “metadata”: Metadata about the instance, including chemical potential, number of bands summed, delta, and scattering approximation.
- “temperatures”: Array of temperatures at which transport properties are computed.
- “transport_function”: The transport function data.
- “electronic_conductivity”: Electronic conductivity values.
- “mobility”: Mobility values.
- “seebeck”: Seebeck coefficient values.
- “peltier”: Peltier coefficient values.
- “electronic_thermal_conductivity”: Electronic thermal conductivity values.
to_frame
Dataframe
Convert data to pandas dataframe.
This will first convert use the to_graph() method to convert to a
Graph. All arguments are passed to that method. The resulting graph is then
converted to a dataframe.
Returns
Dataframe- Pandas dataframe corresponding to data in the 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() method. Please check the documentation of that
method to learn which arguments are allowed.
to_plotly
Produces a graph and convertes it to a plotly figure.
The arguments to this function are passed on to the to_graph() method.
Takes the resulting graph and converts it to a plotly figure.