Repository navigation
Add extraction registration for TangentLinearOperator and fix checks - #253
Open
jpbrodrick89 wants to merge 2 commits into
Open
jpbrodrick89 wants to merge 2 commits into
jpbrodrick89 wants to merge 2 commits into
Conversation
…ction The tangent of a curve of structured operators shares the structure -- diagonal, triangular, tridiagonal, circulant, symmetric, Hermitian -- so those checks keep delegating to the primal. A unit diagonal and semidefiniteness do not transfer: the tangent of a unit-diagonal family has a *zero* diagonal, and the tangent of a semidefinite family need not be semidefinite of either sign, so these now answer `False` instead of delegating. `diagonal`/`tridiagonal`/`first_column` previously raised as unreachable; they now return the *tangent's* entries (consistent with `as_matrix`) by differentiating the primal's own registration -- stored entries, a linear probe whose jvp is the same probe of the tangent, or a constant whose jvp is structurally zero. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Writing a rank-<=k family as `A(t) = U(t) V(t)^T`, the tangent `dU V^T + U dV^T` has rank up to `2k` -- equivalently, it is a limit of differences of two rank-<=k matrices -- so `max_rank(TangentLinearOperator)` is `min(dimension bound, 2 * max_rank(primal))` rather than a delegation. `is_semidefinite` joins the do-not-delegate list alongside its PSD/NSD siblings, for the same reason they are there. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
TangentLinearOperator and fix checks
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.
Previously,
TangentLinearOperator'sdiagonalandtridiagonalregistrations raiseNotImplementedErroras there was no meaningful path that would fire these. However, for the determinant work we need to calculatelx.trace(invert(A) @ dA)for the jvp rule and the efficiency of this depends on extraction of sparse tangents. These are now registered by differentiating through the primals registr:False.max_rankneither delegates nor falls back to the dimension bound: writing a rank-≤k family asA(t) = U(t)V(t)ᵀ, the tangentdU Vᵀ + U dVᵀhas rank up to 2k, so the bound ismin(dimension bound, 2·max_rank(primal)).