Skip to content

Commit ff5684e

Browse files
nstarmanclaude
andcommitted
🩹 fix(transforms): use is_flat_chart in linear pushforward; clarify frozen-τ
- Detect a Cartesian/flat chart with `is_flat_chart(chart)` (isinstance-based) instead of exact `chart == cart` equality, so a flat chart that isn't the exact canonical instance still takes the at-free fast path. - Reword the docstring: this overload is the frozen-τ rule; the act-level router (`prolong`, branching on `is_time_dependent`) sends time-dependent order≥1 acts to the generic prolongation (the `dot(M)` term), so they don't reach this frozen-τ path. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent e9d91ee commit ff5684e

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

  • src/coordinax/transforms/_src/actions

‎src/coordinax/transforms/_src/actions/linear.py‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
import coordinaxs.api.transforms as cxfmapi
2626
from .base import AbstractTransform, materialize_transform
2727
from .custom_types import CDict, HasShape, OptUSys
28-
from .utils import require_matching_keys
28+
from .utils import is_flat_chart, require_matching_keys
2929
from coordinax.internal import pack_uniform_unit
3030

3131

@@ -258,9 +258,13 @@ def pushforward(
258258
canonical Cartesian chart the pushforward is simply ``M v`` and needs no base
259259
point ``at`` (matching `Rotate`). For a non-Cartesian chart the tangent is
260260
pushed through the chart Jacobian (which does require ``at``), ``M`` is applied
261-
in Cartesian, then pulled back. Time-dependent linear maps instead route
262-
through the generic prolongation, which supplies the ``dot(M)`` term and
263-
requires the jet anchors.
261+
in Cartesian, then pulled back.
262+
263+
This overload is the frozen-$\tau$ rule. For an order $\ge 1$ act on a
264+
*time-dependent* linear map, the ``act``-level router (see ``prolong``, which
265+
branches on ``is_time_dependent``) dispatches to the generic prolongation
266+
instead — that path adds the ``dot(M)`` term and requires the jet anchors —
267+
so time-dependent maps do not reach this frozen-$\tau$ overload via ``act``.
264268
265269
Examples
266270
--------
@@ -289,7 +293,7 @@ def pushforward(
289293
cart = chart.cartesian
290294
matrix = op._matrix(cart, tau)
291295

292-
if chart == cart:
296+
if is_flat_chart(chart):
293297
p_cart = v
294298
else:
295299
if at is None:
@@ -305,7 +309,7 @@ def pushforward(
305309
comps_cart = cart.components
306310
p_cart_out = _matmul_cdict(matrix, p_cart, comps_cart)
307311

308-
if chart == cart:
312+
if is_flat_chart(chart):
309313
return p_cart_out
310314

311315
# Map the base point forward (M @ at) to anchor the inverse Jacobian.

0 commit comments

Comments
 (0)