TuckerTensorTrain.t3m#
- t3toolbox.tucker_tensor_train.TuckerTensorTrain.t3m(other, method='inplace_fused', max_tucker_ranks=None, max_tt_ranks=None, rtol=None, atol=None, oversample=1)#
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 ⊙ otherwith optional rank truncation.Like
self * other(whose ranks multiply:n_x·n_yTucker,r_x·r_yTT) but able to truncate the result.methodselects the algorithm – all give the same product, with different cost/memory trade-offs (seedocs/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 larged.'swap'– the swap-based TTM generalization; best when the TT bondrgreatly exceeds the number of modesd(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) andrtol/atol(per-step relative/absolute tolerances).oversample(method='swap'only,>= 1, default1= off): relaxes the intermediate ranks/tolerances by this factor during the swaps and runs a finalt3svdcleanup at the exact targets.1is the lowest-memory / lowest-quality corner; a modest2is a good default for near-form_then_roundquality at a small memory cost; quality approachesform_then_roundasoversample → ∞. Seedocs/ttm_t3m_ht_note.texfor why this is needed (the Tucker leaf-frame coupling).Warning
rtol/atolare not supported for stacked Tucker tensor trains (different stack elements could truncate to different ranks). Usemax_*_ranksfor stacked input, or unstack first. Max-rank truncation is stacking-compatible.- Parameters:
other (TuckerTensorTrain)
method (str)
max_tucker_ranks (Union[int, collections.abc.Sequence[int], None])
max_tt_ranks (Union[int, collections.abc.Sequence[int], None])
rtol (Optional[float])
atol (Optional[float])
oversample (float)
- Return type: