Differentiate general eigen and eigvals
#788
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, ForwardDiff.jl only supports differentiating through
eigenandeigvalsofSymmetricorHermitianmatrices, but not for a generalStridedMatrix. In JuliaManifolds/Manifolds.jl#27 (comment), there is a working version for differentiating througheigenandeigvalsfor general matrices, which also works for complex eigenvalues (e.g., DifferentiableEigen.jl does not support complex eigenvalues). I just copied that version here for higher visibility, more convenient usage, and to avoid type piracy in my (and maybe other's) code. So credit goes to @mateuszbaran. The algorithm is from https://people.maths.ox.ac.uk/gilesm/files/NA-08-01.pdf.I open this as a draft PR because I am not sure if there is something additional that needs to be considered. If this PR is wanted, I can add tests and do a bit of cleanup.
cc @dlfivefifty since he added support for
eigenfor symmetric and Hermitian matrices.Closes #111.