pentapy: A toolbox for pentadiagonal matrizes.
Project description
Welcome to pentapy
Purpose
pentapy is a toolbox to deal with pentadiagonal matrices in Python.
Pentadiagonal linear equation systems arise in many areas of science and engineering: e.g. when solving differential equations, in interpolation problems, or in numerical schemes like finite difference.
Installation
The package can be installed via pip. On Windows you can install WinPython to get Python and pip running.
pip install pentapy
There are pre-built wheels for Linux, MacOS and Windows for most Python versions.
To get the scipy solvers running, you have to install scipy or you can use the following extra argument:
pip install pentapy[all]
Instead of "all" you can also typ "scipy" or "umfpack" to get one of these specific packages.
Citation
If you use pentapy
in your publication, please cite it:
Müller, (2019). pentapy: A Python toolbox for pentadiagonal linear systems. Journal of Open Source Software, 4(42), 1759, https://doi.org/10.21105/joss.01759
To cite a certain release, have a look at the Zenodo site: https://doi.org/10.5281/zenodo.2587158
References
The solver is based on the algorithms PTRANS-I and PTRANS-II presented by Askar et al. 2015.
Documentation and Examples
You can find the documentation under https://pentapy.readthedocs.org.
Solving a pentadiagonal linear equation system
This is an example of how to solve a LES with a pentadiagonal matrix.
import numpy as np
import pentapy as pp
size = 1000
# create a flattened pentadiagonal matrix
M_flat = (np.random.random((5, size)) - 0.5) * 1e-5
V = np.random.random(size) * 1e5
# solve the LES with M_flat as row-wise flattened matrix
X = pp.solve(M_flat, V, is_flat=True)
# create the corresponding matrix for checking
M = pp.create_full(M_flat, col_wise=False)
# calculate the error
print(np.max(np.abs(np.dot(M, X) - V)))
This should give something like:
4.257890395820141e-08
Performance
In the following a couple of solvers for pentadiagonal systems are compared:
- Solver 1: Standard linear algebra solver of Numpy
np.linalg.solve
- Solver 2:
scipy.sparse.linalg.spsolve
- Solver 3: Scipy banded solver
scipy.linalg.solve_banded
- Solver 4: pentapy.solve with
solver=1
- Solver 5: pentapy.solve with
solver=2
The implementations of pentapy are almost one order of magnitude faster than the scipy algorithms for banded or sparse matrices.
The performance plot was created with perfplot
.
Have a look at the script: examples/03_perform_simple.py
.
Requirements:
Optional
Contact
You can contact us via info@geostat-framework.org.
License
MIT © 2019 - 2023
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 Distribution
Built Distributions
File details
Details for the file pentapy-1.3.0.tar.gz
.
File metadata
- Download URL: pentapy-1.3.0.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46e1d9b13bb78d51f754f30bfc819ed784346205f10d2a5b44b52b711a7b6e26 |
|
MD5 | 79bb1c275d787794ca61ba03410a612a |
|
BLAKE2b-256 | e745aca46b729a0857b52e1d52c296b2637cdb6de96398d9f0496c9a73aa6b25 |
File details
Details for the file pentapy-1.3.0-cp312-cp312-win_amd64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 85.1 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ddb3f7ceb0f60b2c52d13c46604ffb23cdd1a1ea704f900dbf37384b3b9796c8 |
|
MD5 | 2f5507baf456bfb6fdcb75cb83c41cd8 |
|
BLAKE2b-256 | f0d13b3e5c050973e4d382c7158f79d0f3cabc75e09389bd37d8754a9fe16ce6 |
File details
Details for the file pentapy-1.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 502.2 kB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3deef1347b5342825bc5e4685e59ae6c90930b1812b3b1025e4e42c7a359cf86 |
|
MD5 | 8386dd3aa8e21daeaf7c508be270c549 |
|
BLAKE2b-256 | b349c67327f29b65b1022f92b2b1b849aa26928c32af1187b2d26b542fd6aa8a |
File details
Details for the file pentapy-1.3.0-cp312-cp312-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 88.9 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81c5d77e9cb43faddda149587ff44a4c4f321dedb4596cb7a4d57eabc270a64b |
|
MD5 | 04a3e376912f86e1c5c6b46c7a8c5855 |
|
BLAKE2b-256 | cf957534c97a84fd39ea7c8c1b7074c43ad6fa5f358d125708b1750d15c7ee8e |
File details
Details for the file pentapy-1.3.0-cp312-cp312-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp312-cp312-macosx_10_9_x86_64.whl
- Upload date:
- Size: 94.7 kB
- Tags: CPython 3.12, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ac78bbde496cdb98ed04e16ae138f9cd46fec806e083daf8361864c3feb7b4a |
|
MD5 | bd25073a018e87b0473217181bd5732f |
|
BLAKE2b-256 | 063722d04f2e5e57ecc8c41e51b3149b039a0a35875f97a1e46aea57802302a4 |
File details
Details for the file pentapy-1.3.0-cp312-cp312-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp312-cp312-macosx_10_9_universal2.whl
- Upload date:
- Size: 174.8 kB
- Tags: CPython 3.12, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7b34d08780d562d877e571fc65bf53ddd431ca4a6a8a503d0a68f42c27cf1fe |
|
MD5 | 7655aa2445bf80849c3acf091ffdbf3f |
|
BLAKE2b-256 | 98cda42e20b8ca23dbbb0f30f63288520e6e9ca01b7152318c80f2eb6432dcdd |
File details
Details for the file pentapy-1.3.0-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 84.9 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff73775ac0002f6f062bab629db0b3b07ec09c40a6b38e80c169059876a97ff3 |
|
MD5 | be1b84f8b0f46352e27a8dc815d461cf |
|
BLAKE2b-256 | 19e50272502f99a78f3f23ea232fc0475424991abbe33a47d88d36eeeb81c0a1 |
File details
Details for the file pentapy-1.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 510.7 kB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f63dbd36c09f0b8aa0f4f5f51beadc9d8759502b97407e426d1636d7ce2a1ef8 |
|
MD5 | 539f73584f0e0c6d53c49413095d6d73 |
|
BLAKE2b-256 | 6dabf6bb8fa2b44fc1d8ab4c4c8286e5ccc68fc9e2ca2aa6fcd43a8f2a939111 |
File details
Details for the file pentapy-1.3.0-cp311-cp311-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 88.3 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0259635a88569939137e676f6ae5a45b580529c956d2d7a1e8e2affffa591e09 |
|
MD5 | 390d7bdd86764b138946ab47adaacb39 |
|
BLAKE2b-256 | d6240d86371cb43e1fe69293256485463b1f1172b8709e1caed1bdb8e315b4ce |
File details
Details for the file pentapy-1.3.0-cp311-cp311-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp311-cp311-macosx_10_9_x86_64.whl
- Upload date:
- Size: 94.3 kB
- Tags: CPython 3.11, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b120afcc195c530d6cbfffe81cc820c3f8c6bfc689753e7ba2c1bafcbb5b8fd |
|
MD5 | 859b9b8085461c6239638709ca3bef0e |
|
BLAKE2b-256 | de1fbc947fa096124727067ff8d33a81fcbe9339df22530bc5599499b223081a |
File details
Details for the file pentapy-1.3.0-cp311-cp311-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp311-cp311-macosx_10_9_universal2.whl
- Upload date:
- Size: 173.9 kB
- Tags: CPython 3.11, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37b147100e3ad143c4c309ea21287cdf1a9621d3db4c6720216ec43d5d6608db |
|
MD5 | ecef869cc463a19e8f7266aded39e9d1 |
|
BLAKE2b-256 | cae29847fc1ff9b41c8a4b8d9f8975f8be671c77129759c31ea8f49e1f03e729 |
File details
Details for the file pentapy-1.3.0-cp310-cp310-win_amd64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 84.9 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeb91e415ab3db0265b80b8c343b75acbf5f36893322e668a19307bd044fb968 |
|
MD5 | 0a42acd6943315ecc35fa5732f2d0952 |
|
BLAKE2b-256 | 2b0a860bbd84f6f5e9a3bfa4d7a283ae2082d68d2d6a027c2ac24449ac8cf6d0 |
File details
Details for the file pentapy-1.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 474.3 kB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a30065f8c3847386dc34de5d5ea83dad0152cfdd95fab8b8f9c4ec78630983eb |
|
MD5 | 1d9416137dc759407d55b7e44d2aa45b |
|
BLAKE2b-256 | 287fd3fb866714dfed9e7ca3f6033502118e385da3bc1faaacbc39b4f61d85a2 |
File details
Details for the file pentapy-1.3.0-cp310-cp310-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 88.5 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b8b8d3dc78ae7e526f32fbd631cfdbc4499c46eda1241bfd74c17689dcaaf3e7 |
|
MD5 | a0e8334b9a9ce075a7f987f4c08171da |
|
BLAKE2b-256 | 0cd85f70c1880a45ff7089c5938c8fd484d75de280eee2c16b0f3013d881a7d2 |
File details
Details for the file pentapy-1.3.0-cp310-cp310-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp310-cp310-macosx_10_9_x86_64.whl
- Upload date:
- Size: 94.5 kB
- Tags: CPython 3.10, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b26b1e536023329d520490ff999fc7c38b2d247fd706d8c393b5f01c0263d9d0 |
|
MD5 | 005c3c5e7c9f94bcc05a7e8a09802671 |
|
BLAKE2b-256 | 20c5812f4f4fac703ff1499f6da0f4d45129988d4c9537e65705d25b87bdf2d7 |
File details
Details for the file pentapy-1.3.0-cp310-cp310-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp310-cp310-macosx_10_9_universal2.whl
- Upload date:
- Size: 174.4 kB
- Tags: CPython 3.10, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9eb6776f153ab235c2728993ff994ce11cd198bb6d8b533355de25f3c623662f |
|
MD5 | d544c243e9867ef90f8073a5a5974648 |
|
BLAKE2b-256 | 4c350818e4948e243bcb41e207e38e3948f0a9491cfd25b3f9802980fca4af78 |
File details
Details for the file pentapy-1.3.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 85.4 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aba4bbb264c4317ce9cc30cadbd5389b7002d6a442b42ed9e239300cc56434f7 |
|
MD5 | 1a4226f33b5e382c04183b055d6b29e9 |
|
BLAKE2b-256 | 7b2f6b0fc47065d18cb7dba3a70bcd18571343f5f7e8d483557b289500d90936 |
File details
Details for the file pentapy-1.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 477.0 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46363459ead194d13519204d62463273f2db16e6baf418131e74a377fa6cfccf |
|
MD5 | 10b9553edfa91da3c8b21889d91a02c8 |
|
BLAKE2b-256 | 17f86eada520183773a551d9f4629793153506330f7330c2fae0379a0a29051d |
File details
Details for the file pentapy-1.3.0-cp39-cp39-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp39-cp39-macosx_11_0_arm64.whl
- Upload date:
- Size: 89.3 kB
- Tags: CPython 3.9, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bd1af071af2febf2491e71e796061c48ddc8675cdd827907c18600bbcb2e7bb |
|
MD5 | 01aef5d9105b35dc83bfe08089622753 |
|
BLAKE2b-256 | f454e7381dc0cdeb873082305cab2e2cafdd0b22d58ce11db339bf6c5285b7ec |
File details
Details for the file pentapy-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl
- Upload date:
- Size: 95.2 kB
- Tags: CPython 3.9, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea1adaea9afdb18ff577ba587065b67794cd5cc4e4f13a45474917173ab952db |
|
MD5 | c68a2e168a748111ac6f81124510a8e3 |
|
BLAKE2b-256 | c1de5dae3452ad347706e757d17a7b5c3d0bd06becc6dc797be561d0f9498e8c |
File details
Details for the file pentapy-1.3.0-cp39-cp39-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp39-cp39-macosx_10_9_universal2.whl
- Upload date:
- Size: 175.8 kB
- Tags: CPython 3.9, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50ee2c428fc05841391e072062411ebf95c4d9a1a15058141d7bc1bbfa967402 |
|
MD5 | 4b5fa02ccbca9a8f00e3f507243fdcd2 |
|
BLAKE2b-256 | 7c460f081fe538c99dab095f2f8d1fe20e7cf5c2c747c3262e1919640b0d4344 |
File details
Details for the file pentapy-1.3.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 85.3 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f008e131c1347da2cdd3e60039e269585759202d45d44214c12e210fe7ff48c0 |
|
MD5 | b344f3b277b078354f2087ba34efa312 |
|
BLAKE2b-256 | a4c27c127d29608b9e691553bc0b72e421bb84f175e9424c5aa03c0995f1707d |
File details
Details for the file pentapy-1.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 484.4 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80a6cb7f65d423e2e50f3012f4b510dbd569b8c87b6ec45447953c8025f0762 |
|
MD5 | 0cc59a597795027eed606f83419f5cb9 |
|
BLAKE2b-256 | 2239f889c8db80b22c88db203aeee0a6c154992710bcadfcf8ba81cb3de08e17 |
File details
Details for the file pentapy-1.3.0-cp38-cp38-macosx_11_0_arm64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp38-cp38-macosx_11_0_arm64.whl
- Upload date:
- Size: 88.7 kB
- Tags: CPython 3.8, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18fa7c686329ec5415500510be943756955d2629f5f47c4028fde3ea892fb507 |
|
MD5 | 8f55a0f0f9d923434ab53dca52bc5711 |
|
BLAKE2b-256 | f4daba54369d2dd85e5c26680f69173640734d65289197b2b9960e8fdf80c893 |
File details
Details for the file pentapy-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl
- Upload date:
- Size: 94.8 kB
- Tags: CPython 3.8, macOS 10.9+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3dd5863c84769f3de02c68cc6f8f482b1e0d9ba7637bb4042e704341bfa7ddef |
|
MD5 | fe437a68f16db95556fb22382b6b0458 |
|
BLAKE2b-256 | 294314b40ca93ce3ace71dfb93b209c33d0538c9fc71d8c6fdfa0d6535250814 |
File details
Details for the file pentapy-1.3.0-cp38-cp38-macosx_10_9_universal2.whl
.
File metadata
- Download URL: pentapy-1.3.0-cp38-cp38-macosx_10_9_universal2.whl
- Upload date:
- Size: 174.7 kB
- Tags: CPython 3.8, macOS 10.9+ universal2 (ARM64, x86-64)
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.12.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 663e3525c815787c2cf9d0fbbc54567a6b9fa2c52816abce24bc5f43ceab8590 |
|
MD5 | 3dce1eb3798f4e8934448ce18260540c |
|
BLAKE2b-256 | 4eb47f2db7d8d3376065e2f0ee1367d375807082cd6d1a351d98111d55f21260 |