function get_YM_dYM(path::String,ens::EnsInfo;rw=false,ws::ADerrors.wspace=ADerrors.wsg,w0::Union{Float64,Nothing}=nothing,tau::Union{Float64,Nothing}=nothing)
function apply_rw(data::Vector{<:Array{Float64}},W::Vector{Matrix{Float64}},vcfg::Vector{Vector{Int32}})
function apply_rw(data::Vector{<:Array{Float64}},W::Vector{Matrix{Float64}},vcfg::Union{Nothing,Vector{Vector{Int32}}}=nothing;id::Union{String,Nothing}=nothing,fs::Bool=false)
function check_corr_der(obs::Corr,derm::Vector{Corr})
function check_corr_der(obs::Corr,derm::Vector{Corr};new_version::Bool=false)
g1=Vector{String}(undef,0)
g2=Vector{String}(undef,0)
fordinderm
aux=[d.gamma[1],d.gamma[2]]
push!(g1,aux[1][1:end-3])
push!(g2,aux[2][1:end-3])
if!new_version
aux=[d.gamma[1],d.gamma[2]]
push!(g1,aux[1][1:end-3])
push!(g2,aux[2][1:end-3])
else
aux=[d.gamma[1],d.gamma[2]]
push!(g1,aux[1][1:end])
push!(g2,aux[2][1:end])
end
end
h=copy(derm)
...
...
@@ -78,6 +120,8 @@ The correlator can be normalized with the volume factor if `L` is fixed.
The flag `info` provides extra output that contains information about the primary observables. The function returns the primary observables ``<WO>`` and ``<W>``
(it returns the observable <O> if rw=nothing)
If you turn `flag_strange=true` and `rw` is passed, will reweight to undo negative sign of the strange quark determinant.
```@example
#Single replica
data = read_mesons(path, "G5", "G5")
...
...
@@ -100,22 +144,19 @@ corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=[rw1, rw2])
```
"""
function corr_obs(cdata::CData;real::Bool=true,rw::Union{Array{Float64,2},Nothing}=nothing,L::Int64=1,info::Bool=false,idm::Union{Vector{Int64},Nothing}=nothing,nms::Int64=Int64(maximum(cdata.vcfg)))
function corr_obs(cdata::CData;real::Bool=true,rw::Union{Array{Float64,2},Nothing}=nothing,L::Int64=1,info::Bool=false,idm::Union{Vector{Int64},Nothing}=nothing,nms::Int64=Int64(maximum(cdata.vcfg)),flag_strange::Bool=false)
@@ -131,21 +172,21 @@ function corr_obs(cdata::CData; real::Bool=true, rw::Union{Array{Float64, 2}, No
end
#function corr_obs for R != 1
#TODO: vcfg with gaps
function corr_obs(cdata::Array{CData,1};real::Bool=true,rw::Union{Array{Array{Float64,2},1},Nothing}=nothing,L::Int64=1,info::Bool=false,idm::Union{Vector{Int64},Nothing}=nothing,nms::Union{Int64,Nothing}=nothing)
function corr_obs(cdata::Array{CData,1};real::Bool=true,rw::Union{Array{Array{Float64,2},1},Nothing}=nothing,L::Int64=1,info::Bool=false,replica::Union{Vector{Int64},Nothing}=nothing,idm::Union{Vector{Int64},Nothing}=nothing,nms::Union{Int64,Nothing}=nothing,flag_strange::Bool=false)
function corr_obs_TSM(cdata_sl::CData,cdata_corr::CData;real::Bool=true,rw::Union{Array{Float64,2},Nothing}=nothing,L::Int64=1,info::Bool=false,idm_sl::Union{Vector{Int64},Nothing}=nothing,idm_corr::Union{Vector{Int64},Nothing}=nothing,nms::Union{Int64,Nothing}=nothing)
function corr_obs_TSM(cdata_sl::CData,cdata_corr::CData;real::Bool=true,rw::Union{Array{Float64,2},Nothing}=nothing,L::Int64=1,info::Bool=false,idm_sl::Union{Vector{Int64},Nothing}=nothing,idm_corr::Union{Vector{Int64},Nothing}=nothing,nms::Union{Int64,Nothing}=nothing,flag_strange::Bool=false)
# cdata1 is sloppy, cdata2 is correction
ifcdata_sl.id!=cdata_corr.id
error("Error: cdata_sl id != cdata_corr id")
...
...
@@ -265,9 +307,8 @@ function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::U
@@ -287,7 +328,7 @@ function corr_obs_TSM(cdata_sl::CData, cdata_corr::CData; real::Bool=true, rw::U
end
end
function corr_obs_TSM(cdata1::Array{CData,1},cdata2::Array{CData,1};real::Bool=true,rw::Union{Array{Array{Float64,2},1},Nothing}=nothing,L::Int64=1,info::Bool=false,idm_sl::Union{Vector{Int64},Nothing}=nothing,idm_corr::Union{Vector{Int64},Nothing}=nothing,nms::Union{Int64,Nothing}=nothing)
function corr_obs_TSM(cdata1::Array{CData,1},cdata2::Array{CData,1};real::Bool=true,rw::Union{Array{Array{Float64,2},1},Nothing}=nothing,L::Int64=1,info::Bool=false,replica_sl::Union{Vector{Int64},Nothing}=nothing,idm_sl::Union{Vector{Int64},Nothing}=nothing,idm_corr::Union{Vector{Int64},Nothing}=nothing,nms::Union{Int64,Nothing}=nothing,flag_strange::Bool=false)
function md_sea(a::uwreal,md::Vector{Matrix{Float64}},ow::uwreal,w::Union{uwreal,Nothing}=nothing,ws::ADerrors.wspace=ADerrors.wsg)
function md_sea(a::uwreal,md::Vector{Matrix{Float64}},ow::uwreal,w::Union{uwreal,Nothing}=nothing,ws::ADerrors.wspace=ADerrors.wsg,wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)
nid=neid(a)
p=findall(t->t==1,a.prop)
...
...
@@ -470,7 +527,7 @@ function md_sea(a::uwreal, md::Vector{Matrix{Float64}}, ow::uwreal, w::Union{uwr
end
nrw=size(md_aux,1)
uwerr(ow)
isnothing(wpm)?uwerr(ow):uwerr(ow,wpm)
ow_data=ow.mean.+mchist(ow,id)
ifisnothing(w)
...
...
@@ -500,15 +557,20 @@ function md_sea(a::uwreal, md::Vector{Matrix{Float64}}, ow::uwreal, w::Union{uwr
returnnothing
end
function md_sea(a::uwreal,md::Vector{Matrix{Float64}},ow::Array{uwreal},w::Union{uwreal,Nothing}=nothing,ws::ADerrors.wspace=ADerrors.wsg)
d=[md_sea(a,md,ow_,w,ws)forow_inow]
function md_sea(a::uwreal,md::Vector{Matrix{Float64}},ow::Array{uwreal},w::Union{uwreal,Nothing}=nothing,ws::ADerrors.wspace=ADerrors.wsg,wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}},Nothing}=nothing)