Skip to content

Add extraction registration for TangentLinearOperator and fix checks - #253

Open
jpbrodrick89 wants to merge 2 commits into
jpb/operator-colouringfrom
jpb/tangent-structure
Open

jpbrodrick89 wants to merge 2 commits into
jpb/operator-colouringfrom
jpb/tangent-structure

Conversation

@jpbrodrick89

@jpbrodrick89 jpbrodrick89 commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Previously, TangentLinearOperator's diagonal and tridiagonal registrations raise NotImplementedError as there was no meaningful path that would fire these. However, for the determinant work we need to calculate lx.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:

  • The tangent of a unit-diagonal family has a zero diagonal, and the tangent of a {positive, negative, unknown-sign} semidefinite family need not be semidefinite of either sign — these now answer False.
  • max_rank neither delegates nor falls back to the dimension bound: writing a rank-≤k family as A(t) = U(t)V(t)ᵀ, the tangent dU Vᵀ + U dVᵀ has rank up to 2k, so the bound is min(dimension bound, 2·max_rank(primal)).

jpbrodrick89 and others added 2 commits September 25, 2026 10:53
…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>
@jpbrodrick89
jpbrodrick89 added this pull request to stack #255 September 25, 2026 22:28
@jpbrodrick89 jpbrodrick89 changed the title jpb/tangent structure Add extraction registration for TangentLinearOperator and fix checks Sep 25, 2026
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.

1 participant