Deborah.Miriam.CumulantsBundleUtils
Deborah.Miriam.CumulantsBundleUtils.flatten_Q4_columns — Methodflatten_Q4_columns(
Q_data::Vector{Tuple{Int, Float64, Float64, Float64, Float64}}
) -> (
Vector{Float64}, # column 2
Vector{Float64}, # column 3
Vector{Float64}, # column 4
Vector{Float64} # column 5
)Extract and group columns 2-5 from each 5-tuple of the form (Int, Float64, Float64, Float64, Float64).
Arguments
Q_data: A vector of 5-element tuples where the first element is anIntand the remaining areFloat64values.
Returns
- A 4-tuple of vectors, each collecting the respective components from position
2to5across all tuples.
Deborah.Miriam.CumulantsBundleUtils.flatten_Q5_columns — Methodflatten_Q5_columns(
Q_data::Vector{Tuple{Int, Float64, Float64, Float64, Float64, Float64}}
) -> (
Vector{Float64}, # column 2
Vector{Float64}, # column 3
Vector{Float64}, # column 4
Vector{Float64}, # column 5
Vector{Float64} # column 6
)Extract and group columns 2-6 from each 6-tuple of the form (Int, Float64, Float64, Float64, Float64, Float64).
Arguments
Q_data: A vector of 6-element tuples where the first element is anIntand the rest areFloat64values.
Returns
- A 5-tuple of vectors, each collecting the respective components from position
2to6across all tuples.
Deborah.Miriam.CumulantsBundleUtils.split_Q_full — Methodsplit_Q_full(
Q_bundle_ORG::Union{Nothing, NTuple{5, Vector{T}}},
Q_bundle::Vector,
bundle::Union{Ensemble.EnsembleArrayBundle{T}, ReweightingBundle.ReweightingSolverBundle},
ens_idx::Union{Nothing, Int},
jobid::Union{Nothing, String}=nothing;
has_weight::Bool=false
) where T -> NTuple{7, Vector{<:Tuple}}Split Q-observable rows into labeled subsets by using source_tags and secondary_tags attached to the ensemble bundles. Supports both raw-trace mode (Deborah.Miriam.Ensemble.EnsembleArrayBundle) and reweighting mode (Deborah.Miriam.ReweightingBundle.ReweightingSolverBundle).
Inputs
Q_bundle_ORG: Optional original tuple(Q1_ORG, Q2_ORG, Q3_ORG, Q4_ORG, w_ORG). If provided,Q_Y_ORGis built from these arrays (includingw_ORG). Ifnothing,Q_Y_ORGis built fromQ_bundle[1](weight omitted).Q_bundle::Vector: A vector of tuples holding(Q1, Q2, Q3, Q4)and, whenhas_weight=true, an optional 5th arrayw. The four entries are aligned with the bundle variants as follows:Q_bundle[1]⇔FULL-LBOG-ULOG(original; used forQ_Y_ORGandY_ul)Q_bundle[2]⇔FULL-LBOG-ULML(Y_UL-replaced; used forYP_ul)Q_bundle[3]⇔LABL-TROG-BCOG(Y_LB-only,Y_BCoriginal; used forY_tr,Y_bc, andY_lb)Q_bundle[4]⇔LABL-TROG-BCML(Y_LB-only,Y_BCreplaced; used forYP_bc)
bundle: The corresponding bundle providingconf_nums,source_tagsandsecondary_tags. In reweighting mode (has_weight=true), these are read frombundle.solvers[k].ens.data; in raw-trace mode they are read frombundle.arrays[k].data[ens_idx].ens_idx: Index for selecting an ensemble entry in raw-trace mode. Ignored in reweighting mode.jobid: Optional job ID used for logging context.has_weight: Iftrue, each output tuple includes a weight component.
Tag semantics
source_tags:0 → Y_tr,1 → Y_bc/YP_bc,2 → Y_ul/YP_ulsecondary_tags:0 → Y_lb,1 → Y_ul
Invariants enforced
- In
Q_bundle[2](UL-replaced stream): rows withsource_tags==2must havesecondary_tags==1. - In
LB-only streams (Q_bundle[3],Q_bundle[4]): any row withsecondary_tags==0must not havesource_tags==2.
Returns
Each element is a vector of tuples:
- when
has_weight=false:(conf, Q1, Q2, Q3, Q4) - when
has_weight=true:(conf, Q1, Q2, Q3, Q4, w)
Return order:
Q_Y_tr— rows withsource_tags==0fromQ_bundle[3]Q_Y_bc— rows withsource_tags==1fromQ_bundle[3]Q_YP_bc— rows withsource_tags==1fromQ_bundle[4]Q_Y_ul— rows withsource_tags==2fromQ_bundle[1]Q_YP_ul— rows withsource_tags==2fromQ_bundle[2]Q_Y_lb— rows withsecondary_tags==0fromQ_bundle[3]Q_Y_ORG— original stream aligned toconf_nums(usesQ_bundle_ORGif provided; otherwise fromQ_bundle[1])
Notes
Y_LBnow comes fromQ_bundle[3](Y_LB-only,Y_BCoriginal).Q_Y_lbis a convenience union of all rows marked assecondary_tags==0in that stream, so elements inQ_Y_trandQ_Y_bcwill also appear inQ_Y_lbby design.- Length consistency is checked between (
Y_bc,YP_bc) and (Y_ul,YP_ul). If a predicted subset is empty (e.g.,TRP=0), the check is skipped with a warning.