Diagonal Matrix Exponential in Python -
i'm writing numerical algorithm speed in mind. i've come across 2 matrix exponential functions in scipy/numpy (scipy.linalg.expm2, scipy.linalg.expm). have matrix know diagonal beforehand. these scipy functions check if matrix diagonal before run? exponentiation algorithm can faster diagonal matrix, , want make sure these doing smart - if aren't, there easy way it?
if matrix diagonal, exponential can obtained exponentiating every entry on main diagonal, can calculate by:
np.diag(np.exp(np.diag(a)))
Comments
Post a Comment