Considering an arbitrary continuous function $\phi(\mathbf{r})$ on the cube $\mathbf{r} = (x,y,z) \in [0, b]^3$, we approximate $ x $ via a zero-one tuple $(x_1x_2x_3...x_n)\in \{0,1\}^n$ using the following formula:

$$ \begin{align*} x \approx b( \frac{x_1}{2^1} + \frac{x_2}{2^2} + \dots + \frac{x_n}{2^n}). \end{align*} $$

Doing the same thing for $y$ and $z$, we can approximately write $\phi(\mathbf{r})$ down in an “enumerate” form as tensor

$$ \begin{align*} \phi(\mathbf{r})\approx\Phi_{x_1x_2...x_ny_1y_2...y_nz_1z_2...z_n}=:\Phi_{\mathbf{r}}, \end{align*} $$


where $\Phi_{\mathbf{r}}$ is a large tensor of $(2^n)^3$ elements. In order to represent the function $\phi(\mathbf{r})$ more accurately, it is necessary to have a fine grid, that is, a sufficiently large $n$. However, an exponentially increasing space complexity is prohibitively high. So, how to reduce the space complexity as much as possible while maintaining a competitive accuracy?

For any tensor can be unfolded as a tensor train, more general, tensor network, as Fig. 1.

Tensor train.

Fig. 1. Tensor train.

Formally,

$$ \begin{align*} \Phi_{x_1x_2...x_ny_1y_2...y_nz_1z_2...z_n} & \approx \sum_{\alpha_1=1}^{D_1} \sum_{\alpha_2=1}^{D_2} \dots \sum_{\alpha_{3n-1}=1}^{D_{3n-1}} F^{(1)}_{x_1, 1, \alpha_1} F^{(2)}_{x_2, \alpha_1, \alpha_2} \dots F^{(3n)}_{z_{n}, \alpha_{3n-1}, 1}\\ & \equiv F^{(1)}_{x_1} \cdot F^{(2)}_{x_2} \cdot \dots \cdot F^{(n)}_{x_{n}} \cdot F^{(n+1)}_{y_1} \cdot F^{(n+2)}_{y_2} \cdot \dots \cdot F^{(2n)}_{y_{n}} \cdot F^{(2n+1)}_{z_1} \cdot F^{(2n+2)}_{z_2} \cdot \dots \cdot F^{(3n)}_{z_{n}} \\ & = \prod \limits_{i=1}^n F^{(i)}_{x_i} \prod \limits_{j=n+1}^{2n} F^{(j)}_{y_j} \prod \limits_{k=2n+1}^{3n} F^{(k)}_{z_k}, \end{align*} $$


where $\cdot$ is tensor contraction and the space complexity is reduced to $(2\sum_{i=1}^{3n-1}D_{i} D_{i+1})\sim\mathcal{O}(n)$ with $D_{1}=D_{3n}=1$

Citation

Cited as:

Zhao, Tong. (Nov  2024). “Tensor Train for Function Representation”. Tong’Log.
https://zhaotong94.github.io/blog/ttfr/.

Or

@article{zhao2024tensor,
    title   = "Tensor Train for Function Representation",
    author  = "Zhao, Tong",
    journal = "zhaotong94.github.io",
    year    = "2024",
    month   = "Nov",
    url     = "https://zhaotong94.github.io/blog/ttfr/"}