Creates a `Corr` struct with the given `CData` struct `cdata` (`read_mesons`) for a single replica.
Creates a `Corr` struct with the given `CData` struct `cdata` (See also [`read_mesons`](@ref)) for a single replica.
An array of `CData` can be passed as argument for multiple replicas.
An array of `CData` can be passed as argument for multiple replicas.
The flag `real` select the real or imaginary part of the correlator.
# Arguments
If `rw` is specified, the method applies reweighting. `rw` is passed as a matrix of Float64 (`read_ms1`)
- `real::Bool = true`: if true select the real part of the correlator, otherwise select the immaginary one
The correlator can be normalized with the volume factor if `L` is fixed.
- `rw`: reweighting factor. When given, the method applies the reweighting. (See also [`read_ms1`](@ref)). `rw` has to be structered as and `Array{Float64,2}`, if the data have only one replica, or as `Array{Array{Float64,2}}`, if the data have more replicas
- `L::Int64=1`: spatial size of the lattice. It is used to normalize the correlators with the volume `L^3`
The flag `info` provides extra output that contains information about the primary observables. The function returns the primary observables ``<WO>`` and ``<W>``
- `info::Bool =false`: if set to `true`, the method outputs the primary observable `<O>` if `rw=nothing` or `<OW>` and `<W>` if `rw` has been given
(it returns the observable <O> if rw=nothing)
- `replica::Vector{Int64}`: length of the montecarlo replicas
- `nms::Int64`: total length of the montecarlo data. Must be equal to `sum(replica)`
If you turn `flag_strange=true` and `rw` is passed, will reweight to undo negative sign of the strange quark determinant.
- `idm::Vecto{Int64}`: configuration index where the measurements where taken. If multiple replicas are present, `idm` is still a single vector with the `idm` of each replica concatenated in replica-order
- `flag_strange::Bool = false`: if set and rw is passed, it will reweight to undo negative sign of the strange quark determinant
# Example:
- Single replica
```@example
```@example
#Single replica
data = read_mesons(path, "G5", "G5")
data = read_mesons(path, "G5", "G5")
rw = read_ms1(path_rw)
rw = read_ms1(path_rw)
corr_pp = corr_obs.(data)
corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=rw)
corr_pp_r = corr_obs.(data, rw=rw)
```
#Single replica + Info
- Single replica + Info
```@example
data = read_mesons(path, "G5", "G5")
data = read_mesons(path, "G5", "G5")
rw = read_ms1(path_rw)
rw = read_ms1(path_rw)
corr_pp, O = corr_obs(data[1], info=true)
corr_pp, O = corr_obs(data[1], info=true)
corr_pp_r, WO, W = corr_obs(data[1], rw=rw, info=true)
corr_pp_r, WO, W = corr_obs(data[1], rw=rw, info=true)
```
#Two replicas
- Two replicas
```@example
data = read_mesons([path_r1, path_r2], "G5", "G5")
data = read_mesons([path_r1, path_r2], "G5", "G5")
rw1 = read_ms1(path_rw1)
rw1 = read_ms1(path_rw1)
rw2 = read_ms1(path_rw2)
rw2 = read_ms1(path_rw2)
...
@@ -143,6 +147,14 @@ rw2 = read_ms1(path_rw2)
...
@@ -143,6 +147,14 @@ rw2 = read_ms1(path_rw2)
corr_pp = corr_obs.(data)
corr_pp = corr_obs.(data)
corr_pp_r = corr_obs.(data, rw=[rw1, rw2])
corr_pp_r = corr_obs.(data, rw=[rw1, rw2])
```
```
- Replica with gaps in measurements. Let's say 2 replica with montecarlo length [101,200], measurement taken only on even configuration
# replica1 replica2 idm is a single vector with the idm of each replica concatenated
```
"""
"""
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)
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)
...
@@ -193,7 +205,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array
...
@@ -193,7 +205,7 @@ function corr_obs(cdata::Array{CData, 1}; real::Bool=true, rw::Union{Array{Array