Sweeping through the TTN
At a lower level of abstraction, TenNetLib.jl allows to control each fullsweep manually to update StateEnvsTTN.
Skip this part if you want to avoid lower-level abstraction.
SweepDataTTN
TenNetLib.jl defines a struct, called SweepDataTTN, to store essential data after each fullsweep.
TenNetLib.SweepDataTTN — Typemutable struct SweepDataTTN
sweepcount::Int
maxchi::Vector{Int}
energy::Vector{Union{Float64, ComplexF64}}
endHolds historical data after each (full)sweep of the TTN. Requires for convergence check etc.
sweepcount::Int: Number of fullsweeps performed.maxchi::Vector{Int}: Maximum MPS bond/link dimensions after every sweep.energy::Vector{Union{Float64, ComplexF64}}: Energies after every sweep.
Default constructor:
SweepDataTTN(): Initialize an emptySweepDataobject.
Base.copy — MethodBase.copy(swdata::SweepDataTTN)Shallow copy of SweepDataTTN.
sweeppath
TenNetLib.default_sweeppath — Functionfunction default_sweeppath(psi::TTN)For a given a TTN having the default hierarchical binary tree structure, teturns the default path for sweeping through the TTN.
Return values:
Vector{Int2}: The list of nodes as the path to be followed during a (half)sweep.
Perform a fullsweep
TenNetLib.fullsweep! — Methodfunction fullsweep!(sysenv::StateEnvsTTN, sweeppath::Vector{Int2}, solver,
swdata::SweepDataTTN; kwargs...)Perform a fullsweep of the TTN by solver.
Arguments:
sysenv::StateEnvsTTN.sweeppath::Vector{Int2}: The list of nodes as the path to be followed during a (half)sweep. Must have each node atleast once. For the next halfsweep the reverse path is followed.solver: Solver for update. Currently onlyeig_solveris supported.swdata::SweepDataTTN.
Named arguments and their default values:
time_step::Union{Float64, ComplexF64, Nothing} = nothing: Time step for future functionality.normalize::Bool = true: Whether to normalize after update.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".noise::Float64 = 0.0.expand_dim::Int = 0ifnoise == 0else20. Dimension to be expanded (on top ofmaxdim) during subspace expansion.max_expand_dim::Int = 2 * expand_dim. maximum dimension to be expanded during subspace expansion.expand_numiter::Int = 4. Number of iteration for subspace expansion. Should be greater than 1.linkwise_maxdim::Union{Nothing, Dict{LinkTypeTTN, Int}} = nothing. Specifies maximum bond dimension of a particular link.outputlevel::Int = 1. If0prints no information, for1outputs after every fullsweep, if2prints at every update step.
Named arguments for solver and their default values:
See the documentation of KrylovKit.jl.
ishermitian::Bool = true.solver_tol::Float64 = 1E-14.solver_krylovdim::Int = 5.solver_maxiter::Int = 2.solver_outputlevel::Int = 0: Seeverbosityin KrylovKit.jl.solver_eager::Bool = false.solver_check_convergence::Bool = false.
Return values:
::Union{Float64, ComplexF64}: Change in Energy ΔE. It is complex ifishermitian == false.
swdata::SweepDataTTN gets updated.