_serinv#
This backend implements the methods present in Serinv for the specific case of solving lesser, greater, and retarded Green's functions.
For more information see https://github.com/vincent-maillou/serinv
Classes:
-
ReducedSystem–Auxiliary class to handle the reduced system.
Functions:
-
downward_schur–Performs the downward Schur complement decomposition.
-
upward_schur–Performs the upward Schur complement decomposition.
-
permuted_schur–Performs the permuted Schur complement decomposition.
-
downward_selinv–Performs the downward selected inversion.
-
upward_selinv–Performs the upward selected inversion.
-
permuted_selinv–Performs the permuted selected inversion.
ReducedSystem
#
ReducedSystem(selected_solve: bool = False)
Auxiliary class to handle the reduced system.
This is basically a container for the diagonal and off-diagonal blocks of the reduced system with some extra functionality.
Parameters:
-
selected_solve(bool, default:False) –Whether the ReducedSystem should also store blocks for solving the quadratic systems associated with the lesser and greater right-hand-sides, by default False.
Attributes:
-
comm(Comm) –The intranode MPI communicator.
-
num_diags(int) –The number of diagonal blocks in the reduced system.
-
diag_blocks(list[NDArray | None]) –The diagonal blocks of the reduced system.
-
upper_blocks(list[NDArray | None]) –The upper off-diagonal blocks of the reduced system.
-
lower_blocks(list[NDArray | None]) –The lower off-diagonal blocks of the reduced system
-
solve_lesser(bool) –Whether to solve the quadratic system associated with the lesser righ-hand-sideS.
-
diag_blocks_lesser(list[NDArray | None]) –The diagonal blocks of the reduced system associated with the lesser right-hand-side.
-
upper_blocks_lesser(list[NDArray | None]) –The upper off-diagonal blocks of the reduced system associated with the lesser right-hand-side.
-
lower_blocks_lesser(list[NDArray | None]) –The lower off-diagonal blocks of the reduced system associated with the lesser right-hand-side.
-
solve_greater(bool) –Whether to solve the quadratic system associated with the greater right-hand-side.
-
diag_blocks_greater(list[NDArray | None]) –The diagonal blocks of the reduced system associated with the greater right-hand-side.
-
upper_blocks_greater(list[NDArray | None]) –The upper off-diagonal blocks of the reduced system associated with the greater right-hand-side.
-
lower_blocks_greater(list[NDArray | None]) –The lower off-diagonal blocks of the reduced system associated with the greater right-hand-side.
Methods:
-
gather–Gathers the reduced system across all ranks.
-
gather_constant_block_size–Gathers the reduced system across all ranks.
-
solve–Solves the reduced system on all ranks.
-
scatter–Scatters the reduced system across all ranks.
gather
#
gather(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], xr_buffer_upper: list[NDArray], xr_buffer_lower: list[NDArray], sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, xl_buffer_upper: list[NDArray] = None, xl_buffer_lower: list[NDArray] = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, xg_buffer_upper: list[NDArray] = None, xg_buffer_lower: list[NDArray] = None)
Gathers the reduced system across all ranks.
Parameters:
-
a(DSDBSparse) –The system matrix.
-
xr_diag_blocks(list[NDArray]) –The diagonal blocks of the Schur factorization of the retarded system.
-
xr_buffer_upper(list[NDArray]) –The super-diagonal blocks of the Schur factorization of the retarded system.
-
xr_buffer_lower(list[NDArray]) –The sub-diagonal blocks of the Schur factorization of the retarded system.
-
sigma_lesser(DSDBSparse, default:None) –The self-energy matrix for the lesser Green's function, by default None.
-
xl_diag_blocks(list[NDArray], default:None) –The diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_buffer_upper(list[NDArray], default:None) –The super-diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_buffer_lower(list[NDArray], default:None) –The sub-diagonal blocks of the Schur factorization of the lesser system, by default None.
-
sigma_greater(DSDBSparse, default:None) –The self-energy matrix for the greater Green's function, by default None.
-
xg_diag_blocks(list[NDArray], default:None) –The diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_buffer_upper(list[NDArray], default:None) –The super-diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_buffer_lower(list[NDArray], default:None) –The sub-diagonal blocks of the Schur factorization of the greater system, by default None.
gather_constant_block_size
#
gather_constant_block_size(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], xr_buffer_upper: list[NDArray], xr_buffer_lower: list[NDArray], sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, xl_buffer_upper: list[NDArray] = None, xl_buffer_lower: list[NDArray] = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, xg_buffer_upper: list[NDArray] = None, xg_buffer_lower: list[NDArray] = None)
Gathers the reduced system across all ranks.
Parameters:
-
a(DSDBSparse) –The system matrix.
-
xr_diag_blocks(list[NDArray]) –The diagonal blocks of the Schur factorization of the retarded system.
-
xr_buffer_upper(list[NDArray]) –The super-diagonal blocks of the Schur factorization of the retarded system.
-
xr_buffer_lower(list[NDArray]) –The sub-diagonal blocks of the Schur factorization of the retarded system.
-
sigma_lesser(DSDBSparse, default:None) –The self-energy matrix for the lesser Green's function, by default None.
-
xl_diag_blocks(list[NDArray], default:None) –The diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_buffer_upper(list[NDArray], default:None) –The super-diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_buffer_lower(list[NDArray], default:None) –The sub-diagonal blocks of the Schur factorization of the lesser system, by default None.
-
sigma_greater(DSDBSparse, default:None) –The self-energy matrix for the greater Green's function, by default None.
-
xg_diag_blocks(list[NDArray], default:None) –The diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_buffer_upper(list[NDArray], default:None) –The super-diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_buffer_lower(list[NDArray], default:None) –The sub-diagonal blocks of the Schur factorization of the greater system, by default None.
scatter
#
scatter(xr_diag_blocks: list[NDArray], xr_buffer_upper: list[NDArray], xr_buffer_lower: list[NDArray], xr_out: DSDBSparse | _DStackView, return_retarded: bool = True, xl_diag_blocks: list[NDArray] = None, xl_buffer_lower: list[NDArray] = None, xl_buffer_upper: list[NDArray] = None, xl_out: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, xg_buffer_lower: list[NDArray] = None, xg_buffer_upper: list[NDArray] = None, xg_out: DSDBSparse | _DStackView = None)
Scatters the reduced system across all ranks.
Parameters:
-
xr_diag_blocks(list[NDArray]) –The diagonal blocks of the Schur factorization of the retarded system.
-
xr_buffer_upper(list[NDArray]) –The super-diagonal blocks of the Schur factorization of the retarded system.
-
xr_buffer_lower(list[NDArray]) –The sub-diagonal blocks of the Schur factorization of the retarded system.
-
xr_out(DSDBSparse | _DStackView) –The output matrix for the retarded system.
-
return_retarded(bool, default:True) –Whether to write the retarded Green's function to the output matrix, by default True.
-
xl_diag_blocks(list[NDArray], default:None) –The diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_buffer_lower(list[NDArray], default:None) –The sub-diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_buffer_upper(list[NDArray], default:None) –The super-diagonal blocks of the Schur factorization of the lesser system, by default None.
-
xl_out(DSDBSparse | _DStackView, default:None) –The output matrix for the lesser system, by default None.
-
xg_diag_blocks(list[NDArray], default:None) –The diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_buffer_lower(list[NDArray], default:None) –The sub-diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_buffer_upper(list[NDArray], default:None) –The super-diagonal blocks of the Schur factorization of the greater system, by default None.
-
xg_out(DSDBSparse | _DStackView, default:None) –The output matrix for the greater system, by default None.
downward_schur
#
downward_schur(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], obc_blocks: OBCBlocks, sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, stack_slice: slice = Ellipsis, invert_last_block: bool = True, selected_solve: bool = False)
Performs the downward Schur complement decomposition.
upward_schur
#
upward_schur(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], obc_blocks: OBCBlocks, sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, stack_slice: slice = Ellipsis, invert_last_block: bool = True, selected_solve: bool = False)
Performs the upward Schur complement decomposition.
permuted_schur
#
permuted_schur(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], xr_buffer_lower: list[NDArray], xr_buffer_upper: list[NDArray], obc_blocks: OBCBlocks, sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, xl_buffer_lower: list[NDArray] = None, xl_buffer_upper: list[NDArray] = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, xg_buffer_lower: list[NDArray] = None, xg_buffer_upper: list[NDArray] = None, stack_slice: slice = Ellipsis, selected_solve: bool = False)
Performs the permuted Schur complement decomposition.
downward_selinv
#
downward_selinv(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], xr_out: DSDBSparse | _DStackView, sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, xl_out: DSDBSparse | _DStackView = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, xg_out: DSDBSparse | _DStackView = None, selected_solve: bool = False, return_retarded: bool = True)
Performs the downward selected inversion.
upward_selinv
#
upward_selinv(a: DSDBSparse, xr_diag_blocks: list[NDArray], xr_out: DSDBSparse, sigma_lesser: DSDBSparse = None, xl_diag_blocks: list[NDArray] = None, xl_out: DSDBSparse = None, sigma_greater: DSDBSparse = None, xg_diag_blocks: list[NDArray] = None, xg_out: DSDBSparse = None, selected_solve: bool = False, return_retarded: bool = True)
Performs the upward selected inversion.
permuted_selinv
#
permuted_selinv(a: DSDBSparse | _DStackView, xr_diag_blocks: list[NDArray], xr_buffer_lower: list[NDArray], xr_buffer_upper: list[NDArray], xr_out: DSDBSparse | _DStackView, sigma_lesser: DSDBSparse | _DStackView = None, xl_diag_blocks: list[NDArray] = None, xl_buffer_lower: list[NDArray] = None, xl_buffer_upper: list[NDArray] = None, xl_out: DSDBSparse | _DStackView = None, sigma_greater: DSDBSparse | _DStackView = None, xg_diag_blocks: list[NDArray] = None, xg_buffer_lower: list[NDArray] = None, xg_buffer_upper: list[NDArray] = None, xg_out: DSDBSparse | _DStackView = None, selected_solve: bool = False, return_retarded: bool = True)
Performs the permuted selected inversion.