tv_corewise_lift ================ .. py:function:: t3toolbox.backend.tv_operations.tv_corewise_lift(frame, variations, lift_factors) .. code-block:: python def tv_corewise_lift( frame: typ.Tuple[ typ.Sequence[NDArray], # down_tucker_cores. len=d, elm_shape=C+(nDi, Ni) typ.Sequence[NDArray], # up_tt_cores. len=d, elm_shape=C+(rLi, nUi, rR(i+1)) typ.Sequence[NDArray], # left_tt_cores. len=d, elm_shape=C+(rLi, nDi, rL(i+1)) typ.Sequence[NDArray], # right_tt_cores. len=d, elm_shape=C+(rRi, nDi, rR(i+1)) ], variations: typ.Tuple[ typ.Sequence[NDArray], # tucker_variations. len=d, elm_shape=K+C+(nUi, Ni) typ.Sequence[NDArray], # tt_variations. len=d, elm_shape=K+C+(rLi, nDi, rR(i+1)) ], lift_factors: fv_operations.LiftFactors, # the frame's, fv_operations.fv_lift_factors; stack C ) -> typ.Tuple[ typ.Tuple[NDArray, ...], # Bdot. len=d, elm_shape=K+C+(nDi, Ni) typ.Tuple[NDArray, ...], # Gdot. len=d, elm_shape=K+C+(rLi, nDi, rL(i+1)) ]: Lift frame coordinates to raw core variations: ``theta_hat``, the lift of ``v``. ``Bdot_i = (S_i^T)^{+eps} V_i``, ``Gdot_i = H_i x_3 T_i^{+eps}`` (``i <= d-2``), ``Gdot_{d-1} = H_{d-1}``, with the frame's damped pseudo-inverses ``lift_factors`` (:py:func:`~t3toolbox.backend.fv_operations.fv_lift_factors`). The output is a variation of the frame's own raw cores ``theta = (D, L)`` (the base point in its left-canonical gauge): at ``eps = 0``, ``tv_to_dense(t3_corewise_frame((D, L)), theta_hat) == tv_to_dense(frame, v)`` for **any** coordinates ``v`` -- gauged or not -- on every numerically full-rank frame ``t3_orthogonal_representations`` builds, minimal or not (the pseudo-inverses are exact one-sided inverses there); at a rank-deficient point the clipped directions drop out, ``dPhi[theta_hat] = E(Q v)`` (see :py:func:`~t3toolbox.backend.fv_operations.fv_lift_factors`). This is how a tangent direction reaches the core parametrization ``Phi``: the second derivative of ``Phi`` along ``theta_hat`` is what carries the curvature (Weingarten) term of the Riemannian Hessian (Absil, Mahony & Trumpf (2013), "An extrinsic look at the Riemannian Hessian"). ``theta = (D, L)`` is written by the frame's stores it is built from (down, left); its corewise direction ``theta_hat = (Bdot, Gdot)`` moves the point's own raw cores, so it takes ``B``. The last TT slot passes through **undamped**: ``H_{d-1}`` multiplies no inverse. A damping ``eps > 0`` bounds every other slot by ``1/(2 eps)`` near a rank drop; the identity then holds to ``O(eps^2 / sigma^2)`` on the well-conditioned directions. The transpose :py:func:`tv_corewise_lift_transpose` uses the SAME factors, so the composition -- the lift's adjoint, then ``K``, then the lift -- is symmetric for every ``eps``. **Shared points.** With tied lift factors (:py:func:`~t3toolbox.backend.sharing.fv_tied_lift_factors`) each nontrivial sharing group's Tucker slots lift to ONE factor direction, ``Bdot_g = M_g^{+eps} [V_i1; ...]`` against the stacked ``M_g = [S_i1^T; ...]``, the same array at every group mode -- the lift of the tied parametrization ``Phi(T theta_sh)``, ``T`` copying the group factor; singleton modes and the TT slots lift as above. Batching: the factors carry the frame stack ``C``; the variations carry ``K + C`` -- one lift per tangent at the common frame, the factors broadcast over ``K`` (grouped contractions, ``C`` pinned by the factors). ``frame`` is not read by the arithmetic -- the factors carry everything -- but keeps the ``(frame, variations)`` calling convention, and the mode counts are checked against it (structural). .. rubric:: Examples A stack of three tangents at one frame, lifted exactly (``curvature_damping = 0``): >>> import numpy as np >>> import t3toolbox.tucker_tensor_train as t3 >>> import t3toolbox.backend.fv_conversions as fvc >>> import t3toolbox.backend.fv_operations as fvo >>> import t3toolbox.backend.tv_operations as tvo >>> np.random.seed(0) >>> x = t3.TuckerTensorTrain.randn((5, 6, 7), (2, 3, 2), (1, 2, 2, 1)) >>> frame, _ = fvc.t3_orthogonal_representations(x.data) >>> v = fvo.fv_variations_randn(fvo.fv_variation_shapes(frame), (3,)) # K = (3,), ungauged >>> theta_hat = tvo.tv_corewise_lift(frame, v, fvo.fv_lift_factors(frame, 0.0)) >>> print([b.shape for b in theta_hat[0]], [G.shape for G in theta_hat[1]]) [(3, 2, 5), (3, 3, 6), (3, 2, 7)] [(3, 1, 2, 2), (3, 2, 3, 2), (3, 2, 2, 1)] >>> corewise_frame = fvc.t3_corewise_frame((frame[0], frame[2])) # theta = (D, L) >>> print(np.allclose(tvo.tv_to_dense(corewise_frame, theta_hat), tvo.tv_to_dense(frame, v))) True