qttools.boundary_conditions.obc#
source package qttools.boundary_conditions.obc
Classes
-
SanchoRubio — Calculates the surface Green's function iteratively.1.
-
Spectral — Spectral open-boundary condition solver.
-
OBCSystem — An obc system solver with memoization and system reduction.
-
OBCSolver — Abstract base class for the open-boundary condition solver.
source class SanchoRubio(max_iterations: int = 100, convergence_tol: float = 1e-06)
Bases : OBCSolver
Calculates the surface Green's function iteratively.1.
Initializes the Sancho-Rubio OBC.
Parameters
-
max_iterations : int, optional — The maximum number of iterations to perform.
-
convergence_tol : float, optional — The convergence tolerance for the iterative scheme. The criterion for convergence is that the average Frobenius norm of the update matrices
alphaandbetais less than this value.
source class Spectral(nevp: NEVP, block_sections: int = 1, min_decay: float = 0.001, max_decay: float = 6.9, num_ref_iterations: int = 2, min_propagation: float = 0.01, residual_tolerance: float = 0.001, residual_normalization: bool = True, warning_threshold: float = 0.1, eta_decay: float = 1e-14)
Bases : OBCSolver
Spectral open-boundary condition solver.
This technique of obtaining the surface Green's function is based on the solution of a non-linear eigenvalue problem (NEVP), defined via the system-matrix blocks in the semi-infinite contacts.
Those eigenvalues corresponding to reflected modes are filtered out, so that only the ones that correspond to modes that propagate into the leads or those that decay away from the system are retained.
The surface Green's function is then calculated from these filtered eigenvalues and eigenvectors.
Initializes the spectral OBC solver.
Parameters
-
nevp : NEVP — The non-linear eigenvalue problem solver to use.
-
block_sections : int, optional — The number of sections to split the periodic matrix layer into.
-
min_decay : float, optional — The decay threshold after which modes are considered to be evanescent.
-
max_decay : float, optional — The maximum decay to consider for evanescent modes. The default is 6.9 which corresponds to 1000 in the eigenvalues.
-
num_ref_iterations : int, optional — The number of refinement iterations to perform on the surface Green's function.
-
min_propagation : float, optional — The minimum ratio between the real and imaginary part of the group velocity of a mode. This ratio is used to determine how clearly a mode propagates.
-
residual_tolerance : float, optional — The tolerance for the residual of the NEVP.
-
residual_normalization : bool — If the residual should be normalized by the eigenvalue.
-
warning_threshold : float, optional — The threshold for the relative recursion error above which a warning is issued. This is only used if
return_injectedis True. Otherwise, the intend is that the memoizer wrapper handles the warning. -
eta_decay : float, optional — Small value to separate very slow decaying modes from non-decaying ones.
source class OBCSystem(boundary_solver: OBCSolver, cache_compressor: None = None, system_reducer: SystemReducer | None = None, num_ref_iterations: int = 2, relative_tol: float = 0.2, absolute_tol: float = 1e-06, warning_threshold: float = 0.1, memoization_mode: str = 'auto', agreement_threshold: float = 0.999)
Bases : BaseBoundarySystem
An obc system solver with memoization and system reduction.
Initializes the obc system.
Parameters
-
boundary_solver : OBCSolver — The obc solver to be memoized.
-
cache_compressor : object, optional — An object with 'compress' and 'decompress' methods to handle cache compression. If None, no compression is applied.
-
num_ref_iterations : int, optional — The number of fixed-point iterations to refine the solution. Default is 2.
-
relative_tol : float, optional — The relative tolerance for convergence. Default is 0.2.
-
absolute_tol : float, optional — The absolute tolerance for convergence. Default is 1e-6.
-
warning_threshold : float, optional — The threshold for issuing a warning about high residuals. Default is 0.1.
-
memoization_mode : str, optional — The memoization mode. Can be 'off', 'auto', 'force-after-first', or 'force'. Default is 'auto'.
-
agreement_threshold : float, optional — The threshold for agreement across MPI ranks to consider a memoized solution valid. Default is 0.999.
Bases : ABC
Abstract base class for the open-boundary condition solver.
The recursion relation for the surface Green's function is given by: