ut3_orthogonal_representations#

t3toolbox.uniform_frame_variations_format.ut3_orthogonal_representations(x, already_left_orthogonal=False, squash_tails=True)#
def ut3_orthogonal_representations(
        x: ut3.UniformTuckerTensorTrain,
        already_left_orthogonal: bool = False,
        squash_tails: bool = True,
) -> typ.Tuple[
    UT3Frame,  # orthogonal frame
    UT3Variations,  # variations
]:

Construct frame-variation representations of UniformTuckerTensorTrain with orthogonal frame.

Input TuckerTensorTrain:

          1 -- G0 -- G1 -- G2 -- G3 -- 1
X    =         |     |     |     |
               B0    B1    B2    B3
               |     |     |     |

Frame-variation representation with non-orthogonal TT-backend H1:

          1 -- L0 -- H1 -- R2 -- R3 -- 1
X    =         |     |     |     |
               U0    U1    U2    U3
               |     |     |     |

Frame-variation representation with non-orthogonal tucker backend V2:

          1 -- L0 -- L1 -- O2 -- R3 -- 1
X    =         |     |     |     |
               U0    U1    V2    U3
               |     |     |     |
The input tensor train x is defined by:
  • x_tucker_cores = (B0, B1, B2, B3)

  • x_tt_cores = (G0, G1, G2, G3)

The “frame cores” are:
  • tucker_cores = (U0,U1, U2, U3), up orthogonal

  • left_tt_cores = (L0, L1, L2), left orthogonal

  • right_tt_cores = (R1, R2, R3), right orthogonal

  • outer_tt_cores = (O0, O1, O2, O3), down orthogonal

The “variation cores” are:
  • tucker_variations = (V0, V1, V2, V3)

  • tt_variations = (H0, H1, H2, H3)

Parameters:
  • x (TuckerTensorTrain) – Input TuckerTensorTrain x = (x_tucker_cores, x_tt_cores) x_tucker_cores = (B0, …, B(d-1)) x_tt_cores = (G0, …, G(d-1))

  • xnp – Linear algebra backend. Default: np (numpy)

  • already_left_orthogonal (bool)

  • squash_tails (bool)

Returns:

  • T3Base – Orthogonal frame for frame-variation representations of x.

  • T3Variation – Variation for frame-variation representaions of x.

Return type:

t3toolbox.backend.common.typ.Tuple[UT3Frame, UT3Variations]

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.uniform_tucker_tensor_train as ut3
>>> import t3toolbox.uniform_frame_variations_format as ubvf
>>> np.random.seed(0)
>>> x = t3.TuckerTensorTrain.randn((4, 5, 6), (2, 3, 2), (1, 2, 2, 1))
>>> frame, variations = ubvf.ut3_orthogonal_representations(ut3.UniformTuckerTensorTrain.from_t3(x))
>>> type(frame).__name__, type(variations).__name__
('UT3Frame', 'UT3Variations')
>>> frame.shape
(4, 5, 6)
>>> # the orthogonal frame still represents the original tensor:
>>> bool(np.allclose(frame.to_t3frame().to_dense(), x.to_dense()))
True