frame_has_minimal_ranks#

t3toolbox.backend.ranks.frame_has_minimal_ranks(shape, up_ranks, down_ranks, left_ranks, right_ranks, sharing=None)#
def frame_has_minimal_ranks(
        shape:          typ.Sequence[int],
        up_ranks:       typ.Sequence[int],
        down_ranks:     typ.Sequence[int],
        left_ranks:     typ.Sequence[int],
        right_ranks:    typ.Sequence[int],

        sharing:        typ.Optional[typ.Sequence] = None,  # len=d, static; one hashable group label per mode (None = unshared)
) -> bool:

True if a T3Frame with these (redundant) ranks is structurally minimal.

Requires the left/right and up/down rank stores to agree, and the up/left ranks to equal the minimal ranks for the shape. With sharing, minimality is the SHARED notion (compute_minimal_ranks() with sharing): up ranks must additionally be equal within each group (False otherwise – untied ranks cannot carry tied factors), and the group ceiling can keep a rank the per-mode reduction would clip. A diagnostic, never a precondition (minimal rank – shared or not – is not a correctness precondition for any verified operation, and a freshly rank-padded continuation restart legitimately sits below full shared rank).

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

  • up_ranks (t3toolbox.backend.common.typ.Sequence[int])

  • down_ranks (t3toolbox.backend.common.typ.Sequence[int])

  • left_ranks (t3toolbox.backend.common.typ.Sequence[int])

  • right_ranks (t3toolbox.backend.common.typ.Sequence[int])

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

Return type:

bool