Extensions

This page documents extensions to TensorCrossInterpolation.

Currently, there is only one extension, TCIITensorConversion.

TCIITensorConversion

Dependencies:

This module is automatically loaded when ITensors and ITensorMPS are present in addition to TensorCrossInterpolation. It offers conversion constructors between ITensorMPS types and TensorCrossInterpolation types, and an analogue of the evaluate function for ITensor types.

ITensorMPS.MPO — Method
MPO(tt::TCI.AbstractTensorTrain{T}; sites=nothing)

Convert a tensor train to an ITensorMPS.MPO. Arguments:

  • tt: The tensor train to be converted.
  • sites: An array of arrays of ITensor Index objects, where sites[n][m] corresponds to the mth index attached to the nth site.

If siteindices is left empty, a default set of indices will be generated.

source
ITensorMPS.MPS — Method
MPS(tt::TCI.AbstractTensorTrain{T}; sites=nothing)

Convert a tensor train to an ITensorMPS.MPS. Arguments:

  • tt: The tensor train to be converted.
  • siteindices: An array of ITensor Index objects, where sites[n] corresponds to the index for the nth site.

If siteindices is left empty, a default set of indices will be generated.

source
TensorCrossInterpolation.TensorTrain — Method
function TensorTrain(mps::ITensorMPS.MPS)
function TensorTrain{V}(mps::ITensorMPS.MPS)

Converts an ITensorMPS.MPS object into a TensorTrain. Note that this only works if the MPS has a single leg per site. Otherwise, use TensorCrossInterpolation.TensorTrain(mps::ITensorMPS.MPO).

The untyped form returns a TensorTrain{ComplexF64,3}, as before. The typed form converts every site tensor to V, so an MPS of one eltype can be turned into a TensorTrain of another (for example TensorTrain{Float32}(mps::MPS{Float64})) instead of failing with a MethodError inside the constructor. Both forms handle a two-site MPS, which used to build a Vector{Any} because the middle-tensor comprehension is empty.

source
TensorCrossInterpolation.evaluate — Method
function evaluate(
    mps::Union{ITensorMPS.MPS,ITensorMPS.MPO},
    indices::AbstractVector{<:ITensors.Index},
    indexvalues::AbstractVector{Int}
)

Evaluates an MPS or MPO for a given set of index values.

  • indices is a list of ITensors.Index objects that specifies the order in which indices are given.
  • indexvalues is a list of integer values in the same order as indices.

If many evaluations are necessary, it may be advantageous to convert your MPS to a TensorCrossInterpolation.TTCache object first.

source
TensorCrossInterpolation.evaluate — Method
function evaluate(
    mps::Union{ITensorMPS.MPS,ITensorMPS.MPO},
    indexspecs::Vararg{AbstractVector{<:Tuple{ITensorMPS.Index,Int}}}
)

Evaluates an MPS or MPO for a given set of index values.

  • indexspec is a list of tuples, where each tuple contains an ITensorMPS.Index object specifying an index, and an Int corresponding to the value of the specified index.

If many evaluations are necessary, it may be advantageous to convert your MPS to a TensorCrossInterpolation.TTCache object first.

source