--- id: pyamg version: "5.3.0" license: MIT license_treatment: permissive maintenance: active --- # pyamg — PyAMG: Algebraic Multigrid Solvers in Python License: permissive · Maintenance: active · Downloads: 141.9K/mo ## 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 above — verify before relying. PyAMG provides Algebraic Multigrid (AMG) solvers for efficiently solving large-scale sparse linear systems, with implementations of Classical AMG and Smoothed Aggregation methods. 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 pip install pyamg uv add pyamg poetry add pyamg ## Installing pyamg 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. 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) Requires numpy and scipy; Python 3.9 or later. 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_current - Install friction: medium - Maintenance: active - Downloads: 141.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags algebraic multigrid solver, sparse matrix linear solver, AMG preconditioner, large-scale linear systems, multigrid methods python, sparse matrix solver, iterative linear solver, numerical-linear-algebra, sparse-matrices, scientific-computing [View on SkillFed](https://skillfed.io/packages/pyamg) · [View on PyPI](https://pypi.org/project/pyamg/)