TT

TT(self, options: TTOptions | None = None)

A tensor train factorisation.

This class computes and stores a tensor train factorisation of the discretisation of an arbitrary function on a tensor-product grid, using the alternating cross approximation algorithm outlined in Oseledets and Tyrtyshnikov (2010).

Parameters

options : TTOptions | None = None

Parameters which control the construction of the tensor train factorisation.

Methods

Name Description
initialise Initialises the TT.
sweep Runs a single cross iteration.
round Rounds the TT cores.

initialise

TT.initialise(target_func: Callable[[Tensor], Tensor], grid: Grid)

Initialises the TT.

Parameters

target_func : Callable[[Tensor], Tensor]

A function that takes an \(n \times d\) matrix with rows containing samples from the tensor product grid, and returns an \(n\)-dimensional vector containing the values of the target function evaluated at each sample.

grid : Grid

The tensor product grid used to construct the TT.

sweep

TT.sweep()

Runs a single cross iteration.

If cross iterations have been run previously, this performs a sweep over the cores in the opposite order to the previous sweep.

round

TT.round(tol: float | None = None, max_rank: int | None = None)

Rounds the TT cores.

Applies double rounding to get back to the starting direction.

Parameters

tol : float | None = None

The tolerance to use when applying truncated SVD to round each core.

References

Oseledets, Ivan, and Eugene Tyrtyshnikov. 2010. “TT-Cross Approximation for Multidimensional Arrays.” Linear Algebra and Its Applications 432 (1): 70–88. https://doi.org/10.1016/j.laa.2009.07.024.