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)withtucker_weightslen=d, elm_shapestack_shape+(ni,)andtt_weightslen=d+1, elm_shapestack_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 coreG_k’s right leg; the leftmost boundary bondr0(no left neighbour) is absorbed rightward intoG_0’s left leg. Each of the d+1 bonds is absorbed exactly once.
Stacking rides the leading
'...'(weights share the cores’Cstack). jax-ness is inferred.