The TTN
object
TenNetLib.TTN
— Typemutable 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 siteIndex
s.graph::Graph{Int2}
: Underlying structure of the network defined byGraph{Int2}
.tensors::Dict{Int2, ITensor}
: Tensors in the TTN.orthocenter::Int2
: Orthogonality center of the TTN.
ITensors.siteinds
— Methodfunction ITensors.siteinds(ttn::TTN)
Returns the site Index
s of the TTN
.
ITensors.siteind
— Methodfunction ITensors.siteind(ttn::TTN, n::Int)
Returns the n
th site Index
of the TTN
.
TenNetLib.numsites
— Methodfunction numsites(ttn::TTN)
Returns the number of physical sites in the TTN
.
TenNetLib.getgraph
— Methodfunction getgraph(ttn::TTN)
Returns (shallow copy of) the underlying graph of the TTN
.
Base.getindex
— Methodfunction Base.getindex(ttn::TTN, node::Int2)
function Base.getindex(ttn::TTN, ll::Int, nn::Int)
Returns the tensor at the node::Int2
= (ll, nn)
.
Base.setindex!
— Methodfunction 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))
.
ITensors.orthocenter
— Methodfunction orthocenter(ttn::TTN)
Returns the orthogonality center of the TTN
.
Base.copy
— MethodBase.copy(ttn::TTN)
Shallow copy of TTN
.
TenNetLib.isvalidnode
— Methodfunction isvalidnode(ttn::TTN, node::Int2)
Checks whether the input node::Int2
is a valid node in the TTN
graph.
TenNetLib.isneighbor
— Methodfunction isneighbor(ttn::TTN, node1::Int2, node2::Int2)
Checks whether node1
and node2
are neighboring nodes in the TTN.
ITensors.findsite
— Methodfunction 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
.
ITensors.findsites
— Methodfunction ITensors.findsites(ttn::TTN, is)
Returns the sites of the TTN that have Index
s in common with the Index
or ITensor
or their collection is
.
TenNetLib.findnode
— Methodfunction 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
.
TenNetLib.findnodes
— Methodfunction findnodes(ttn::TTN, is)
Returns the nodes of the TTN that have Index
s in common with the Index
or ITensor
or their collection is
.
TenNetLib.find_sitenode
— Methodfunction find_sitenode(ttn::TTN, n::Int)
Return node of the TTN that is associated with the site n
.
TenNetLib.find_sitenodes
— Methodfunction find_sitenodes(ttn::TTN, ns)
Returns nodes of the TTN that are associated with the sites ns
(a collection of Int
s).
ITensors.maxlinkdim
— Methodfunction ITensors.maxlinkdim(ttn::TTN)
Returns the maximum bond/link dimension of the TTN.
LinearAlgebra.normalize!
— Methodfunction LinearAlgebra.normalize!(ttn::TTN)
Normalizes the TTN. The TTN must have well-defined orthogonality center.
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.
ITensors.hasqns
— Methodfunction ITensors.hasqns(ttn::TTN)
Checks whether the TTN has QNs.
TenNetLib.find_qnnode
— Methodfunction 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.
TenNetLib.moveisometry_to_next!
— Methodfunction 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 totrue
,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"
.
TenNetLib.isometrize_full!
— Methodfunction 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"
.
TenNetLib.isometrize!
— Methodfunction 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"
.