compute_raw_sweep_ranks#

t3toolbox.backend.ranks.compute_raw_sweep_ranks(shape, tucker_ranks, tt_ranks, cap_tucker_ranks, cap_tt_ranks, sharing=None, use_jax=False)#
def compute_raw_sweep_ranks(
        shape:        typ.Sequence[int],  # (N0, ..., N(d-1))
        tucker_ranks,                     # current Tucker ranks: seq (n0,...) or array (d,)+stack
        tt_ranks,                         # current TT ranks:     seq (r0,...) or array (d+1,)+stack
        cap_tucker_ranks,                 # min(current, max) Tucker ranks, same form as tucker_ranks
        cap_tt_ranks,                     # min(current, max) TT ranks,     same form as tt_ranks
        sharing: typ.Optional[typ.Sequence] = None,  # len=d, static; one hashable group label per mode (None = unshared)
        use_jax: bool = False,
) -> typ.Tuple:                           # (raw_tucker_ranks, raw_tt_ranks), same form as inputs

Ranks the T3-SVD sweep produces under hard rank caps – i.e. the ranks t3svd returns (it does not minimize; see rank_adjustment_sweep()). The sweep is down-orthogonalize, right-orthogonalize, then a left-to-right pass that caps each Tucker/TT edge: at each mode the SVD keeps min(structural rank, cap), so a downstream cap can leave an upstream rank above the structural minimum (non-minimal – see compute_minimal_ranks()). The caps enter the forward pass via the pre-capped ranks. (Used by uniform ut3svd to shrink the padded supercore to the actual content ranks.)

With sharing (a partition with a real group), the predicted ranks are those of the TWO-PHASE grouped sweep (_t3svd_shared / its uniform twin), which is a different pipeline: TT-bond rounding first (capped), then a lossless right sweep, then all Tucker truncations at once (each group keeps min(n_g, sum_{i in g} rL_i*rR_i, cap) of its concatenation – the structural size of the group SVD, assigned group-wide), then a lossless left re-orthogonalization that can shrink bonds against the reduced Tucker ranks. Verified == the ragged grouped t3svd output ranks over randomized structures/caps. Input Tucker ranks and caps must be equal within each group (structural error otherwise). sharing=None or an all-singleton partition is the unshared recurrence above.

Parameters:
  • shape (t3toolbox.backend.common.typ.Sequence[int])

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

  • use_jax (bool)

Return type:

t3toolbox.backend.common.typ.Tuple