Deborah.Miriam.Cumulants
Deborah.Miriam.Cumulants.calc_Q — Methodcalc_Q(
trMi::Vector{T}
) where T -> (real(T), real(T), real(T), real(T))Compute the first four moments $Q_n \; (n=1,2,3,4)$ from $\text{Tr} \, M^{-n} \; (n=1,2,3,4)$ vectors.
Arguments
trMi::Vector{T}: Vector containing traces, wheretrMi[2]is $\text{Tr} \, M^{-1}$trMi[3]is $\text{Tr} \, M^{-2}$trMi[4]is $\text{Tr} \, M^{-3}$trMi[5]is $\text{Tr} \, M^{-4}$
Formula
\[\begin{aligned} Q_1 &= N_{\text{f}} \, \text{Tr} \, M^{-1} \\ Q_2 &= - N_{\text{f}} \, \text{Tr} \, M^{-2} + \left( \text{Tr} \, M^{-1} \right)^2 \\ Q_3 &= 2 \, N_{\text{f}} \, \text{Tr} \, M^{-3} - 3 \, N_{\text{f}}^{2} \, \text{Tr} \, M^{-2} \, \text{Tr}\, M^{-1} + \left( N_{\text{f}} \, \text{Tr} \, M^{-1} \right)^{3} \\ Q_4 &= - 6 \, N_{\text{f}} \, \text{Tr} \, M^{-4} + 8 \, N_{\text{f}}^{2} \, \text{Tr} \, M^{-3} \, \text{Tr} \, M^{-1} + 3 \left( N_{\text{f}} \, \text{Tr} \, M^{-2} \right)^{2} - 6 \, N_{\text{f}} \, \text{Tr} \, M^{-2} \, \left( N_{\text{f}} \, \text{Tr} \, M^{-1} \right)^{2} + \left( N_{\text{f}} \, \text{Tr} \, M^{-1} \right)^{4} \end{aligned}\]
Notes
Unlike this Deborah.Miriam, Deborah.Esther uses slightly different definitions for $Q_{n} \; (n=1,2,3,4)$. In this implementation, the factor of $N_{\text{f}}$ does not explicitly appear, because the trace rescaling step already incorporates $N_{\text{f}}$ into the normalization.
See also:
Deborah.Miriam.MultiEnsembleLoader.generate_trMi_vectorDeborah.Esther.TraceRescaler.rescale_trace(for comparison of rescaling conventions)
Returns
Q1::T: $Q_1$ momentQ2::T: $Q_2$ momentQ3::T: $Q_3$ momentQ4::T: $Q_4$ moment
Deborah.Miriam.Cumulants.calc_cumulants — Method@inline @fastmath calc_cumulants(
V::T,
Q1::T,
Q2::T,
Q3::T,
Q4::T,
jobid::Union{Nothing, String}=nothing
) where T -> (T, T, T, T)Compute statistical cumulants from trace moments $Q_1$ through $Q_4$.
Arguments
V::T: Volume (typically $N_S^3 \times N_T$), used for normalization.Q1::T: First moment $Q_1$Q2::T: Second moment $Q_2$Q3::T: Third moment $Q_3$Q4::T: Fourth moment $Q_4$jobid::Union{Nothing, String}: Optional job ID for logging.
Formula
\[\begin{align*} \chi &= \frac{\left\langle Q_2 \right\rangle - \left\langle Q_1 \right\rangle^2}{V} \\ S &= \frac{ \left\langle Q_3 \right\rangle - 3 \, \left\langle Q_2 \right\rangle \, \left\langle Q_1 \right\rangle + 2 \, \left\langle Q_1 \right\rangle^3 }{\left( \left\langle Q_2 \right\rangle - \left\langle Q_1 \right\rangle^2 \right)^{\frac{3}{2}}} \\ K &= \frac{ \left\langle Q_4 \right\rangle - 4 \, \left\langle Q_3 \right\rangle \, \left\langle Q_1 \right\rangle - 3 \, \left\langle Q_2 \right\rangle^2 + 12 \, \left\langle Q_2 \right\rangle \, \left\langle Q_1 \right\rangle^2 - 6 \, \left\langle Q_1 \right\rangle^4 }{\left( \left\langle Q_2 \right\rangle - \left\langle Q_1 \right\rangle^2 \right)^{2}} \\ B &= 1 - \frac{\left\langle Q_4 \right\rangle}{3 \, \left\langle Q_2 \right\rangle^2} \end{align*}\]
Returns
susceptibility::T: susceptibility of chiral condensate ($\chi$)skewness::T: skewness of chiral condensate (measures asymmetry)kurtosis::T: kurtosis of chiral condensate (measures tailedness)binder_cumulant::T: Binder cumulant
Notes
- Prevents division by near-zero variance using
eps(T)safeguard. - Assumes input types are floating point (e.g.,
Float64,Float32).
Deborah.Miriam.Cumulants.calc_trace — Methodcalc_trace(
trMi::Vector{T}
) where T -> (real(T), real(T), real(T), real(T))Extract the first four raw trace components ($\text{Tr} \, M^{-n} \; (n=1,2,3,4)$) from a trace vector.
Arguments
trMi::Vector{T}: Trace vector where indices2..5contain the four trace components:trMi[2]is $\text{Tr} \, M^{-1}$trMi[3]is $\text{Tr} \, M^{-2}$trMi[4]is $\text{Tr} \, M^{-3}$trMi[5]is $\text{Tr} \, M^{-4}$
Returns
trM1::real(T),trM2::real(T),trM3::real(T),trM4::real(T)
Notes
- Requires
length(trMi)$\ge 5$.
Deborah.Miriam.Cumulants.compute_cumulants — Methodcompute_cumulants(
bin_size::Int,
V::Int,
obs::Vector{Vector{T}},
w::Vector{T},
jobid::Union{Nothing, String}=nothing
) where T -> Vector{Vector{T}}Compute raw jackknife-resampled cumulants from reweighted trace observables.
This function performs jackknife resampling of reweighted $Q$-moments ($Q_{n} \; (n=1,2,3,4)$), and computes the corresponding cumulants – susceptibility, skewness, kurtosis, and Binder cumulant – for each resample. The resulting cumulant vectors are returned directly, without performing any averaging or error estimation.
Arguments
bin_size::Int: Bin size used for jackknife resamplingV::Int: Lattice volume, used for normalization of condensate and susceptibilityobs::Vector{Vector{T}}: List of $Q$-observable vectors per configurationw::Vector{T}: Reweighting factors per configurationjobid::Union{Nothing, String}: Optional job ID for logging or debugging
Returns
cumulants_jk::Vector{Vector{T}}: Jackknife-resampled cumulants packed as a vector of vectors:cond_jk: Chiral condensatesusp_jk: Susceptibilityskew_jk: Skewnesskurt_jk: Kurtosisbind_jk: Binder cumulant
Each sub-vector has length equal to the number of jackknife bins (n_jk = nconf / bin_size), and can be passed to Deborah.Sarah.Jackknife.jackknife_average_error externally for analysis.
Deborah.Miriam.Cumulants.compute_cumulants_raw — Methodcompute_cumulants_raw(
bin_size::Int,
V::Int,
obs::Vector{Vector{T}},
jobid::Union{Nothing, String}=nothing
) where T -> Vector{Vector{T}}Compute raw jackknife-resampled cumulants from single ensemble.
This function performs jackknife resampling of raw $Q$-moments ($Q_{n} \; (n=1,2,3,4)$) and computes the corresponding cumulants – susceptibility, skewness, kurtosis, and Binder cumulant —- for each resample. The resulting cumulant vectors are returned directly, without performing any averaging or error estimation.
Arguments
bin_size::Int: Bin size used for jackknife resamplingV::Int: Lattice volume, used for normalization of condensate and susceptibilityobs::Vector{Vector{T}}: List of raw $Q$-observable vectors per configurationjobid::Union{Nothing, String}: Optional job ID for logging or debugging
Returns
cumulants_jk::Vector{Vector{T}}: Jackknife-resampled cumulants packed as a vector of vectors:cond_jk: Chiral condensatesusp_jk: Susceptibilityskew_jk: Skewnesskurt_jk: Kurtosisbind_jk: Binder cumulant
Each sub-vector has length equal to the number of jackknife bins (n_jk = nconf / bin_size), and can be passed to Deborah.Sarah.Jackknife.jackknife_average_error externally for analysis.
Deborah.Miriam.Cumulants.compute_moments_raw — Methodcompute_moments_raw(
bin_size::Int,
obs::Vector{Vector{T}},
jobid::Union{Nothing, String}=nothing
) where T -> Vector{Vector{T}}Compute jackknife resamples of the moments $Q_{n} \; (n=1,2,3,4)$ (of single ensemble) from per-configuration inputs obs. For each configuration i, calc_Q is called to obtain (Q1[i], Q2[i], Q3[i], Q4[i]), and then jackknife resampling is applied component-wise.
Arguments
bin_size::Int: Jackknife bin size.obs::Vector{Vector{T}}: Per-configuration vectors consumed bycalc_Q.jobid: Optional job id for logging.
Returns
Vector{Vector{T}}with 4 elements:[Q1_jk, Q2_jk, Q3_jk, Q4_jk], where each is a length-njkvector of jackknife resample values.
Deborah.Miriam.Cumulants.compute_traces_raw — Methodcompute_traces_raw(
bin_size::Int,
obs::Vector{Vector{T}},
jobid::Union{Nothing, String}=nothing
) where T -> Vector{Vector{T}}Make jackknife resamples for traces $\text{Tr} \, M^{-n} \; (n=1,2,3,4)$ in the same return shape as compute_cumulants_raw, but without computing cumulants.
The input obs[i] is assumed to be a length-5 vector like: [dummy, trM1, trM2, trM3, trM4] The first entry is ignored; only indices 2..5 are used.
Arguments
bin_size::Int: Jackknife bin size.obs::Vector{Vector{T}}: Per-configuration trace vectors (length = 5).jobid: Optional job id for logging.
Returns
Vector{Vector{T}}with 4 elements:[trM1_jk, trM2_jk, trM3_jk, trM4_jk], where eachtrM*_jkis a vector of lengthnjkcontaining the jackknife resample values for that trace component.
Notes
- This is a lightweight companion to
compute_cumulants_raw. No volume $V$ or $\kappa$-scaling is applied here; it simply jackknifes the provided $\text{Tr} \, M^{-n} \; (n=1,2,3,4)$.