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 (2.7, 3.4-3.7).
If your system is not supported and you want to have the Cython routines of pentapy installed, you have to provide a c-compiler and run:
pip install numpy cython
pip install pentapy
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 - 2021
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
Hashes for pentapy-1.1.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72cf69a7ae55229708f691a07f28fbde0131e1f47734e5099ee73b74759bcec0 |
|
MD5 | 7520043cc72cfe1792f72d35dd054b15 |
|
BLAKE2b-256 | 4e37c6bf867f099d2871394e61f42b2440b7310e6056895ec90b774bcda4277e |
Hashes for pentapy-1.1.1-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66dd4b29f43c57bf3e683c19cac2d401be6fd0b0b8678f0e7c88065f4e51a4cf |
|
MD5 | 09bf8728baf852934140e6276d770e41 |
|
BLAKE2b-256 | a003a8de1882b358f9f7a44ae2b293f6dbc4bfd9f29d114402b2cd055fcb6d90 |
Hashes for pentapy-1.1.1-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce2f1c9620b3c321d55368a30e10bb85ec17fa332b1c8e8affc6df0b7bee916f |
|
MD5 | a025162631a7019bcbd7cda754cf0229 |
|
BLAKE2b-256 | d946702b8ab3b44f2f96d77f18d446e50f152514344907ee9d2b6418a2c70ae7 |
Hashes for pentapy-1.1.1-cp39-cp39-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69ac32b82efd37b97872129c3554ea650daa13de1f5617125bceea215bbd5a87 |
|
MD5 | a0b2d4cd5b94247e76b0780ec7515d67 |
|
BLAKE2b-256 | 56e1e641b0200824859388501d4c405289409e84bc168c48d49744dd66da6495 |
Hashes for pentapy-1.1.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1cad2fd291cf2d40f7f68227f0d7a966a60f328fd740be242ae0299ed78f2b01 |
|
MD5 | 190716e80a8dcef47466395bb6ed982d |
|
BLAKE2b-256 | 19e6b4f9ca748d9c17ecf01bb07d3ab56035cba89ff33c2ad93acc43c0b69c9b |
Hashes for pentapy-1.1.1-cp39-cp39-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b91a96c33f5241fe60e7bafad6dec9018659e4dd502501bcd5bee994ca97ab5b |
|
MD5 | 73972f700609b71eb5a0e0ef52fa0859 |
|
BLAKE2b-256 | ee4958276792a9ca16c8a8a649022f20d6ac15fbeadad6727eeb863f4e9b71a2 |
Hashes for pentapy-1.1.1-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd58c85cc2cdf7d67fe20eb9295414513539f0ab2a3e984b0d73eee19a0072bc |
|
MD5 | 7e0f882fcebfb6d13d469199893fdb3c |
|
BLAKE2b-256 | 4ba6913fb283b2f4ed4c6cd90c17cdabb0128f377be3c426f9d010ef00be2699 |
Hashes for pentapy-1.1.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 415c0b326136f0b334d8b9f8e63902d13cca50deda4976f12a11689e7e766a19 |
|
MD5 | 1738bad2e6adf1a09afaa23043594109 |
|
BLAKE2b-256 | e42aae619d0fb077cddeb753f169f7f56795524f01bf68091048f278c2690406 |
Hashes for pentapy-1.1.1-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3bf49c6eb1f60a0b4b068dba13e450a45fe8d0ca4b3325ee1713ca2062373eef |
|
MD5 | da3e876c3b192d94cf9312fb04f8f27a |
|
BLAKE2b-256 | b8db1ca957746d62c12933e071c2c5dbbfafecf943a5951dbe56b502193ecc10 |
Hashes for pentapy-1.1.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d23decf37f41122ae0e5b3b8fd6ee1796f1583b6a6b4317d49c8609094eaba54 |
|
MD5 | c7f461b4846af223c96303f4a20a79d6 |
|
BLAKE2b-256 | c8d679760c6eeb617ba8ebb5aaf0360be149f1a96f62bb002284e6277a6944a7 |
Hashes for pentapy-1.1.1-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2015a072221e2e392f4a75073ce62ebdf9d924debddf1a1b08dee3a3bbcd103 |
|
MD5 | 28232caf5b633f9758124c2f76613eff |
|
BLAKE2b-256 | d332a91b96202fa112a4ba6003dae647a485c1f1182964542908863dec81eaee |
Hashes for pentapy-1.1.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96910bf4f3e1bd53305380b5a32ebf4ac6501626ba5613e4379303f0f13f6f91 |
|
MD5 | e790baa67652a2780322991c1488e5e4 |
|
BLAKE2b-256 | ac47351efb400618cc196143f65a4d211539ad26183774015629618a964195dd |
Hashes for pentapy-1.1.1-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64295a427ff5c1761c996a9e7ce4c4d822d31b95948a4cf9acbfcd5b8814c3e9 |
|
MD5 | 5e6a04502f7b59563b53da8ed9652d65 |
|
BLAKE2b-256 | 79ae1e4bcbf77f2db6833ec9a40eb41d167c91e357ff8c864d8e2c151312ee9b |
Hashes for pentapy-1.1.1-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73a78d9cb40fa6287e24f45d4be1110418e25e5c60e4c960a2dbc14da02aa80 |
|
MD5 | d29f6149ac18418ab43e147204ad93c9 |
|
BLAKE2b-256 | d394ad70d1b1f24aec30a23f7fc07163daffeaceeff00c85adb74d8d8ca5c26f |
Hashes for pentapy-1.1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d749eace99d58f1967948c12591e5157aafeafa5093800adb92e4c8cce91f62 |
|
MD5 | d19e6f7324ecda1f7c97a67e1f3d390a |
|
BLAKE2b-256 | 99ae4a6c9971be6487317f7be31c3dc8920e0d82d1efcbe1c9573ed37e7e188f |
Hashes for pentapy-1.1.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e4695264fefd96d53c6b0723f10408a7bd64ac41b53801f070a2eb5b451f29bf |
|
MD5 | 88c1919b0443d8b9143590933b5aadc8 |
|
BLAKE2b-256 | 2c3649bb318d62a65a73f34d2e365ecaec53089530b22630f5c51b72b9f7977d |
Hashes for pentapy-1.1.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8f1f0813feaa4ec15b22c7216250ff33acb13290cb11ba27d5afe93d11db02d |
|
MD5 | a6c588c3c8296966591ee60dfc901858 |
|
BLAKE2b-256 | 3d2bca82f413783f4c4c0d76ac08553bfa4db6843dabe8d86f867fb2865baa91 |
Hashes for pentapy-1.1.1-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57e2fceb18d4baaf214e3b8d8d32849e67c507b9462db90271b49549bd39578e |
|
MD5 | 0592b3cf4d73550fc43f5e251c5a1249 |
|
BLAKE2b-256 | 927c9be754619cbcca947479c2cfd3870bf9675ef0e18621aeb9d2a7cf97d8fc |
Hashes for pentapy-1.1.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7bf9e3c7d8b94b46ad8d93d0eb683f6d0f90559ab8defb806a6f4bc301e88cd |
|
MD5 | 701f9c2e3d6cedb0102a55982f8fe4e3 |
|
BLAKE2b-256 | 43aadae359d7e4a8f9d28cf3e47ea3b18d81809b4c60ec392c35ab2604cb7d57 |
Hashes for pentapy-1.1.1-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52261b8a3c17b39551ce7e28b6dc0d965071121e76e73c882708a9f3dd1b5d71 |
|
MD5 | f96d3e22a8929be41f0bc226edf21f0b |
|
BLAKE2b-256 | 1471b49e33f1354b157379e33aeab49f9dc974d8b5d5aff669801629f139ba46 |
Hashes for pentapy-1.1.1-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0adc52a93159e79a28ee0c4fe43e7f7d01d5303f289c505dd4e0db844752c78b |
|
MD5 | 1acb2310bc93707735a9e2e401effdee |
|
BLAKE2b-256 | 30e85afb261ba7c705bbf29a79f48f4a9337afb8c674bfef1518bd64e402d129 |
Hashes for pentapy-1.1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54a33680789826165bf73acdfcdf5650d8da7da6f7ee7c22bc7b6b653c5dc48a |
|
MD5 | 8df421a539b56a9c7eb253bfb3bad5a1 |
|
BLAKE2b-256 | a65e856a2f8667b37c970ae58ccaaa1d625b2ba4bf3bbd34ed2d6191b94209bc |
Hashes for pentapy-1.1.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 895346440e9ca4fe9b8897ce631854970eec8a1b32a8cdee27f6b8d86d59742e |
|
MD5 | 1a317f096601737db47086d3a940d11a |
|
BLAKE2b-256 | 204bfcaca566e26fcb309020467c6a7f339184ed146d67a5121a17670062717a |
Hashes for pentapy-1.1.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9475d8a9ca339470aae532211180d51ac08aec08f67667f81410ea9fe7012aca |
|
MD5 | 84525374a10a680d9ceaf65735dddbf5 |
|
BLAKE2b-256 | 5df42e4bbfb060a4d57f25e7d3b61ab40f64515d604eafae3070a6a89eb27182 |
Hashes for pentapy-1.1.1-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccf368fc80ca19f18e1b08981e0615f1296e6f1c09cac400d4d31b52615b9477 |
|
MD5 | e93e65df92ce9e2fe17339f5fa5c10bb |
|
BLAKE2b-256 | 61f4d1207a5b821498b5188ce36b31915269775c0e26910210649d0642bb3afc |
Hashes for pentapy-1.1.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d0391f34b0b1f4675cc46b7c363f5375ed7e99bf8029f95b01b8c29bf9f21af |
|
MD5 | ec43e63bc989dc15f3695f2451fceb1b |
|
BLAKE2b-256 | bebec16b4e7410568379b6c6146f299eb2e0afbb807ce1a0531d581bb9f237a6 |
Hashes for pentapy-1.1.1-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cec7287ee0e68f832ac0a2bae153cb70f73e2fad93e73ca6f572bdb0351cc4a3 |
|
MD5 | 5277cb0fb4617141e95942d8ea0b0058 |
|
BLAKE2b-256 | 32b645f9fb6e886509b20f8ba444abec4199c5f7a22d3ef8febf2f64b01d5644 |
Hashes for pentapy-1.1.1-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc9fd16df8a353fbd4a18ccc9243d3e2c3c38661b8917d78e9d651f40a6b2a6d |
|
MD5 | e5e94d5a84c5758a30a81cb3eb801ea5 |
|
BLAKE2b-256 | 64ef6c8dbcd76dce5c8b107be929e18469ce52229eb38fa690bd90d420fa3e6f |
Hashes for pentapy-1.1.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bc41ab371b43a175ebe83a025f74fb3f33f48c21e3717e538d74758fd75d2c5 |
|
MD5 | 00078a4c9994fa1eb7fb3c9a33dc7edb |
|
BLAKE2b-256 | 345d85bcc4ecdbf1b5b33daf9d1d001fb8e05ad9e2d008d8283fbe2bfb227532 |
Hashes for pentapy-1.1.1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 151091c166b0b7df932fb77566cf83a8fb3df78a26016aec32ca602d26fd777c |
|
MD5 | 5c03d460f7e4e0d186b6ff848a7c1b9d |
|
BLAKE2b-256 | e413b9d4b49f79a577fe4ecfe6048c589bdacdbac0de4f181ab1330d039e2b74 |
Hashes for pentapy-1.1.1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 41ce181b67970c9b0304414411c2ecc3dbff69ef91de2f149c7d48f7c4584fe4 |
|
MD5 | 37526cc0a71ca413f100ebe770523b8a |
|
BLAKE2b-256 | 00d2f9d9c815d70cb729f1fae8e05a20580ff5cc0628023e21a7399a65c33571 |
Hashes for pentapy-1.1.1-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b835abbb744726c11281aebb1a8cb8ab66412aa0dae3abb98bc2ad4f8527ae4e |
|
MD5 | 2668a76ac480f618fae19897b6e2f324 |
|
BLAKE2b-256 | 55111c9f281e8e4a5789494655c5393489b44209383d4af03b4e1868bc4eddac |
Hashes for pentapy-1.1.1-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 120083d9548b5a2928648c07c6c864681e2575493a407d3b83a99249b87b6a25 |
|
MD5 | 08444148b185aaa90f2e7399f5065909 |
|
BLAKE2b-256 | 4a5b26c3992a80efe089d518b723fed0a062578f75b4f82c03006cacb9ecd27e |
Hashes for pentapy-1.1.1-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 668275856dba8a0eecb25298f9be48382068b7ea8edd8399008822464823dcfa |
|
MD5 | 20ec4532aeb0fd1686268400b599b1fe |
|
BLAKE2b-256 | e5fc7bd895a1be0dcf84c603420ee4546bf854534b8f719d2f50f49cf8f0c698 |
Hashes for pentapy-1.1.1-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70ea3fddf0a866c62b81d7ae7c09646a8681ce7a9c4696781d33dd4668595f97 |
|
MD5 | ba69d1a9477991948f0d9113116ffc9d |
|
BLAKE2b-256 | 31b949395dd06f0597e0925e0fa27a8632cecdb009ad373014f3e3d56c2a5f05 |