calc_n

static ThomasFermi.calc_n(physics, numerics, V, K_mat, g0_dx_K_plus_1_inv, n_guess=None)

Calculates the particle density n(x) using a ThomasFermi model.

This is done by by solving the set of self-consistent equations, eqs. (4) & (5) of arXiv:2509.13298 by using the successive iteration method.

Parameters:
  • physics (PhysicsParameters) – The physical device parameters.

  • numerics (NumericsParameters) – Options for numeric calculations.

  • V (ndarray[float]) – A 1D array containing the total potential V(x) (in mV) from all of the gates at each of the points in physics.x.

  • K_mat (ndarray[float]) – A 2D array with shape (len(x), len(x)), where K_mat[i, j] gives the value of the Coulomb interaction (in meV) between two particles at points x[i] and x[j].

  • g0_dx_K_plus_1_inv (ndarray[float] | None) – Inverse of (g_0 * delta_x * K_mat + identity), or None to calculate it automatically if needed.

  • n_guess (ndarray[float], optional) – Initial guess (in 1/nm) for the particle density n(x). If absent, an array of zeros will be used.

Returns:

  • n (ndarray[float]) – The calculated particle density (in 1/nm). This array has the same length as physics.x.

  • phi (ndarray[float]) – The electron-electron Coulomb potential, equal to dot(K_mat, n) * delta_x. This array has the same length as physics.x.

  • converged (bool) – Whether or not the calculation converged within the tolerance specified by numerics within the allotted number of iterations.

Raises:

ConvergenceWarning – If the process does not converge to the required tolerance within the specified number of iterations, given by numerics.calc_n_rel_tol and numerics.calc_n_max_iterations_guess or numerics.calc_n_max_iterations_no_guess.