Documentation
QuanticsTCI.quanticscrossinterpolate — Methodfunction quanticscrossinterpolate(
::Type{ValueType},
f,
size::NTuple{d,Int},
initialpivots::AbstractVector{<:AbstractVector}=[ones(Int, d)];
unfoldingscheme::Symbol=:interleaved,
kwargs...
) where {ValueType,d}Interpolate a Tensor $F$ as a quantics tensor train. For an explanation of arguments, etc., see the documentation of the main overload.
QuanticsTCI.quanticscrossinterpolate — Methodfunction quanticscrossinterpolate(
::Type{ValueType},
f,
xvals::AbstractVector{<:AbstractVector},
initialpivots::Union{Nothing,AbstractVector{<:AbstractVector}}=nothing;
unfoldingscheme::Symbol=:interleaved,
nrandominitpivot=5,
kwargs...
) where {ValueType}Interpolate a function $f(\mathbf{x})$ as a quantics tensor train. This overload automatically constructs a Grid object from the $\mathbf{x}$ points given in xvals.
Arguments:
xvals::AbstractVector{<:AbstractVector}: A set of discrete points wherefcan be evaluated, given as a set of arrays, wherexvals[i]describes theith axis. Each array inxvalsshould contain2^Rpoints for some integerR.- For all other arguments, see the documentation of the main overload.
QuanticsTCI.quanticscrossinterpolate — Methodfunction quanticscrossinterpolate(
::Type{ValueType},
f,
xvals::AbstractVector,
initialpivots::AbstractVector=[1];
kwargs...
) where {ValueType}Interpolate a function $f(x)$ as a quantics tensor train. This is an overload for 1d functions. For an explanation of arguments and return type, see the documentation of the main overload.
QuanticsTCI.quanticscrossinterpolate — Methodfunction quanticscrossinterpolate(
::Type{ValueType},
f,
size::NTuple{d,Int},
initialpivots::AbstractVector{<:AbstractVector}=[ones(Int, d)];
unfoldingscheme::Symbol=:interleaved,
kwargs...
) where {ValueType,d}Interpolate a function $f(\mathbf{x})$ as a quantics tensor train. This overload automatically constructs a Grid object using the information contained in size. Here, the ith argument runs from 1 to size[i].
QuanticsTCI.quanticscrossinterpolate — Methodfunction quanticscrossinterpolate(
::Type{ValueType},
f,
grid::QuanticsGrids.Grid{n},
initialpivots::Union{Nothing,AbstractVector{<:AbstractVector}}=nothing;
nrandominitpivot=5,
kwargs...
) where {ValueType}Interpolate a function $f(\mathbf{x})$ as a quantics tensor train. The tensor train itself is constructed using the 2-site tensor cross interpolation algorithm implemented in TensorCrossInterpolation.crossinterpolate2.
Arguments:
ValueTypeis the return type off. Automatic inference is too error-prone.fis the function to be interpolated.fmay take multiple arguments. The return type should beValueType.gridis aGrid{n}object fromQuanticsGrids.jlthat describes a d-dimensional grid of discrete points indexed by binary digits. To avoid constructing a grid explicitly, use one of the other overloads.initialpivotsis a vector of pivots to be used for initialization.nrandominitpivotdetermines how many random pivots should be used for initialization if no initial pivot is given.
All other arguments are forwareded to crossinterpolate2. Most importantly:
tolerance::Float64is a float specifying the target tolerance for the interpolation. Default:1e-8.pivottolerance::Float64is a float that specifies the tolerance for adding new pivots, i.e. the truncation of tensor train bonds. It should be <= tolerance, otherwise convergence may be impossible. Default:tolerance.maxbonddim::Intspecifies the maximum bond dimension for the TCI. Default:typemax(Int), i.e. effectively unlimited.maxiter::Intis the maximum number of iterations (i.e. optimization sweeps) before aborting the TCI construction. Default:200.
For all other arguments, see the documentation for TensorCrossInterpolation.crossinterpolate2.
QuanticsTCI.quanticsfouriermpo — Methodfunction quanticsfouriermpo(
R::Int;
sign::Float64=-1.0,
maxbonddim::Int=12,
tolerance::Float64=1e-14,
K::Int=25,
method::Symbol=:SVD,
normalize::Bool=true
)::TCI.TensorTrain{ComplexF64}Generate a quantics Fourier transform operator in tensor train form. When contracted with a quantics tensor train $F_{\boldsymbol{\sigma}}$ representing a function, the result will be the fourier transform of the function in quantics tensor train form, $\tilde{F}_{\boldsymbol{\sigma}'} = \sum_{\boldsymbol{\sigma}} F_{\boldsymbol{\sigma}} \exp(-2\pi i (k_{\boldsymbol{\sigma'}}-1) (m_{\boldsymbol{\sigma}} - 1)/M)$, where $k_{\boldsymbol{\sigma}} = \sum_{\ell=1}^R 2^{R-\ell} \sigma_\ell$, $m_{\boldsymbol{\sigma}'} = \sum_{\ell=1}^R 2^{R-\ell} \sigma'_\ell$, and $M=2^R$.
Before the Fourier transform, the left most index corresponds to $\sigma_1$, which describes the largest length scale, and the right most index corresponds to $\sigma_R$, which describes the smallest length scale. The indices $\sigma_1' \ldots \sigma_{R}'$ in the fourier transformed QTT are aligned in the inverse order; that is, the left most index corresponds to $\sigma'_R$, which describes the smallest length scale. This allows construction of an operator with small bond dimension (see reference 1). If necessary, a call to TCI.reverse(tt) can restore large-to-small index ordering.
The Fourier transform operator is implemented using a direct analytic construction of the tensor train by Chen and Lindsey (see reference 2). The tensor train thus obtained is then re-compressed to the user-given bond dimension and tolerance.
Arguments:
R: number of bits of the fourier transform.sign: sign in the exponent $\exp(2i\pi \times \mathrm{sign} \times (k_{\boldsymbol{\sigma'}}-1) (x_{\boldsymbol{\sigma}}-1)/M)$, usually $\pm 1$.maxbonddim: bond dimension to compress the operator to. From observations,maxbonddim = 12is generally big enough to reach an accuracy of1e-12.tolerance: tolerance of the TT compression. Note that the error in the fourier transform is generally a bit larger than this error tolerance.K: bond dimension of the TT before compression, i.e. number of basis functions to approximate the Fourier transform with (see reference 2). The TT will become inaccurate forK < 22; higher values may be necessary for very high precision.method: method with which to compress the TT. Choose between:SVDand:CI.normalize: whether or not to normalize the operator as an isometry.