I want to calculate the exponential of a 200x200 matrix (expm(B)) and get the following problem. Thanks a lot for your help.
exp_matrix2 = expm(B)
File ".../python2.7/site-packages/scipy/linalg/matfuncs.py", line 261, in expm return scipy.sparse.linalg.expm(A)
File ".../python2.7/site-packages/scipy/sparse/linalg/matfuncs.py", line 582, in expm return _expm(A, use_exact_onenorm='auto')
File ".../python2.7/site-packages/scipy/sparse/linalg/matfuncs.py", line 618, in _expm eta_1 = max(h.d4_loose, h.d6_loose)
File ".../python2.7/site-packages/scipy/sparse/linalg/matfuncs.py", line 457, in d4_loose structure=self.structure)**(1/4.)
File ".../python2.7/site-packages/scipy/sparse/linalg/matfuncs.py", line 301, in _onenormest_matrix_power MatrixPowerOperator(A, p, structure=structure))
File ".../python2.7/site-packages/scipy/sparse/linalg/_onenormest.py", line 95, in onenormest est, v, w, nmults, nresamples = _onenormest_core(A, A.H, t, itmax)
File "/python2.7/site-packages/scipy/sparse/linalg/_onenormest.py", line 424, in _onenormest_core Z = np.asarray(AT_linear_operator.matmat(S))
File ".../python2.7/site-packages/scipy/sparse/linalg/interface.py", line 326, in matmat Y = self._matmat(X)
File ".../python2.7/site-packages/scipy/sparse/linalg/interface.py", line 468, in _matmat return super(_CustomLinearOperator, self)._matmat(X)
File ".../python2.7/site-packages/scipy/sparse/linalg/interface.py", line 174, in _matmat return np.hstack([self.matvec(col.reshape(-1,1)) for col in X.T])
File "/home/dk2518/anaconda2/lib/python2.7/site-packages/scipy/sparse/linalg/interface.py", line 219, in matvec y = self._matvec(x)
File ".../python2.7/site-packages/scipy/sparse/linalg/interface.py", line 471, in _matvec return self.__matvec_impl(x)
File ".../python2.7/site-packages/scipy/sparse/linalg/interface.py", line 266, in rmatvec y = self._rmatvec(x)
File ".../python2.7/site-packages/scipy/sparse/linalg/matfuncs.py", line 203, in _rmatvec x = A_T.dot(x)
ValueError: shapes (207,207) and (1,207) not aligned: 207 (dim 1) != 1 (dim 0)
np.block
– TomNash