I'm working on a scientific python project where I need to evaluate a lot of matrix exponential functions of the form exp(M)
. Currently, I'm using the scipy.linalg.expm
function to evaluate this expression but even for my smallish test cases this step is taking a very long time. After taking a look into the implementation, this function doesn't seam to look for, or use much of the structure that might be present in the input matrix. The matrices I'm feeding the function are actually fairly nice in that the matrix M is block diagonal with the first matrix A being upper triangular and the second matrix B being a diagonal matrix.
M = [[A, 0],
[0, B]]
I can speed up the calculation a bit by getting the diagonal values after the first block but this still leaves me with the A matrix which can get reasonably big. Is there a faster way to calculate exp(A)
when the matrix A is known to be upper triangular in advance?