pyamg
PyAMG: Algebraic Multigrid Solvers in Python
Decision gist · record as of 2026-08-14
Yes. PyAMG is a mature, actively maintained library (active status, recent commits) with no known vulnerabilities, permissive MIT licensing, and solid platform coverage. Install friction is moderate due to compiled components, but prebuilt wheels mitigate this. Suitable for anyone solving large sparse linear systems, especially on unstructured problems where classical multigrid is impractical.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires numpy and scipy; Python 3.9 or later.
- Medium install friction due to compiled C++ components, but prebuilt wheels are available for Python 3.9–3.13 on macOS, Linux, and Windows.
- Active maintenance with recent releases; last commit 2026-03-30.
License · maintenance · safety
MIT (permissive) — MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
last release 2025-08-24 (355 days) · last repo commit 2026-03-30 · 652 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 141,888 downloads/mo, #11,231 on PyPI
Alternatives
Verify before relying
import pyamg
import numpy as np
A = pyamg.gallery.poisson((500, 500), format='csr')
ml = pyamg.ruge_stuben_solver(A)
b = np.random.rand(A.shape[0])
x = ml.solve(b, tol=1e-10)- Performance characteristics and scalability limits for specific problem sizes or matrix structures
- Comparative efficiency versus other multigrid or iterative solvers in typical use cases
What it is and what it does
PyAMG is a library of Algebraic Multigrid solvers designed to solve large-scale sparse linear systems with optimal or near-optimal efficiency. Unlike geometric multigrid, AMG requires little geometric information about the underlying problem and develops a sequence of coarser grids directly from the input matrix—making it especially useful for problems on unstructured meshes and irregular grids. The library is written primarily in Python with performance-critical C++ components.
The package implements Classical (Ruge-Stuben) AMG and Smoothed Aggregation methods, with experimental support for Adaptive Smoothed Aggregation and Compatible Relaxation. It is commonly used as a preconditioner or standalone solver in scientific computing workflows, particularly for finite-element and finite-difference discretizations. Installation is straightforward via pip or conda, with prebuilt wheels for modern Python versions on major platforms.
Use it for
- Solve 2D/3D Poisson problems and other elliptic PDEs on unstructured grids where geometric information is unavailable
- Precondition iterative solvers for large sparse systems arising from finite-element discretizations
- Accelerate convergence of Krylov subspace methods (e.g., GMRES, CG) via multigrid preconditioning
- Prototype and develop multilevel solution strategies for research in numerical linear algebra
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
PyAMG is a mature, actively maintained library (active status, recent commits) with no known vulnerabilities, permissive MIT licensing, and solid platform coverage. Install friction is moderate due to compiled components, but prebuilt wheels mitigate this. Suitable for anyone solving large sparse linear systems, especially on unstructured problems where classical multigrid is impractical.
Install
pyamg on PyPI
Before you install
Medium install friction due to compiled C++ components, but prebuilt wheels are available for Python 3.9–3.13 on macOS, Linux, and Windows. Active maintenance with recent releases; last commit 2026-03-30.
Requires numpy and scipy; Python 3.9 or later.
License in practice
MIT license permits commercial and private use with minimal restrictions; suitable for most projects.
Quickstart
import pyamg
import numpy as np
A = pyamg.gallery.poisson((500, 500), format='csr')
ml = pyamg.ruge_stuben_solver(A)
b = np.random.rand(A.shape[0])
x = ml.solve(b, tol=1e-10)
Verify before relying
- Performance characteristics and scalability limits for specific problem sizes or matrix structures
- Comparative efficiency versus other multigrid or iterative solvers in typical use cases
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 2 packagesnumpyscipy |
| Maintenance | Actively maintained 355 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 141,888 / month, #11,231 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: C++Programming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9Topic :: EducationTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: MathematicsTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pyamg-5.3.0-cp310-cp310-macosx_10_9_x86_64.whl; pyamg-5.3.0-cp310-cp310-macosx_11_0_arm64.whl; pyamg-5.3.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pyamg-5.3.0-cp310-cp310-musllinux_1_2_x86_64.whl; pyamg-5.3.0-cp310-cp310-win32.whl; pyamg-5.3.0-cp310-cp310-win_amd64.whl; pyamg-5.3.0-cp311-cp311-macosx_10_9_x86_64.whl; pyamg-5.3.0-cp311-cp311-macosx_11_0_arm64.whl; pyamg-5.3.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pyamg-5.3.0-cp311-cp311-musllinux_1_2_x86_64.whl; pyamg-5.3.0-cp311-cp311-win32.whl; pyamg-5.3.0-cp311-cp311-win_amd64.whl; pyamg-5.3.0-cp312-cp312-macosx_10_13_x86_64.whl; pyamg-5.3.0-cp312-cp312-macosx_11_0_arm64.whl; pyamg-5.3.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl; pyamg-5.3.0-cp312-cp312-musllinux_1_2_x86_64.whl; pyamg-5.3.0-cp312-cp312-win32.whl; pyamg-5.3.0-cp312-cp312-win_amd64.whl; pyamg-5.3.0-cp313-cp313-macosx_10_13_x86_64.whl; pyamg-5.3.0-cp313-cp313-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “algebraic multigrid solver”
- pyamgPyAMG provides Algebraic Multigrid (AMG) solvers for efficiently…
- gekkoGEKKO is a Python package for optimization and machine learning that…
- amplpyamplpy is a Python interface to AMPL, an algebraic modeling language…
Give your agent the search over MCP, or paste the wish link into any chat.
More Scientific/Engineering packages
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
pandas provides fast, flexible data structures (Series and DataFrame) for loading, cleaning, transforming, and analyzing labeled or relational data in Python.
scipy provides numerical algorithms for mathematics, science, and engineering—including optimization, integration, linear algebra, Fourier transforms, signal and image processing, and ODE solvers—built on numpy arrays.
scikit-learn provides a comprehensive Python library for supervised and unsupervised machine learning, including classification, regression, clustering, dimensionality reduction, and model evaluation tools built on NumPy and SciPy.
Install it if you need to train, evaluate, or deploy supervised or unsupervised learning models.
dill extends Python's pickle module to serialize and deserialize a much wider range of Python objects, including functions, lambdas, classes, and interpreter sessions, to byte streams for storage or network transmission.
Multiprocess is an enhanced fork of Python's standard multiprocessing library that uses dill for better serialization, allowing you to spawn processes with a threading-like API and share complex objects between them.
Install it if you use multiprocessing and encounter pickle serialization limits with lambdas or complex objects.
See also nvidia-cusolver · nvidia-cusolver-cu12 · qdldl · pybammsolvers · pybamm · qpsolvers · nvidia-cusolver-cu11 · POT · gekko · amplpy