py-mkl-pardiso
Python pybind11 wrapper for the Intel oneMKL PARDISO sparse direct solver.
pymklpardiso exposes double-precision real and complex support from Intel's
PARDISO
sparse direct solver to Python via pybind11.
It works with SciPy sparse matrices in CSR format and NumPy arrays.
Supported platforms: Linux (x86_64), Windows (AMD64).
Installation
pip install py-mkl-pardiso
Or install from source (requires MKL):
git clone https://github.com/bodono/py-mkl-pardiso.git
cd py-mkl-pardiso
pip install -e ".[test]"
Building from source requires:
- Intel oneMKL (set
MKLROOTif not auto-detected) - A C++17 compiler
- Python >= 3.10
- pybind11 >= 2.12
Quick start
import numpy as np
import scipy.sparse as sp
from pymklpardiso import PardisoSolver, MTYPE_REAL_SYM_POSDEF
# Build a symmetric positive-definite matrix (upper triangle, CSR)
A_full = np.array([
[4.0, 1.0],
[1.0, 3.0],
])
A_upper = sp.csr_matrix(np.triu(A_full))
A_upper.sort_indices()
# Create solver — analyzes, factors, and is ready to solve
solver = PardisoSolver(A_upper, MTYPE_REAL_SYM_POSDEF)
b = np.array([1.0, 2.0])
x = solver.solve(b)
print(x) # [0.09090909 0.63636364]
Complex matrices use the corresponding complex matrix type and NumPy
complex128 values. Hermitian and complex-symmetric matrices are supplied as
an upper-triangular CSR matrix, just like real symmetric matrices:
from pymklpardiso import MTYPE_COMPLEX_HERM_POSDEF
A_full = np.array([
[4.0, 1.0 + 1.0j],
[1.0 - 1.0j, 3.0],
])
A_upper = sp.csr_matrix(np.triu(A_full))
solver = PardisoSolver(A_upper, MTYPE_COMPLEX_HERM_POSDEF)
b = np.array([1.0 + 2.0j, 3.0 - 1.0j])
x = solver.solve(b)
Hermitian matrix diagonals must be real. The wrapper validates this whenever
numeric values are loaded, including during construction, factor(), and
refactor().
Refactoring workflow
When the sparsity pattern stays the same but values change (e.g., in an
iterative algorithm), use refactor() to skip symbolic analysis:
solver = PardisoSolver(A_upper, MTYPE_REAL_SYM_POSDEF)
for new_values in value_generator:
solver.refactor(new_values)
x = solver.solve(b)
API reference
PardisoSolver(A, mtype, iparms=None, msglvl=0)
Create a PARDISO solver instance. The constructor extracts the CSR sparsity
pattern from A, applies any iparms overrides, and runs symbolic analysis
- numeric factorization so the solver is ready to call
solve().
| Parameter | Type | Default | Description |
|---|---|---|---|
A |
sparse CSR | (required) | Square sparse matrix (any object with indptr, indices, data, shape). For symmetric and Hermitian types, pass only the upper triangle in CSR format. |
mtype |
int |
(required) | Matrix type (see constants below). |
iparms |
dict |
None |
Optional {index: value} iparm overrides. |
msglvl |
int |
0 |
Message level (0 = silent, 1 = print statistics). |
Matrix type constants
| Constant | Value | Description |
|---|---|---|
MTYPE_REAL_STRUCT_SYM |
1 | Real structurally symmetric |
MTYPE_REAL_SYM_POSDEF |
2 | Real symmetric positive definite |
MTYPE_REAL_SYM_INDEF |
-2 | Real symmetric indefinite |
MTYPE_REAL_NONSYM |
11 | Real nonsymmetric |
MTYPE_COMPLEX_STRUCT_SYM |
3 | Complex structurally symmetric |
MTYPE_COMPLEX_HERM_POSDEF |
4 | Complex Hermitian positive definite |
MTYPE_COMPLEX_HERM_INDEF |
-4 | Complex Hermitian indefinite |
MTYPE_COMPLEX_SYM |
6 | Complex symmetric |
MTYPE_COMPLEX_NONSYM |
13 | Complex nonsymmetric |
Core methods
solver.solve(b)
Solve Ax = b. Accepts 1D (n,) or 2D (n, nrhs) arrays. Returns the
solution as a new NumPy array (Fortran-contiguous for 2D). Real solvers return
float64; complex solvers return complex128 and promote real right-hand
sides automatically.
solver.solve_into(b, x)
Solve Ax = b writing into pre-allocated x. For 2D arrays, both b and
x must be Fortran-contiguous. The output must have dtype float64 for a
real solver or complex128 for a complex solver.
solver.refactor(values)
Re-factorize with new nonzero values (phase 22 only). Does not re-run
symbolic analysis. Raises if symbolic analysis is invalid; use factor() to
re-analyze from scratch. values must match the stored sparsity pattern
exactly.
solver.factor(values)
Re-analyze and re-factorize with new values (phases 11 + 22). This always runs
fresh symbolic analysis. Use this for error recovery or when iparm changes
require fresh symbolic analysis. values must match the stored sparsity
pattern exactly.
Analysis invalidation: symbolic analysis (phase 11) becomes invalid when an
iparm value changes via set_iparm() or set_iparm_all(), or after
release() / reset(). Changing numeric values alone does not invalidate
analysis. After a successful factor(), subsequent refactor() calls
continue to work, including with value-dependent analysis settings such as
iparm[10] = 1. When analysis is invalid, refactor() raises; call
factor() to re-analyze and recover.
Other methods
| Method | Description |
|---|---|
solver.release() |
Free PARDISO internal memory. |
solver.n |
Matrix dimension (property). |
solver.nnz |
Number of nonzeros (property). |
solver.mtype |
Matrix type (property). |
solver.set_perm(perm) |
Set fill-reducing permutation. |
solver.clear_perm() |
Clear permutation. |
solver.has_perm() |
Whether a permutation is set. |
solver.set_iparm(idx, value) |
Set a single iparm entry. |
solver.get_iparm() |
Get all 64 iparm values. |
solver.get_iparm_value(idx) |
Get a single iparm value. |
solver.set_iparm_all(iparm) |
Set all 64 iparm values. |
solver.set_msglvl(msglvl) |
Change message level. |
solver.run_phase(phase) |
Run an arbitrary PARDISO phase. |
solver.run_phase_into(phase, b, x) |
Run a phase with RHS/output arrays. |
iparm notes
iparm[0]is locked to1(user-supplied parameters).iparm[27]is locked to0(double precision). The wrapper supportsfloat64andcomplex128, not PARDISO's single-precision mode.iparm[34]is locked to1(zero-based indexing).- See the MKL PARDISO iparm documentation for all parameters.
License
MIT
Release files for py-mkl-pardiso 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| py_mkl_pardiso-0.0.6.tar.gz | 28.2 kB | Details |
Built distributions (wheels)
Total release size: 217.7 MB
Release files / py_mkl_pardiso-0.0.6.tar.gz
| Download URL | py_mkl_pardiso-0.0.6.tar.gz |
|---|---|
| Size | 28.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4b12872e26f75e03f024e18abf522dab941ee628068abd6abd3fc154265111ee
|
|
BLAKE2b-256 checksum How to use checksums |
1ddd0904a4367c74cb18945c60c3497d93f3451757e809efe9d7df5ce2c6ad77
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp314-cp314t-win_amd64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp314-cp314t-win_amd64.whl |
|---|---|
| Size | 18.1 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Windows x86-64 |
|
SHA-256 checksum How to use checksums |
c8b844dc9d395138c0e41e92ccefd8376336022f7c03e74e07d672e74eb6d01f
|
|
BLAKE2b-256 checksum How to use checksums |
87cb24856cbc13e745697e2c9dcdc9066a213bfa7b2812224f06de001e898355
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
59f0d566eb24f00d154f4ad6f15540f4dec6507b985b972888fb216d219ec5b4
|
|
BLAKE2b-256 checksum How to use checksums |
4cd8e859df25f7c1a31724878ef77426282376640811ba93442cbad005d61690
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp314-cp314-win_amd64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp314-cp314-win_amd64.whl |
|---|---|
| Size | 18.1 MB |
| Tags | CPython 3.14 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
45a64428b081ec78668f167924aaddc3f5ddbc77add31d6815956687711057a6
|
|
BLAKE2b-256 checksum How to use checksums |
da0ef5c40a9af196690819fa06f55c3e0596cb2ca6b675df5851b78e8d9c385b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
dae8f384ef952b8adb19f717a2f5782c80f8d00aacd3fc54e422a2251d4dfde7
|
|
BLAKE2b-256 checksum How to use checksums |
439f815c44b8b1fbc4a22bfb1032f5bcdf4ad91cbc1d65bf3fc285fe2d725e44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp313-cp313-win_amd64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 17.9 MB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
4df94e9c514cb52e0053164a2ce36e49f6b3fdc7236bf74b95ab77874ef43ee1
|
|
BLAKE2b-256 checksum How to use checksums |
2aa8c0025b45123e1a1e03128be1f9fea3a53f6d623276b4e0ac0821884f475d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
ff0c2a10d1d547bd6e738b60eebdb7cf2129ae80f9c8d41a393b8b3052798766
|
|
BLAKE2b-256 checksum How to use checksums |
501d04d43676fedb41b5f88b60fdbddcea206056763e2a6d0a37b981d9c9a235
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp312-cp312-win_amd64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 17.9 MB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b268ff80d38e2980593151f09595a78468a08d2ba935f7a0f74f0a97ab640dd0
|
|
BLAKE2b-256 checksum How to use checksums |
4c80643436cd1eae26e24072491ecbe5033dca96505ad8a4505988ca397b4ee1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
4f27db7a6e770760fbd79b28cf7ceb6635c1934d943937d644eccfea9d703789
|
|
BLAKE2b-256 checksum How to use checksums |
9f6354a5efcd7f0f167593a700d52e2d2b11a7966ad1baf0d10a9ef8a4af7d6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp311-cp311-win_amd64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 17.9 MB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
569f7eb2614d14ac1b53c7a4129e122fecf877575a1ff37e3662398e8ec5903f
|
|
BLAKE2b-256 checksum How to use checksums |
75a273e4d2ad41d8530b3385ad29b2af99d7b44603bdca40a837c0fbff36e1a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
f449187b02e80e0b5004d3061693ec2f020b4ed69b067398f92eb63a2e873ada
|
|
BLAKE2b-256 checksum How to use checksums |
e69564526865d5d9ae33cec6d755a2dc2d27e3c44991d69fe57a1d2adae50238
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp310-cp310-win_amd64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 17.9 MB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
f0fbab23082f390f437aadcc8a34e188ee1a51887e0c90e04b2eb165bf64014a
|
|
BLAKE2b-256 checksum How to use checksums |
f12377fb01314ea84c7f76650534343a3223a20551bc24b0d20b0aa76a19a33a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / py_mkl_pardiso-0.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | py_mkl_pardiso-0.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 18.3 MB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
8894b74e9e1b236d4b2bbb815da808df182e55370098e094015aa79cb27c94be
|
|
BLAKE2b-256 checksum How to use checksums |
b5ac41c9f7e5800c2b0915d96dbdf07cb0e7102a61c52beb055763204b365bf7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency log