`linalg._expm_frechet`¶

Frechet derivative of the matrix exponential.

Module Contents¶

Functions¶

 `expm_frechet`(A,E,method=None,compute_expm=True,check_finite=True) Frechet derivative of the matrix exponential of A in the direction E. `expm_frechet_block_enlarge`(A,E) This is a helper function, mostly for testing and profiling. `_diff_pade3`(A,E,ident) `_diff_pade5`(A,E,ident) `_diff_pade7`(A,E,ident) `_diff_pade9`(A,E,ident) `expm_frechet_algo_64`(A,E) `vec`(M) Stack columns of M to construct a single vector. `expm_frechet_kronform`(A,method=None,check_finite=True) Construct the Kronecker form of the Frechet derivative of expm. `expm_cond`(A,check_finite=True) Relative condition number of the matrix exponential in the Frobenius norm.
`expm_frechet`(A, E, method=None, compute_expm=True, check_finite=True)

Frechet derivative of the matrix exponential of A in the direction E.

A : (N, N) array_like
Matrix of which to take the matrix exponential.
E : (N, N) array_like
Matrix direction in which to take the Frechet derivative.
method : str, optional

Choice of algorithm. Should be one of

• SPS (default)
• blockEnlarge
compute_expm : bool, optional
Whether to compute also expm_A in addition to expm_frechet_AE. Default is True.
check_finite : bool, optional
Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
expm_A : ndarray
Matrix exponential of A.
expm_frechet_AE : ndarray
Frechet derivative of the matrix exponential of A in the direction E.

For `compute_expm = False`, only expm_frechet_AE is returned.

expm : Compute the exponential of a matrix.

This section describes the available implementations that can be selected by the method parameter. The default method is SPS.

Method blockEnlarge is a naive algorithm.

Method SPS is Scaling-Pade-Squaring [1]. It is a sophisticated implementation which should take only about 3/8 as much time as the naive implementation. The asymptotics are the same.

New in version 0.13.0.

 [1] Awad H. Al-Mohy and Nicholas J. Higham (2009) Computing the Frechet Derivative of the Matrix Exponential, with an application to Condition Number Estimation. SIAM Journal On Matrix Analysis and Applications., 30 (4). pp. 1639-1657. ISSN 1095-7162
```>>> import scipy.linalg
>>> A = np.random.randn(3, 3)
>>> E = np.random.randn(3, 3)
>>> expm_A, expm_frechet_AE = scipy.linalg.expm_frechet(A, E)
>>> expm_A.shape, expm_frechet_AE.shape
((3, 3), (3, 3))
```
```>>> import scipy.linalg
>>> A = np.random.randn(3, 3)
>>> E = np.random.randn(3, 3)
>>> expm_A, expm_frechet_AE = scipy.linalg.expm_frechet(A, E)
>>> M = np.zeros((6, 6))
>>> M[:3, :3] = A; M[:3, 3:] = E; M[3:, 3:] = A
>>> expm_M = scipy.linalg.expm(M)
>>> np.allclose(expm_A, expm_M[:3, :3])
True
>>> np.allclose(expm_frechet_AE, expm_M[:3, 3:])
True
```
`expm_frechet_block_enlarge`(A, E)

This is a helper function, mostly for testing and profiling. Return expm(A), frechet(A, E)

`_diff_pade3`(A, E, ident)
`_diff_pade5`(A, E, ident)
`_diff_pade7`(A, E, ident)
`_diff_pade9`(A, E, ident)
`expm_frechet_algo_64`(A, E)
`vec`(M)

Stack columns of M to construct a single vector.

This is somewhat standard notation in linear algebra.

M : 2d array_like
Input matrix
v : 1d ndarray
Output vector
`expm_frechet_kronform`(A, method=None, check_finite=True)

Construct the Kronecker form of the Frechet derivative of expm.

A : array_like with shape (N, N)
Matrix to be expm’d.
method : str, optional
Extra keyword to be passed to expm_frechet.
check_finite : bool, optional
Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
K : 2d ndarray with shape (N*N, N*N)
Kronecker form of the Frechet derivative of the matrix exponential.

This function is used to help compute the condition number of the matrix exponential.

expm : Compute a matrix exponential. expm_frechet : Compute the Frechet derivative of the matrix exponential. expm_cond : Compute the relative condition number of the matrix exponential

in the Frobenius norm.
`expm_cond`(A, check_finite=True)

Relative condition number of the matrix exponential in the Frobenius norm.

A : 2d array_like
Square input matrix with shape (N, N).
check_finite : bool, optional
Whether to check that the input matrix contains only finite numbers. Disabling may give a performance gain, but may result in problems (crashes, non-termination) if the inputs do contain infinities or NaNs.
kappa : float
The relative condition number of the matrix exponential in the Frobenius norm

A faster estimate for the condition number in the 1-norm has been published but is not yet implemented in scipy.

New in version 0.14.0.

expm : Compute the exponential of a matrix. expm_frechet : Compute the Frechet derivative of the matrix exponential.