JuliaDiff / JuliaDiff/ChainRules.jl
derivatives of more matrix functions
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 475
- Forks
- 98
- PR merge metrics
- No merged PRs in 30d
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the existing matfun_frechet implementation for exp and compare it with the augmented-matrix construction described in this issue. Investigate which Taylor-series matrix functions can use that construction and how correctness should be checked. Done means matfun_frechet supports the agreed additional functions with validated Fréchet derivatives.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100