ut3_rank_adjustment_sweep#

t3toolbox.backend.ut3_svd.ut3_rank_adjustment_sweep(data, direction='right_to_left', sharing=None)#
def ut3_rank_adjustment_sweep(
        data: UT3Data,
        direction: str = 'right_to_left',  # 'right_to_left' | 'left_to_right'
        sharing: typ.Optional[typ.Sequence] = None,  # len=d, static; one hashable group label per mode (None = unshared)
) -> UT3Data:

A single lossless directional sweep that drops structurally-redundant ranks – the uniform analog of ragged rank_adjustment_sweep (the minimization step; ut3svd() does not minimize).

'right_to_left' returns a right-orthogonal result; 'left_to_right' a left-orthogonal one. It reaches the minimal ranks only if the input is already orthogonal in the opposite direction – a ut3svd() result is left-orthogonal, so 'right_to_left' minimizes it. (The precondition is required here: unlike ragged, the static masks shrink to the minimal ranks, so a wrong-direction call on a non-oppositely-orthogonal input is lossy. Compose both directions for a minimal result in a chosen gauge.)

With sharing, the reduction is the grouped one (SHARED minimal ranks – the group ceiling, so a shared rank exceeding a single mode’s local ceiling is kept, where the per-mode reduction would clip it and untie the group) and the sweep is the grouped two-phase (tied factors stay tied, one array’s worth of content at every group mode). The partition is remapped through the mode reversal.

Parameters:
  • data (UT3Data)

  • direction (str)

  • sharing (t3toolbox.backend.common.typ.Optional[t3toolbox.backend.common.typ.Sequence])

Return type:

UT3Data