scipy.sparse.linalg.expm

scipy.sparse.linalg.expm(A)[源代码]

使用Pade近似计算矩阵指数。

参数
A(M,M)类阵列或稀疏矩阵

要求幂的二维数组或矩阵(稀疏或密集)

退货
expA(M,M)ndarray

的矩阵指数 A

注意事项

这是算法(6.1),它是算法(5.1)的简化。

0.12.0 新版功能.

参考文献

1

Awad H.Al-Mohy和Nicholas J.Higham(2009)“矩阵指数的一种新的缩放和平方算法”。暹罗矩阵分析与应用杂志。31(3)。970-989页。ISSN 1095-7162

示例

>>> from scipy.sparse import csc_matrix
>>> from scipy.sparse.linalg import expm
>>> A = csc_matrix([[1, 0, 0], [0, 2, 0], [0, 0, 3]])
>>> A.toarray()
array([[1, 0, 0],
       [0, 2, 0],
       [0, 0, 3]], dtype=int64)
>>> Aexp = expm(A)
>>> Aexp
<3x3 sparse matrix of type '<class 'numpy.float64'>'
    with 3 stored elements in Compressed Sparse Column format>
>>> Aexp.toarray()
array([[  2.71828183,   0.        ,   0.        ],
       [  0.        ,   7.3890561 ,   0.        ],
       [  0.        ,   0.        ,  20.08553692]])