compute_manifold_dim#
- t3toolbox.backend.ranks.compute_manifold_dim(shape, tucker_ranks, tt_ranks, sharing=None)#
def compute_manifold_dim( shape: typ.Sequence[int], # (N0, ..., N(d-1)) tucker_ranks: typ.Sequence[int], # (n0, ..., n(d-1)) tt_ranks: typ.Sequence[int], # (r0, ..., rd) sharing: typ.Optional[typ.Sequence] = None, # len=d, static; one hashable group label per mode (None = unshared) ) -> int:
Dimension of the fixed-rank Tucker tensor train manifold for the given structure.
Computed from the structurally-minimal ranks (gauge already quotiented). Because the reduction to minimal ranks happens here, this is the true tangent-space dimension for any structure of the given ranks, minimal or not: a rank the rest of the network cannot support adds no tangent directions, and passing the non-reduced ranks gives the same answer as passing the reduced ones.
With
sharing, the dimension of the shared-factor manifold (Tucker factors tied within each group): the reduction to minimal ranks is the SHARED one (compute_minimal_ranks()withsharing– the unshared reduction can clip a group rank the group ceiling admits, and the formula applied to the clipped ranks miscounts), the TT-core term is unchanged (TT cores are never tied), and there is one Stiefel termn_g*(N_g - n_g)per GROUP instead of per mode. Cf. Molozhavenko & Rakhuba (2026), Thm. 5, which proves a single trailing block (and over-subtracts by one: the boundary bondr_d = 1carries no gauge); arbitrary partitions are our extension, validated empirically against dense tied-tangent ranks.- Parameters:
shape (t3toolbox.backend.common.typ.Sequence[int])
tucker_ranks (t3toolbox.backend.common.typ.Sequence[int])
tt_ranks (t3toolbox.backend.common.typ.Sequence[int])
sharing (t3toolbox.backend.common.typ.Optional[t3toolbox.backend.common.typ.Sequence])
- Return type:
int