Repository navigation
Add (I-UU^T)dAVΣ^{-1} projector terms for rectangular SVD - #15
Merged
Merged
Conversation
For non-square matrices (m≠n), the thin SVD derivative formulas require
null-space projector terms: (I-UU^T)dA V Σ^{-1} for dU when m>k, and
(I-VV^T)dA^T U Σ^{-1} for dV when n>k. These were already present in
the complex variants (zgesvd_d, cgesvd_d) but missing from the real
variants.
Files changed:
- dgesvd_d.f90, sgesvd_d.f90: add projector blocks after omega*GEMM
- dgesvd_dv.f90, sgesvd_dv.f90: add projector blocks inside ndir loop,
defer ad_dir deallocation so projectors can use it
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace the old explicit (I-UU^T) construction with the cleaner
projector formula matching the real variants:
- dU += (I-UU^T) * dA * V * Σ^{-1} when m > k
- dV += (I-VV^T) * dA^T * U * Σ^{-1} when n > k
Applied to zgesvd_d, zgesvd_dv, cgesvd_d, cgesvd_dv.
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.
For non-square matrices (m≠n), the thin SVD derivative formulas require null-space projector terms: (I-UU^T)dA V Σ^{-1} for dU when m>k, and (I-VV^T)dA^T U Σ^{-1} for dV when n>k. These were already present in the complex variants (zgesvd_d, cgesvd_d) but missing from the real variants.
Files changed: