API Reference
Main Calculator
- tlc.TLC
alias of
tlc
Note
TLC (uppercase) is the recommended import name.
tlc (lowercase) is kept as a backward-compatible alias.
Trap
- class tlc.Trap(name: str, E_t1: float, E_t2: float = 0.0, N_t: float = 0.0, q1: int = 0, q2: int = 0, q3: int | None = None, g: float = 1.0, C_p1: float = 0.0, C_p2: float = 0.0, C_n1: float = 0.0, C_n2: float = 0.0)[source]
Defect trap level for SRH recombination calculations.
Supports single-level (two charge state) and two-level (three charge state) defect transitions. Use the factory classmethods for clarity:
Trap.single_level()— common single-level (two charge state) caseTrap.two_level()— two-level (three charge state) case
Examples
>>> trap = Trap.single_level("V_Cd", E_t=0.5, N_t=1e15, ... q_initial=0, q_final=-1, ... C_p=1e-7, C_n=1e-8)
>>> trap = Trap.two_level("V_O", E_t1=0.3, E_t2=0.8, N_t=1e14, ... q1=2, q2=1, q3=0, ... C_p1=1e-7, C_p2=1e-8, ... C_n1=1e-8, C_n2=1e-9)
Create a Trap with explicit charge states and capture coefficients.
Prefer
Trap.single_level()orTrap.two_level()factory methods.- Parameters:
name (str) – Defect name (e.g.
"V_Cd").E_t1 (float) – Trap energy level 1 from VBM (eV).
E_t2 (float) – Trap energy level 2 from VBM (eV). Only used for two-level traps.
N_t (float) – Total trap concentration (cm^-3).
q1 (int) – Charge state 1.
q2 (int) – Charge state 2.
q3 (int or None) – Charge state 3. None for single-level (two charge state) traps.
g (float) – Degeneracy factor.
C_p1 (float) – Hole capture coefficient for transition 1 (cm^3 s^-1).
C_p2 (float) – Hole capture coefficient for transition 2 (cm^3 s^-1).
C_n1 (float) – Electron capture coefficient for transition 1 (cm^3 s^-1).
C_n2 (float) – Electron capture coefficient for transition 2 (cm^3 s^-1).
- property D
Deprecated alias for
defect_name.
- rate(n0, p0, delta_n, N_n, N_p, e_gap, temp)[source]
Compute SRH recombination rate for this trap.
Uses single-level SRH if
q3 is None, otherwise two-level (three charge state) SRH formalism.- Parameters:
n0 (float) – Equilibrium electron concentration (cm^-3).
p0 (float) – Equilibrium hole concentration (cm^-3).
delta_n (float) – Excess carrier concentration (cm^-3).
N_n (float) – Effective conduction band DOS (cm^-3).
N_p (float) – Effective valence band DOS (cm^-3).
e_gap (float) – Band gap (eV).
temp (float) – Temperature (K).
- Returns:
SRH recombination rate (cm^-3 s^-1).
- Return type:
float or numpy.ndarray
- classmethod single_level(name: str, E_t: float, N_t: float, q_initial: int, q_final: int, g: float = 1.0, C_p: float = 0.0, C_n: float = 0.0) Trap[source]
Create a single-level (two charge state) trap.
- Parameters:
name (str) – Defect name (e.g.
"V_Cd").E_t (float) – Trap energy level from VBM (eV).
N_t (float) – Trap concentration (cm^-3).
q_initial (int) – Initial charge state.
q_final (int) – Final charge state.
g (float) – Degeneracy factor.
C_p (float) – Hole capture coefficient (cm^3 s^-1).
C_n (float) – Electron capture coefficient (cm^3 s^-1).
- Returns:
A single-level Trap instance with
q3=None.- Return type:
Examples
>>> trap = Trap.single_level("V_Cd", E_t=0.5, N_t=1e15, ... q_initial=0, q_final=-1, ... C_p=1e-7, C_n=1e-8)
- classmethod two_level(name: str, E_t1: float, E_t2: float, N_t: float, q1: int, q2: int, q3: int, g: float = 1.0, C_p1: float = 0.0, C_p2: float = 0.0, C_n1: float = 0.0, C_n2: float = 0.0) Trap[source]
Create a two-level (three charge state) trap.
- Parameters:
name (str) – Defect name (e.g.
"V_O").E_t1 (float) – Trap energy level 1 from VBM (eV).
E_t2 (float) – Trap energy level 2 from VBM (eV).
N_t (float) – Trap concentration (cm^-3).
q1 (int) – Charge state 1.
q2 (int) – Charge state 2.
q3 (int) – Charge state 3.
g (float) – Degeneracy factor.
C_p1 (float) – Hole capture coefficient for transition 1 (cm^3 s^-1).
C_p2 (float) – Hole capture coefficient for transition 2 (cm^3 s^-1).
C_n1 (float) – Electron capture coefficient for transition 1 (cm^3 s^-1).
C_n2 (float) – Electron capture coefficient for transition 2 (cm^3 s^-1).
- Returns:
A two-level Trap instance with
q3set.- Return type:
Examples
>>> trap = Trap.two_level("V_O", E_t1=0.3, E_t2=0.8, N_t=1e14, ... q1=2, q2=1, q3=0, ... C_p1=1e-7, C_p2=1e-8, ... C_n1=1e-8, C_n2=1e-9)
DefectData
- class tlc.defect_data.DefectData(n0: float, p0: float, fermi_level: float, e_gap: float, temperature: float, N_n: float, N_p: float, traps: list = <factory>)[source]
Container for equilibrium carrier data and trap properties.
This is the interface between external defect tools (e.g. doped) and the TLC SRH calculator. Users can create this directly with numerical values or use
defect_data_from_doped().- Parameters:
n0 (float) – Equilibrium electron concentration (cm^-3).
p0 (float) – Equilibrium hole concentration (cm^-3).
fermi_level (float) – Fermi level position from VBM (eV).
e_gap (float) – Band gap (eV).
temperature (float) – Operating temperature (K).
N_n (float) – Effective conduction band DOS (cm^-3).
N_p (float) – Effective valence band DOS (cm^-3).
traps (list[Trap]) – List of Trap objects with N_t (concentration) already set.
Examples
>>> from tlc import Trap, DefectData >>> trap = Trap.single_level("V_Cd", E_t=0.5, N_t=1e15, ... q_initial=0, q_final=-1, ... C_p=1e-7, C_n=1e-8) >>> data = DefectData(n0=1e10, p0=1e16, fermi_level=0.3, ... e_gap=1.2, temperature=300, ... N_n=1e18, N_p=1e18, traps=[trap])
- N_n: float
- N_p: float
- e_gap: float
- fermi_level: float
- classmethod from_effective_masses(fermi_level: float, e_gap: float, temperature: float, m_e: float, m_h: float, traps: list | None = None) DefectData[source]
Create DefectData by computing DOS and carrier concentrations from effective masses.
- Parameters:
fermi_level (float) – Fermi level position from VBM (eV).
e_gap (float) – Band gap (eV).
temperature (float) – Operating temperature (K).
m_e (float) – Electron effective mass (in units of free electron mass m0).
m_h (float) – Hole effective mass (in units of free electron mass m0).
traps (list[Trap] or None) – List of Trap objects. Defaults to empty list.
- Returns:
Instance with computed
N_n,N_p,n0,p0.- Return type:
Examples
>>> data = DefectData.from_effective_masses( ... fermi_level=0.3, e_gap=1.2, temperature=300, ... m_e=0.2, m_h=0.8) >>> print(f"n0={data.n0:.2e}, p0={data.p0:.2e}")
- n0: float
- p0: float
- temperature: float
- traps: list
Doped Interface
Interface between doped DefectThermodynamics and TLC DefectData.
- tlc.doped_interface.defect_data_from_doped(defect_thermo, trap_config: dict, temperature: float = 300.0, anneal_temperature: float | None = None) DefectData[source]
Create DefectData from a doped DefectThermodynamics object.
- Parameters:
defect_thermo (doped.thermodynamics.DefectThermodynamics) – Parsed defect thermodynamics from doped.
trap_config (dict) –
Maps defect names to capture coefficients. Format:
{ "V_Sb": { "transitions": [ {"q1": 0, "q2": -1, "E_t1": 0.5, "E_t2": 0.0, "g": 1, "C_p1": 1e-7, "C_n1": 1e-8, "C_p2": 0, "C_n2": 0}, ] }, }
temperature (float) – Operating temperature in K (default 300).
anneal_temperature (float or None) – Annealing temperature in K. If provided, uses the frozen defect approximation via get_fermi_level_and_concentrations. If None, uses equilibrium at
temperature.
- Returns:
Container with equilibrium carriers, effective DOS, and Trap objects.
- Return type:
Examples
>>> from doped.thermodynamics import DefectThermodynamics >>> thermo = DefectThermodynamics.from_json("defect_thermo.json") >>> config = {"V_Cd": {"transitions": [ ... {"q1": 0, "q2": -1, "E_t1": 0.5, "C_p1": 1e-7, "C_n1": 1e-8} ... ]}} >>> data = defect_data_from_doped(thermo, config, temperature=300)