Exponential of simple block triangular matrix

I have a custom struct that represents a block-matrix of the form

X = [
    A B
    0 A 
]

Where A and B are arbitrary (probably non-pathological) square matrices. A and B are small in the context I’m currently looking at. They’d be stored as StaticArrays.SMatrix instances, as properties of my struct.

I’m looking to implement a method for exp for my struct. The exponential is going to have the same block structure as the original X, with

exp(X) = [
    exp(A)  F
       0   exp(A)
]

where the matrix F is a little less trivial. I found some notes about the mathematical background, which also discusses solutions.

Does anyone who is less rusty than me on their linear algebra have any recommendations for how to most easily (but efficiently) get F? Is there any package I should be aware of that helps with this? Again, A and B are small, so I’m not looking for anything Krylov-based. I was thinking maybe I should adapt padm from Expokit. Is there something easier or better?

I at some point worked out what you get from applying the Base.exp implementation (using Pade approximation) to the upper triangular block matrix case, so as to explicitly get the nonzero blocks of the exponential; the result is in the attachment.
exp.jl (13.5 KB)

1 Like