Repository navigation
Handle Symmetric/Hermitian tangents with other uplo in ProjectTo - #721
Merged
Merged
Conversation
Projecting e.g. `Symmetric(B, :L)` with the projector of a `Symmetric(A, :U)` threw `ArgumentError: Cannot construct Symmetric; uplo doesn't match`, since the already-symmetric input was rewrapped with the primal's uplo. Such inputs now go through the symmetrizing fallback, so the result is stored with the primal's uplo. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #721 +/- ##
==========================================
+ Coverage 93.47% 93.50% +0.03%
==========================================
Files 15 15
Lines 1011 1016 +5
==========================================
+ Hits 945 950 +5
Misses 66 66 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Covers the generic `_same_uplo` fallback, which is only reached when the input is a plain array that already passes issymmetric/ishermitian. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
ProjectTofor aSymmetric/Hermitianprimal throws when the tangent is aSymmetric/Hermitianthat stores the other triangle:Because
issymmetricholds, the input was rewrapped asSymmetric(dy, project.uplo), which LinearAlgebra refuses for a mismatcheduplo(on Julia 1.10 as well as newer versions). Such inputs now go through the existing symmetrizing fallback, so the result has the same value and is stored with the primal'suplo.The same-
uplopath keeps its ownreturn. Merging both into a single type-unstabledzallocated on Julia 1.10, which made the existing@ballocatedtest fail.This came up in JuliaDiff/ChainRules.jl, where the
Matrix(::HermOrSym)rules are switching toProjectTo(natural tangents). Under the old rules a mismatched-uplotangent worked.Bumps the version to 1.26.6.
🤖 Generated with Claude Code