linear-solvers
Select and configure linear solvers for Ax=b systems arising in numerical simulations — choose between direct (LU, Cholesky) and iterative (CG, GMRES…
Skill by HeshamFS
Install
Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.
npx agentmarket install skill/heshamfs-linear-solvers
Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.
Get the weekly diff
The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.
About
Reviews
Write a reviewNo reviews yet. Installed it? Reviews come from verified installers only. How reviews work
Permissions
What this skill can do and what it asks for, from its SKILL.md and code. Checked Oct 25, 2026.
- Tools
- No tools found
- Secrets
- None asked for
- Install scripts
- None found
- Runs as
- Python package
Network hosts it talks to 1
codeload.github.com· found in install command
Files it touches
~/.claude/skills/linear-solvers
Tools it pre-approves 4
From allowed-tools in SKILL.md: the agent may use these without asking you each time.
Read,Write,Grep,Glob
What's inside
- Skill name
linear-solvers- Description
- Select and configure linear solvers for Ax=b systems arising in numerical simulations — choose between direct (LU, Cholesky) and iterative (CG, GMRES, BiCGSTAB, MINRES) methods, analyze sparsity patterns and matrix conditioning, recommend preconditioners (AMG, ILU, IC), apply row/column scaling, and diagnose convergence stagnation from residual histories. Use when setting up a linear solve for FEM/FVM assembly, debugging slow or stalled Krylov iterations, choosing a preconditioner for SPD or nonsymmetric systems, or investigating ill-conditioning, even if the user only says "my solver is slow" or "GMRES won't converge."
- License
- Apache-2.0
- Allowed tools
- Read,, Write,, Grep,, Glob
- Metadata
- author: HeshamFS · version: 1.2.3 · eval_cases: 4 · last_reviewed: 2026-10-19 · security_tier: medium · last_evaluated: 2026-06-24 · security_reviewed: true · agent_evaluation_status: not_revalidated · last_deterministic_eval: 2026-10-20
- Instructions
- 221 lines in SKILL.md · view on GitHub
Before installing
- Ships executable scripts
Files (14)
- CHANGELOG.md
- SKILL.md
- evals.json · evals/
- A.npy · evals/files/
- convergence_patterns.md · references/
- preconditioner_catalog.md · references/
- scaling_guidelines.md · references/
- solver_decision_tree.md · references/
- convergence_diagnostics.py · scripts/
- preconditioner_advisor.py · scripts/
- residual_norms.py · scripts/
- scaling_equilibration.py · scripts/
- solver_selector.py · scripts/
- sparsity_stats.py · scripts/
SKILL.md (first lines)
# 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.10+
- 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 dense and small enough to factor in memory (dense float64
storage n²·8 bytes < ~2 GB, i.e. n ≲ 16000)?
├── YES → Use direct solver (Cholesky/LDLᵀ/LU by symmetry)
└── 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
```
### Quick Reference
| Matrix Type | Solver | Preconditioner |
|-------------|--------|----------------|
| SPD, sparse | CG | AMG, IC |
| Symmetric indefinite | MINRES | SPD preconditioner (SSOR, symmetric block-diagonal, or AMG on SPD part) |
| Nonsymmetric | GMRES, BiCGSTAB | ILU, AMG |
| Dense | LU, Cholesky | None |
| Saddle point | Schur complement, Uzawa | Block preconditioner |
## Script Outputs (JSON Fields)
| Script | Key Outputs |
|--------|-------------|
| `scripts/solver_selector.py` | `recommended`, `alternatives`, `notes` |
| `scripts/convergence_diagnostics.py` | `rate`, `asymptotic_rate`, `stagnation`, `recommended_action` |
| `scripts/sparsity_stats.py` | `nnz`, `density`, `bandwidth`, `symmetry` |
| `scripts/preconditioner_advisor.py` | `suggested`, `notes` |
| `scripts/scaling_equilibration.py` | `row_scale`, `col_scale`, `notes` |
| `scripts/residual_norms.py` | `residual_norms`, `relative_norms`, `converged` |
## Workflow
1. **Characterize matrix** - symmetry, definiteness, sparsity
2. **Analyze sparsity** - Run `scripts/sparsity_stats.py`
3. **Select solver** - Run `scripts/solver_selector.py`
4. **Choose preconditioner** - Run `scripts/preconditioner_advisor.py`
5. **Apply scaling** - If ill-conditioned, use `scripts/scaling_equilibration.py`
6. **Monitor convergence** - Use `scripts/convergence_diagnostics.py`
7. **Diagnose issues** - Check residual history with `scripts/residual_norms.py`
## Conversational Workflow Example
**User**: My GMRES solver is stagnating after 50 iterations. The residual drops to 1e-3 then stops improving.
**Agent workflow**:
1. Diagnose convergence:
```bash
python3 scripts/convergence_diagnostics.py --residuals 1,0.1,0.01,0.005,0.003,0.002,0.002,0.002 --json
```
2. Check for preconditioning advice:
```bash
python3 scripts/preconditioner_advisor.py --matrix-type nonsymmetric --sparse --ill-conditioned --json
```
3. Recommend: Increase restart parameter, try ILU(k) with higher k, or switch to AMG.
## Pre-Solve Checklist
- [ ] Confirm matrix symmetry/definiteness
- [ ] Decide direct vs iterative based on size and sparsity
- [ ] Set residual tolerance relative to physics scale
- [ ] Choose preconditioner appropriate to matrix structure
- [ ] Apply scaling/equilibration if needed
- [ ] Track convergence and adjust if stagnation occurs
## CLI Examples
```bash
# Analyze sparsity pattern
python3 scripts/sparsity_stats.py --matrix A.npy --json
# Select solver for SPD sparse system
python3 scripts/solver_selector.py --symmetric --positive-definite --sparse --size 1000000 --json
# Get preconditioner recommendation
python3 scripts/preconditioner_advisor.py --matrix-type spd --sparse --json
# Diagnose convergence from residual history
python3 scripts/convergence_diagnostics.py --residuals 1,0.2,0.05,0.01 --json
# Apply scaling
python3 scripts/scaling_equilibration.py --matrix A.npy --symmetric --json
# Compute residual norms
python3 scripts/residual_norms.py --residual 1,0.1,0.01 --rhs 1,0,0 --json
```
## Error Handling
| Error | Cause | Resolution |From HeshamFS/materials-simulation-skills, Apache-2.0.
More from HeshamFS/materials-simulation-skills
- 0.676score
benchmark-and-mms-planner
HeshamFS
Plan verification and validation campaigns for simulation codes using manufactured solutions, canonical benchmark problems, grid/time refinement, uncertainty…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
differentiation-schemes
HeshamFS
Select and apply numerical differentiation schemes for PDE and ODE discretization — generate finite-difference stencils at arbitrary order and accuracy…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
mesh-generation
HeshamFS
Plan and evaluate mesh generation for numerical simulations — estimate grid resolution from physics scales (interface width, boundary layers, wavelengths)…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
nonlinear-solvers
HeshamFS
Select and configure nonlinear solvers for root-finding f(x)=0, optimization min F(x), and least-squares problems — choose among Newton, Newton-Krylov…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
numerical-integration
HeshamFS
Select and configure time integration methods for ODE and PDE simulations — choose among explicit Runge-Kutta, BDF, Rosenbrock, and Adams families, set…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
numerical-stability
HeshamFS
Analyze numerical stability for time-dependent PDE simulations — check CFL and Fourier criteria, perform von Neumann stability analysis, detect stiffness…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
time-stepping
HeshamFS
Plan and control time-step policies for transient simulations — couple CFL and physics-based stability limits with adaptive stepping, ramp initial transients…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
fair-simulation-packager
HeshamFS
Create FAIR-minded reproducibility bundles for materials simulations by collecting input/output file inventories, hashes, units, engine versions, structure…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
hpc-runtime-doctor
HeshamFS
Diagnose HPC runtime and scheduler problems for materials simulations, including MPI/OpenMP/GPU layout, modules, CUDA/Kokkos hints, scratch paths, walltime…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
slurm-job-script-generator
HeshamFS
Generate correct, copy-pasteable SLURM sbatch job scripts and sanity-check HPC resource requests — configure nodes, MPI tasks, OpenMP threads, memory…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
skill-evaluator
HeshamFS
Rigorously evaluate an Agent Skill end-to-end across ANY coding-agent CLI — verify its scripts emit the documented numbers (deterministic checks), test…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
ontology-explorer
HeshamFS
Parse, navigate, and query materials science ontology structures — browse class hierarchies, inspect individual classes and their properties, look up object…
SkillAFreshness: A★ 83Claude Code +9
Signals
- Stars
- 83
- Forks
- 6
- Open issues
- 0
- Last commit (this folder)
- Oct 21, 2026 (7 days ago)
From GitHub (fetched Oct 24, 2026).
Details
- Version
- 1.2.3
- License
- Apache-2.0
- First seen
- Oct 24, 2026
- Last checked
- Oct 24, 2026
- Source
- GitHubgithub-graphql
More from HeshamFS
- 0.676score
numerical-stability
HeshamFS
Analyze numerical stability for time-dependent PDE simulations — check CFL and Fourier criteria, perform von Neumann stability analysis, detect stiffness…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
differentiation-schemes
HeshamFS
Select and apply numerical differentiation schemes for PDE and ODE discretization — generate finite-difference stencils at arbitrary order and accuracy…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
mesh-generation
HeshamFS
Plan and evaluate mesh generation for numerical simulations — estimate grid resolution from physics scales (interface width, boundary layers, wavelengths)…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
nonlinear-solvers
HeshamFS
Select and configure nonlinear solvers for root-finding f(x)=0, optimization min F(x), and least-squares problems — choose among Newton, Newton-Krylov…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
numerical-integration
HeshamFS
Select and configure time integration methods for ODE and PDE simulations — choose among explicit Runge-Kutta, BDF, Rosenbrock, and Adams families, set…
SkillAFreshness: A★ 83Claude Code +9 - 0.676score
time-stepping
HeshamFS
Plan and control time-step policies for transient simulations — couple CFL and physics-based stability limits with adaptive stepping, ramp initial transients…
SkillAFreshness: A★ 83Claude Code +9
Cite this page
linear-solvers skill. Agent Mart. https://agentmart.dev/skills/heshamfs-linear-solvers (last updated 2026-10-24)