PyAMG: Algebraic Multigrid Solvers in Python
Project description
Installation
PyAMG requires numpy
and scipy
pip install pyamg
or
python setup.py install
or with conda (see details below)
conda config --add channels conda-forge
conda install pyamg
Introduction
PyAMG is a library of Algebraic Multigrid (AMG) solvers with a convenient Python interface.
PyAMG is currently developed by Luke Olson, and Jacob Schroder.
Citing
@MISC{OlSc2018, author = "Olson, L. N. and Schroder, J. B.", title = "{PyAMG}: Algebraic Multigrid Solvers in {Python} v4.0", year = "2018", url = "https://github.com/pyamg/pyamg", note = "Release 4.0" }
Getting Help
For documentation see http://pyamg.readthedocs.io/en/latest/.
Create an issue.
Look at the Tutorial or the Examples (for instance the 0STARTHERE example).
What is AMG?
AMG is a multilevel technique for solving large-scale linear systems with optimal or near-optimal efficiency. Unlike geometric multigrid, AMG requires little or no geometric information about the underlying problem and develops a sequence of coarser grids directly from the input matrix. This feature is especially important for problems discretized on unstructured meshes and irregular grids.
PyAMG Features
PyAMG features implementations of:
- Ruge-Stuben (RS) or Classical AMG
- AMG based on Smoothed Aggregation (SA)
and experimental support for:
- Adaptive Smoothed Aggregation (αSA)
- Compatible Relaxation (CR)
The predominant portion of PyAMG is written in Python with a smaller amount of supporting C++ code for performance critical operations.
Example Usage
PyAMG is easy to use! The following code constructs a two-dimensional Poisson problem and solves the resulting linear system with Classical AMG.
import pyamg
import numpy as np
A = pyamg.gallery.poisson((500,500), format='csr') # 2D Poisson problem on 500x500 grid
ml = pyamg.ruge_stuben_solver(A) # construct the multigrid hierarchy
print(ml) # print hierarchy information
b = np.random.rand(A.shape[0]) # pick a random right hand side
x = ml.solve(b, tol=1e-10) # solve Ax=b to a tolerance of 1e-10
print("residual: ", np.linalg.norm(b-A*x)) # compute norm of residual vector
Program output:
multilevel_solver Number of Levels: 9 Operator Complexity: 2.199 Grid Complexity: 1.667 Coarse Solver: 'pinv2' level unknowns nonzeros 0 250000 1248000 [45.47%] 1 125000 1121002 [40.84%] 2 31252 280662 [10.23%] 3 7825 70657 [ 2.57%] 4 1937 17971 [ 0.65%] 5 483 4725 [ 0.17%] 6 124 1352 [ 0.05%] 7 29 293 [ 0.01%] 8 7 41 [ 0.00%] residual: 1.24748994988e-08
Conda
More information can be found at conda-forge/pyamg-feedstock.
Installing pyamg
from the conda-forge
channel can be achieved by adding conda-forge
to your channels with:
conda config --add channels conda-forge
Once the conda-forge
channel has been enabled, pyamg
can be installed with:
conda install pyamg
It is possible to list all of the versions of pyamg
available on your platform with:
conda search pyamg --channel conda-forge
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for pyamg-4.2.0-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd65f9a992d387de3182d4f649a64a4092ed95b456113ce12315129aa77bd7e1 |
|
MD5 | dbf4d13c8642285763c2f082708ac774 |
|
BLAKE2b-256 | 389ebf0460f16545f73957187b1cd9ddc3ce4351ffb2dc8774046073b8b90387 |
Hashes for pyamg-4.2.0-pp37-pypy37_pp73-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5334b12f72a02898f19b9be921242d572986bfc0df399dd383a8aebf760e633 |
|
MD5 | bf198300681c6d4b34d4f45ff51c12bf |
|
BLAKE2b-256 | 39a20bb2280268180e334c328fa6734b3b85de8c39c6a4205693cab9b9ddabc4 |
Hashes for pyamg-4.2.0-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f234bf129d16e3b44305d6108e2852c6a022481d2a203024e9ad6235d00d6fc |
|
MD5 | 429fbf9b864dda97e3569c7e763d7191 |
|
BLAKE2b-256 | bc5df8622c2f8aaa07ad35336f10c940176b0f629c8a597da57700639336683b |
Hashes for pyamg-4.2.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f966c689102c2e95e3a0f9daf7e29b51b439e32b7c7b56bc4e66bc041fa3e788 |
|
MD5 | fad23bd519b3580a7cbbee8d140ed8f8 |
|
BLAKE2b-256 | 7437ef0b2fd811eafb9957d07bdd142b7dcffa3712d14a208f89e5cfe5328000 |
Hashes for pyamg-4.2.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d8d87372fc7b35faad9f824ac07ec03c8fe8fcaf62226d6f0a6994fee74f0b7 |
|
MD5 | e08aeba7acc342cf25c55f32eecdc3d7 |
|
BLAKE2b-256 | 4b0146f929917389cc911596ed6d7a27c30ffe9f4a5ea143cf6eaac13aa08563 |
Hashes for pyamg-4.2.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57e119238924e934b0f93b2dc237c749fa42ece1ef020b0e6ed297e39f580bb4 |
|
MD5 | c55d8909d1f41f31858d4fbf485a29d9 |
|
BLAKE2b-256 | 7e6cb9f33a04f490c238b5eb8e4d83c3e0ee47398a8947b83c8b12376e3b9b6a |
Hashes for pyamg-4.2.0-cp310-cp310-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23fbeca41bfb951397441ff0470ff545427e8dfa6846370d9e362a5392991db9 |
|
MD5 | 628599df4d2646e24ce84a965069d185 |
|
BLAKE2b-256 | 4259ff27d90e41acedbd839bc5d972f1c8dfc9153d2599af3bd1b4ef568e9448 |
Hashes for pyamg-4.2.0-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2079daa3164e3efcebd1cbb20ad3f82fc0064fa54682343cb36373d9d40ddb55 |
|
MD5 | 7a53749864a043e90576315fd5b49c8d |
|
BLAKE2b-256 | d5f419f56964706473cd97640ee875917f4ca3827ee5aef235555f99567f32fe |
Hashes for pyamg-4.2.0-cp310-cp310-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 84b941963315cb70eb580137ab13b4f8cd72ced72563aa7890ff0b8058fd8fe3 |
|
MD5 | 18935aafc93178343f5106de6a894c3e |
|
BLAKE2b-256 | 91a1524e42694b14e68f5e83a0be13d517d30d1102659901a4f25a21ee32ca3e |
Hashes for pyamg-4.2.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 618a7afd44ff88909e0e9172c8303b9bea6ebdc55c4a679a25fe182951c95fbc |
|
MD5 | 6a15188b9531c9d847f219793b5e6fc9 |
|
BLAKE2b-256 | 1bc46031366d4be02d81b7798e7a74231678e666c54fcfb28f8a8d07a4af5bac |
Hashes for pyamg-4.2.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 377c1f16fe08622281f3030afb83563572284be20ed1bc45f85aa95d48aa9d8a |
|
MD5 | 46b034a005f35c4155634ac5118318b1 |
|
BLAKE2b-256 | 403942ecb276f230230361f6719f0f03d6d44425d8d8102421046f96cbcdb373 |
Hashes for pyamg-4.2.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec50b4153251029fb9c16c4600bed08e8da9e8dc3bcdeb54ef79696b0d3db07d |
|
MD5 | bd9d1ad1b6b7a9eedf3254022aa50c5a |
|
BLAKE2b-256 | 68beae84d86ad20bdc89d7685bc60017966b75127a468f4ba73817d56e8f44e7 |
Hashes for pyamg-4.2.0-cp39-cp39-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 243a508634b092957481db2486cbe1a295f62eb89b10471acb9455bd98e8a809 |
|
MD5 | 2b80db38c60dafb601de3f9cb83456ef |
|
BLAKE2b-256 | 70f9293180c9fdc1f24e1902e4e0de23fc7bedfc039a223ed0d51995bd090ff5 |
Hashes for pyamg-4.2.0-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19780367d9d8a68fc73345b4a9d67a402e71d5572f2aa740b0a50c3cd8463731 |
|
MD5 | 9c81f76363a893f7b6f03a501415da7e |
|
BLAKE2b-256 | 069ddd919f6f2d0bdfa9152d37fd19ff1e92f54802f60e6e09d44c9b7c2739eb |
Hashes for pyamg-4.2.0-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f92d50dc4d0ad5afd450edbc144a734b2e8b0a89e189a70a8ea04eb6ebeefef1 |
|
MD5 | fbd0958e7f936b63ee7517ae35282b44 |
|
BLAKE2b-256 | d27f4015ddac907567d5a5608e52647e3909504ab8e24d952a54cd6394878c8e |
Hashes for pyamg-4.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 284b9da2166dd7e8a9f864f06cd2bd137d3eee5474bb521e562870f066a760c8 |
|
MD5 | 33b2de681bcefb95f4081967d87c6162 |
|
BLAKE2b-256 | 13b4407f32f7bf2d951ca37bc5d8267db4f2694e1e61cf0bb4228e4b91d3cca3 |
Hashes for pyamg-4.2.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80702f7095ff209bfb7a7302b2352e6037d418f6babd7bea65de98b35b83d933 |
|
MD5 | 36db5eca8eec75975f4fac950fd57d70 |
|
BLAKE2b-256 | 9ef61053a65206a1b6443c755fe19c170209075cb0c81d68f81abf7ddf9331b9 |
Hashes for pyamg-4.2.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dc3c46b1a23887f32a0c3b4a96bff2abb26a46aa3df0a35d695ffbf05d32339 |
|
MD5 | 1640bb8fef293e82dbc0219bd218707b |
|
BLAKE2b-256 | a535aec136801385d68fb11f48ec07724e57fa6fcc85dc11d80beb1f5ce16109 |
Hashes for pyamg-4.2.0-cp38-cp38-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 707489f3912abf3d1289923bd0a5d43ec471a54525d90bcb84abd17685a6297b |
|
MD5 | 5342ef444f1b4e4a0defe95c8560a422 |
|
BLAKE2b-256 | 216bc807fd90d6d0d3f38745c11e2f45ad93f74952197dd8c136b7117dfcfd15 |
Hashes for pyamg-4.2.0-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c52e599471b3e90ba6c1b548e3a52daeb6c87ead35e2e88e8e56d603109d3af |
|
MD5 | 6ddf3b5083036abd14e7ce34b286db3b |
|
BLAKE2b-256 | 1bf24505f073d3ed06fa77a58d8c0e2f195bb668d6f5a6ca611ace65337f1175 |
Hashes for pyamg-4.2.0-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7000ccebb2a2e23cb4a7479aa18aa43d83c177181b2fdee611f218b8b6cd4bb1 |
|
MD5 | b84612d9ec7fdf5386d584646d986470 |
|
BLAKE2b-256 | bd61fe3a2fdc05a8a67987b44145706d2a5e71d5e4943fa216eb1a93875b5048 |
Hashes for pyamg-4.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 685010396737e7ae073b681f8481ce4db33428e82219ba311fc01fbd00c5e864 |
|
MD5 | 63d30603de5c3e5cbdcde03abd5b22f0 |
|
BLAKE2b-256 | 90260bc66de76bb9ba42e93ec29ef137deb446a420a3dbb654ec0b7a39df12ab |
Hashes for pyamg-4.2.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d7823a968b8a0911f901bd899371bb82778918d157a12f1a3330fd87b59e514 |
|
MD5 | 74c440c0aefacd8606490f6dc91ae7a4 |
|
BLAKE2b-256 | 5e33c88dbbb6374b9ee667b3ee1b23ce893732b9cf62a3fd63c0a496c82cdcad |
Hashes for pyamg-4.2.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9c0933dd097a0f819b55b6eac009b236ea709e4696d00460ce39a20fddf07444 |
|
MD5 | 229e48ff6f601f487d69304115eff8e1 |
|
BLAKE2b-256 | 6d7afbb9640d01e2a98759ebea3b1e2aa793c1bccf1c70edf4cb7f9faecabaf8 |
Hashes for pyamg-4.2.0-cp37-cp37m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ddeae2261280011ddbffc8e1a1c300dc629c4f4bd49d8318a77aa2ce35785be |
|
MD5 | a9d962611bb8ad552deb0a2ef5bf6d47 |
|
BLAKE2b-256 | fabaf2e3ddada173c838454c842f367817421382447857c764c084e94a6e23a0 |
Hashes for pyamg-4.2.0-cp37-cp37m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1fc053a746376f1e360c7770d7ba1c7a856362828ccc42f9cc64c985ad7d241 |
|
MD5 | 2f9581fe802b11a7cca01fca1580522a |
|
BLAKE2b-256 | 9c5c132d65dea57bb20bed850d01869f90ae287ce7ecb9041542dd7756f6b66b |
Hashes for pyamg-4.2.0-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7ebaba03470d17e3c7bbf3d2bf449241f695dd35211d7dc66376f3768b5e56e3 |
|
MD5 | 573b1b21c59974f1b2a1d74f2a2bd904 |
|
BLAKE2b-256 | 46ea7779cffff1a224bebd51a8ad12dade39d7324bd21568cb05c72c96fbfc83 |
Hashes for pyamg-4.2.0-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc0210a7d90fbab51d5caa6bdd747c0234444191c11328e6f555d3db4ade8e86 |
|
MD5 | 08f22b9ab3d6659829aa055e4999cb2e |
|
BLAKE2b-256 | 8ed7a8d07f267b9e1f31faf1be2b2aeb919cf163768ab79cef05ddebdd5ee303 |
Hashes for pyamg-4.2.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a2d6df6e9b4326ef62faeea382ece0a5e711c9a28e6d5cdd7b2e843cc54352e |
|
MD5 | 2ff9d74b0e3337f717df2759668697fb |
|
BLAKE2b-256 | 29bacd60606374b2f56651d93806daa6eae82e16d330541e46121801a13307e3 |
Hashes for pyamg-4.2.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e0adddec4a44312f9a8edd85151560c789d23d0435b8c197c6039d9ebe094c96 |
|
MD5 | f7453a1846c7228d5d608f0f7995b886 |
|
BLAKE2b-256 | d7d96cd226eb5b41f03fcffb796dfd0b88708ad6ae697170a07fc2eb60cb5c29 |
Hashes for pyamg-4.2.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0fc77c266d5005fa6988e498c4f713c01b92c0286e8fee746a3046df02be7d8d |
|
MD5 | 2a73d958cf5dcafacb605a62bd20b75d |
|
BLAKE2b-256 | d7b8d6d5df9371be5814aa218e54837a7c4b3c292948a8089fd9761b4aadc595 |
Hashes for pyamg-4.2.0-cp36-cp36m-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a5ce63bf96d97e55d787522159f1343f555dcab244f3f6224dbe0ba9f65851e |
|
MD5 | d0544691e1129f38de573288a4a6cc42 |
|
BLAKE2b-256 | dfa3eb59d7a995cf9f603baaf085afe0a975b99e5ff659db87b2fd1e84ae2846 |
Hashes for pyamg-4.2.0-cp36-cp36m-musllinux_1_1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b106549c9f61f292d7c90f929f651aa2bd99d259a94df4f1eee4821380bccc1 |
|
MD5 | e72da617abb7c255cd3907fde418014e |
|
BLAKE2b-256 | fb7a696523d4aa816d06a450103e9344d8b0ce8366f402850fa6f911efe0ce3d |
Hashes for pyamg-4.2.0-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f60c18c9a78aa5ea9cb3d812395abba72acce6fb4c92b3f6e0a07198a25825d1 |
|
MD5 | b163bab7d6ba7155f1ad6cfe40db9590 |
|
BLAKE2b-256 | d04683048fe45c43bb26cb8a130eb6dba296e1ab03d8e131ea10077c2a28aac6 |
Hashes for pyamg-4.2.0-cp36-cp36m-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 975fd2709ef86951f48ee4dce8675fa8640896ecb25453e388d00eddad491e11 |
|
MD5 | db734ee3fa4fc62f5b382e7683c7c42e |
|
BLAKE2b-256 | ea60b968c0db170145a9f66ab1e977ea4d451cfc8ae95e50bfa65f4c6e5d603a |
Hashes for pyamg-4.2.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95e53c65894d1e4eac658ee3257b5a760a7863dedbe4540923d2c21d875faa22 |
|
MD5 | 665d7afc04fe04c30b4bb59be8d69300 |
|
BLAKE2b-256 | f1c7d7f0a8492aa787259ed2b5a4e43e11676b115ce68440fa2dc26dc65fa5c8 |