t3_orthogonality_residual ========================= .. py:function:: t3toolbox.backend.t3_orthogonalization.t3_orthogonality_residual(x, side) .. code-block:: python def t3_orthogonality_residual( x: typ.Tuple[typ.Sequence[NDArray], typ.Sequence[NDArray]], # (tucker_cores, tt_cores) side: str, # 'left' or 'right' ) -> NDArray: # shape = stack_shape; max abs deviation from orthonormality per stack element (0 == exact) Non-enforcing check of T3 *left/right-orthogonal form*: Tucker cores down-orthogonal AND TT cores left- (``side='left'``) or right- (``side='right'``) orthogonal, **per stack element**. Returns the max-abs deviation from the identity over (each stacked block of), reduced over the **non-stack** axes (shape ``stack_shape``): - Tucker B_i, all i: ``einsum('...io,...jo->...ij', B, B) = I`` - TT G_i, left (i = 0..d-2): ``einsum('...aib,...aic->...bc', G, G) = I`` - TT G_i, right (i = 1..d-1): ``einsum('...aib,...cib->...ac', G, G) = I`` The boundary TT core (last for left, first for right) is the center remainder and is not checked. This is the form :py:func:`t3_left_orthogonalize` / :py:func:`t3_right_orthogonalize` produce and the form ``t3svd(..., assume_orthogonal=...)`` may assume.