utv_corewise_inner ================== .. py:function:: t3toolbox.backend.utv_operations.utv_corewise_inner(variations_a, variations_b, n_stack) .. code-block:: python def utv_corewise_inner( variations_a: typ.Tuple, # UT3Variations .data: (tkv, ttv, shape, masks), supercore stack = K + C variations_b: typ.Tuple, # UT3Variations .data: same structure as variations_a n_stack: int, # number of leading stack axes (K + C) to keep; 0 -> a single scalar ) -> NDArray: # coordinate inner product, shape = stack_shape[:n_stack] (scalar if n_stack==0) The raw coordinate (corewise) inner product of two uniform tangents' variations -- mask-applied and stack-keeping; **not** the Hilbert-Schmidt metric. The raw-tuple backend twin of :py:meth:`~t3toolbox.uniform_manifold.UT3Tangent.corewise_inner` (which delegates here). Masks both variation supercores once (``ufv_apply_variations_masks`` -- so the garbage padding is zeroed, never summed into the dot), then sums the elementwise product over the leading mode index ``d`` and the trailing core axes, **keeping the first** ``n_stack`` **stack axes** (one dot per stacked tangent). Pass ``n_stack = len(stack_shape)`` to keep the whole ``K + C`` stack, or ``n_stack = 0`` to collapse to a single scalar -- the unstacked optimizer's coordinate ``⟨·,·⟩``, the check-free twin the geometries' ``inner`` binds (it equals Hilbert-Schmidt only on an orthonormal, gauged frame). Masking makes it robust to garbage padding, so the reduction needs no clean-padding precondition.