Select and configure linear solvers for systems Ax=b in dense and sparse problems. Use when choosing direct vs iterative methods, diagnosing convergence issues, estimating conditioning, selecting preconditioners, or debugging stagnation in GMRES/CG/BiCGSTAB.
name: linear-solvers
description: Select and configure linear solvers for systems Ax=b in dense and sparse problems. Use when choosing direct vs iterative methods, diagnosing convergence issues, estimating conditioning, selecting preconditioners, or debugging stagnation in GMRES/CG/BiCGSTAB.
allowed-tools: Read, Bash, Write, Grep, Glob
Linear Solvers
Goal
Provide a universal workflow to select a solver, assess conditioning, and diagnose convergence for linear systems arising in numerical simulations.
Requirements
Python 3.8+
NumPy, SciPy (for matrix operations)
See individual scripts for dependencies
Inputs to Gather
Input
Description
Example
Matrix size
Dimension of system
n = 1000000
Sparsity
Fraction of nonzeros
0.01%
Symmetry
Is A = Aᵀ?
yes
Definiteness
Is A positive definite?
yes (SPD)
Conditioning
Estimated condition number
10⁶
Decision Guidance
Solver Selection Flowchart
Is matrix small (n < 5000) and dense?
├── YES → Use direct solver (LU, Cholesky)
└── NO → Is matrix symmetric?
├── YES → Is it positive definite?
│ ├── YES → Use CG with AMG/IC preconditioner
│ └── NO → Use MINRES
└── NO → Is it nearly symmetric?
├── YES → Use BiCGSTAB
└── NO → Use GMRES with ILU/AMG