Repository navigation
Fix DGEEV_D eigenvector derivatives: normalization, complex pairs, le… - #16
Merged
Merged
Conversation
…ft eigenvectors
Three fixes to the forward-mode differentiated DGEEV:
1. Add normalization correction for eigenvector derivatives. DGEEV
normalizes eigenvectors to unit 2-norm, so dv must satisfy
v^T*dv = 0. The perturbation formula produces dv in the span of
other eigenvectors, which is not Euclidean-orthogonal to v for
non-symmetric matrices. Project out the v-component after summing.
2. Add complex conjugate pair eigenvector derivatives. The original
code only handled real-real eigenvalue coupling. Now handles all
four cases: real-real, real-complex, complex-real, complex-complex,
with proper complex arithmetic in LAPACK's real storage format.
3. Add left eigenvector derivatives using du_i = sum_{j!=i}
[(v_j^H * dA^T * u_i) / ((lambda_i* - lambda_j*) * (v_j^H * u_j))] * u_j
with the same normalization correction and complex pair handling.
Test covers both all-real eigenvalues and a matrix with two complex
conjugate pairs (3+/-2i, 8+/-1.5i). All derivatives match central FD
to <1e-8 relative error.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add right/left eigenvector derivatives and normalization correction to: - sgeev_d (single precision real, with complex conjugate pair handling) - cgeev_d, zgeev_d (complex: simplified, no conjugate pair trick) - dgeevx_d, sgeevx_d, cgeevx_d, zgeevx_d (expert variants) The _dv wrappers call _d routines in a loop, so they inherit these fixes automatically. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
sriharikrishna
added a commit
that referenced
this pull request
Dec 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
…ft eigenvectors
Three fixes to the forward-mode differentiated DGEEV:
Add normalization correction for eigenvector derivatives. DGEEV normalizes eigenvectors to unit 2-norm, so dv must satisfy v^T*dv = 0. The perturbation formula produces dv in the span of other eigenvectors, which is not Euclidean-orthogonal to v for non-symmetric matrices. Project out the v-component after summing.
Add complex conjugate pair eigenvector derivatives. The original code only handled real-real eigenvalue coupling. Now handles all four cases: real-real, real-complex, complex-real, complex-complex, with proper complex arithmetic in LAPACK's real storage format.
Add left eigenvector derivatives using du_i = sum_{j!=i} [(v_j^H * dA^T * u_i) / ((lambda_i* - lambda_j*) * (v_j^H * u_j))] * u_j with the same normalization correction and complex pair handling.
Test covers both all-real eigenvalues and a matrix with two complex conjugate pairs (3+/-2i, 8+/-1.5i). All derivatives match central FD to <1e-8 relative error.