Skip to content

qttools.obc#

source package qttools.obc

Classes

  • OBCSolver Abstract base class for the open-boundary condition solver.

  • OBCMemoizer Memoization class to reuse the result of an OBC function call.

  • SanchoRubio Calculates the surface Green's function iteratively.1.

  • Spectral Spectral open-boundary condition solver.

source class OBCSolver()

Bases : ABC

Abstract base class for the open-boundary condition solver.

The recursion relation for the surface Green's function is given by:

\[ x_{ii} = (a_{ii} - a_{ji} x_{ii} a_{ij})^{-1} \]

source class OBCMemoizer(obc_solver: OBCSolver, num_ref_iterations: int = 3, memoize_rel_tol: float = 0.01, memoize_abs_tol: float = 1e-08, warning_threshold: float = 0.0001, memoizing_mode: str = 'auto')

Memoization class to reuse the result of an OBC function call.

Initalizes the memoizer.

Parameters

  • obc_solver : OBCSolver The OBC solver to wrap.

  • num_ref_iterations : int, optional The maximum number of refinement iterations to do.

  • memoize_rel_tol : float, optional The required relative accuracy to only memoize.

  • memoize_abs_tol : float, optional The required absolute accuracy to only memoize. If either of the tolerances is met, the result is memoized.

  • warning_threshold : float, optional The threshold for the relative recursion error to issue a warning.

  • memoizing_mode : str, optional Possible modes are:

    • 'auto': (default) automatically decide whether to memoize or recompute based on the recursion error.
    • 'force': always memoize
    • 'force-after-first': always memoize after the first call
    • 'off': never memoize

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 alpha and beta is less than this value.

source class Spectral(nevp: NEVP, block_sections: int = 1, min_decay: float = 0.001, max_decay: float | None = None, num_ref_iterations: int = 2, x_ii_formula: str = 'self-energy', two_sided: bool = False, treat_pairwise: bool = True, pairing_threshold: float = 0.25, min_propagation: float = 0.01, residual_tolerance: float = 0.001, residual_normalization: str | None = 'eigenvalue', warning_threshold: float = 0.1)

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. If not provided, the maximum decay is set to the logarithm of the outer radius of the contour annulus if applicable. Otherwise, it is set to log(10).

  • num_ref_iterations : int, optional The number of refinement iterations to perform on the surface Green's function.

  • x_ii_formula : str, optional The formula to use for the calculation of the surface Green's function. The default is via the boundary "self-energy". The other option is "direct". The "self-energy" formula corresponds to Equation (13.1) in the paper 1 and the "direct" formula corresponds to Equation (15).

  • two_sided : bool, optional Whether to solve the NEVP for both left and right eigenvectors, and construct the surface Green's function from both.

  • treat_pairwise : bool, optional Whether to match complex conjugate modes and treat them in pairs during the determining of reflected modes.

  • pairing_threshold : float, optional The threshold for which two modes are considered to be a mode pair.

  • 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 : str | None, optional The formula to use for the normalization of the residual. The default is the "operator" formula. The other options are "eigenvalue" and None. The "operator" formula corresponds to normalization by the Frobenius norm of the operator, the "eigenvalue" formula corresponds to normalization by the absolute of the eigenvalues, and None results in no normalization.


  1. S. Brück, et al., Efficient algorithms for large-scale quantum transport calculations, The Journal of Chemical Physics, 2017.