bundles / scipy 1.18.0 / scipy / sparse / linalg / _matfuncs / expm
function
scipy.sparse.linalg._matfuncs:expm
Signature
def expm(A)Summary
Compute the matrix exponential using Pade approximation.
Parameters
A: (M,M) array_like or sparse array2D Array or Matrix (sparse or dense) to be exponentiated
Returns
expA: (M,M) ndarrayMatrix exponential of
A
Notes
This is algorithm (6.1) which is a simplification of algorithm (5.1).
Examples
from scipy.sparse import csc_array from scipy.sparse.linalg import expm A = csc_array([[1, 0, 0], [0, 2, 0], [0, 0, 3]])✓
A.toarray()
✗array([[1, 0, 0],
[0, 2, 0],
[0, 0, 3]])
Aexp = expm(A)
✓Aexp Aexp.toarray()✗
array([[ 2.71828, 0. , 0. ],
[ 0. , 7.38906, 0. ],
[ 0. , 0. , 20.08554]])
Aliases
scipy.sparse.linalg.expm