Optimizing TTN
Functions to optimize TTN.
OptimizeParamsTTN
TenNetLib.jl defines a struct, called OptimizeParamsTTN
, to control TTN optimizations.
TenNetLib.OptimizeParamsTTN
— Typemutable struct OptimizeParamsTTN
maxdim::Vector{Int}
nsweeps::Vector{Int}
cutoff::Vector{Float64}
noise::Vector{Float64}
noisedecay::Vector{Float64}
disable_noise_after::Vector{Int}
end
Holds parameters to control the optimzation sweeps of the TTN.
maxdim::Vector{Int}
: Maximum allowed TTN bond/link dimensions at each stages of optimization.nsweeps::Vector{Int}
: Number of sweeps to be performed at each statges of optimization.cutoff::Vector{Float64}
: Cutoff for SVD truncation at each stages of optimization.noise::Vector{Float64}
: Noise level at each stages of optimization.noisedecay::Vector{Float64}
: Decay of noise level at each states of optimization.
Noise is divided by noisedecay
after each sweep.
disable_noise_after::Vector{Int}
: Switch of noise after this many sweeps at each
states of optimization.
All these Vector
s must have same dimension.
TenNetLib.OptimizeParamsTTN
— Methodfunction OptimizeParamsTTN(;maxdim::Vector{Int}, nsweeps::Vector{Int},
cutoff::Union{Vector{Float64}, Float64} = Float64_threshold(),
noise::Union{Vector{Float64}, Float64, Int} = 0.0,
noisedecay::Union{Vector{Float64}, Float64, Int} = 1.0,
disable_noise_after::Union{Vector{Int}, Int} = typemax(Int))
Constructor for OptimizeParamsTTN
. Takes named arguments.
maxdim::Vector{Int}
: Maximum allowed TTN bond/link dimensions at each stages of optimization.nsweeps::Vector{Int}
: Number of sweeps to be performed at each statges of optimization.cutoff::Union{Float64, Vector{Float64}} = Float64_threshold()
: Cutoff for SVD truncation at each stages of optimization. IfFloat64
,cutoff
remains same throughout the optimization simulation.noise::Union{Float64, Int, Vector{Float64}} = 0.0
: Noise level at each stages of optimization. IfFloat64
/Int
, initialnoise
remains same throughout the optimization.noisedecay::Union{Float64, Int, Vector{Float64}} = 1.0
: Decay of noise level at each states of optimization. Noise is divided bynoisedecay
after each sweep. IfFloat64
/Int
,noisedecay
remains same throughout the DMRG simulation.disable_noise_after::Union{Int, Vector{Int}} = typemax(Int)
: Switch of noise after this many sweeps at each states of optimization. IfInt
,disable_noise_after
remains same throughout the optimization.
Base.copy
— MethodBase.copy(params::OptimizeParamsTTN)
Shallow copy OptimizeParamsTTN.
A lower level optimization function
Following function modifies StateEnvsTTN
in-place. Skip this function if you want to avoid lower-level abstraction.
TenNetLib.optimize!
— Methodfunction optimize!(sysenv::StateEnvsTTN,
params::OptimizeParamsTTN,
sweeppath::Vector{Int2};
kwargs...)
Performs optimization of the TTN.
Arguments:
sysenv::StateEnvsTTN
.params::OptimizationParamsTTN
.sweeppath::Vector{Int2}
: The path to be followed during optimization sweep. A vector that must contain all the nodes atleast once.
Named arguments and their default values:
normalize::Bool = true
: Whether to normalize after update.svd_alg::String = "divide_and_conquer"
.weight::Float64 = -1.0
: Weight for the excited state calculation. Must be set to greater than0
for the excited state optimization.outputlevel::Int = 1
. If0
prints no information, for1
outputs after every fullsweep, if2
prints at every update step.
Convergence criteria:
energyErrGoal
: Optimization (at a particluar stage) stops when energy difference between two consecutive sweeps falls below this threshold and the optimzation moves to the next stage.noise
must be belowFloat64_threshold()
to trigger this early stopping.
Named arguments for eig_solver
and their default values:
See documentation of KrylovKit.jl.
ishermitian::Bool = true
solver_tol::Float64 = 1E-14
.solver_krylovdim::Int = 3
.solver_maxiter::Int = 1
.solver_outputlevel::Int = 0
: Seeverbosity
in KrylovKit.jl.solver_eager::Bool = false
.solver_check_convergence::Bool = false
.
Return values:
SweepDataTTN
Higher level optimzation functions
TenNetLib.optimize
— Methodfunction optimize(psi0::TTN, H::CouplingModel,
params::OptimizeParamsTTN,
sweeppath::Vector{Int2};
kwargs...)
function optimize(psi0::TTN, H::CouplingModel, Ms::Vector{TTN},
params::OptimizeParamsTTN,
sweeppath::Vector{Int2};
kwargs...)
Performs optimization of the TTN.
Arguments:
psi0::TTN
: Initial TTN.H::CouplingModel
,Ms::Vector{MPS}
.params::OptimizationParamsTTN
.sweeppath::Vector{Int2}
: The path to be followed during optimization sweep. A vector that must contain all the nodes atleast once.
Named arguments and their default values:
normalize::Bool = true
: Whether to normalize after update.svd_alg::String = "divide_and_conquer"
.weight::Float64 = -1.0
: Weight for the excited state calculation. Must be set to greater than0
for the excited state optimization.outputlevel::Int = 1
. If0
prints no information, for1
outputs after every fullsweep, if2
prints at every update step.
Convergence criteria:
energyErrGoal
: Optimization (at a particluar stage) stops when energy difference between two consecutive sweeps falls below this threshold and the optimzation moves to the next stage.noise
must be belowFloat64_threshold()
to trigger this early stopping.
Named arguments for eig_solver
and their default values:
See documentation of KrylovKit.jl.
ishermitian::Bool = true
solver_tol::Float64 = 1E-14
.solver_krylovdim::Int = 3
.solver_maxiter::Int = 1
.solver_outputlevel::Int = 0
: Seeverbosity
in KrylovKit.jl.solver_eager::Bool = false
.solver_check_convergence::Bool = false
.
Return values:
::Float64
: Energy.::TTN
: The state psi.