tv_apply_derivatives_transpose#

t3toolbox.backend.sampling_derivatives.tv_apply_derivatives_transpose(c, ww, pp, frame, order, sum_over_probes=False)#
def tv_apply_derivatives_transpose(
        c:          NDArray,                # residual jet (scalar), shape=(order+1)+W+K+C
        ww:         typ.Sequence[NDArray],  # probe vectors X,        len=d, elm_shape=W+(Ni,)
        pp:         typ.Sequence[NDArray],  # perturbation vectors P, len=d, elm_shape=W+(Ni,)
        frame:       typ.Tuple[
            typ.Sequence[NDArray], typ.Sequence[NDArray],
            typ.Sequence[NDArray], typ.Sequence[NDArray],
        ],                                  # = T3Frame.data = (U, O, P, Q)
        order:      int,                    # highest derivative order
        sum_over_probes: bool = False,      # True: sum the sample stack W (the J^T r back-projection)
) -> typ.Tuple[
    typ.Tuple[NDArray, ...],  # dU_tildes (Tucker variation gradient)
    typ.Tuple[NDArray, ...],  # dG_tildes (TT variation gradient)
]:                                          # = T3Variations.data

Transpose of tv_apply_derivatives(): back-project residual jets c into a variation gradient (dU_tildes, dG_tildes). The adjoint-state apply transpose – the scalar residual jet c seeds one propagation sweep (no per-mode residual, no nu/eta), so it is about half the probe transpose. Full W + K + C stacking: c carries the tangent stack K, which rides to the variation gradient; sum_over_probes sums (True, the Gauss-Newton J^T r) or keeps (False, W rides into the variation stack) the sample stack W; K/C always kept. Verified vs the dense adjoint identity <c, J v> = <J^T c, v> and jax.linear_transpose.

Parameters:
  • c (NDArray)

  • ww (t3toolbox.backend.common.typ.Sequence[NDArray])

  • pp (t3toolbox.backend.common.typ.Sequence[NDArray])

  • frame (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray]])

  • order (int)

  • sum_over_probes (bool)

Return type:

t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis], t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]]