thomas#
Includes our Thomas algorithm based wave function solver.
Classes:
-
Thomas–Wave function solver using the block Thomas algorithm.
Thomas
#
Bases: WFSolver
Wave function solver using the block Thomas algorithm.
Parameters:
-
matrix_type(str, default:'complex_nonsymmetric') –The type of the system matrix. Must be one of 'real_symmetric_indefinite', 'complex_hermitian_indefinite', or 'complex_nonsymmetric'. Default is 'complex_nonsymmetric'.
-
matrix_view(str, default:'full') –The view of the system matrix. Must be one of 'full', 'upper', or 'lower'. 'upper' and 'lower' are only valid for symmetric or Hermitian matrices. Default is 'full'.
Methods:
-
solve–Solves the sparse system a @ x = b using the block Thomas algorithm.
solve
#
solve(a: csr_matrix, b: NDArray, reuse_analysis: bool = False, reuse_factorization: bool = False, overwrite_b: bool = True) -> NDArray
Solves the sparse system a @ x = b using the block Thomas algorithm.
Since b is directly modified in-place, b is lost after this call.
Parameters:
-
a(csr_matrix) –The sparse system matrix.
-
b(NDArray) –The dense right-hand side vector.
-
reuse_analysis(bool, default:False) –Whether to reuse the analysis phase from a previous solve, by by default False. This is useful when solving multiple linear systems with the same sparsity pattern but different numerical values.
-
reuse_factorization(bool, default:False) –Not implemented for this solver.
-
overwrite_b(bool, default:True) –Whether to overwrite the input b with the solution. Default is True. If False, a copy of b will be made before solving, and the original b will remain unchanged. This can be useful if the caller needs to keep the original right-hand side vector for later use.
Returns:
-
x(NDArray) –The solution vector.