Imaginary Time Proxy
For computing imaginary time proxies (ITP). Use a graph structure to store terms in the current version, which may be changed to a bi-tree structure in the future.
FiniteMPS.ImagTimeProxyGraph
— Type mutable struct ImagTimeProxyGraph{L}
Ops::Vector{Vector{NTuple{2,AbstractLocalOperator}}} # Ops[si][idx]
Refs::Dict{String,Dict}
graph::MetaDiGraph{Int64,Float64}
end
The concrete type for storing the imaginary time proxy (ITP)
to be calculated with a graph structure.
Fields
Ops::Vector{Vector{NTuple{2,AbstractLocalOperator}}}
Store the operators in a sparse way. Ops[si][idx]
stores the idx
-th operator on site si
.
Refs::Dict{String,Dict}
Store the references of the values to be calculated. Refs[ITPname][si]
stores the reference to the value of ITPname
with the site indices si
.
graph::MetaDiGraph{Int64,Float64}
The graph with the ITP information binding to its vertices and edges, provided by MetaGraphs.jl[https://github.com/JuliaGraphs/MetaGraphs.jl]
.
Constructors
ImagTimeProxyGraph(L::Int64) -> ::ImagTimeProxyGraph{L}
The only constructor for ImagTimeProxyGraph
, which creates an empty graph with L
sites. The ITP terms can be added to it by methods like addITP2!
or addITP4!
later.
Base.merge!
— Methodmerge!(Tree::InteractionTree) -> Tree::InteractionTree
Merge interactions with same left or right environment tensor. Symmetrical merging from boundary to bulk is used here, which works well for most cases.
merge!(Tree::ObservableTree) -> Tree::ObservableTree
Merge observables in Tree
that share the same parent node to reduce the computation cost of environment tensors. The behavior is similar to merge!
for InteractionTree
, but some detailed logic is different.
merge!(G::ImagTimeProxyGraph;
verbose::Int64=0,
half::Bool=false) -> nothing
Search and merge some repeated vertices in the ITP graph G
.
Kwargs
verbose::Int64 = 0
Display the merging process if verbose > 0
.
half::Bool = false
Only execute the left(right) merging for the left(right) half sites if half = true
.
FiniteMPS.addITP2!
— Function addITP2!(G::ImagTimeProxyGraph,
Op::NTuple{2,AbstractTensorMap},
si::NTuple{2,Int64},
Opname::NTuple{2,Union{Symbol,String}},
ValueType::Type{<:Number}=Number;
ITPname::Union{Symbol,String}=prod(string.(Opname)),
Z::Union{Nothing,AbstractTensorMap}=nothing,
merge::Bool=true
) -> nothing
Add a two-site term A(β/2)B
to the ITP graph. If Z
is given, assume each operator is fermionic.
FiniteMPS.addITP4!
— Function addITP4!(G::ImagTimeProxyGraph,
Op::NTuple{4,AbstractTensorMap},
si::NTuple{4,Int64},
Opname::NTuple{4,Union{Symbol,String}},
ValueType::Type{<:Number}=Number;
ITPname::Union{Symbol,String}=prod(string.(Opname)),
Z::Union{Nothing,AbstractTensorMap}=nothing,
merge::Bool=true
) -> nothing
Add a 4-site term A(β/2)B(β/2)CD)
to the ITP graph. If Z
is given, assume each operator is fermionic.
FiniteMPS.calITP!
— Function calITP!(G::ImagTimeProxyGraph, ρ::MPO; kwargs...) -> ::TimerOutput
Calculate the values of ITP stroed in graph G
and assign the results to G.Refs
. Return the TimerOutput
object which collects the time cost.
Kwargs
serial::Bool = false
Force to compute in serial mode, usually used for debugging.
GCspacing::Int64 = 100
The spacing of manual garbage collection.
verbose::Int64 = 0
Display the timer outputs during the calculation if verbose > 0
.
showtimes::Int64 = 100
The number of times to show the timer outputs.
ntasks::Int64 = get_num_threads_julia() - 1
The number of tasks to be used in multi-threading mode.
disk::Bool = false
Store the environment tensors in disk if true
.
maxdegree::Int64 = 4
This argument is only used if disk=true
. The environment tensor in a vectex will be stored in disk only if its degree < maxdegree
, otherwise it will be left in memory to avoid frequent disk I/O.
Base.convert
— Functionconvert(T::Type, Tree::ObservableTree; kwargs...)
Collect the observables from the tree and store them in a dictionary or a named tuple. Current valid types are Dict
and NamedTuple
.
convert(T::Type, G::ImagTimeProxyGraph; kwargs...)
Collect the observables from the graph G
and store them in a dictionary or a named tuple. Current valid types are Dict
and NamedTuple
.