TuckerTensorTrain.t3m ===================== .. py:method:: t3toolbox.tucker_tensor_train.TuckerTensorTrain.t3m(other, method = 'inplace_fused', max_tucker_ranks = None, max_tt_ranks = None, rtol = None, atol = None, oversample = 1) .. code-block:: python def t3m( self, other: 'TuckerTensorTrain', # same shape & stack_shape method: str = 'inplace_fused', # the memory-light default for large d max_tucker_ranks: typ.Union[int, Sequence[int], None] = None, # scalar (caps all) or len=d max_tt_ranks: typ.Union[int, Sequence[int], None] = None, # scalar (caps all) or len=d+1 rtol: typ.Optional[float] = None, # requires unstacked atol: typ.Optional[float] = None, # requires unstacked oversample: float = 1, # method='swap' only; intermediate-rank relaxation ) -> 'TuckerTensorTrain': Elementwise (Hadamard) product ``self ⊙ other`` with optional rank truncation. Like ``self * other`` (whose ranks multiply: ``n_x·n_y`` Tucker, ``r_x·r_y`` TT) but able to **truncate** the result. ``method`` selects the algorithm -- all give the same product, with different cost/memory trade-offs (see ``docs/ttm_t3m_ht_note.tex``): - ``'form_then_round'`` -- form the full product, then round. Parallel forming; cheapest to run for small bonds. This is what ``*`` uses. - ``'inplace_fused'`` (default) -- a fused sweep that never materializes the full product; the right default for large ``d``. - ``'swap'`` -- the swap-based TTM generalization; best when the TT bond ``r`` greatly exceeds the number of modes ``d`` (``O(d²·r³)`` compute, ``O(r̃²)`` memory). Truncation (any combination; default none ⇒ exact full product): ``max_tucker_ranks`` / ``max_tt_ranks`` (a scalar caps every position, or a per-position sequence) and ``rtol`` / ``atol`` (per-step relative/absolute tolerances). ``oversample`` (``method='swap'`` only, ``>= 1``, default ``1`` = off): relaxes the intermediate ranks/tolerances by this factor during the swaps and runs a final ``t3svd`` cleanup at the exact targets. ``1`` is the lowest-memory / lowest-quality corner; a modest ``2`` is a good default for near-``form_then_round`` quality at a small memory cost; quality approaches ``form_then_round`` as ``oversample → ∞``. See ``docs/ttm_t3m_ht_note.tex`` for why this is needed (the Tucker leaf-frame coupling). .. warning:: ``rtol``/``atol`` are **not supported for stacked** Tucker tensor trains (different stack elements could truncate to different ranks). Use ``max_*_ranks`` for stacked input, or unstack first. Max-rank truncation *is* stacking-compatible.