Performing TDVP
TDVPEngine
TenNetLib.jl defines a struct, called TDVPEngine, to store essential data during TDVP sweeps.
TenNetLib.TDVPEngine — Typemutable struct TDVPEngine{T <: Union{ProjMPO,
ProjMPOSum2,
ProjMPO_MPS2,
ProjMPOSum_MPS,
ProjCouplingModel,
ProjCouplingModel_MPS}}Holds the MPS state, SweepData, and absolute elpased time for TDVP simulations.
sysenv::StateEnvs: Holds the state psi and environments PH.swdata::SweepData: Holds the historical data after each (full)sweep.abstime::Float64: Absolute elapsed time.
TenNetLib.TDVPEngine — Methodfunction TDVPEngine(psi::MPS, H::{T}) where T <: Union{MPO, Vector{MPO}, CouplingModel}Constructor of the TDVPEngine from different forms of Hamiltonians.
TenNetLib.TDVPEngine — Methodfunction TDVPEngine(psi::MPS, H::T, Ms::Vector{MPS};
weight::Float64) where T <: Union{MPO, Vector{MPO}, CouplingModel}Constructor of TDVPEngine from different forms of Hamiltonians and a vector of MPS.
TenNetLib.getpsi — Methodfunction getpsi(engine::TDVPEngine)Returns (shallow copy of) the state psi.
TenNetLib.sweepcount — Methodfunction sweepcount(engine::TDVPEngine)Returns the number of sweeps performed.
TenNetLib.getenergy — Methodfunction getenergy(engine::TDVPEngine)Returns the energy of the state psi.
TenNetLib.getentropy — Methodfunction getentropy(engine::TDVPEngine)Returns the mid-chain entropy of the state psi.
TenNetLib.maxchi — Methodfunction maxchi(engine::TDVPEngine)Returns the maximum bond/link dimension of the state psi.
TenNetLib.totalerror — Methodfunction totalerror(engine::TDVPEngine)Returns the sum of the truncation errors of all the sweeps performed.
TenNetLib.sweeperror — Methodfunction sweeperror(engine::TDVPEngine)Returns the truncation error in the last sweep.
TenNetLib.krylov_extend! — Methodfunction krylov_extend!(engine::TDVPEngine{ProjMPO}; kwargs...)Performs Global Subspace Expansion.
Arguments and their default values:
extension_krylovdim::Int = 3: Number of Krylov vectors used for GSE.extension_applyH_cutoff::Float64 = Float64_threshold(): Cutoff for the application the MPO to the MPS.extension_applyH_maxdim::Int = maxlinkdim(psi) + 1: Maximum bond/link dimension of the resulting MPS after the application of the MPO to the MPS.extension_cutoff::Float64 = 1E-10: Cutoff for the basis extension step in GSE.
TenNetLib.sweepdata — Methodfunction sweepdata(engine::TDVPEngine)Returns the (shallow copy of) SweepData.
TenNetLib.abstime — Methodfunction abstime(engine::TDVPEngine)Returns the absolute elapsed time.
TenNetLib.updateH! — Methodfunction updateH!(engine::TDVPEngine, H::T;
recalcEnv::Bool = true) where T <: Union{MPO, Vector{MPO}, CouplingModel}Update Hamiltonian H in engine::TDVPEngine. If recalcEnv = false, it reuses previous environments. recalcEnv = false is only defined when the TDVPEngine is created from a single MPO.
TenNetLib.updateH! — Methodfunction updateH!(engine::TDVPEngine, H::T, Ms::Vector{MPS};
weight::Float64,
recalcEnv::Bool = true) where T <: Union{MPO, Vector{MPO}, CouplingModel}Update Hamiltonian H in engine::TDVPEngine. recalcEnv = false is not supported.
Base.copy — MethodBase.copy(engine::TDVPEngine)Shallow copy of TDVPEngine.
tdvpsweep!
Following function performs one TDVP sweep.
TenNetLib.tdvpsweep! — Functiontdvpsweep!(engine::TDVPEngine, time_step::Union{Float64, ComplexF64};
nsite::Union{Int, String} = "dynamic",
solver = exp_solver,
kwargs...)::NothingPerforms one TDVP sweep. Computes ψ' = exp(time_step * H) * ψ. Therefore, for real-time dynamics with step dt, time_step should be -im * dt.
Arguments:
engine::TDVPEngine.time_step::Union{Float64, ComplexF64}.nsite::Union{Int, String} = "dynamic": For two or one site sweeps,nsite=2ornsite=1respectively. Fornsite="dynamic",dynamic_fullsweep!is performed.solver = exp_solver: Onlyexp_solveris supported now.
Named arguments and their default values:
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".outputlevel::Int = 1. If0prints no information, for1outputs after every fullsweep, if2prints at every update step.eigthreshold::Float64 = 1E-12. Only applicable fornsite = "dynamic"(seedynamic_fullsweep!).extendat::Union{Nothing, Int} = nothing: If specified, at everyextendatth sweep, Global Subspace Expansion is performed followed by a pure one-site sweep iftypeof(sysenv) == StateEnvs{ProjMPO}, else performs a full two-site sweep. Only applicable fornsite = "dynamic"(seedynamic_fullsweep!).
Named arguments for solver and their default values:
See the documentation of KrylovKit.jl.
ishermitian::Bool = true.solver_tol::Float64 = 1E-12.solver_krylovdim::Int = 30.solver_maxiter::Int = 100.solver_outputlevel::Int = 0.: Seeverbosityin KrylovKit.jl.solver_eager::Bool = true.solver_check_convergence::Bool = true.
Arguments for Global Subspace Expansion and their default values:
Only applicable for nsite = "dynamic" (see dynamic_fullsweep!).
extension_krylovdim::Int = 3: Number of Krylov vectors used for GSE.extension_applyH_cutoff::Float64 = Float64_threshold(): Cutoff for the application the MPO to the MPS.extension_applyH_maxdim::Int = maxlinkdim(psi) + 1: Maximum bond/link dimension of the resulting MPS after the application of the MPO to the MPS.extension_cutoff::Float64 = 1E-7: Cutoff for the basis extension step in GSE.