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.