Commit 74d82fba authored by Javier's avatar Javier

corr_sym added

parent 34dd8c51
......@@ -10,7 +10,7 @@ include("juobs_obs.jl")
export read_mesons, read_ms1, read_ms, read_md, truncate_data!
export get_matrix, energies, uwdot, uweigvals, uweigvecs, uweigen, invert, getall_eigvals, getall_eigvecs
export corr_obs, md_sea, md_val, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine
export corr_obs, corr_sym, md_sea, md_val, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine
export meff, mpcac, dec_const, dec_const_pcvc, comp_t0
end # module
......@@ -125,7 +125,35 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
return Corr(obs, cdata)
end
@doc raw"""
corr_sym(corrL::Corr, corrR::Corr, parity::Int64=1)
Computes the symmetrized correlator using the left correlador `corrL` and the right correlator `corrR`. The source position
of `corrR` must be `T - 1 - y0`, where `y0` is the source position of `corrL`.
```@example
pp_sym = corr_sym(ppL, ppR, +1)
a0p_sym = corr_sym(a0pL, a0pR, -1)
```
"""
function corr_sym(corrL::Corr, corrR::Corr, parity::Int64=1)
T = length(corrL.obs)
sym = [:kappa, :mu, :gamma]
if corrL.y0 != T - 1 - corrR.y0
error("Corr: Parameter mismatch")
end
for s in sym
if getfield(corrL, s) != getfield(corrR, s)
error("Corr: Parameter mismatch")
end
end
if abs(parity) != 1
error("incorrect value of parity (+- 1)")
end
res = (corrL.obs[1:end] + parity * corrR.obs[end:-1:1]) / 2
return Corr(res, corrL.kappa, corrL.mu, corrL.gamma, corrL.y0)
end
#TODO: VECTORIZE, uwreal?
@doc raw"""
md_sea(a::uwreal, md::Vector{Matrix{Float64}}, ws::ADerrors.wspace=ADerrors.wsg)
......
......@@ -167,6 +167,7 @@ mutable struct Corr
y0 = Int64(h[1].x0)
return new(a, kappa, mu, gamma, y0)
end
Corr(o::Vector{uwreal}, k::Vector{Float64}, m::Vector{Float64}, g::Vector{String}, y::Int64) = new(o, k, m, g, y)
end
mutable struct YData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment