Module solve

Module solve 

Source
Expand description

The internal fields between two adjacent stacks: a certified Krylov or pivoted LU solve of (I - L1 U2) up = rhs, kept for the pullback.

Upstream: the numpy.linalg.solve inside treams.SMatrices.illuminate with a second S-matrix. The Krylov branch and its contraction test are treams-rs extensions.

L1 is the reflection of the lower stack for waves incident from the positive side (above) and U2 the reflection of the upper stack for waves incident from the negative side (below), so up holds the upgoing fields between the stacks.

Modulesยง

saved ๐Ÿ”’
The original internal solve strategy and its numerical state, with a fixed factor slot that never builds a reflection product solely for serialization.

Structsยง

AdjointSolve ๐Ÿ”’
The adjoint solution of an internal system, beside its borrowed forward solution.
InternalSolve ๐Ÿ”’
The forward solution of the internal system and what its adjoint solve reuses.

Enumsยง

InternalFactor ๐Ÿ”’
What the pullback reuses to solve the adjoint system.

Constantsยง

ITERATIVE_MAX_COLUMNS ๐Ÿ”’
Most right-hand sides for which the Krylov solve is tried; wider batches factor.
ITERATIVE_MIN_ROWS ๐Ÿ”’
Rows from which a certified contraction tries the bounded Krylov solve before falling back to a dense LU factorization.
KRYLOV_STEPS ๐Ÿ”’
Krylov iterations, without restart, of one internal solve before the dense fallback.

Functionsยง

absolute_row_sums ๐Ÿ”’
Positive row sums of (|re A| + |im A|) weights, rounded upward.
internal_iteration ๐Ÿ”’
The unrestarted Krylov solve of the operator, or of its adjoint, for a thin batch, or None when it fails numerically and the caller should factor the operator instead.
internal_operator ๐Ÿ”’
The internal operator I - lower upper.
is_contraction ๐Ÿ”’
Whether ||L U||_inf < 1 holds for the operator I - L U, which proves it invertible.
reflection_action ๐Ÿ”’
Apply I - L U, or its adjoint, using only thin products.
reflections_contract ๐Ÿ”’
Certify ||L U||_inf < 1 using |L| |U| 1, in quadratic work.