Summary
After extracting ScipyLinearBackend, replace the extracted implementation in matrix_ops.py with thin delegation to a module-default backend instance.
Implementation
from .backends import ScipyLinearBackend
_DEFAULT_BACKEND = ScipyLinearBackend()
def implicit_solve(left_op, right_op, x):
"""Solve L @ y = R @ x using the default backend."""
return _DEFAULT_BACKEND.solve(left_op, right_op, x)
def clear_implicit_solver_cache():
"""Clear the default backend solver cache."""
_DEFAULT_BACKEND.clear_cache()
What stays unchanged
- Operator builders (
build_laplacian_tridiag, build_implicit_euler_operators, etc.)
- Stage operator factories (
make_stage_operator_factory, make_constant_base_builder)
- Grouping utilities,
smooth(), kron_*
Operator type alias
Files to modify
src/op_engine/matrix_ops.py — replace extracted implementation with delegation
Acceptance criteria
Dependencies
Depends on: #20 (ScipyLinearBackend)
Parallel with: #21 (inject into CoreSolver)
Summary
After extracting
ScipyLinearBackend, replace the extracted implementation inmatrix_ops.pywith thin delegation to a module-default backend instance.Implementation
What stays unchanged
build_laplacian_tridiag,build_implicit_euler_operators, etc.)make_stage_operator_factory,make_constant_base_builder)smooth(),kron_*Operatortype aliasFiles to modify
src/op_engine/matrix_ops.py— replace extracted implementation with delegationAcceptance criteria
from op_engine import implicit_solve, clear_implicit_solver_cachestill worksDependencies
Depends on: #20 (ScipyLinearBackend)
Parallel with: #21 (inject into CoreSolver)