qtcad.transport.negf_poisson module
Self-consistent NEGF-Poisson solver.
- class qtcad.transport.negf_poisson.Solver(d, d_negf=None, source_subd=None, drain_subd=None, Vds: float = 0.0, solver_params=None)
Bases:
Solver
Self-consistent NEGF-Poisson solver to resolve the nonequilibrium quantum statistics of two-probe devices assuming ballistic/coherent transport. See The nonequilibrium Green’s function (NEGF) formalism.
- Attributes:
d (Device) – The simulated device on which Poisson’s equation is solved.
d_negf (SubDevice) – The subdevice of
d
on which the calculation of charge density within the NEGF formalism is restricted; None if the charge density is calculated on the entirety ofd
.source_subd (SubDevice) – The subdevice of
d
corresponding to the source buffer region.drain_subd (SubDevice) – The subdevice of
d
corresponding to the drain buffer region.Vds (float) – Drain-source voltage. By convention, the drain-source current is positive when the drain-source voltage is positive.
solver_params (SolverParams) – Solver parameters.
Note
When holes are the confined carriers in the simulated device, the outputs of this solver follows the convention defined in QTCAD convention for holes.
This solver assumes complete dopant ionization even when
d.ionization
is not"complete"
.
- __init__(d, d_negf=None, source_subd=None, drain_subd=None, Vds: float = 0.0, solver_params=None)
- Parameters:
d (Device) – The simulated device on which Poisson’s equation is solved.
d_negf (SubDevice, optional) – The subdevice of
d
on which the calculation of charge density within the NEGF formalism is restricted. If None, the charge density is computed on the entirety ofd
. Default: None.source_subd (SubDevice, optional) – The subdevice of
d
corresponding to the source buffer region. If None, the source buffer region is taken as the region ofd
labelled as"source"
. Default: None.drain_subd (SubDevice, optional) – The subdevice of
d
corresponding to the drain buffer region. If None, the drain buffer region is taken as the region ofd
labelled as"drain"
. Default: None.Vds (float, optional) – Drain-source voltage. By convention, the drain-source current is positive when the drain-source voltage is positive. Default: 0.0.
solver_params (SolverParams, optional) – Solver parameters for the NEGF-Poisson simulation. If None, solver parameters are automatically generated. Default: None.
Note
The mesh of
d
must be constructed through extrusion along the transport (source-drain) axis.If
source_subd
(drain_subd
) is None,d
must have a region labelled as"source"
("drain"
).Each region must consist of at least 3 extrusion layers.
The device
d
must contain exactly two boundaries defined throughnew_quantum_lead_bnd
, corresponding to the source and drain surfaces.If
solver_params.n_jobs
is so large that CPU usage is running close to maximum usage, Numba and Joblib may produce warnings pertaining to sub-optimal parallelization. In such cases, the value ofsolver_params.n_jobs
should be decreased (possibly down to 1).
- get_current(energies: ndarray | None = None, log_scale: bool = False, title: str | None = None, path: str | None = None, show_figure: bool = False) float
Calculate the drain-source current through the Landauer-Büttiker formula (Eq. (11.9)) using a specified energy grid and plot the transmission function (Eq. (11.8)), if desired.
- Parameters:
energies (Numpy.ndarray, optional) – Energy grid. The increments between successive values in the array need to be constant. If None, a grid within the transport window is used; in this case, the number of grid points is set by
solver_params.n_real
. Default: None.log_scale (bool, optional) – Whether the y axis (transmission function) is on a log scale (True) or on a linear scale (False). Default: False.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: False.
- Returns:
float – The drain-source current.
- get_current_adaptive(log_scale: bool = True, title: str | None = None, path: str | None = None, show_figure: bool = False) float
Calculate the drain-source current through the Landauer-Büttiker formula (Eq. (11.9)) using adaptive integration algorithm and plot the spectral current (Eq. (11.10)), if desired.
- Parameters:
log_scale (bool, optional) – Whether the y axis (spectral current) is on a log scale (True) or on a linear scale (False). Default: True.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: False.
- Returns:
float – The drain-source current.
- get_density()
Compute the electron or hole density within the NEGF formalism.
- Returns:
Field – Electron or hole density in
d_negf
. Also assigned to eitherd_negf.nq
(for electrons) ord_negf.pq
(for holes).
- plot_band_edge(begin: Tuple, end: Tuple, length_unit: str = 'nm', title: str | None = None, path: str | None = None, show_figure: bool = True) Tuple[ndarray, ndarray]
Compute and plot the band edge (i.e. the confinement potential), including the effect of quantum confinement along the plane normal to the transport direction, along a specified linecut.
- Parameters:
begin (tuple) – Coordinates x, y, z, of the first point along the linecut.
end (tuple) – Coordinates x, y, z of the last point along the linecut.
length_unit (str, optional) – Units of length to use for the plot;
"nm"
for nanometers,"um"
for micrometers,"mm"
for millimeters. Default: “nm”.title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a vector containing the distance along the linecut, and another Numpy.ndarray, a vector containing the band edge.
Note
The band diagram produced by this method may be inaccurate in systems with non-uniform cross sections normal to the transport direction.
- plot_bandstructure(n_bands=None, n_kpts=100, lead='source', title: str | None = None, path: str | None = None, show_figure: bool = True)
Compute and plot the 1D bandstructure of a specified lead.
For a lead with natural (non-essential) boundary condition, it is recommended to use this method only after having obtained the converged electric potential through the
solve
method.- Parameters:
n_bands (int, optional) – Number of bands to be included, starting from the lowest-energy band. If None, compute the whole bandstructure. Default: None.
n_kpts (int, optional) – Number of grid points for the wavenumber. Default: 100.
lead (str, optional) – The lead whose bandstructure is to be computed;
"source"
or"drain"
. Default:"source"
.title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a matrix containing the calculated eigenvalues (each column corresponding to a band), and another Numpy.ndarray, a vector containing the wavenumber grid.
- plot_dos(energies: ndarray | None = None, log_scale: bool = False, title: str | None = None, path: str | None = None, show_figure: bool = True) Tuple[ndarray, ndarray]
Compute and plot the density of states (DOS) of the central region, including the effect of broadening due to coupling to the leads, as defined through Eq. (11.11), at specified energies.
- Parameters:
energies (Numpy.ndarray, optional) – Energy grid. If None, a grid within the transport window is used; in this case, the number of grid points is set by
solver_params.n_real
. Default: None.log_scale (bool, optional) – Whether the y axis (density of states) is on a log scale (True) or on a linear scale (False). Default: False.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a vector containing the DOS, and another Numpy.ndarray, a vector containing the energy grid.
- plot_ldos(begin: Tuple, end: Tuple, length_unit: str = 'nm', energies: ndarray | None = None, log_scale: bool = True, title: str | None = None, path: str | None = None, show_figure: bool = True) Tuple[ndarray, ndarray, ndarray]
Compute and plot the local density of states (LDOS), defined through Eq. (11.12), along a specified linecut and for specified energies.
- Parameters:
begin (tuple) – Coordinates x, y, z, of the first point along the linecut.
end (tuple) – Coordinates x, y, z of the last point along the linecut.
length_unit (str, optional) – Units of length to use for the plot;
"nm"
for nanometers,"um"
for micrometers,"mm"
for millimeters. Default: “nm”.energies (Numpy.ndarray, optional) – Energy grid. If None, a grid within the transport window is used; in this case, the number of grid points is set by
solver_params.n_real
. Default: None.log_scale (bool, optional) – Whether the color scale (LDOS) is on a log scale (True) or on a linear scale (False). Default: True.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a matrix containing the LDOS (with its rows corresponding to positions along the linecut and columns corresponding to energies), a second Numpy.ndarray, a vector containing the energy grid, and a third Numpy.ndarray, a vector containing the positions along the linecut.
- plot_spectral_current(energies: ndarray | None = None, log_scale: bool = True, title: str | None = None, path: str | None = None, show_figure: bool = True) Tuple[ndarray, ndarray]
Compute and plot the spectral current, defined through Eq. (11.10), at specified energies.
- Parameters:
energies (Numpy.ndarray, optional) – Energy grid. If None, a grid within the transport window is used; in this case, the number of grid points is set by
solver_params.n_real
. Default: None.log_scale (bool, optional) – Whether the y axis (spectral current) is on a log scale (True) or on a linear scale (False). Default: True.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a vector containing the spectral current, and another Numpy.ndarray, a vector containing the energy grid.
- plot_spectral_density(begin: Tuple, end: Tuple, length_unit: str = 'nm', energies: ndarray | None = None, log_scale: bool = False, title: str | None = None, path: str | None = None, show_figure: bool = True) Tuple[ndarray, ndarray, ndarray]
Compute and plot the spectral density, defined through Eq. (11.13), along a specified linecut and for specified energies.
- Parameters:
begin (tuple) – Coordinates x, y, z, of the first point along the linecut.
end (tuple) – Coordinates x, y, z of the last point along the linecut.
length_unit (str, optional) – Units of length to use for the plot;
"nm"
for nanometers,"um"
for micrometers,"mm"
for millimeters. Default: “nm”.energies (Numpy.ndarray, optional) – Energy grid. If None, a grid within the transport window is used; in this case, the number of grid points is set by
solver_params.n_real
. Default: None.log_scale (bool, optional) – Whether the color scale (spectral charge) is on a log scale (True) or on a linear scale (False). Default: False.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a matrix containing the spectral density (with its rows corresponding to positions along the linecut and columns corresponding to energies), a second Numpy.ndarray, a vector containing the energy grid, and a third Numpy.ndarray, a vector containing the positions along the linecut.
- plot_transmission(energies: ndarray | None = None, log_scale: bool = False, title: str | None = None, path: str | None = None, show_figure: bool = True) Tuple[ndarray, ndarray]
Compute and plot the transmission function, defined through Eq. (11.8), at specified energies.
- Parameters:
energies (Numpy.ndarray, optional) – Energy grid. If None, a grid within the transport window is used; in this case, the number of grid points is set by
solver_params.n_real
. Default: None.log_scale (bool, optional) – Whether the y axis (transmission function) is on a log scale (True) or on a linear scale (False). Default: False.
title (str, optional) – Title of the plot. Default: None.
path (str, optional) – The path to which the plot is saved in
.png
format. If None, no file is saved. Default: None.show_figure (bool, optional) – Whether the plot should be shown. Default: True.
- Returns:
tuple – A tuple containing a Numpy.ndarray, a vector containing the transmission function, and another Numpy.ndarray, a vector containing the energy grid.
- solve() Tuple[int, bool]
Self-consistently solve for the electric potential calculated with the linear Poisson equation (see Eq. (11.5)) and for the charge density calculated with the NEGF formalism (see Eq. (11.4)).
This method modifies
d.rho
,d.phi
,d.V
, andd.nq
(for electrons) ord.pq
(for holes).- Returns:
tuple – A tuple containing an int, the index number of the last iteration of the self-consistent solver, and a bool, whether the self-consistent solver converged.
- update_hamiltonian()
Update the Hamiltonian used for NEGF calculations following a manual change in
d.phi
performed throughset_potential
.This method only needs to be called to perform NEGF calculations (e.g. computing the transmission function through
plot_transmission
) prior to calling thesolve
method. Aftersolve
is called, the Hamiltonian is automatically updated.
- class qtcad.transport.negf_poisson.SolverParams(inp_dict: dict | None = None)
Bases:
SolverParams
Parameters to pass to an NEGF-Poisson solver.
- Attributes:
tol (float) – Tolerance to use on the potential in the self-consistent NEGF-Poisson algorithm, i.e. convergence criterion. See Eq. (11.6). Default: 1e-5.
maxiter (int) – Maximum number of iterations for the self-consistent NEGF-Poisson algorithm. Default: 100.
adaptive (bool) – Whether the integration of the Green’s function to compute the charge density (see Eq. (11.4)) is performed using an adaptive integration algorithm. Default: True.
adaptive_tol (float) – The convergence criterion for the relative error on the adaptive integration of the Green’s function. Only used when
adaptive
isTrue
. Default: 1e-6.n_poles (int) – Number of Fermi poles for the contour integral of the Green’s function. Only used when
adaptive
isFalse
. Default: 20.n_circle (int) – Number of quadrature points on the semi-circular part of the contour integral of the Green’s function. Only used when
adaptive
isFalse
. Default: 30.n_plat (int) – Number of quadrature points on the horizontal line above the Fermi poles of the contour integral of the Green’s function. Only used when
adaptive
isFalse
. Default: 20.n_real (int) – Number of quadrature points on the real axis of the contour integral of the Green’s function. Only used when
adaptive
isFalse
. Default: 10.mixing_algo (str) – Mixing algorithm to use; either
"linear"
,"broyden"
,"pulay"
, or"periodic_pulay"
. Default:"periodic_pulay"
.mixing_param (float) – Mixing rate. Default: 0.1.
mixing_maxit (int) – History size for Broyden mixing. Only used when
mixing_algo
is"broyden"
. Default: 20.n_jobs (int) – The maximum number of concurrently running jobs for the contour integration of the Green’s function. If -1, all CPUs are used. If 1 is given, no parallel computing code is used at all. For n_jobs below -1, (n_cpus + 1 + n_jobs) CPUs are used, where n_cpus is the number of logical cores on the system. Default: 1.
prefer (str) – Type of parallelism for the contour integration of the Green’s function;
"threads"
for thread-based parallelism,"processes"
for process-based parallelism.self_energy_dir (str) – Path to the directory in which the self-energy matrices for NEGF calculations are stored. At Solver initialization, this directory must either not exist or be empty. Furthermore, this directory is deleted just before completion of
solve
. If None, the self-energies are not saved to disk and are re-computed as necessary. Default: None.load_from (string) – Path to the file from which the initial guess for the electric potential for the NEGF-Poisson algorithm is loaded. If None, the initial guess is taken as the solution to Poisson’s equation with charge density uniformly equal to zero. Default: None.
save_to (string) – Path to the file to which the electric potential obtained after running
solve
is saved. If None, no file is saved. Default: None.verbose (bool) – Whether messages concerning the status of the NEGF-Poisson algorithm are printed to screen. Default: True.
Note
The parameters
n_poles
,n_circle
,n_plat
, andn_real
define number of quadrature points for the contour integral defined in in Ref. [BMOrdejon+02]; see Calculation of charge density.- __init__(inp_dict: dict | None = None)
Instantiate the SolverParams object.
- Parameters:
inp_dict (dict, optional) – Dictionary specifying certain solver parameters to be used instead of their default values.