zoomy_core.analysis.reduce_pencil module

zoomy_core.analysis.reduce_pencil module#

Generic singular-pencil reduction for the principal-symbol problem.

When a linearised PDE system has algebraic constraint rows (M_t row = zero), the principal-symbol pencil (M_x, M_t) is singulardet(M_x λ M_t) 0 and standard generalised-eigenvalue solvers return garbage.

This module reduces a singular pencil to a regular one by repeatedly:

  1. Picking an algebraic row (M_t row identically zero).

  2. Solving its M_x-row for one field (the field with the simplest non-zero coefficient in that row).

  3. Substituting that field’s expression into every other row of M_x and M_t, then dropping the row + the eliminated column.

After reduction (when no all-zero M_t row remains), the pencil is regular and standard generalised-eigenvalue routines work.

The algorithm is generic — it works for any system with algebraic constraints, regardless of the model. It chooses elimination order by “simplest coefficient first”, which is deterministic but not unique; the finite eigenvalues are basis-invariant under valid elimination choices, so the result is independent of the order.

zoomy_core.analysis.reduce_pencil.reduce_singular_pencil(M_x, M_t, fields, M_0=None, *, verbose=False)#

Eliminate algebraic-constraint rows + the corresponding fields.

Three classes of “algebraic” rows are handled:

  1. M_t row = 0 and M_x row != 0 — principal-symbol algebraic constraint at high k. Use the M_x row to solve for one field and substitute into all remaining rows (M_x, M_t and M_0 if provided).

  2. M_t row = 0 and M_x row = 0 and M_0 row != 0 — zeroth-order algebraic constraint (k-independent). Use the M_0 row to solve. REQUIRES M_0 argument.

  3. All three rows zero — redundant; drop the row.

Returns (M_x_reduced, M_t_reduced, fields_reduced) with no all-zero M_t rows. If M_0 was provided it is also reduced; access via the returned tuple’s caller side-effect (the matrix is mutated in place — pass a copy if you need the original).

Parameters:
  • M_x (MutableDenseMatrix) –

  • M_t (MutableDenseMatrix) –

  • fields (List) –

  • M_0 (Optional[MutableDenseMatrix]) –

  • verbose (bool) –

Return type:

Tuple[MutableDenseMatrix, MutableDenseMatrix, List]