tt_zipper_left_to_right#
- t3toolbox.backend.tt_operations.tt_zipper_left_to_right(coresA, coresB)#
def tt_zipper_left_to_right( coresA: typ.Sequence[NDArray], # len=d, elm_shape=stack_shape+(rAi, ni, rA(i+1)) coresB: typ.Sequence[NDArray], # len=d, elm_shape=stack_shape+(rBi, ni, rB(i+1)) ) -> typ.Tuple[NDArray, ...]: # zipper matrices, len=d+1, elm_shape=stack_shape+(rAi, rBi)
Accumulate left-to-right the partial contractions of two TT chains sharing tensor indices.
Returns d+1 matrices Z_i; Z_0 is the (left-boundary) ones matrix and Z_(i+1) contracts Z_i with cores A_i, B_i. Stack-aware. Polymorphic over the representation (the scan reuse rule): a ragged core tuple gives a ragged
xscanand a tuple of d+1 matrices; a uniform TT supercore ((d,)+stack+(rA, n, rB), detected as a bare ndarray) gives the uniformxscanover the leading mode axis – still returned as a tuple of d+1 matrices (the caller stacks if it wants a supercore).