Description
I notice that we only currently implement matfun_frechet
(the Fréchet derivative of matrix functions) for exp(A)
, in #331 by @sethaxen.
However, I came across a beautifully simple result based on Magnus et al. (2021) (proposition 2) that looks like it should allow us to define matfun_frechet
for (at least) any function with a Taylor series.
In particular, it is easy to show by induction that the Fréchet derivative d(Aⁿ) = (Aⁿ)′[dA] of f(A)=Aⁿ is given by:
It then follows, for any analytic matrix function f(A) (i.e. with a Taylor series), that
That is, you augment the matrix A with E and compute f on the augmented matrix — the diagonal blocks are now f(A) and the upper-right block is the Fréchet derivative f'(A) applied to E.
It's not as efficient as an algorithm specialized for particular functions f(A), e.g. it's probably slower than our current exp implementation, because doubling the matrix size probably increases the cost by a factor of 8 (or maybe less, if the algorithm can take advantage of the block-triangular structure). But it's better than nothing.