tt_change_core_shapes#

t3toolbox.backend.tt_operations.tt_change_core_shapes(tt_cores, new_tucker_ranks, new_tt_ranks)#
def tt_change_core_shapes(
        tt_cores:         typ.Sequence[NDArray],  # len=d, elm_shape=stack_shape+(rLi,ni,rR(i+1))
        new_tucker_ranks: typ.Sequence[int],      # len=d
        new_tt_ranks:     typ.Sequence[int],      # len=d+1
) -> typ.Tuple[NDArray, ...]:  # resized tt_cores. len=d, elm_shape=stack_shape+(new_rLi,new_ni,new_rR(i+1))

Increase/decrease Tucker and/or TT ranks for TT cores using zero padding/truncation.

Parameters:
  • tt_cores (t3toolbox.backend.common.typ.Sequence[NDArray])

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

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

Return type:

t3toolbox.backend.common.typ.Tuple[NDArray, Ellipsis]