uniform_minimal#

t3toolbox.backend.uniform_fitting.uniform_minimal(x0)#
def uniform_minimal(
        x0:  typ.Any,   # UniformTuckerTensorTrain
) -> typ.Any:           # the same tensor with structurally-minimal ranks (x0 itself if already minimal)

Reduce x0 to its structurally-minimal ranks – the SAME tensor, with any unrealizable nominal rank dropped (e.g. a TT bond rank exceeding what the Tucker ranks can realize). A no-op (returns x0 unchanged) when it is already minimal, which is the common case.

Uniform fitting requires a minimal frame (uniform_least_squares_problem()). The reason is structural: from a non-minimal frame the manifold retraction truncates to the realizable (minimal) rank, which no longer matches the fixed masks the optimizer holds loop-invariant – so the next step’s masking desyncs and crashes. The ragged layer tolerates non-minimal ranks (per-core shapes adapt); the uniform layer cannot (its masks are fixed), so it must start minimal and stay minimal (from a minimal frame the retraction provably preserves the ranks). Reduction: t3svd (-> left-orthogonal) then a 'right_to_left' rank_adjustment_sweep() (-> minimal, right-orthogonal). Same-tensor, done once at setup (eager).

Parameters:

x0 (t3toolbox.backend.common.typ.Any)

Return type:

t3toolbox.backend.common.typ.Any