tensor4all / TensorCrossInterpolation.jl

https://tensor4all.github.io/TensorCrossInterpolation.jl/
MIT License
13 stars 0 forks source link

TensorCrossInterpolation

Dev CI

The TensorCrossInterpolation module implements the tensor cross interpolation algorithm for efficient interpolation of multi-index tensors and multivariate functions.

This algorithm is used in the quantics tensor cross interpolation (QTCI) method for exponentially efficient interpolation of functions with scale separation. QTCI is implemented in the QuanticsTCI.jl module.

Installation

This module has been registered in the General registry. It can be installed by typing the following in a Julia REPL:

using Pkg; Pkg.add("TensorCrossInterpolation.jl")

Usage

This section only contains the bare minimum to get you started. An example with more explanation can be found in the user manual.

Given a multivariate function f, the function crossinterpolate2 will generate a tensor cross interpolation for f. For example, to interpolate the 8d lorentzian $f(\mathbf v) = 1/(1 + \mathbf v^2)$ on an 8-dimensional lattice of integers, $\mathbf{v} \in {1, 2, ..., 10}^8$:

import TensorCrossInterpolation as TCI
f(v) = 1/(1 + v' * v)
# There are 8 tensor indices, each with values 1...10
localdims = fill(10, 8)
tolerance = 1e-8
tci, ranks, errors = TCI.crossinterpolate2(Float64, f, localdims; tolerance=tolerance)

Note:

The resulting TensorCI2 object can be further manipulated, see user manual. To evaluate the TCI interpolation, simply call your TensorCI1 object like you would call the original function:

originalvalue = f([1, 2, 3, 4, 5, 6, 7, 8])
interpolatedvalue = tci([1, 2, 3, 4, 5, 6, 7, 8])

The sum of all function values on the lattice can be obtained very efficiently from a tensor train:

sumvalue = sum(tci)

Online user manual

An example with more explanation can be found in the user manual.

Related modules

TCIITensorConversion.jl

A small helper module for easy conversion of TensorCI1, TensorCI2 and TensorTrain objects into ITensors MPS objects. This should be helpful for those integrating TCI into a larger tensor network algorithm. For this conversion, simply call the MPS constructor on the object:

mps = MPS(tci)

QuanticsTCI.jl

A module that implements the quantics representation and combines it with TCI for exponentially efficient interpolation of functions with scale separation.

Contributions

Authors

This project is maintained by

For their contributions to this library's code, we thank


References