scipy.linalg.

expm_frechet#

scipy.linalg.expm_frechet(A, E, method=None, compute_expm=True, check_finite=True)[原始碼]#

矩陣 A 的矩陣指數在 E 方向上的 Fréchet 導數。

參數:
A(N, N) 陣列型別

要計算矩陣指數的矩陣。

E(N, N) 陣列型別

計算 Fréchet 導數的矩陣方向。

method字串,選用

演算法的選擇。應為以下其中之一

  • SPS (預設)

  • blockEnlarge

compute_expm布林值,選用

是否除了 expm_frechet_AE 之外,還要計算 expm_A。預設為 True。

check_finite布林值,選用

是否檢查輸入矩陣是否僅包含有限數字。停用可能會提高效能,但如果輸入包含無限大或 NaN,可能會導致問題(崩潰、無法終止)。

回傳值:
expm_Andarray

A 的矩陣指數。

expm_frechet_AEndarray

矩陣 A 的矩陣指數在 E 方向上的 Fréchet 導數。

對於 compute_expm = False,僅回傳 expm_frechet_AE

另請參閱

expm

計算矩陣的指數。

註解

本節描述可通過 method 參數選擇的可用實作方式。預設方法為 SPS

方法 blockEnlarge 是一種簡單的演算法。

方法 SPS 是 Scaling-Pade-Squaring [1]。它是一種複雜的實作方式,應僅需花費約為簡單實作方式 3/8 的時間。漸近線是相同的。

在版本 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 numpy as np
>>> from scipy import linalg
>>> rng = np.random.default_rng()
>>> A = rng.standard_normal((3, 3))
>>> E = rng.standard_normal((3, 3))
>>> expm_A, expm_frechet_AE = linalg.expm_frechet(A, E)
>>> expm_A.shape, expm_frechet_AE.shape
((3, 3), (3, 3))

建立一個包含 [[A, E], [0, A]] 的 6x6 矩陣

>>> M = np.zeros((6, 6))
>>> M[:3, :3] = A
>>> M[:3, 3:] = E
>>> M[3:, 3:] = A
>>> expm_M = linalg.expm(M)
>>> np.allclose(expm_A, expm_M[:3, :3])
True
>>> np.allclose(expm_frechet_AE, expm_M[:3, 3:])
True