CouplingModel
TenNetLib.jl degines as struct, called the CouplingModel, to store the Hamiltonian terms. In case of MPS based algorithms, CouplingModel can replace MPO without modifying rest of the code. For Tree Tensor Network (TTN) codes, only CouplingModel can be used. Different elements of CouplingModel are contracted in parallel.
TenNetLib.CouplingModel — Typestruct CouplingModel
sites::Vector{Index}
terms::Vector{IDTensors}
endCouplingModel for a given OpStrings Hamiltonian terms and sites::Vector{Index}.
sites::Vector{Index}: SiteIndexs.terms::Vector{IDTensors}: Collection of Hamiltonian terms.
TenNetLib.CouplingModel — Methodfunction CouplingModel(os::OpStrings,
sites::Vector{Index};
merge::Bool = true,
maxdim::Int = typemax(Int),
mindim::Int = 1,
cutoff::Float64 = Float64_threshold(),
svd_alg::String = "divide_and_conquer",
chunksize::Int = 12)Constructor of the CouplingModel from os::OpStrings and sites::Vector{Index}.
Named arguments and their default values:
merge::Bool = true. Iftrue, merges all the terms having same spatial support resulting in larger virtual dimension. Otherwise, all the terms have virtual dimension one.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".chunksize::Int = 12.
Example:
os = OpStrings()
for j=1:N-1
os += 1, "Sz" => j, "Sz" => j+1
os += 0.5, "S+" => j, "S-" => j+1
os += 0.5, "S-" => j, "S+" => j+1
end
H = CouplingModel(os,sites)TenNetLib.CouplingModel — Methodfunction CouplingModel(os::OpStrings,
mpo::MPO;
merge::Bool = true,
maxdim::Int = typemax(Int),
mindim::Int = 1,
cutoff::Float64 = Float64_threshold(),
svd_alg::String = "divide_and_conquer",
chunksize::Int = 12)Constructor of the CouplingModel from os::OpStrings and mpo::MPO. Resultant CouplingModel is the sum of os and the mpo.
Named arguments and their default values:
merge::Bool = true. Iftrue, merges all the terms having same spatial support resulting in larger virtual dimension. Otherwise, all the terms have virtual dimension one.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".chunksize::Int = 12.
TenNetLib.CouplingModel — Methodfunction CouplingModel(mpos::MPO...)Constructs CouplingModel from a collection of MPOs. Different MPO terms can be contracted in parallel during different MPS/TTN algorithms. Useful for TTN codes.
Base.length — Methodfunction Base.length(model::CouplingModel)Number of sites in the system.
Base.copy — Methodfunction Base.copy(model::CouplingModel)Shallow copy of CouplingModel.
Base.getindex — Methodfunction Base.getindex(model::CouplingModel, n)Returns Hamiltonian terms for nth site(s) in the CouplingModel.
ITensors.SiteTypes.siteinds — Methodfunction ITensorMPS.siteinds(model::CouplingModel)Returns the site Indexs of the CouplingModel.