PAOFLOW.boltzmann.do_doping#

Attributes#

Functions#

FD(ene, mu, temp)

Evaluate the Fermi-Dirac occupation function.

calc_N(data_controller, ene, dos, mu, temp[, dosweight])

Integrate the DOS times the Fermi-Dirac function to get the electron count.

solve_for_mu(data_controller, ene, dos, N0, temp[, ...])

Find the chemical potential that yields a target electron count.

do_doping(data_controller, temps, ene, fname)

Compute the temperature-dependent chemical potential for a doped system.

Module Contents#

PAOFLOW.boltzmann.do_doping.comm[source]#
PAOFLOW.boltzmann.do_doping.rank[source]#
PAOFLOW.boltzmann.do_doping.FD(ene, mu, temp)[source]#

Evaluate the Fermi-Dirac occupation function.

Parameters:
  • ene (np.ndarray) – Energy grid (eV).

  • mu (float) – Chemical potential (eV).

  • temp (float) – Temperature in Kelvin. When 0.0, the step function is used.

Returns:

Fermi-Dirac occupation \(f(\varepsilon) = [e^{(\varepsilon-\mu)/k_BT}+1]^{-1}\) clamped to [0, 1].

Return type:

np.ndarray

PAOFLOW.boltzmann.do_doping.calc_N(data_controller, ene, dos, mu, temp, dosweight=2.0)[source]#

Integrate the DOS times the Fermi-Dirac function to get the electron count.

Parameters:
  • data_controller (DataController) – Object providing data_attributes. Required attribute: core_electrons (int).

  • ene (np.ndarray) – Energy grid (eV).

  • dos (np.ndarray, shape (ne,)) – Density of states on ene.

  • mu (float) – Trial chemical potential (eV).

  • temp (float) – Temperature (K).

  • dosweight (float, optional) – Spin degeneracy weight applied to the integral (default 2.0).

Returns:

Electron count minus core_electrons minus the integrated DOS (negative of the total electron number minus core_electrons).

Return type:

float

PAOFLOW.boltzmann.do_doping.solve_for_mu(data_controller, ene, dos, N0, temp, refine=False, try_center=False, dosweight=2.0)[source]#

Find the chemical potential that yields a target electron count.

Parameters:
  • data_controller (DataController) – Passed directly to calc_N().

  • ene (np.ndarray) – Energy grid (eV).

  • dos (np.ndarray, shape (ne,)) – Density of states on ene.

  • N0 (float) – Target electron count (including doping offset).

  • temp (float) – Temperature (K).

  • refine (bool, optional) – When True, perform a bounded scalar minimisation of \(|N(\mu) - N_0|\) around the best grid point (default False).

  • try_center (bool, optional) – When True and mu falls inside a band gap, try to place \(\mu\) at the gap centre (default False).

  • dosweight (float, optional) – Spin degeneracy weight forwarded to calc_N() (default 2.0).

Returns:

Chemical potential \(\mu\) (eV) that satisfies \(N(\mu) = N_0\) (computed on rank 0 only; all other ranks return None).

Return type:

float

Notes

The function first scans the energy grid for the point that minimises \(|N(\mu) - N_0|\), then optionally refines using scipy.optimize.minimize_scalar with method='bounded'.

PAOFLOW.boltzmann.do_doping.do_doping(data_controller, temps, ene, fname)[source]#

Compute the temperature-dependent chemical potential for a doped system.

Parameters:
  • data_controller (DataController) – Object providing data_arrays and data_attributes. Required arrays: dos (fixed-smearing DOS) or dosdk (adaptive-smearing DOS), selected by attr['smearing']. Required attributes: smearing, doping_conc, nelec, omega.

  • temps (array_like of float) – Temperatures in Kelvin at which \(\mu(T)\) is evaluated.

  • ene (np.ndarray) – Energy grid (eV) over which the DOS is defined.

  • fname (str) – Base name for the output file. The sign and magnitude of doping_conc are appended to produce e.g. fname_n1e18.dat.

Returns:

Writes a two-column file {fname}{sign}{|doping|}.dat via DataController.write_file_row_col() with columns temperature and \(\mu(T)\).

Return type:

None

Notes

The target electron number is \(N = N_{\rm elec} - n_d \Omega\) where \(\Omega\) is the unit-cell volume and \(n_d\) is the carrier concentration in \(\text{cm}^{-3}\). For each temperature solve_for_mu() is called on rank 0 and the result broadcast.