t3toolbox.OLD_uniform#

Attributes#

UniformTuckerTensorTrain

Tuple containing supercores of a Uniform Tucker tensor train

UniformEdgeWeights

Tuple containing edge masks for a Uniform Tucker tensor train. Often used for masking.

UniformT3Base

Base supercores for base-variation representation of Uniform Tucker tensor train.

UniformT3Variation

Variation supercores for base-variation representation of Uniform Tucker tensor train.

UniformBVEdgeWeights

Edge weights for base-variation format.

UniformBVStructure

Shape and rank structure of a uniform base-variation T3 representation.

Functions#

get_uniform_base_structure(→ UniformBVStructure)

Get the structore of a uniform base.

get_uniform_base_hole_shapes(→ Tuple[Tuple[int, int, ...)

Get the hole shapes for a uniform base.

check_ut3(→ None)

Check internal shape consistency of UniformTuckerTensorTrain.

get_uniform_structure(→ UniformStructure)

Get padded structure of uniform Tucker tensor train.

get_original_structure(masks)

Get original (unpadded) structure of a uniform Tucker tensor train.

apply_masks(→ UniformTuckerTensorTrain)

Apply masks to uniform Tucker tensor train cores.

apply_masks_to_base(→ UniformT3Base)

Apply masks to uniform Tucker tensor train base.

apply_masks_to_variation(→ UniformT3Variation)

Apply masks to uniform Tucker tensor train variation.

uniform_squash_tails(→ UniformTuckerTensorTrain)

Squash tails of uniform Tucker tensor train.

pack_tensors(→ NDArray)

Use zero-padding to pack several tensors with ragged shapes into one tensor with an extra dimension.

unpack(→ Tuple[NDArray, Ellipsis])

Get ragged (variable length) edge vectors from uniform edge vectors.

make_uniform_masks(→ UniformEdgeWeights)

uniform_randn(→ UniformTuckerTensorTrain)

Makes a uniform Tucker tensor train with random cores.

uniform_zeros(→ UniformTuckerTensorTrain)

Makes a uniform Tucker tensor train with cores filled with zeros.

t3_to_ut3(→ Tuple[UniformTuckerTensorTrain, ...)

Convert TuckerTensorTrain to UniformTuckerTensorTrain.

ut3_to_t3(...)

Convert UniformTuckerTensorTrain to TuckerTensorTrain.

bv_to_ubv(→ Tuple[UniformT3Variation, UniformT3Base, ...)

ut3_to_dense(→ NDArray)

Construct dense tensor represented by uniform Tucker tensor train

are_ut3_ranks_minimal(→ bool)

Checks if the ranks of a uniform Tucker train are minimal.

ut3_entry(→ NDArray)

Compute entry (entries) of a uniform Tucker tensor train.

ut3_add(→ Tuple[UniformTuckerTensorTrain, ...)

Add two UniformTuckerTensorTrains, x,y -> x+y.

ut3_scale(→ UniformTuckerTensorTrain)

Scale a uniform Tucker tensor train, s,x -> s*x.

ut3_neg(→ UniformTuckerTensorTrain)

Flip a uniform Tucker tensor train, x -> -x.

ut3_sub(→ Tuple[UniformTuckerTensorTrain, ...)

Subtract two UniformTuckerTensorTrains, x,y -> x-y.

Module Contents#

t3toolbox.OLD_uniform.UniformTuckerTensorTrain#

Tuple containing supercores of a Uniform Tucker tensor train

Uniform Tucker tensor trains are created by padding a Tucker tensor train so that the ranks are uniform, then stacking the TT cores and Tucker cores into “supercores”, which have one more dimension.

Padding may be tracked with boolean mask arrays associated with the edges.

See also

UniformTuckerTensorTrainMasks

Components
  • tucker_supercore: NDArray. shape=(d, n, N). Stacked padded tucker cores

  • tt_supercore: NDArray. shape=(d, r, n, r). Stacked padded TT-cores

Here:
  • d = num_cores

  • N = padded_shape

  • n = padded_tucker_rank

  • r = padded_tt_rank

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.uniform_tucker_tensor_train as ut3
>>> x = t3.t3_corewise_randn(((14,15,16), (4,6,5), (1,3,2,1)))
>>> cores, masks = ut3.t3_to_ut3(x)
>>> print(ut3.get_padded_structure(cores))
(3, 16, 6, 3)
>>> print(ut3.original_structure(masks))
((14, 15, 16), (4, 6, 5), (1, 3, 2, 1))
t3toolbox.OLD_uniform.UniformEdgeWeights#

Tuple containing edge masks for a Uniform Tucker tensor train. Often used for masking.

See also

UniformTuckerTensorTrainCores

Components
  • shape_masks: NDArray. shape=(d,N). Weights for edges between Tucker cores and exterior of tensor

  • tucker_masks: NDArray. shape=(d,n). Weights for edges between Tucker cores and adjacent TT-cores

  • tt_masks: NDArray. shape=(d+1,r). Weights for edges between adjacent TT-cores

Here:
  • d = num_cores

  • N = padded_shape

  • n = padded_tucker_rank

  • r = padded_tt_rank

Examples

>>> import numpy as np
>>> import t3toolbox.tucker_tensor_train as t3
>>> import t3toolbox.uniform_tucker_tensor_train as ut3
>>> x = t3.t3_corewise_randn(((14,15,16), (4,6,5), (1,3,2,1)))
>>> cores, masks = ut3.t3_to_ut3(x)
>>> print(ut3.get_padded_structure(cores))
(3, 16, 6, 3)
>>> print(ut3.original_structure(masks))
((14, 15, 16), (4, 6, 5), (1, 3, 2, 1))
t3toolbox.OLD_uniform.UniformT3Base#

Base supercores for base-variation representation of Uniform Tucker tensor train.

The components of T3Base are the “base cores”:
  • up_tucker_cores: NDArray, shape=(d, nU, N), up orthogonal elements

  • left_tt_cores: NDArray, shape=(d, r, nU, r), left orthogonal elements

  • right_tt_cores: NDArray, shape=(d, r, nU, r), right orthogonal elements

  • outer_tt_cores: NDArray, shape=(d, r, nO, r), outer orthogonal elements

See also

t3toolbox.tucker_tensor_train.T3Base, UniformT3Variation

t3toolbox.OLD_uniform.UniformT3Variation#

Variation supercores for base-variation representation of Uniform Tucker tensor train.

Components
  • var_tucker_supercore: NDArray, shape=(d,nO,N)

  • var_tt_supercore: NDArray, shape=(d,r,nU,r)

The variation components should fit in the “holes” of a UniformT3Variation.

See also

t3toolbox.tucker_tensor_train.T3Variation, UniformT3Base

t3toolbox.OLD_uniform.UniformBVEdgeWeights#

Edge weights for base-variation format.

Components
  • shape_weights: NDArray, shape=(d,Ni)

  • up_tucker_weights: NDArray, shape=(d,nUi)

  • outer_tucker_weights: NDArray, shape=(d,nOi)

  • left_tt_weights: NDArray, shape=(d,rLi)

  • right_tt_weights: NDArray, shape=(d,rRi)

See also

t3tools.tucker_tensor_train.EdgeWeights, t3tools.basis_coordinates_format.BVEdgeWeights, UniformT3Variation, UniformT3Base

t3toolbox.OLD_uniform.UniformBVStructure#

Shape and rank structure of a uniform base-variation T3 representation.

Components
  • d: int, number of tensor indices

  • N: size of external indices

  • nU: up tucker rank

  • nO: outer tucker rank

  • rL: left TT rank

  • rR: right TT rank