obc#
Includes both abstract and concrete open boundary condition solver classes.
Modules:
-
obc–Includes classes for the open boundary system, solver and
-
sancho_rubio–Includes the Sancho-Rubio open boundary condition solver.
-
spectral–Includes a spectral solver for the open boundary conditions.
Classes:
-
OBCSolver–Abstract base class for the open-boundary condition solver.
-
OBCSystem–An obc system solver with memoization and system reduction.
-
SanchoRubio–Calculates the surface Green's function iteratively.[^1].
-
Spectral–Spectral open-boundary condition solver.
OBCSolver
#
Bases: ABC
Abstract base class for the open-boundary condition solver.
The recursion relation for the surface Green's function is given by:
Methods:
-
__call__–Returns the surface Green's function.
__call__
abstractmethod
#
__call__(a_ii: NDArray, a_ij: NDArray, a_ji: NDArray, contact: str) -> NDArray
Returns the surface Green's function.
Parameters:
-
a_ii(NDArray) –Diagonal boundary block of a system matrix.
-
a_ij(NDArray) –Superdiagonal boundary block of a system matrix.
-
a_ji(NDArray) –Subdiagonal boundary block of a system matrix.
-
contact(str) –The contact to which the boundary blocks belong.
Returns:
-
x_ii(NDArray) –The system's surface Green's function.
OBCSystem
#
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.
Parameters:
-
boundary_solver(OBCSolver) –The obc solver to be memoized.
-
cache_compressor(object, default:None) –An object with 'compress' and 'decompress' methods to handle cache compression. If None, no compression is applied.
-
num_ref_iterations(int, default:2) –The number of fixed-point iterations to refine the solution. Default is 2.
-
relative_tol(float, default:0.2) –The relative tolerance for convergence. Default is 0.2.
-
absolute_tol(float, default:1e-06) –The absolute tolerance for convergence. Default is 1e-6.
-
warning_threshold(float, default:0.1) –The threshold for issuing a warning about high residuals. Default is 0.1.
-
memoization_mode(str, default:'auto') –The memoization mode. Can be 'off', 'auto', 'force-after-first', or 'force'. Default is 'auto'.
-
agreement_threshold(float, default:0.999) –The threshold for agreement across MPI ranks to consider a memoized solution valid. Default is 0.999.
SanchoRubio
#
Bases: OBCSolver
Calculates the surface Green's function iteratively.1.
-
M P Lopez Sancho et al., "Highly convergent schemes for the calculation of bulk and surface Green functions", 1985 J. Phys. F: Met. Phys. 15 851 ↩
Parameters:
-
max_iterations(int, default:100) –The maximum number of iterations to perform.
-
convergence_tol(float, default:1e-06) –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.
Methods:
-
__call__–Returns the surface Green's function.
__call__
#
__call__(a_ii: NDArray, a_ij: NDArray, a_ji: NDArray, contact: str) -> NDArray
Returns the surface Green's function.
Parameters:
-
a_ii(NDArray) –Diagonal boundary block of a system matrix.
-
a_ij(NDArray) –Superdiagonal boundary block of a system matrix.
-
a_ji(NDArray) –Subdiagonal boundary block of a system matrix.
-
contact(str) –The contact to which the boundary blocks belong.
Returns:
-
x_ii(NDArray) –The system's surface Green's function.
Spectral
#
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.
Parameters:
-
nevp(NEVP) –The non-linear eigenvalue problem solver to use.
-
block_sections(int, default:1) –The number of sections to split the periodic matrix layer into.
-
min_decay(float, default:0.001) –The decay threshold after which modes are considered to be evanescent.
-
max_decay(float, default:6.9) –The maximum decay to consider for evanescent modes. The default is 6.9 which corresponds to 1000 in the eigenvalues.
-
num_ref_iterations(int, default:2) –The number of refinement iterations to perform on the surface Green's function.
-
min_propagation(float, default:0.01) –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, default:0.001) –The tolerance for the residual of the NEVP.
-
residual_normalization(bool, default:True) –If the residual should be normalized by the eigenvalue.
-
warning_threshold(float, default:0.1) –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, default:1e-14) –Small value to separate very slow decaying modes from non-decaying ones.
-
S. Brück, et al., Efficient algorithms for large-scale quantum transport calculations, The Journal of Chemical Physics, 2017. ↩
-
Methods:
-
__call__–Returns the surface Green's function.
__call__
#
__call__(a_ii: NDArray, a_ij: NDArray, a_ji: NDArray, contact: str, return_injected: bool = False, return_modes_only: bool = False) -> NDArray | tuple[NDArray, NDArray, NDArray]
Returns the surface Green's function.
Parameters:
-
a_ii(NDArray) –Diagonal boundary block of a system matrix.
-
a_ij(NDArray) –Superdiagonal boundary block of a system matrix.
-
a_ji(NDArray) –Subdiagonal boundary block of a system matrix.
-
contact(str) –The contact to which the boundary blocks belong.
-
return_injected(bool, default:False) –Whether to return the injection vector. If True, the function returns a tuple of the surface Green's function and the injection vector. False by default.
-
return_modes_only(bool, default:False) –Whether to return the reflected modes without computing the surface Green's function. If True, the function returns a tuple of None, the injection vector, the reflected modes, their eigenvalues, and their pseudoinverses. False by default.
Returns:
-
x_ii(NDArray) –The system's surface Green's function. If return_modes_only is True, this is None.
-
b_injected(NDArray) –The injected b. Returned only if return_injected is True.
-
phi_reflected(NDArray) –The reflected modes. Returned only if return_modes_only is True.
-
eig_reflected(NDArray) –The eigenvalues corresponding to the reflected modes. Returned only if return_modes_only is True.
-
phi_inv_reflected(NDArray) –The pseudoinverse of the reflected modes. Returned only if return_modes_only is True.