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.
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 geostat-framework.readthedocs.io.
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/04_perform_simple.py
.
Requirements:
Optional
Contact
You can contact us via info@geostat-framework.org.
License
MIT © 2019 - 2020
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.0rc2-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c854913997c35d5851da81b39e007990100e105b7211ca71a6d3054ea2999083 |
|
MD5 | fe218a04a84bf4076b29296f17ed2fd3 |
|
BLAKE2b-256 | 0a7766151e0e2f65afaf3418aa95047dc703c98d48fc1e4519ab2b359e69d1ad |
Hashes for pentapy-1.1.0rc2-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3558e80ce615259ae457cf632d8923e2dcb4d7e1d1cd3f54c8b9d9fd6dbe7388 |
|
MD5 | 1789f1f85be41b2f546015a3a8110063 |
|
BLAKE2b-256 | c13337a768c7732bf2687d47f5f747d6af283cf9f7dbec5ae092a1d25ee22007 |
Hashes for pentapy-1.1.0rc2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0c70370793b67001b48aba4a5641df9d7863815f95f0003ac41aaac7718df6e |
|
MD5 | a5e0603c6a0a6b44645d6bc1c760882f |
|
BLAKE2b-256 | fd09c2ccdfb73aac0fba6df79d277791d50d41ae9274a89a1392882bd20b633d |
Hashes for pentapy-1.1.0rc2-cp38-cp38-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16139fc8eb93328bc23475b2297538f223420e32ceaac63ba8f1aa924b0a2285 |
|
MD5 | a158f22645b19941203bf969d01bcf0b |
|
BLAKE2b-256 | 6cc1b2b41eb11ad56afcc1a1c82a0211c6337146b475ed212f53a9f9461dabc4 |
Hashes for pentapy-1.1.0rc2-cp38-cp38-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f77fb264c5e8fab196908ae070c6ef6ea4d055dab8de61d4d4bb55b995dbc593 |
|
MD5 | 09358123b2f1b4095ad9ab1e58956dbe |
|
BLAKE2b-256 | a3116b7f383e1d2729e6a812c25914e70d0ced2cc8094abd36be121c399dadfa |
Hashes for pentapy-1.1.0rc2-cp38-cp38-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 200098c413a9fe923a517b4f68b2c5ec0e238ebc758c44ee0f319902d3e09636 |
|
MD5 | 13604926d128d6801ffd7a7731ae4c73 |
|
BLAKE2b-256 | 3bcdcd5e43767e631e28b1d6936f3b0ce2e239596d5688709ddaca20d692bb67 |
Hashes for pentapy-1.1.0rc2-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e147562304c60f1735ae92bcfde32843c69d07a3d2da13c8b0e67c7de92a6281 |
|
MD5 | bda3da5fb451f77284eeb85e82ce517f |
|
BLAKE2b-256 | d894812d073df2eae41ad3437b10bcdcd7e7e206a2585ea59eabf88d2a1d8ed7 |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf45b6d9747fd6331d512af52f42332e02551b92d358a05fc0105b746d1aa045 |
|
MD5 | d3a13a37a266b59184bad31851d46933 |
|
BLAKE2b-256 | ad4dcb50c3f4c62e1b3dc611d3add2910d6176af82ef30a2cbeb769f7c03e32b |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e38c78e71d7188a4db6815aaa57df0788c0f327e694d53696901ceb5e5881f26 |
|
MD5 | 07ff400879856b9ed37492f394b0a677 |
|
BLAKE2b-256 | 91d750230a4d86347d1265c146969428b681ae294c78af7ce9695a79de358906 |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6b2fbd6d9cf496647fd0c5fc55a3015722e05c21abfbe881c75d3a86a0feaf4 |
|
MD5 | 8fc8c746160d050654ed97e3d09c6480 |
|
BLAKE2b-256 | 7d24e00bc1c76eb11a544eed3dadce62dfba6c16a0f10daf71012ddc93eb533c |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2fdc79ebb735423b11031f526e2b22c2d4944606e59dfca9bd228307e6abbed2 |
|
MD5 | 54db3de1f7beba2e2f6cf7cf227d5b50 |
|
BLAKE2b-256 | 22e45c54757d470a48848665cc52067fb7e6eac8590332bc3331a81b09af97b7 |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 613279cfce38708040da3a17eaba5167511bd4812a9288a89d8095b997c6e3fb |
|
MD5 | 65fc049aefcb172dcd9e875dc3a07ace |
|
BLAKE2b-256 | 4f6f703cdbcf203a9fec138ff20c2c96be23aa835dbec1387391e1e9cf3a1713 |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90aa872b8c6067dd64951a953ce9d85a64f927def770b8a9bc4405250c394e76 |
|
MD5 | 06ce6bf706011b8a41c11a50cdfa068b |
|
BLAKE2b-256 | a1e83c50e2d0c71f8ff2d7de3da371754f9d696342832fcaf1e1f3e3edd3f0e5 |
Hashes for pentapy-1.1.0rc2-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7b3f92855c254191ef854fb66b1950834c37354777db2c85bda63743c739f3f |
|
MD5 | d17b1e6366d0b5f4063686fd8c2db12b |
|
BLAKE2b-256 | fd012a56c606a4b851f4f5e318e657c1a3280ec2ce9e2ccc1598476688353870 |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a70fe1473d1921eaabb0c62198e96ad93a100cd9e869fe78e8dec6bdf9d1b5d4 |
|
MD5 | 030156bee6521dbd8627934a39ec2bf0 |
|
BLAKE2b-256 | 8c93649d07c2edc4c6f8ffe32e2c385253b1b79de54a64899f17f2884736e551 |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b462586b98372a6897b6ac3f43a430246d4dcf7e6424e21573607c1905b3464 |
|
MD5 | 13730515308d646908b24e213b134429 |
|
BLAKE2b-256 | f1bff359d3c4bb9a73ec13e21e4190c556d5bb4e7140ed0d002fa8c8143b1f65 |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d20f9e1e2e360fab7b9b469e811b3d14b57db081a5fddd9478dd4b4135f25305 |
|
MD5 | dd11db55c0271e5770a6da5b17283b6c |
|
BLAKE2b-256 | 70e86ed2431d1d9c9d686853b09444d541ccd8464ebfd87f9a95141783c37740 |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65ec0f8f186d15860db7a1d3f1dcd4fe23f4047c6616db0f7bcc123002057c0c |
|
MD5 | 749c1408561ed8ab220f265d00507c5c |
|
BLAKE2b-256 | 0cb34b5ba965b68ddf1b79dfa7294a2c1e44e8a6df4ec6da1fea0270d82e42ef |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4578e945ab2950cb44e5250d53f268af29d74c07203c94c8e467ff50f9b1bdca |
|
MD5 | 6f030962c3ffaebf016af3b27a4ba012 |
|
BLAKE2b-256 | ff9ce37fcc4739a0245dbb35b7ec175dfeca924dc5acd8a334ca819d0f867590 |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d616a41bc5fdfdf9d68e65a211f11ebef3f0a0e2aef804818b281fad12a240dd |
|
MD5 | 6bf0a1a7e1afa8c0c07625ded73c255d |
|
BLAKE2b-256 | 90ea145ba02838afcd417f7424d6bdf9ccbe7fdd9f52be2acc849a5e197bdb58 |
Hashes for pentapy-1.1.0rc2-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f851983dca6e787badf8a87031da833352a5cd3298da892d3d643871010d6667 |
|
MD5 | 0c8c63cc89bc2cca722ff4818257aae3 |
|
BLAKE2b-256 | b98ac0a61df96fa8166841036bb81bf3560fc48576ee5fb87dc5ae7fb61aeaa6 |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 152151824808509d006bafbb52ba662fab509395ad3cc8c45145ff3542de76f7 |
|
MD5 | 063a50f4950d98ddffad6691dfb39d65 |
|
BLAKE2b-256 | ab8e9505dac7de8a530676c95b6d3620f1e62df04e72d955a39b8e34d08c2ec9 |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9741e71e2e49270524bece6c41a0159e3882ec06e51b3a6bf1a3861c48f9a588 |
|
MD5 | fd495a16d15478b65200cdf65e542b52 |
|
BLAKE2b-256 | 6f1767f04d84f7798007071dbcf02f02192a745a7cd2bc583cf8c3ade787cdd1 |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98a234c8fa1039bfa9fa956510dff7499b974f4f71670334820db6701e8fc887 |
|
MD5 | e7662e5c96d5b2bdf37c3b2dd61f2987 |
|
BLAKE2b-256 | 4be951122dcb609df69e6c8332bfd35312192112d0fc5f8f2c766bc1d74c1491 |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-manylinux2010_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 11834b30858724dc297443902e94f27ed1c5f6a23bdf00f55a70775b4a96da7e |
|
MD5 | 85783c43bfa06a2106beec877dada180 |
|
BLAKE2b-256 | 168778058191e081410b6971ea5393c55aa1454c02c0e5c938e91488b522d547 |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-manylinux1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 909936397945dde38b39be35df26f87c3dcd29763a058cae2b0355f4fc114dc3 |
|
MD5 | e4c43ffdeac1f12595836e6f9dfe9c4c |
|
BLAKE2b-256 | fcd435f9ceaf5b6b078db1c60519dd58959754533195618e3932e36c72afd3ff |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 656914abbd3b4cd19b69b3ed368cb620145347b0ea8ba5095a54fde5933aaee4 |
|
MD5 | c9f005bb2abfbecf77f99eb97610858e |
|
BLAKE2b-256 | 954bdec0a4bee9fdacfe210140f3650f5535a85330a0dda944faed0ecc47c729 |
Hashes for pentapy-1.1.0rc2-cp35-cp35m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4da98763b1a39ac067a23d716f2accadc5d86d3e973664f22ccbf2677e8fdd72 |
|
MD5 | 750f4c7252a1697a930b83084ebd6396 |
|
BLAKE2b-256 | 92dd7d114cbafb5bc99b557ad8b188392fcc14e524bdfccdfc4e2880c0217706 |