The TTN object

TenNetLib.TTNType
mutable struct TTN{T}
    sites::Vector{Index{T}}
    graph::Graph{Int2}
    tensors::Dict{Int2, ITensor}
    orthocenter::Int2
end

Tree Tensor Network (TTN) object.

Each tensor is indexed by the tuple of integers (::Int2), (ll, nn), where (usually) ll denotes the layer index and nn denotes the tensor index at each layer.

  • sites::Vector{Index}: Physical site Indexs.
  • graph::Graph{Int2}: Underlying structure of the network defined by Graph{Int2}.
  • tensors::Dict{Int2, ITensor}: Tensors in the TTN.
  • orthocenter::Int2: Orthogonality center of the TTN.
source
ITensors.siteindMethod
function ITensors.siteind(ttn::TTN, n::Int)

Returns the nth site Index of the TTN.

source
TenNetLib.getgraphMethod
function getgraph(ttn::TTN)

Returns (shallow copy of) the underlying graph of the TTN.

source
Base.getindexMethod
function Base.getindex(ttn::TTN, node::Int2)
function Base.getindex(ttn::TTN, ll::Int, nn::Int)

Returns the tensor at the node::Int2 = (ll, nn).

source
Base.setindex!Method
function Base.setindex!(ttn::TTN, tensor::ITensor, node::Int2)
function Base.setindex!(ttn::TTN, tensor::ITensor, ll::Int, nn::Int)

Sets the tensor at the node::Int2 = (ll, nn). If the node is not the orthogonality center, orthogonality center is set to (typemin(Int), typemin(Int)).

source
TenNetLib.isvalidnodeMethod
function isvalidnode(ttn::TTN, node::Int2)

Checks whether the input node::Int2 is a valid node in the TTN graph.

source
TenNetLib.isneighborMethod
function isneighbor(ttn::TTN, node1::Int2, node2::Int2)

Checks whether node1 and node2 are neighboring nodes in the TTN.

source
ITensors.findsiteMethod
function ITensors.findsite(ttn::TTN, is)

Returns the first site of the TTN that has at least one Index in common with the Index or ITensor or their collection is.

source
ITensors.findsitesMethod
function ITensors.findsites(ttn::TTN, is)

Returns the sites of the TTN that have Indexs in common with the Index or ITensor or their collection is.

source
TenNetLib.findnodeMethod
function findnode(ttn::TTN, is)

Returns the first node of the TTN that has at least one Index in common with the Index or ITensor or their collection is.

source
TenNetLib.findnodesMethod
function findnodes(ttn::TTN, is)

Returns the nodes of the TTN that have Indexs in common with the Index or ITensor or their collection is.

source
TenNetLib.find_sitenodesMethod
function find_sitenodes(ttn::TTN, ns)

Returns nodes of the TTN that are associated with the sites ns (a collection of Ints).

source
ITensors.maxlinkdimMethod
function ITensors.maxlinkdim(ttn::TTN)

Returns the maximum bond/link dimension of the TTN.

source
LinearAlgebra.normalize!Method
function LinearAlgebra.normalize!(ttn::TTN)

Normalizes the TTN. The TTN must have well-defined orthogonality center.

source
Info

To conserve global symmetry in TTN, TenNetLib.jl uses a dummy index of dimension one whose flux fixes the superselection sector. This dummy index is attached to one of the tensors of TTN, usually the eccentric central node. Unlike MPS, the fluxes of all tensors in TTN are zero.

TenNetLib.find_qnnodeMethod
function find_qnnode(ttn::TTN)

Returns the node where the a dummy QN Index is attached to fix the QN sector. Returns nothing if the TTN does not have QN.

source
TenNetLib.moveisometry_to_next!Method
function moveisometry_to_next!(ttn::TTN, node1::Int2, node2::Int2; kwargs...)

Moves the isometry / orthogonality center of the TTN from node1::Int2 to the neighboring node2::Int. node1 and node2 must be neighboring nodes. node1 must be the orthogonality center unless ignore_orthocenter = true.

Note: Does not normalize the TTN afterwards.

Named arguments and their default values.

  • ignore_orthocenter::Bool = false: If set to true, node1 is not required to be the orthogonality center.
  • maxdim::Int = typemax(Int): Maximum bond dimension after SVD truncation.
  • mindim::Int = 1: Minimum bond dimension after SVD truncation.
  • cutoff::Float64 = Float64_threshold(): Cutoff for SVD truncation.
  • svd_alg::String = "divide_and_conquer".
source
TenNetLib.isometrize_full!Method
function isometrize_full!(ttn::TTN, node::Int2; kwargs...)

Isometrizes the TTN from scratch with respect to the orthogonality center node::Int2.

Named arguments and their default values.

  • normalize::Bool = true: Whether to normalize the TTN afterwards.
  • maxdim::Int = typemax(Int): Maximum bond dimension after SVD truncation.
  • mindim::Int = 1: Minimum bond dimension after SVD truncation.
  • cutoff::Float64 = Float64_threshold(): Cutoff for SVD truncation.
  • svd_alg::String = "divide_and_conquer".
source
TenNetLib.isometrize!Method
function isometrize!(ttn::TTN, node::Int2; kwargs...)

Moves the isometry / orthogonality center of the TTN to a new center node. If the TTN does not have proper orthoginality center, Isometrizes the TTN from scratch.

Named arguments and their default values.

  • normalize::Bool = true: Whether to normalize the TTN afterwards.
  • maxdim::Int = typemax(Int): Maximum bond dimension after SVD truncation.
  • mindim::Int = 1: Minimum bond dimension after SVD truncation.
  • cutoff::Float64 = Float64_threshold(): Cutoff for SVD truncation.
  • svd_alg::String = "divide_and_conquer".
source