Skip to main content

Python interface to the Intel MKL Pardiso library to solve large sparse linear systems of equations

Project description

pypardiso-tests

PyPardiso

PyPardiso is a python package to solve large sparse linear systems of equations with the Intel oneAPI Math Kernel Library PARDISO solver, a shared-memory multiprocessing parallel direct sparse solver.

PyPardiso provides the same functionality as SciPy's scipy.sparse.linalg.spsolve for solving the sparse linear system Ax=b. However in many cases it is significantly faster than SciPy's built-in single-threaded SuperLU solver.

PyPardiso is not a python interface to the PARDISO Solver from the PARDISO 7.2 Solver Project and it also doesn't currently support complex numbers. Check out JuliaSparse/Pardiso.jl for these more advanced use cases.

Installation

PyPardiso runs on Linux, Windows and MacOS. It can be installed with conda or pip. It is recommended to install PyPardiso using a virtual environment.

conda-forge PyPI
conda-forge version PyPI version
conda install -c conda-forge pypardiso pip install pypardiso

Basic usage

How to solve the sparse linear system Ax=b for x, where A is a square, sparse matrix in CSR (or CSC) format and b is a vector (or matrix):

In [1]: import pypardiso

In [2]: import numpy as np

In [3]: import scipy.sparse as sp

In [4]: A = sp.rand(10, 10, density=0.5, format='csr')

In [5]: A
Out[5]:
<10x10 sparse matrix of type '<class 'numpy.float64'>'
	with 50 stored elements in Compressed Sparse Row format>

In [6]: b = np.random.rand(10)

In [7]: x = pypardiso.spsolve(A, b)

In [8]: x
Out[8]:
array([ 0.02918389,  0.59629935,  0.33407289, -0.48788966,  3.44508841,
        0.52565687, -0.48420646,  0.22136413, -0.95464127,  0.58297397])

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypardiso-0.4.6.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

pypardiso-0.4.6-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file pypardiso-0.4.6.tar.gz.

File metadata

  • Download URL: pypardiso-0.4.6.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pypardiso-0.4.6.tar.gz
Algorithm Hash digest
SHA256 ff13eff486a2246d9c5bc9cec9f5bc8009f1b8831b2d10767787d768d98afa06
MD5 25aacf2c5b4975c33b950ce4edda93ac
BLAKE2b-256 018ba88f8ee0b4a98d15737b728d6306682a1c8aaa588600a906ccde35965361

See more details on using hashes here.

File details

Details for the file pypardiso-0.4.6-py3-none-any.whl.

File metadata

  • Download URL: pypardiso-0.4.6-py3-none-any.whl
  • Upload date:
  • Size: 10.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.2

File hashes

Hashes for pypardiso-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 43d370a91ab97062bce1862e76387def1732ad944c5882024c5c3be2c6e9e77c
MD5 678bff4a842d0eb6d3d68bd023d69231
BLAKE2b-256 1de829b96e539ff24c3425e90003e69a24296009ac8c6280665ea1a08bdd61f6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page