t3_rank_adjustment_sweep#
- t3toolbox.backend.t3_svd.t3_rank_adjustment_sweep(x, direction='right_to_left')#
def t3_rank_adjustment_sweep( x: typ.Tuple[ typ.Tuple[NDArray, ...], # tucker_cores typ.Tuple[NDArray, ...], # tt_cores ], direction: str = 'right_to_left', # 'right_to_left' | 'left_to_right' ) -> typ.Tuple[ typ.Tuple[NDArray, ...], # tucker_cores typ.Tuple[NDArray, ...], # tt_cores ]:
A single lossless directional sweep that drops structurally-redundant ranks (re-SVD each Tucker edge and TT bond with no cap). The represented tensor is unchanged.
'right_to_left'produces a right-orthogonal result;'left_to_right'a left-orthogonal one. A single sweep reaches the minimal ranks only if the input is already orthogonal in the opposite direction – e.g. at3svd()result is left-orthogonal, sot3_rank_adjustment_sweep(result, 'right_to_left')minimizes it (verify withhas_minimal_ranks). On a general input it is a partial reduction; compose both directions for guaranteed minimal ranks.