Skip to content

Conversation

@JoshuaLampert
Copy link
Contributor

@JoshuaLampert JoshuaLampert commented Dec 3, 2025

Currently, ForwardDiff.jl only supports differentiating through eigen and eigvals of Symmetric or Hermitian matrices, but not for a general StridedMatrix. In JuliaManifolds/Manifolds.jl#27 (comment), there is a working version for differentiating through eigen and eigvals for 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 eigen for symmetric and Hermitian matrices.
Closes #111.

@JoshuaLampert JoshuaLampert marked this pull request as draft December 3, 2025 14:13
@codecov
Copy link

codecov bot commented Dec 3, 2025

Codecov Report

❌ Patch coverage is 0% with 21 lines in your changes missing coverage. Please review.
✅ Project coverage is 88.99%. Comparing base (e8eb009) to head (a4aa531).

Files with missing lines Patch % Lines
src/dual.jl 0.00% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #788      +/-   ##
==========================================
- Coverage   90.73%   88.99%   -1.75%     
==========================================
  Files          11       11              
  Lines        1069     1090      +21     
==========================================
  Hits          970      970              
- Misses         99      120      +21     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compatibility with Base linear algebra functions

1 participant