t3_absorb_weights#

t3toolbox.backend.t3_operations.t3_absorb_weights(x0, weights)#
def t3_absorb_weights(
        x0:      typ.Tuple[typ.Sequence[NDArray], typ.Sequence[NDArray]],  # (tucker_cores, tt_cores)
        weights: typ.Tuple[typ.Sequence[NDArray], typ.Sequence[NDArray]],  # (tucker_weights, tt_weights)
) -> typ.Tuple[
    typ.Tuple[NDArray, ...],  # weighted tucker_cores, len=d,   elm_shape=stack_shape+(ni, Ni)
    typ.Tuple[NDArray, ...],  # weighted tt_cores,     len=d,   elm_shape=stack_shape+(ri, ni, r(i+1))
]:

Contract diagonal edge weights into a Tucker tensor train’s cores (shape-preserving).

weights = (tucker_weights, tt_weights) with tucker_weights len=d, elm_shape stack_shape+(ni,) and tt_weights len=d+1, elm_shape stack_shape+(ri,) – one diagonal (stored as its vector) per internal edge. The result is a plain (tucker_cores, tt_cores) whose dense value is the fully-weighted network. Side-convention (library-decided):

  • Tucker weights → the Tucker cores (the rank leg): '...i,...io->...io'.

  • TT bond weights leftward: bond r(k+1) into its left-neighbour core G_k’s right leg; the leftmost boundary bond r0 (no left neighbour) is absorbed rightward into G_0’s left leg. Each of the d+1 bonds is absorbed exactly once.

Stacking rides the leading '...' (weights share the cores’ C stack). jax-ness is inferred.

Parameters:
  • x0 (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray]])

  • weights (t3toolbox.backend.common.typ.Tuple[t3toolbox.backend.common.typ.Sequence[NDArray], t3toolbox.backend.common.typ.Sequence[NDArray]])

Return type:

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