Casting real numbers in scipy sparse matrix to complex to use MUMPS
We need to cast real numbers to complex so we can use Mumps, for now, otherwise this error appears
[...]
/home/mat/.local/lib/python3.8/site-packages/pescado/poisson/problem.py:577: in solve
return self.linear_problem_inst.solve(
/home/mat/.local/lib/python3.8/site-packages/pescado/poisson/problem.py:1162: in solve
output=self.solver(A=lhs, B=rhs, **kwargs))
/home/mat/.local/lib/python3.8/site-packages/pescado/poisson/solver.py:91: in __call__
self.mumps_solver_obj.factor(A)
/usr/lib/python3/dist-packages/kwant/linalg/mumps.py:320: in factor
self.analyze(a, ordering=ordering, overwrite_a=overwrite_a)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <kwant.linalg.mumps.MUMPSContext object at 0x7fa33b340d90>
a = <35x35 sparse matrix of type '<class 'numpy.float64'>'
with 93 stored elements in COOrdinate format>, ordering = 'auto'
overwrite_a = False
def analyze(self, a, ordering='auto', overwrite_a=False):
"""Perform analysis step of MUMPS.
In the analyis step, MUMPS figures out a reordering for the matrix and
estimates number of operations and memory needed for the factorization
time. This step usually needs not be called separately (it is done
automatically by `factor`), but it can be useful to test which ordering
would give best performance in the actual factorization, as MUMPS
estimates are available in `analysis_stats`.
Parameters
----------
a : sparse SciPy matrix
input matrix. Internally, the matrix is converted to `coo` format
(so passing this format is best for performance)
ordering : { 'auto', 'amd', 'amf', 'scotch', 'pord', 'metis', 'qamd' }
ordering to use in the factorization. The availability of a
particular ordering depends on the MUMPS installation. Default is
'auto'.
overwrite_a : True or False
whether the data in a may be overwritten, which can lead to a small
performance gain. Default is False.
"""
a = a.tocoo()
if a.ndim != 2 or a.shape[0] != a.shape[1]:
raise ValueError("Input matrix must be square!")
if not ordering in orderings.keys():
raise ValueError("Unknown ordering '"+ordering+"'!")
dtype, row, col, data = _make_assembled_from_coo(a, overwrite_a)
if dtype != self.dtype:
> self.mumps_instance = getattr(_mumps, dtype+"mumps")(self.verbose)
E AttributeError: module 'kwant.linalg._mumps' has no attribute 'dmumps'
/usr/lib/python3/dist-packages/kwant/linalg/mumps.py:229: AttributeError