pynitride.core.cython_maths module

Cython-optimized mathematical utilities for the Poisson-Schrodinger problem.

This module contains a couple useful high-performance math functions, including a tridiagonal matrix solver and an approximate Fermi-Dirac integral of order 1/2 and -1/2. These functions are compiled by Cython, and are tested for accuracy and speed by the test_cython_maths module.

pynitride.core.cython_maths.fd12()

Implements the Fermi-Dirac integral of order 1/2 (Van Halen and Pulfrey approximation).

This is essentially as given in Table 6 and Equations 24-26 of (Wong et al Solid-State Electronics 1994), except that for very negative arguments (\(x < -10\)), this function will replace the sum over integrals by simply the first term (\(e^x\)). Since, in a typical simulation, the Fermi-Dirac integral is often computed for arguments with very negative \(x\) (ie Fermi-level in midgap), this often results in a several-times speedup.

Parameters:

x – the argument to the Fermi-Dirac 1/2 integral, as a numpy array.

Returns:

the evaluation, as a numpy array.

pynitride.core.cython_maths.fd12p()

Implements the derivative of the fd12().

Computes \(\mathcal{F}_{1/2}'(x)\), which is equal to \(\mathcal{F}_{-1/2}(x)\). The appropriate sums were obtained by simply differentiating the expressions used to form fd12().

Parameters:
  • integral (the argument to the Fermi-Dirac -1/2) –

  • array. (as a numpy) –

Returns:

the evaluation, as a numpy array.

pynitride.core.cython_maths.idd()

Computes the ionized dopant density given the normalized Fermi position and degeneracy factor

See Tiwari Compound Semiconductor Devices pg 31-32. Prevents underflow by zeroing at large eta.

Parameters:
  • eta

    For donors, this should be eta=(E_F-E_c + E)/kT

    where E is the dopant energy down from the conduction edge

    For acceptors, this should be eta=(E_v-E_F + E)/kT

    where E is the dopant energy down from the valence edge

  • g – degeneracy factor (as given by Tiwari)

Returns:

the evaluation as a numpy array

pynitride.core.cython_maths.iddd()

Computes the derivative of the ionized dopant density (with respect to eta), given the normalized Fermi position and degeneracy factor

See Tiwari Compound Semiconductor Devices pg 31-32. Prevents underflow by zeroing at large eta.

Parameters:
  • eta

    For donors, this should be eta=(E_F-E_c + E)/kT

    where E is the dopant energy down from the conduction edge

    For acceptors, this should be eta=(E_v-E_F + E)/kT

    where E is the dopant energy down from the valence edge

  • g – degeneracy factor (as given by Tiwari)

Returns:

the evaluation as a numpy array

pynitride.core.cython_maths.tdma()

Implements the tridiagonal matrix algorithm.

Solves \(Mx=d\) where \(M\) is a tridiagonal matrix described by three diagonals \(a,b,c\). A good discussion of the algorithm is available at CFD-Online. All arguments are given as 1-D numpy arrays of the same length.

Parameters:
  • a – the lower subdiagonal of \(M\). This should include a single leading zero so it is the same length as b.

  • b – the diagonal of \(M\).

  • c – the upper subdiagonal of \(M\). This should include a single trailing zero so it is the same length as b.

  • d – the desired result of \(Mx\). Should be the same length as \(b\).

  • copy – If true, arrays will be copied (default); otherwise they will be overwritten.

Returns:

\(x\), the solution vector as a numpy array.