Measuring the TTN
TenNetLib.measure — Methodfunction measure(::Type{ElT} = ComplexF64, psi::TTN, opten::ITensor)Returns (complex / real) local expectation value (::ComplexF64 / ::Float64) of a given TTN psi::TTN. The operator opten::ITensor must be single-site operator.
For ElT = Float64, if the expectation value is complex, raises a warning!
TenNetLib.measure — Methodfunction measure(::Type{ElT} = ComplexF64, psi::TTN, opstr::String, pos::Int)Returns (complex / real) local expectation value (::ComplexF64 / ::Float64) of a given TTN psi::TTN for a given operator name (opstr::String) and a site index (pos::Int)
For ElT = Float64, if the expectation value is complex, raises a warning!
TenNetLib.measure — Methodfunction measure(::Type{ElT} = ComplexF64, psi::TTN, opstr::String; kwargs...)Returns (complex / real) local expectation values (::Vector{ComplexF64} / ::Vector{Float64}) of a given TTN psi::TTN for a given operator name (opstr::String) at all the sites.
Optionally, for specific sites, keyword argument sites can be specified, e.g., sites = [1, 2, 3].
For ElT = Float64, if the expectation value is complex, raises a warning!
TenNetLib.measure — Methodfunction measure(::Type{ElT} = ComplexF64, psi::TTN, optens::Vector{ITensor})Returns (complex / real) multi-site expectation value (::ComplexF64 / ::Float64) of a given TTN psi::TTN for a given vector of single-site operators (optens::Vector{ITensor}).
For ElT = Float64, if the expectation value is complex, raises a warning!
TenNetLib.measure — Methodfunction measure(::Type{ElT} = ComplexF64, psi::TTN, oppairs::Vector{Pair{String, Int}};
isfermions::Bool = true)Returns (complex / real) multi-site expectation value (::ComplexF64 / ::Float64) of a given TTN psi::TTN. oppairs::Vector{Pair{String, Int}} contains pairs of operator names (String) and site locations (Int). E.g., for <ψ|OᵢOⱼOₖ... |ψ>, oppairs = ["O" => i, "O" => j, "O" => k,...].
Fermionic JW strings are added automatically for fermionic operators if isfermions::Bool = true (default).
For ElT = Float64, if the expectation value is complex, raises a warning!
Example:
valueC = measure(psi, ["Cdag" => 2, "C" => 6, "Cdag" => 9, "C" => 12])
valueR = measure(Float64, psi, ["Cdag" => 2, "C" => 6, "Cdag" => 9, "C" => 12])