nontrivial_groups#

t3toolbox.backend.sharing.nontrivial_groups(groups)#
def nontrivial_groups(
        groups: typ.Tuple[typ.Tuple[int, ...], ...],  # static; canonical form (validate_sharing)
) -> typ.Tuple[typ.Tuple[int, ...], ...]:             # static; the groups with >= 2 modes

The sharing groups that actually tie anything (two or more modes), in canonical order.

An all-singleton result means the partition is trivial – shared operations dispatch to their unshared code paths in that case.

Examples

>>> import t3toolbox.backend.sharing as sharing
>>> groups = sharing.validate_sharing((0, 1, 1, 2), (4, 5, 5, 6))
>>> sharing.nontrivial_groups(groups)
((1, 2),)
>>> sharing.nontrivial_groups(sharing.validate_sharing((0, 1, 2), (4, 5, 6)))
()
Parameters:

groups (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[int, ...], ...])

Return type:

t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Tuple[int, …], …]