FunnyTN.TensorNetworks

FunnyTN.TensorNetworks

CanonicalityError <: Exception

Canonicality error.

MPO{T} <: TensorTrain

Matrix Product Operator.

We use the following convention to number legs: 2 | 1–A–4 | 3

MPS{T, BC, TT<:MPSTensor{T}} <: TensorTrain{T, TT}
MPS{BC}(tensors::Vector{TT}, l::Int) -> MPS

matrix product state, BC is the boundary condition, l is the canonical center (0 if not needed).

Tensor Train with homogeneous tensor rank.

TensorTrain{T, TT}<:AbstractTN{T, TT}

Chained tensors.

assert_boundary_match(tensors, bc::Symbol)
assert_chainable(tensors)
assert_valid(tn)

assert tensor network structure tn is valid.

canomove!(mps::MPS, direction::Symbol; tol::Real=1e-15, D::Int=typemax(Int64), method=:SVD) -> MPS

move canonical center, direction can be :left, :right or Int (Int means moving right for n step).

compress!(mps::MPS, D::Int; tol::Real=1e-15, niter::Int=3, method=:SVD) -> MPS

Compress an mps.

hgetindex(mps::MPS, inds) -> Number

Returns the amplitude of specific configuration in hilbert space, ind can be either integer or tuple.

hsize(mps::MPS, [i::Int])

size of hilbert space.

naive_compress!(mps::MPS, D::Int; tol::Real=1e-15, method=:SVD) -> MPS

Compress an mps in a naive way.

rand_mps([::Type], nflavor::Int, bond_dims::Vector{Int}) -> MPS

Random matrix product state.

recanonicalize(mps::MPS; move_right_first::Bool=true, tol::Real=1e-15, D::Int=1000) -> MPS

Trun this MPS into canonical form.

svdtrunc(state::Matrix; tol=0)

SVD decomposition and truncate.

Parse a normal state into a Matrix produdct state.

state: The target state, 1D array. nflavor: The dimension of a single site, integer. l: The division point of left and right canonical scanning, integer between 0 and number of site. method: The method to extract orthonormal matrices. * :qr -> get A,B matrices by the method of QR decomposition, faster, rank revealing in a non-straight-forward way. * :svd -> get A,B matrices by the method of SVD decomposition, slow, rank revealing. tol: The tolerence of singular value, float.

Return an <MPS> instance.

Base.getindexMethod.

MPO Tensor

Base.sumMethod.

Summation over <MPS>es.

Args: tts (list of <MPS>): instances to be added. labels (list of str): the new labels for added state.

Returns: <MPS>, the added MPS.

in addition of tensor trains, we need to take boundary condition into consideration.

MPS Tensor