Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
MesonMixingWilsonGroup.cpp
Go to the documentation of this file.
2
4
9
10std::shared_ptr<CoefficientGroup> MesonMixingCoefficientGroup::clone() const
11{
12 return std::make_shared<MesonMixingCoefficientGroup>(*this);
13}
14
15
16//Fake !!
17void MesonMixingCoefficientGroup::init_running_parameter_blocks() {
18 // WilsonParamComposer composer;
19
20 LOG_DEBUG("Init running matrices blocks of Meson Mixing Coefficient group");
21 std::unordered_map<ParameterType, std::vector<std::string>> eta_powers_src = {{ParameterType::WILSON, {"WPARAM_RUN_SM"}}};
22
23 auto eta_powers_func = [] (const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
24 double eta5 = src.get_val("WPARAM_RUN_SM",2);
25 double eta4 = src.get_val("WPARAM_RUN_SM",3);
26
27 for (int i = 0; i < MMRP::n_pows; ++i) {
28 dep_block->store_or_assign(LhaID(1, i), std::make_shared<Parameter>(ParamId{ParameterType::WILSON, "ETA_POWS_MIXING", LhaID(1, i)}, std::pow(eta5, (MMRP::ai)[i]), 0., 0.));
29 dep_block->store_or_assign(LhaID(2, i), std::make_shared<Parameter>(ParamId{ParameterType::WILSON, "ETA_POWS_MIXING", LhaID(2, i)}, std::pow(eta4, (MMRP::bi)[i]), 0., 0.));
30 }
31 };
32
33 std::unordered_map<ParameterType, std::vector<std::string>> mtx_src = {{ParameterType::WILSON, {"WPARAM_RUN_SM", "ETA_POWS_MIXING"}}};
34
35 auto U_5_func = [] (const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
36 double eta_5 = src.get_val("WPARAM_RUN_SM",2);
37 auto pid = [] (int n, int k, int l) {
38 return ParamId{ParameterType::WILSON, "UM_MATRIX_5", LhaID(n, k, l)};
39 };
40
42
43 double U0, U1;
44
45 // V
46 double eta_V = src.get_val("ETA_POWS_MIXING",LhaID(1, 0));
47 U0 = MMRP::a0_V_5 * eta_V;
48 U1 = (MMRP::a1_V_5 + MMRP::b_V_5 * eta_5) * eta_V;
49 dep_block->store_or_assign(LhaID(0, 0, 0), std::make_shared<Parameter>(pid(0, 0, 0), U0, 0., 0.));
50 dep_block->store_or_assign(LhaID(0, 5, 5), std::make_shared<Parameter>(pid(0, 5, 5), U0, 0., 0.));
51 dep_block->store_or_assign(LhaID(1, 0, 0), std::make_shared<Parameter>(pid(1, 0, 0), U1, 0., 0.));
52 dep_block->store_or_assign(LhaID(1, 5, 5), std::make_shared<Parameter>(pid(1, 5, 5), U1, 0., 0.));
53
54 // LR
55 std::array<double, 2> eta_LR {
56 src.get_val("ETA_POWS_MIXING",LhaID(1, 1)),
57 src.get_val("ETA_POWS_MIXING",LhaID(1, 2)),
58 };
59
60 for (int i = 0; i < 2; ++i) {
61 for (int j = 0; j < 2; ++j) {
62 U0 = U1 = 0;
63 for (int k = 0; k < 2; ++k) {
64 U0 += MMRP::a0_LR_5[i][j][k] * eta_LR[k];
65 U1 += (MMRP::a1_LR_5[i][j][k] + MMRP::b_LR_5[i][j][k] * eta_5) * eta_LR[k];
66 }
67 dep_block->store_or_assign(LhaID(0, 1+i, 1+j), std::make_shared<Parameter>(pid(0, 1+i, 1+j), U0, 0., 0.));
68 dep_block->store_or_assign(LhaID(1, 1+i, 1+j), std::make_shared<Parameter>(pid(1, 1+i, 1+j), U1, 0., 0.));
69 }
70 }
71
72 // S
73 std::array<double, 2> eta_S {
74 src.get_val("ETA_POWS_MIXING",LhaID(1, 3)),
75 src.get_val("ETA_POWS_MIXING",LhaID(1, 4)),
76 };
77
78 for (int i = 0; i < 2; ++i) {
79 for (int j = 0; j < 2; ++j) {
80 U0 = U1 = 0;
81 for (int k = 0; k < 2; ++k) {
82 U0 += MMRP::a0_S_5[i][j][k] * eta_S[k];
83 U1 += (MMRP::a1_S_5[i][j][k] + MMRP::b_S_5[i][j][k] * eta_5) * eta_S[k];
84 }
85 dep_block->store_or_assign(LhaID(0, 3+i, 3+j), std::make_shared<Parameter>(pid(0, 3+i, 3+j), U0, 0., 0.));
86 dep_block->store_or_assign(LhaID(1, 3+i, 3+j), std::make_shared<Parameter>(pid(1, 3+i, 3+j), U1, 0., 0.));
87 dep_block->store_or_assign(LhaID(0, 6+i, 6+j), std::make_shared<Parameter>(pid(0, 6+i, 6+j), U0, 0., 0.));
88 dep_block->store_or_assign(LhaID(1, 6+i, 6+j), std::make_shared<Parameter>(pid(1, 6+i, 6+j), U1, 0., 0.));
89 }
90 }
91 };
92
93 auto U_4_func = [] (const BlockSrc& src, std::shared_ptr<DependentBlock> dep_block) {
94 double eta_5 = src.get_val("WPARAM_RUN_SM",2);
95 double eta_4 = src.get_val("WPARAM_RUN_SM",3);
96 auto pid = [] (int n, int k, int l) {
97 return ParamId{ParameterType::WILSON, "UM_MATRIX_4", LhaID(n, k, l)};
98 };
99
101
102 double U0, U1;
103
104 // V
105 double eta_5_V = src.get_val("ETA_POWS_MIXING",LhaID(1, 0));
106 double eta_4_V = src.get_val("ETA_POWS_MIXING",LhaID(2, 0));
107 U0 = MMRP::a0_V_4 * eta_4_V * eta_5_V;
108 U1 = (MMRP::a1_V_4 + MMRP::b_V_4 * eta_4 + MMRP::c_V_4 * eta_4 * eta_5) * eta_4_V * eta_5_V;
109 dep_block->store_or_assign(LhaID(0, 0, 0), std::make_shared<Parameter>(pid(0, 0, 0), U0, 0., 0.));
110 dep_block->store_or_assign(LhaID(0, 5, 5), std::make_shared<Parameter>(pid(0, 5, 5), U0, 0., 0.));
111 dep_block->store_or_assign(LhaID(1, 0, 0), std::make_shared<Parameter>(pid(1, 0, 0), U1, 0., 0.));
112 dep_block->store_or_assign(LhaID(1, 5, 5), std::make_shared<Parameter>(pid(1, 5, 5), U1, 0., 0.));
113
114 // LR
115 std::array<double, 2> eta_5_LR {
116 src.get_val("ETA_POWS_MIXING",LhaID(1, 1)),
117 src.get_val("ETA_POWS_MIXING",LhaID(1, 2)),
118 };
119
120 std::array<double, 2> eta_4_LR {
121 src.get_val("ETA_POWS_MIXING",LhaID(2, 1)),
122 src.get_val("ETA_POWS_MIXING",LhaID(2, 2)),
123 };
124
125 for (int i = 0; i < 2; ++i) {
126 for (int j = 0; j < 2; ++j) {
127 U0 = U1 = 0;
128 for (int k = 0; k < 2; ++k) for (int l = 0; l < 2; ++l) {
129 U0 += MMRP::a0_LR_4[i][j][k][l] * eta_4_LR[k] * eta_5_LR[l];
130 U1 += (MMRP::a1_LR_4[i][j][k][l] + MMRP::b_LR_4[i][j][k][l] * eta_4 + MMRP::c_LR_4[i][j][k][l] * eta_4 * eta_5) * eta_4_LR[k] * eta_5_LR[l];
131 }
132 dep_block->store_or_assign(LhaID(0, 1+i, 1+j), std::make_shared<Parameter>(pid(0, 1+i, 1+j), U0, 0., 0.));
133 dep_block->store_or_assign(LhaID(1, 1+i, 1+j), std::make_shared<Parameter>(pid(1, 1+i, 1+j), U1, 0., 0.));
134 }
135 }
136
137 // S
138 std::array<double, 2> eta_5_S {
139 src.get_val("ETA_POWS_MIXING",LhaID(1, 3)),
140 src.get_val("ETA_POWS_MIXING",LhaID(1, 4)),
141 };
142
143 std::array<double, 2> eta_4_S {
144 src.get_val("ETA_POWS_MIXING",LhaID(2, 3)),
145 src.get_val("ETA_POWS_MIXING",LhaID(2, 4)),
146 };
147
148 for (int i = 0; i < 2; ++i) {
149 for (int j = 0; j < 2; ++j) {
150 U0 = U1 = 0;
151 for (int k = 0; k < 2; ++k) for (int l = 0; l < 2; ++l) {
152 U0 += MMRP::a0_S_4[i][j][k][l] * eta_4_S[k] * eta_5_S[l];
153 U1 += (MMRP::a1_S_4[i][j][k][l] + MMRP::b_S_4[i][j][k][l] * eta_4 + MMRP::c_S_4[i][j][k][l] * eta_4 * eta_5) * eta_4_S[k] * eta_5_S[l];
154 }
155 dep_block->store_or_assign(LhaID(0, 3+i, 3+j), std::make_shared<Parameter>(pid(0, 3+i, 3+j), U0, 0., 0.));
156 dep_block->store_or_assign(LhaID(1, 3+i, 3+j), std::make_shared<Parameter>(pid(1, 3+i, 3+j), U1, 0., 0.));
157 dep_block->store_or_assign(LhaID(0, 6+i, 6+j), std::make_shared<Parameter>(pid(0, 6+i, 6+j), U0, 0., 0.));
158 dep_block->store_or_assign(LhaID(1, 6+i, 6+j), std::make_shared<Parameter>(pid(1, 6+i, 6+j), U1, 0., 0.));
159 }
160 }
161 };
162
163 adapters.iblock_c->compose_block("ETA_POWS_MIXING", eta_powers_src, eta_powers_func);
164 adapters.iblock_c->compose_block("UM_MATRIX_5", mtx_src, U_5_func);
165 adapters.iblock_c->compose_block("UM_MATRIX_4", mtx_src, U_4_func);
166}
167
168std::unordered_map<WCoefId, scalar_t>
170 const std::unordered_map<QCDOrder, std::unordered_map<WCoefId, scalar_t>>& coef_matching,
171 const BlockSrc& src)
172{
173 int n_f_final = QCDHelper::get_nf(src.get_val("B_SCALE",1));
174 std::string src_block = n_f_final < 5 ? "UM_MATRIX_4" : "UM_MATRIX_5";
175
176 std::array<complex_t, 32> Ci_match_BMU = {};
177 std::array<complex_t, 8> Ci_match_temp = {};
179 for (size_t n = 0; n < 4; n++) {
180 for (size_t k = 0; k < 8; k++) {
181 Ci_match_temp[k] = coef_matching.at(QCDOrder::LO).at(WCoefMapper::to_id(ids[8 * n + k]));
182 }
183 Ci_match_temp = MMRP::change_basis(Ci_match_temp, MMRP::SUSY_to_BMU);
184 for (size_t k = 0; k < 8; k++) {
185 Ci_match_BMU[8 * n + k] = Ci_match_temp[k];
186 }
187 Ci_match_temp = MMRP::change_basis(Ci_match_temp, MMRP::BMU_to_SUSY);
188 }
189
190 double fact = 4. * PI / src.get_val("WPARAM_RUN_SM",1);
191
192 std::array<complex_t, 32> Ci_run {};
193
194 for (size_t k = 0; k < 8; k++) {
195 for (size_t l = 0; l < 8; l++) {
196 double U0 = src.raw().at(src_block)->contains(LhaID(0, k, l)) ? src.raw().at(src_block)->retrieve(LhaID(0, k, l))->get_val() : scalar_t();
197 double U1 = src.raw().at(src_block)->contains(LhaID(1, k, l)) ? src.raw().at(src_block)->retrieve(LhaID(1, k, l))->get_val() : scalar_t();
198 double U = U0 + fact * U1;
199 Ci_run[k] += U * Ci_match_BMU[l];
200 Ci_run[k + 8] += U * Ci_match_BMU[l + 8];
201 Ci_run[k + 16] += U * Ci_match_BMU[l + 16];
202 Ci_run[k + 24] += U * Ci_match_BMU[l + 24];
203 }
204 }
205
206 std::unordered_map<WCoefId, scalar_t> Ci_run_map {};
207 for (size_t k = 0; k < 32; k++) {
208 Ci_run_map[WCoefMapper::to_id(ids[k])] = Ci_run[k];
209 }
210
211 return Ci_run_map;
212}
QCDOrder
@ MESON_MIXING
#define LOG_DEBUG(...)
Macro for logging debug messages.
Definition Logger.h:45
Lightweight view over a set of source blocks.
Definition SourcesView.h:71
const std::unordered_map< std::string, std::shared_ptr< Block > > & raw() const
Returns the underlying map reference.
scalar_t get_val(std::string_view blk, std::initializer_list< long > code) const
Retrieves the value of a parameter given as an initializer_list.
Polymorphic container of WilsonCoefficient objects representing a coefficient group.
WilsonGroupAdapterConfig adapters
Adapter configuration bundle (proxies, composers, core APIs, MARTY hooks).
static std::unordered_map< WCoefId, scalar_t > base_1_LO_calculation(const std::unordered_map< QCDOrder, std::unordered_map< WCoefId, scalar_t > > &coef_matching, const BlockSrc &src)
MesonMixingCoefficientGroup(WilsonGroupAdapterConfig adapters)
std::shared_ptr< CoefficientGroup > clone() const override
Polymorphic clone.
static int get_nf(double mu, MassType mass_b_type=MassType::POLE, MassType mass_t_type=MassType::POLE)
Returns the number of active flavors n_f at scale μ.
static std::vector< WCoef > get_group(WGroup g)
Returns the list of Wilson coefficients belonging to a WGroup.
constexpr double PI
Definition constants.h:7
Represents an identifier of a LHA element, possibly containing several sub-ids.
Definition LhaID.h:56
static constexpr std::array< double, n_pows > bi
Exponents for nf=4 evolution (eta_4^bi).
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > c_S_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a1_LR_5
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a1_LR_4
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a0_S_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a0_S_5
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a0_LR_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a1_S_5
static constexpr std::array< double, n_pows > ai
Exponents for nf=5 evolution (eta_5^ai).
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > a0_LR_5
static const std::array< std::array< double, n_coefs >, n_coefs > SUSY_to_BMU
Change of basis matrix from SUSY basis to BMU basis.
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > a1_S_4
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > b_LR_4
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > c_LR_4
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > b_LR_5
static const std::array< std::array< std::array< double, 2 >, 2 >, 2 > b_S_5
static const std::array< std::array< double, n_coefs >, n_coefs > BMU_to_SUSY
Change of basis matrix from BMU basis to SUSY basis.
static std::array< complex_t, n_coefs > change_basis(const std::array< complex_t, n_coefs > &Ci_in, const std::array< std::array< double, n_coefs >, n_coefs > &P)
Applies a basis change Ci_out = P * Ci_in.
static const std::array< std::array< std::array< std::array< double, 2 >, 2 >, 2 >, 2 > b_S_4
static constexpr int n_pows
Number of exponent entries stored in ai / bi (for eta power vectors).
Composite identifier for a single parameter.
Definition ParamID.h:57
Dependency injection bundle for CoefficientGroup.
std::shared_ptr< IBlockComposer > iblock_c
Composer used to register dependent parameters / dependent blocks.