sparse_dot
sparse_dot copied to clipboard
Solve sparse linear system for complex numbers
The MKL sparse QR solver doesn't support complex floats, only reals: https://www.intel.com/content/www/us/en/docs/onemkl/developer-reference-c/2024-0/sparse-qr-routines.html
Is it true? pyMKL is a Python wrapper of Intel MKL routines and solves sparce linear systems with support for complex numbers.
I'm a bit confused. Maybe the last MKL version erased it?
The pardiso solver supports complex floats. Wrapping it for python wouldn't be terribly difficult but the interface is complex compared to the QR solver.
Thank you for your replay,
Yes but I need it for electromagnetc field simulation where fields are complex numbers. That is the reason.
Aight I have added a wrapper for pardisoinit and pardiso in d12521d2eac15d826ee6eb172fdf0d7b9f7b6a66 and they can be called as follows:
from sparse_dot_mkl.solvers import pardiso, pardisoinit
pt, iparm = pardisoinit(11, single_precision=True)
X, pt, perm, error = pardiso(
A, # CSR MATRIX
B, # Dense Matrix
pt,
11, # mtype
iparm,
13 # phase
)
I can't promise every pardiso option will work; I've only added tests for real & complex nonsymmetric A.