# Cross factorization of tensors: xfac#

`xfac`

is a c++ library (with python binding) to learn low-rank tensor train representations from a given tensor or function.
The learning is made by *tensor cross interpolation*.
Given a multidimensional function \(f:\mathcal{R}^n \rightarrow \mathcal{C}\), the library can generate an accurate approximation:

where \(M\) are matrices. As the variables are effectively separated, some tasks like integration or sum are now very cheap.

This factorization can be relevant even for function of one variable via the so-called *quantics* representation. In quantics, each variable is replaced by its \(R\) binary digits \(\sigma_0,\sigma_1,...,\sigma_{R-1}\) (for instance \(x=\sum^{R-1}_{r=0}\sigma_r 2^{-r}\) if \(0 \le x < 1\)), and then factorized:

making explicit the possible low entanglement between different scales of the function. Potentially, quantics allows arbitrary resolution representation (by using astronomically big grids of \(2^R\) points) with cost scaling linear in \(R\).

As examples of applications we can mention:

Integration of multidimensional functions:

quadratures

quantics

Computation of partition functions

Quantics: superfast Fourier transform

Quantics: solving partial differential equations

Automatic construction of matrix product operators

Function optimization

Quantum chemistry

The orignal math papers and the implemented algorithms are referenced here and:

Yuriel Núñez Fernández, Marc K. Ritter, Matthieu Jeannin, Jheng-Wei Li, Thomas Kloss, Olivier Parcollet, Jan von Delft, Hiroshi Shinaoka, and Xavier Waintal,

Learning low-rank tensor train representations: new algorithms and libraries,in preparation, (2024).

**Source code**

The public source code repo is: tensor4all/xfac

**Installation**

Install `xfac`

and this documentation according to the instructions in the README.md file of the code repo.

**License**

The licence is written in file LICENSE.rst of the code repo.