Select and configure linear solvers for systems Ax=b across dense and sparse problems. Use when choosing direct vs iterative methods, diagnosing convergence issues, estimating conditioning, or selecting preconditioners for large-scale simulations.
This Claude skill provides a comprehensive workflow for selecting, configuring, and diagnosing linear solvers for systems of equations (Ax=b). It streamlines the process of choosing between direct and iterative methods—such as GMRES, CG, or BiCGSTAB—based on matrix properties like sparsity, symmetry, and conditioning, ensuring optimal performance and numerical stability for large-scale simulations.
Use Cases
Scientific Computing: Automatically selecting the most efficient solver (LU, Cholesky, or Iterative) for large-scale physics and engineering simulations.
Performance Optimization: Analyzing matrix sparsity and density to recommend optimal preconditioning strategies like AMG or ILU to speed up convergence.
Numerical Debugging: Diagnosing stagnation or slow convergence in iterative solvers by analyzing residual history and matrix conditioning.
Data Pre-processing: Applying scaling and equilibration to ill-conditioned matrices to prevent numerical instability and improve solution accuracy.
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