t3_apply_corewise_transpose#
- t3toolbox.backend.apply.t3_apply_corewise_transpose(c, ww, core_pair, sum_over_probes=False)#
def t3_apply_corewise_transpose( c: NDArray, # residual, shape=W+C ww: typ.Sequence[NDArray], # apply vectors, len=d, elm_shape=W+(Ni,) core_pair: typ.Tuple[ typ.Sequence[NDArray], # tucker_cores, len=d, elm_shape=C+(ni,Ni) typ.Sequence[NDArray], # tt_cores, len=d, elm_shape=C+(ri,ni,r(i+1)) ], sum_over_probes: bool = False, # True: sum the apply stack W (the gradient J^T r) ) -> typ.Tuple[ typ.Tuple[NDArray, ...], # tucker-core gradients, same shapes as tucker_cores typ.Tuple[NDArray, ...], # tt-core gradients, same shapes as tt_cores ]:
Corewise (non-manifold) transpose of
t3_apply(): gradient of the measurement w.r.t. the cores of the framecore_pair, treated as independent variables.The adjoint of the core parametrization
cores -> apply(X(cores), ww)at the base point – the gradient a core-wise optimizer (Adam, L-BFGS) needs. Returns gradients shaped exactly like(tucker_cores, tt_cores)– a gradient, NOT a tensor (so no|W|blow-up: the apply stack collapses into the fixed-size cores). Distinct from the ambient transpose (a free CP tensor) and the tangent transpose (a Riemannian tangent); seedocs/transposes.md.Implemented by the Section 6.3 (“corewise simplification”) substitution into the tangent transpose,
B -> D,G -> U, L, R:tv_apply_transpose()at the frame(B, G, G, G). The manifold operation requires an orthogonal frame; the corewise one works for anyB,G.sum_over_probes=Truesums the apply stackW(the gradientJ^T r);FalsekeepsWas a stack (one core-gradient set per probe).Math reference: Section 6.3, Alger et al. (2026), “Tucker Tensor Train Taylor Series” (arXiv:2603.21141).