对于 2x2 矩阵 A,令 T 为包含其特征向量的矩阵。 令 D 为对角矩阵,其中包含 A 在其对角线上的特征值。
因此,AT = TD
假设T是可逆的,A = TDT-1
注意 An = TDnT-1
上式意味着 e(TDT-1) = Te(D)T-1 因为指数函数的幂级数展开。
但是当我使用 numpy 尝试这个时,它为 e(TDT-1) 和 Te(D)T-1
产生不同的结果import numpy as np
import numpy.linalg as LA
A = np.array([[3, -1],[-1, 3]])
e_values, e_vectors = LA.eig(A)
D = np.diag(e_values)
T = e_vectors.T
r1 = np.matmul(T, np.matmul(np.exp(D), LA.inv(T)))
r2 = np.exp(np.matmul(T, np.matmul(D, LA.inv(T))))
print("r1: ", r1,"\nr2: ", r2)
以上输出
r1: [[29.99360307 23.60454697]
[23.60454697 31.99360307]]
r2: [[20.08553692 2.71828183]
[ 2.71828183 20.08553692]]