Hyperiso 1.0.3
Modular flavour-physics calculations, Wilson coefficients and statistical inference
Loading...
Searching...
No Matches
C9.cpp
Go to the documentation of this file.
1#include <iostream>
2#include <string>
3
4// HYPERISO_MARTY_OPERATOR_NORM_ABI: ew-input-normalization-v1
5// HYPERISO_MARTY_TEMPLATE_ABI: semileptonic-c9-tree-first-split-regprop-fresh-loop-model-v17
6using namespace csl;
7using namespace mty;
8using namespace std;
9using namespace sm_input;
10
11namespace {
12
13enum class HyperisoMartyC9LinkerSelection {
14 NonPhotonVector,
15 PhotonOnly
16};
17
18HyperisoMartyC9LinkerSelection hyperiso_marty_c9_linker_selection =
19 HyperisoMartyC9LinkerSelection::NonPhotonVector;
20
21void hyperiso_marty_set_c9_linker_selection(HyperisoMartyC9LinkerSelection selection) {
22 hyperiso_marty_c9_linker_selection = selection;
23}
24
25bool hyperiso_marty_tree_level_matching = false;
26
27void hyperiso_marty_set_semileptonic_order(mty::Order order) {
28 hyperiso_marty_tree_level_matching = (order == mty::Order::TreeLevel);
29}
30
31bool hyperiso_marty_is_photon_name(std::string const& name) {
32 return name == "A" || name == "A;\\gamma" || name.find("\\gamma") != std::string::npos;
33}
34
35bool hyperiso_marty_is_scalar_particle(const mty::Particle& particle) {
36 return particle->getSpinDimension() == 1;
37}
38
39bool hyperiso_marty_is_photon_linker_particle(const mty::Particle& particle) {
40 return hyperiso_marty_is_photon_name(std::string(particle->getName()));
41}
42
43bool hyperiso_marty_is_forbidden_c9_linker_particle(const mty::Particle& particle) {
44 // Raw photon linkers A -> l+l- carry the regulated propagator used by
45 // MARTY's 4-fermion penguin patch. They are not a finite C9/CP9 matching
46 // coefficient. Finite photon pieces must be supplied analytically or via
47 // WilsonMatchingPatch. This does not veto particles inside loops, only the
48 // linker that MARTY connects to the lepton current.
49 if (hyperiso_marty_is_photon_linker_particle(particle)) {
50 return true;
51 }
52
53 // Neutral scalar/Goldstone linkers can be present as External particles of
54 // the penguin sub-amplitude before MARTY connects the 4-fermion graph. They
55 // should not be projected onto vector C9/CP9; scalar effects belong to CQ*
56 // operators. Again, this does not remove scalar BSM particles in loops or
57 // boxes, only a scalar linker attached to the lepton current.
58 if (hyperiso_marty_is_scalar_particle(particle)) {
59 return true;
60 }
61
62 return false;
63}
64
65template <typename Predicate>
66bool hyperiso_marty_has_linker_matching(mty::FeynmanDiagram const& diag, Predicate predicate) {
67 // In MARTY's 4-fermion coefficient construction, the penguin linker X in
68 // b -> s X is still an External particle when diagram filters are applied.
69 // After connectAmplitudes(), it may appear as a Mediator. Check both;
70 // checking Mediator only misses A/G0 and leaves reg_prop-dependent terms.
71 for (const auto& particle : diag.getParticles(mty::FeynmanDiagram::DiagramParticleType::External)) {
72 if (predicate(particle)) {
73 return true;
74 }
75 }
76 for (const auto& particle : diag.getParticles(mty::FeynmanDiagram::DiagramParticleType::Mediator)) {
77 if (predicate(particle)) {
78 return true;
79 }
80 }
81 return false;
82}
83
84bool hyperiso_marty_has_photon_linker(mty::FeynmanDiagram const& diag) {
85 return hyperiso_marty_has_linker_matching(diag, [](const mty::Particle& particle) {
86 return hyperiso_marty_is_photon_linker_particle(particle);
87 });
88}
89
90bool hyperiso_marty_has_forbidden_c9_linker(mty::FeynmanDiagram const& diag) {
91 return hyperiso_marty_has_linker_matching(diag, [](const mty::Particle& particle) {
92 return hyperiso_marty_is_forbidden_c9_linker_particle(particle);
93 });
94}
95
96bool hyperiso_marty_accept_c9_linker(mty::FeynmanDiagram const& diag) {
97 // Linker filtering is a one-loop penguin policy. At tree level a scalar
98 // leptoquark mediator is a legitimate source of C9 after operator
99 // projection/Fierz rearrangement and must not be mistaken for a neutral
100 // scalar penguin linker.
101 if (hyperiso_marty_tree_level_matching) {
102 return true;
103 }
104 switch (hyperiso_marty_c9_linker_selection) {
105 case HyperisoMartyC9LinkerSelection::NonPhotonVector:
106 return !hyperiso_marty_has_forbidden_c9_linker(diag);
107 case HyperisoMartyC9LinkerSelection::PhotonOnly:
108 return hyperiso_marty_has_photon_linker(diag);
109 }
110 return !hyperiso_marty_has_forbidden_c9_linker(diag);
111}
112
113// Backward-compatible aliases: older generated caches/templates called these
114// names. Keeping aliases prevents one half-updated template from failing to
115// compile. The semantically precise helper is hyperiso_marty_has_photon_linker.
116bool hyperiso_marty_has_forbidden_c9_penguin_mediator(mty::FeynmanDiagram const& diag) {
117 return hyperiso_marty_has_forbidden_c9_linker(diag);
118}
119
120bool hyperiso_marty_has_photon_mediator(mty::FeynmanDiagram const& diag) {
121 return hyperiso_marty_has_photon_linker(diag);
122}
123
124} // namespace
125
126void defineLibPath(Library &lib) {
127#ifdef MARTY_LIBRARY_PATH
128 lib.addLPath(MARTY_LIBRARY_PATH);
129 lib.addLPath(MARTY_LIBRARY_PATH "/..");
130 lib.addLPath(MARTY_LIBRARY_PATH "/marty");
131 lib.addLPath(MARTY_LIBRARY_PATH "/marty/lha");
132#endif
133#ifdef MARTY_INCLUDE_PATH
134 lib.addIPath(MARTY_INCLUDE_PATH);
135#endif
136}
137
138int calculate_C9mu(Model &model, gauge::Type gauge) {
139
140 model.getParticle("W")->setGaugeChoice(gauge);
141 model.getParticle("Z")->setGaugeChoice(gauge);
142
143 undefineNumericalValues(); // Allow for HIso to set all the parameters' values
144 mty::option::excludeExternalLegsCorrections = false;
145
146 Expr factorOperator = -4 * GetComplexConjugate(V_ts) * V_tb * G_F * pow_s(e_em / (4 * CSL_PI), 2) / csl::sqrt_s(2);
147 FeynOptions opts;
148 // The photon-penguin part of b -> s l l is not used directly as the final
149 // C9 four-fermion coefficient because it carries MARTY's regulated photon
150 // propagator. In BSM-split mode the same template is evaluated twice:
151 // - NonPhotonVector -> exported as C9 and evaluated numerically
152 // with reg_prop = 1e-6.
153 // - PhotonOnly -> exported separately as C9_A and evaluated
154 // numerically with reg_prop = 1.
155 // The numeric wrapper writes C9 = C9_non-photon + C9_A.
156 opts.addFilter([](mty::FeynmanDiagram const& diag) {
157 return hyperiso_marty_accept_c9_linker(diag);
158 });
159 opts.setFermionOrder({1, 0, 2, 3});
160 opts.setWilsonOperatorCoefficient(factorOperator);
161
162 auto wil = model.computeWilsonCoefficients(
163 mty::Order::OneLoop,
164 {Incoming("b"),
165 Outgoing("s"),
166 Outgoing("mu"),
167 Outgoing(AntiPart("mu"))},
168 opts
169 );
170
171 Expr C9_mu = getWilsonCoefficient(
172 wil,
173 dimension6Operator(model, wil, DiracCoupling::VL, DiracCoupling::V)
174 );
175
176 [[maybe_unused]] int sysres = system("rm -rf libs/C9_SM");
177 mty::Library wilsonLib("C9_SM", "libs");
178 wilsonLib.cleanExistingSources();
179 wilsonLib.addFunction("C9", C9_mu);
180 defineLibPath(wilsonLib);
181 wilsonLib.print();
182
183 return 0;
184}
185
186int main() {
187 SM_Model sm;
188 return calculate_C9mu(sm, gauge::Type::Feynman);
189}
void defineLibPath(Library &lib)
Definition C9.cpp:126
int calculate_C9mu(Model &model, gauge::Type gauge)
Definition C9.cpp:138
int main()
Definition C9.cpp:186
Model
RealMatrix diag(const gsl_vector *X)
Builds a diagonal matrix from a GSL vector.
Definition Matrix.cpp:464
Standard Model of particle physics.
Definition sm.h:35
csl::Expr e_em
Definition sm.h:78
csl::Expr G_F
Definition sm.h:84
void undefineNumericalValues()
csl::Expr V_tb
Definition sm.h:244
csl::Expr V_ts
Definition sm.h:306
Definition sm.h:30
Hash specialization for SymbolId<Tag>.
Definition BlockName.h:353