Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
model.h
Go to the documentation of this file.
1 // This file is part of MARTY.
2 //
3 // MARTY is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 3 of the License, or
6 // (at your option) any later version.
7 //
8 // MARTY is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with MARTY. If not, see <https://www.gnu.org/licenses/>.
15 
27 #ifndef MODE_H_INCLUDED
28 #define MODE_H_INCLUDED
29 
30 #include "modelBuilder.h"
31 #include "lagrangian.h"
32 #include "expander.h"
33 #include "group.h"
34 #include "feynmanRule.h"
35 #include "graph.h"
36 #include "operatorBasis.h"
37 #include "gaugedGroup.h"
38 #include "kinematics.h"
39 #include "doc_brown_link.h"
40 
41 namespace mty::wick{
42 class Graph;
43 }
44 
45 namespace mty {
46 
47 struct WilsonSet;
48 class Insertion;
49 class FeynOptions;
50 class Kinematics;
51 class Amplitude;
52 
53 enum class DecompositionMode {
54  Minimal,
55  BasisProjection,
56  Matching
57 };
58 
68 class Model: public ModelBuilder {
69 
70 public:
71 
72  inline static Model *current = nullptr;
73 
74 public:
75 
77  // Constructors
79 
80  template<class ...Args>
81  explicit Model(Args &&...args)
82  :ModelBuilder(std::forward<Args>(args)...)
83  {
84  current = this;
85  }
86 
87  ~Model() override = default;
88 
89  Model(Model&& other) = delete;
90  Model& operator=(Model&& other) = delete;
91  Model(Model const &other) = delete;
92  Model &operator=(Model const &other) = delete;
93 
95  // Getters
97 
98  size_t getFeynmanRulesNumber() const;
99 
100  std::vector<mty::FeynmanRule> const &getFeynmanRules();
101 
102  mty::FeynmanRule& getFeynmanRule(size_t pos);
103  mty::FeynmanRule const& getFeynmanRule(size_t pos) const;
104 
106  // Modifiers
108 
109  void filterFeynmanRules();
110 
112  // Computation utilities
114 
115  void computeFeynmanRules();
116 
117  mty::Amplitude computeAmplitude(
118  int order,
119  std::vector<mty::Insertion> insertions,
120  FeynOptions &options
121  );
122 
123  mty::Amplitude computeAmplitude(
124  int order,
125  std::vector<mty::Insertion> insertions,
126  Kinematics const &kinematics,
127  FeynOptions &options
128  );
129 
130  mty::Amplitude computeAmplitude(
131  int order,
132  std::vector<mty::Insertion> insertions
133  );
134 
135  mty::Amplitude computeAmplitude(
136  int order,
137  std::vector<mty::Insertion> insertions,
138  Kinematics const &kinematics
139  );
140 
141  mty::Amplitude computePartialAmplitude(
142  int order,
143  std::vector<mty::Insertion> insertions,
144  FeynOptions options = {}
145  );
146 
147  mty::Amplitude computePartialAmplitude(
148  int order,
149  std::vector<mty::Insertion> insertions,
150  Kinematics const &kinematics,
151  FeynOptions options = {}
152  );
153 
171  mty::Amplitude computeAmplitude(
172  std::vector<Lagrangian::TermType> &lagrangian,
173  std::vector<Insertion> insertions,
174  Kinematics const &kinematics,
175  FeynOptions options,
176  std::vector<FeynmanRule const*> rules = {}
177  );
178 
179  mty::Amplitude computeAmplitude(
180  std::vector<FeynmanRule const*> &feynRules,
181  std::vector<Insertion> const &insertions,
182  Kinematics const &kinematics,
183  FeynOptions const &options
184  );
185 
186  csl::Expr computeSquaredAmplitude(
187  Amplitude const &ampl,
188  bool applyDegreesOfFreedomFactor = true
189  );
190 
191  csl::Expr computeSquaredAmplitude(
192  WilsonSet const &ampl,
193  bool applyDegreesOfFreedomFactor = true
194  );
195 
196  csl::Expr computeSquaredAmplitude(
197  Amplitude const &amplL,
198  Amplitude const &amplR,
199  bool applyDegreesOfFreedomFactor = true
200  );
201 
202  csl::Expr computeSquaredAmplitude(
203  WilsonSet const &amplL,
204  WilsonSet const &amplR,
205  bool applyDegreesOfFreedomFactor = true
206  );
207 
208  WilsonSet getWilsonCoefficients(
209  Amplitude const &ampl,
210  FeynOptions const &feynOptions,
211  DecompositionMode mode = DecompositionMode::Matching
212  );
213 
214  WilsonSet getWilsonCoefficients(
215  Amplitude const &ampl,
216  DecompositionMode mode = DecompositionMode::Matching
217  );
218 
219  WilsonSet computeWilsonCoefficients(
220  int order,
221  std::vector<Insertion> const &insertions,
222  FeynOptions feynOptions = {},
223  bool disableFermionOrdering = false
224  );
225 
226  WilsonSet computeWilsonCoefficients_default(
227  int order,
228  std::vector<Insertion> const &insertions,
229  FeynOptions const &feynOptions = {}
230  );
231 
232  WilsonSet computeWilsonCoefficients_2Fermions_1Vector(
233  std::vector<Insertion> const &insertions,
234  FeynOptions const &feynOptions = {}
235  );
236 
237  WilsonSet computeWilsonBoxes_4Fermions(
238  Kinematics const &kinematics,
239  FeynOptions feynOptions = {}
240  );
241 
242  WilsonSet computeSingleWilsonPenguin_4Fermions(
243  Kinematics const &kinematics,
244  std::pair<size_t, size_t> const &treeCoupling,
245  std::pair<size_t, size_t> const &loopCoupling,
246  Insertion const &mediator,
247  FeynOptions feynOptions = {}
248  );
249 
250  WilsonSet computeWilsonPenguins_4Fermions(
251  Kinematics const &kinematics,
252  FeynOptions feynOptions = {}
253  );
254 
255  WilsonSet computeWilsonCoefficients_4Fermions(
256  std::vector<Insertion> insertions,
257  FeynOptions feynOptions = {}
258  );
259 
260  Amplitude connectAmplitudes(
261  Amplitude const &M1,
262  Amplitude const &M2,
263  FeynOptions const &options = {}
264  );
265 
266  static void projectOnBasis(
267  csl::Expr &expr,
268  OperatorBasis basis
269  );
270 
271  friend
272  std::ostream& operator<<(
273  std::ostream &out,
274  Model const &obj
275  );
276 protected:
277 
278  std::vector<mty::QuantumField> recoverQuantumInsertions(
279  std::vector<csl::Expr> const &insertions
280  );
281 
282  struct KinematicLink {
283  Kinematics kinematics;
284  csl::Tensor pL;
285  csl::Tensor pR;
286  std::pair<csl::Expr, csl::Expr> pL_replacement;
287  std::pair<csl::Expr, csl::Expr> pR_replacement;
288  mty::Particle mediator;
289 
295  int isMediator(csl::Expr const &expr) const;
296  };
297 
298  KinematicLink connectKinematics(
299  Amplitude &M1,
300  Amplitude &M2
301  ) const;
302 
303  std::pair<csl::Expr, csl::Expr> getMomentumReplacement(
304  Amplitude const &M,
305  size_t replacedMomentum
306  ) const;
307 
308  void replaceMomentumForLink(
309  Amplitude &M,
310  std::pair<csl::Expr, csl::Expr> const &pReplacement
311  ) const;
312 
313  bool mediatorToPropagator(
314  csl::Expr &prod,
315  KinematicLink const &link
316  ) const;
317 
318  csl::Expr connectMediator(
319  csl::Expr const &M1,
320  csl::Expr const &M2,
321  KinematicLink const &link
322  ) const;
323 
324 protected:
325 
326  std::vector<mty::FeynmanRule> feynmanRules;
327 };
328 
329 int operatorDegeneracy(std::vector<mty::Insertion> const &insertions);
330 
331 int matchingFermionSign(std::vector<int> fermionOrder);
332 
333 int fermionSign(
334  std::vector<Insertion> const &model,
335  std::vector<Insertion> order
336  );
337 
338 } // End of namespace mty
339 
340 #endif /* MODE_H_INCLUDED */
Group objects handling different possible symmetry groups. For now only semi-simple groups have repre...
std::ostream & operator<<(std::ostream &fout, csl::Type type)
This class inherits from std::shared_ptr<QuantumFieldParent> and should be used instead of direct Qua...
Definition: quantumField.h:1409
Namespace of MARTY.
Definition: 2HDM.h:31
Contains the Expander class that expands the Lagrangian in perturbation to find all Feynman diagrams ...
File containing the ModelBuilder class.
Interface class containing the result of an amplitude calculation.
Definition: amplitude.h:41
Instances of this class can be given to mty::Model when launching a calculation to customize the outp...
Definition: feynOptions.h:44
Definition: wilson.h:121
std::pair< csl::Expr, csl::Expr > getMomentumReplacement(std::vector< mty::QuantumField > const &insertions, std::vector< csl::Tensor > const &momenta, size_t posReplaced)
Creates the relevant replacement (using momentum conservation) to replace one particular momentum...
Definition: amplitudeSimplification.cpp:911
Contains the mty::Kinematics class.
csl::Expr M2
Wino mass.
Definition: MSSM.h:100
Definition: insertion.h:33
Stores insertion and momenta data and provides a simple interface to manipulate it.
Definition: kinematics.h:39
File containing classes handling gauge groups.
Contains the FeynmanRule object for Feynman rules.
csl::Expr M1
Bino mass.
Definition: MSSM.h:96
Represents a Feynman rule.
Definition: feynmanRule.h:42
Handles graphs for applying wick theorem. In this file lies the algorithm performing Wick contraction...
Contains all objects in the theory. In particular QuantumField objects, Gauge, Flavor, Particle...
Definition: model.h:68
OperatorBasis
Operator basis for Wilson coefficients.
Definition: operatorBasis.h:8
Contains the Lagrangian class, that encapsulates all interaction terms for a model.
Class containing all model building features of MARTY.
Definition: modelBuilder.h:54
Definition: feynmanDiagram.h:31