Observable Tree
Similar with InteractionTree, for computing expectation value of observables.
FiniteMPS.ObservableTree — Typestruct ObservableTree{L}
Ops::Vector{Vector{AbstractLocalOperator}}
Refs::Dict{String, Dict}
RootL::InteractionTreeNode
RootR::InteractionTreeNode
endSimilar to InteractionTree but specially used for calculation of observables.
Constructors
ObservableTree(L)Initialize an empty object, where L is the number of sites.
Base.merge! — Methodmerge!(Tree::InteractionTree) -> Tree::InteractionTreeMerge 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::ObservableTreeMerge 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) -> nothingSearch and merge some repeated vertices in the ITP graph G.
Kwargs
verbose::Int64 = 0Display the merging process if verbose > 0.
half::Bool = falseOnly execute the left(right) merging for the left(right) half sites if half = true.
FiniteMPS.treewidth — Functiontreewidth(Tree::ObservableTree) -> Tuple{Int64, Int64}Return the tree width of the left and right trees.
FiniteMPS.addObs! — FunctionaddObs!(Tree::ObservableTree{L},
Op::NTuple{N, AbstractTensorMap},
si::NTuple{N, Int64},
fermionic::NTuple{N, Bool};
Z = nothing,
pspace = nothing,
name = _default_IntrName(N),
IntrName = prod(string.(name)),
) -> nothingAdd an N-site observable to Tree, where the observable is characterized by N-tuples Op, si and fermionic. The implementation and usage is similar to addIntr!, except for the logic to deal with same operator which is added twice.
Kwargs
Z::Union{Nothing, AbstractTensorMap, AbstractVector}Provide the parity operator to deal with the fermionic anti-commutation relations.If Z == nothing, assume all operators are bosonic. Otherwise, a uniform (single operator) Z::AbstractTensorMap or site-dependent (length L vector) Z::AbstractVector should be given.
pspace::Union{Nothing, VectorSpace, Vector{<:VectorSpace}}Provide the local Hilbert space (VectorSpace in TensorKit.jl). This is not required in generating Hamiltonian, so the default value is set as nothing. But some processes like generating an identity MPO require this information. In such cases, a uniform or site-dependent (length L vector) pspace should be given.
name::NTuple{N, Union{Symbol, String}}Give a name of each operator.
IntrName::Union{Symbol, String}Give a name of the interaction, which is used as the key of Tree.Refs::Dict that stores interaction strengths. The default value is the product of each operator name.
FiniteMPS.calObs! — FunctioncalObs!(Tree::ObservableTree{L},
Ψ::AbstractMPS{L},
Φ::AbstractMPS{L} = Ψ;
kwargs...
) -> TO::TimerOutputCalculate ⟨Ψ|O|Φ⟩ of all observables O stored in Tree, using bra ⟨Ψ| and ket |Φ⟩.
Kwargs
El::AbstractTensorMap
Er::AbstractTensorMapManually set boundary left or right environment tensor. Default is the rank-2 isometry deduced from Ψ and Φ, which may be incorrect if the operators have nontrivial auxiliary spaces.
normalize::Bool = falseIf 'true', calculate ⟨Ψ|O|Φ⟩/(|Ψ||Φ|) instead of ⟨Ψ|O|Φ⟩.
serial::Bool = falseForce to choose serial mode, usually used when debugging.
disk::Bool = falseStore environment tensor in disk or not.
maxsize::Int64 = maximum(treewidth(Tree))Number of environment tensors left in memory. Default is the larger one of the width of left tree or right tree.
verbose::Int64 = 0Show the timer several times if verbose > 0.
showtimes::Int64 = 10Times to show the timer.
GCSpacing::Int64 = 100The spacing (count nodes) between two nearest manual GC.gc().
ntasks::Int64 = get_num_threads()Number of distributed tasks, used in multithreaded mode.