DefectThermodynamics#

class DefectThermodynamics(defects_analysis, bulk_dos, fixed_concentrations=None, external_defects=[], xtol=1e-05, eform_kwargs={}, dconc_kwargs={})[source]#

Bases: object

Class that handles the calculations of defect equilibriua under different conditions.

Parameters:
  • defects_analysis (DefectsAnalysis) – DefectsAnalysis object.

  • bulk_dos (dict or Dos) –

    Density of states to integrate. Can be provided as density of states D(E) or using effective masses.

    Format for effective masses is a dict with the following keys:

    • ”m_eff_h” : holes effective mass in units of m_e (electron mass)

    • ”m_eff_e” : electrons effective mass in units of m_h

    Format for explicit DOS (dictionary) with the following keys:

    • ’energies’ : list or np.array with energy values

    • ’densities’ : list or np.array with total density values

    • ’structure’ : pymatgen Structure of the material, needed for DOS volume and charge normalization

    Alternatively, a pymatgen Dos object (Dos, CompleteDos, or FermiDos).

  • fixed_concentrations (dict) – Dictionary with fixed concentrations. Keys are defect entry names in the standard format, values are the concentrations. (ex {‘Vac_Na’:1e20})

  • external_defects (list) – List of external defect concentrations (not present in defect entries). Must either be a list of dictionaries with {‘charge’: float, ‘conc’: float} or a list of SingleDefConc objects.

  • xtol (float) – Tolerance for bisect (scipy) to solve charge neutrality.

  • eform_kwargs (dict) – Kwargs to pass to entry.formation_energy.

  • dconc_kwargs (dict) – Kwargs to pass to entry.defect_concentration.

Methods

get_pO2_quenched_thermodata

Calculate defect and carrier concentrations as a function of oxygen partial pressure with quenched defects.

get_pO2_thermodata

Calculate defect and carrier concentrations as a function of the oxygen partial pressure.

get_single_point_quenched_thermodata

Compute carrier concentrations, defect concentrations and Fermi level for a single set of chemical potentials.

get_single_point_thermodata

Compute carrier concentrations, defect concentrations and Fermi level for a single set of chemical potentials.

get_variable_species_quenched_thermodata

Calculate defect and carrier concentrations as a function of the concentration of a particular defect species (usually a dopant) with quenched defects.

get_variable_species_thermodata

Calculate defect and carrier concentrations as a function of the concentration of a particular defect species (usually a dopant).

get_pO2_quenched_thermodata(reservoirs, initial_temperature, final_temperature, quenched_species=None, quench_elements=False, name=None)[source]#

Calculate defect and carrier concentrations as a function of oxygen partial pressure with quenched defects. It is possible to select which defect species to quench and which ones are free to equilibrate. Frozen defects in the inputs of the class are still considered.

Parameters:
  • reservoirs (dict, Reservoirs or PressureReservoirs) – Object with partial pressure values as keys and chempots dictionary as values.

  • initial_temperature (float) – Value of initial temperature in K.

  • final_temperature (float) – Value of final temperature in K.

  • quenched_species (list) – List of defect species to quench. If None all defect species are quenched.The default is None.

  • quench_elements (bool) – If True the total concentrations of elements at high temperature go in the charge neutrality at low temperature. If False the quenched concentrations are the ones of single defect species (e.g. elements are not allowed to equilibrate on different sites). The default is False.

  • name (str) – Name to assign to ThermoData.

Returns:

thermodata – ThermoData object that contains the thermodynamic data:

partial_pressures(list)

List of partial pressure values in atm.

defect_concentrations(list)

List of DefectConcentrations objects (cm^-3)

carrier_concentrations(list)

List of tuples with intrinsic carriers concentrations (holes,electrons) in cm^-3.

fermi_levels(list)

list of Fermi level values in eV.

Return type:

ThermoData

get_pO2_thermodata(reservoirs, temperature=None, name=None)[source]#

Calculate defect and carrier concentrations as a function of the oxygen partial pressure.

Parameters:
  • reservoirs (dict, Reservoirs or PressureReservoirs) – Object with partial pressure values as keys and chempots dictionary as values.

  • temperature (float) – Temperature in Kelvin. If None reservoirs.temperature is used.

  • name (str) – Name to assign to ThermoData.

Returns:

thermodata – ThermoData object that contains the thermodynamic data:

partial_pressures(list)

List of partial pressure values in atm.

defect_concentrations(list)

List of DefectConcentrations objects (cm^-3)

carrier_concentrations(list)

List of tuples with intrinsic carriers concentrations (holes,electrons) in cm^-3.

fermi_levels(list)

list of Fermi level values in eV.

Return type:

ThermoData

get_single_point_quenched_thermodata(chemical_potentials, initial_temperature, final_temperature, quenched_species=None, quench_elements=False, fixed_concentrations=None, external_defects=None, name=None)[source]#

Compute carrier concentrations, defect concentrations and Fermi level for a single set of chemical potentials.

Parameters:
  • chemical_potentials (dict or Chempots) – Chempots object containing chemical potentials.

  • initial_temperature (float) – Initial temperature in K.

  • final_temperature (float) – Final temperature in K

  • quenched_species (list) – List of defect species to quench. If None all defect species are quenched.

  • quench_elements (bool) – If True the total concentrations of elements at high temperature go in the charge neutrality at low temperature. If False the quenched concentrations are the ones of single defect species (e.g. elements are not allowed to equilibrate on different sites).

  • fixed_concentrations (dict) – Dictionary with fixed concentrations. Keys are defect entry names in the standard format, values are the concentrations. (ex {‘Vac_Na’:1e20})

  • external_defects (list) – List of external defect concentrations (not present in defect entries). Must either be a list of dictionaries with {‘charge’: float, ‘conc’: float} or a list of SingleDefConc objects.

  • name (str) – Label for ThermoData.

Returns:

thermodata – ThermoData object that contains the thermodynamic data:

defect_concentrations(DefectConcentrations)

DefectConcentrations object (cm^-3).

carrier_concentrations(tuple)

Tuple with intrinsic carriers concentrations in cm^-3 (holes,electrons).

fermi_levels(float)

Fermi level value in eV.

Return type:

ThermoData

get_single_point_thermodata(chemical_potentials, temperature, fixed_concentrations=None, external_defects=None, name=None, eform_kwargs=None, dconc_kwargs=None)[source]#

Compute carrier concentrations, defect concentrations and Fermi level for a single set of chemical potentials.

Parameters:
  • chemical_potentials (dict or Chempots) – Chempots object containing chemical potentials.

  • temperature (int) – Temperature in K.

  • fixed_concentrations (dict) – Dictionary with fixed concentrations. Keys are defect entry names in the standard format, values are the concentrations. (ex {‘Vac_Na’:1e20})

  • external_defects (list) – List of external defect concentrations (not present in defect entries). Must either be a list of dictionaries with {‘charge’: float, ‘conc’: float} or a list of SingleDefConc objects.

  • name (str) – Label for ThermoData.

  • eform_kwargs (dict) – Kwargs to pass to entry.formation_energy.

  • dconc_kwargs (dict) – Kwargs to pass to entry.defect_concentration.

Returns:

thermodata – ThermoData object that contains the thermodynamic data:

defect_concentrations(DefectConcentrations)

DefectConcentrations object (cm^-3).

carrier_concentrations(tuple)

Tuple with intrinsic carriers concentrations in cm^-3 (holes,electrons).

fermi_levels(float)

Fermi level value in eV.

Return type:

ThermoData

get_variable_species_quenched_thermodata(variable_defect_specie, concentration_range, chemical_potentials, initial_temperature, final_temperature, quenched_species=None, quench_elements=False, external_defects=[], npoints=50, name=None)[source]#

Calculate defect and carrier concentrations as a function of the concentration of a particular defect species (usually a dopant) with quenched defects. It is possible to select which defect species to quench and which ones are free to equilibrate. Frozen defects in the inputs of the class are still considered.

Parameters:
  • variable_defect_specie (str or dict) –

    Variable species. Possible formats are:

    • str: name or element, if the variable defect species is in defect entries.

    • dict : {‘name’:str,’charge’:int or float} if the variable species is not in defect entries.

  • concentration_range (tuple or list) – Range of the concentration of the variable species in cm^-3.

  • chemical_potentials (dict or Chempots) – Chempots object containing chemical potentials.

  • initial_temperature (float) – Value of initial temperature in K.

  • final_temperature (float) – Value of final temperature in K.

  • quenched_species (list) – List of defect species to quench. If None all defect species are quenched.

  • quench_elements (bool) – If True the total concentrations of elements at high temperature go in the charge neutrality at low temperature. If False the quenched concentrations are the ones of single defect species (e.g. elements are not allowed to equilibrate on different sites).

  • external_defects (list) – List of external defect concentrations (not present in defect entries). Must either be a list of dictionaries with {‘charge’: float, ‘conc’: float} or a list of SingleDefConc objects.

  • npoints (int) – Number of points to divide concentration range.

  • name (str) – Name to assign to ThermoData.

Returns:

thermodata – ThermoData object that contains the thermodynamic data:

variable_defect_specie(str)

Name of variable defect species.

variable_concentrations(list)

List of concentrations of variable species.

defect_concentrations(list)

List of DefectConcentrations objects in the same format as the output of DefectsAnalysis.

carrier_concentrations(list)

List of tuples with intrinsic carriers concentrations (holes,electrons) in cm^-3.

fermi_levels(list)

List of Fermi level values in eV.

Return type:

ThermoData

get_variable_species_thermodata(variable_defect_specie, concentration_range, chemical_potentials, temperature, external_defects=[], npoints=50, name=None)[source]#

Calculate defect and carrier concentrations as a function of the concentration of a particular defect species (usually a dopant).

Parameters:
  • variable_defect_specie (str or dict) –

    Variable species. Possible formats are:

    • str: name or element, if the variable defect species is in defect entries.

    • dict : {‘name’:str,’charge’:int or float} if the variable species is not in defect entries.

  • concentration_range (tuple or list) – Range of the concentration of the variable species in cm^-3.

  • chemical_potentials (dict or Chempots) – Chempots object containing chemical potentials.

  • temperature (float) – Temperature.

  • npoints (int) – Number of points to divide concentration range.

  • external_defects (list) – List of external defect concentrations (not present in defect entries). Must either be a list of dictionaries with {‘charge’: float, ‘conc’: float} or a list of SingleDefConc objects.

  • name (str) – Label for ThermoData.

Returns:

thermodata – ThermoData object that contains the thermodynamic data:

variable_defect_specie(str)

Name of variable defect species.

variable_concentrations(list)

List of concentrations of variable species.

defect_concentrations(list)

List of DefectConcentrations objects in the same format as the output of DefectsAnalysis.

carrier_concentrations(list)

List of tuples with intrinsic carriers concentrations (holes,electrons) in cm^-3.

fermi_levels(list)

List of Fermi level values in eV.

Return type:

ThermoData