tucker_change_core_shapes#

t3toolbox.backend.t3_operations.tucker_change_core_shapes(tucker_cores, new_shape, new_tucker_ranks)#
def tucker_change_core_shapes(
        tucker_cores:     typ.Sequence[NDArray],  # len=d, elm_shape=stack_shape+(ni,Ni)
        new_shape:        typ.Sequence[int],      # len=d
        new_tucker_ranks: typ.Sequence[int],      # len=d
) -> typ.Tuple[NDArray, ...]:  # resized tucker_cores. len=d, elm_shape=stack_shape+(new_ni,new_Ni)

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

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

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

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

Return type:

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