Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
amplitudeInitializer.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 
24 #pragma once
25 
26 #include <variant>
27 #include "feynOptions.h"
28 #include "lagrangian.h"
29 #include "amplitude.h"
30 
31 namespace mty {
32 
33  class Model;
34  class Kinematics;
35 
37 
38  public:
39 
41  mty::Model const *t_model,
42  mty::FeynOptions const &t_options,
43  Kinematics const &t_kinematics,
44  std::vector<mty::QuantumField> const &t_insertions,
45  std::vector<mty::Lagrangian::TermType> &t_lagrangian
46  );
47 
49  mty::Model const *t_model,
50  mty::FeynOptions const &t_options,
51  Kinematics const &t_kinematics,
52  std::vector<mty::QuantumField> const &t_insertions,
53  std::vector<mty::FeynmanRule const*> &t_lagrangian
54  );
55 
56  template<class ...Args>
57  static Amplitude getAmplitude(
58  std::vector<std::vector<size_t>> const &terms,
59  Args &&...args
60  )
61  {
62  AmplitudeInitializer ampl (std::forward<Args>(args)... );
63  return ampl.getAmplitude(terms);
64  }
65 
66  Amplitude getAmplitude(
67  std::vector<std::vector<size_t>> const &terms
68  );
69 
70  void initMomentumVertices(
71  std::vector<FeynmanRule> &localRules,
72  std::map<csl::Tensor, size_t> &vertexIds,
73  std::vector<csl::Tensor> const &vertices,
74  std::vector<csl::Tensor> &witnessVertices,
75  csl::PseudoIntegral &integral,
76  std::vector<csl::Expr> &fieldVertices
77  );
78 
79  std::vector<std::vector<size_t>> getExternalSymmetries(
80  csl::Expr &fieldProd
81  ) const;
82 
83  std::vector<csl::Expr> applyExternalSymmetries(
84  csl::Expr const& res,
85  std::vector<size_t> perm
86  ) const;
87 
88  std::vector<csl::Expr> applyAllExternalSymmetries(
89  std::vector<csl::Expr> const& init,
90  std::vector<std::vector<size_t>>::iterator first,
91  std::vector<std::vector<size_t>>::iterator last
92  ) const;
93 
94  void simplifyFullQuantumCalculation(
95  mty::FeynmanDiagram &diagram,
96  csl::PseudoIntegral const &integral,
97  std::vector<size_t> const &posTerms,
98  std::vector<std::vector<size_t>> &externalSym
99  );
100 
101  void simplifyRuledCalculation(
102  mty::FeynmanDiagram &diagram,
103  csl::PseudoIntegral const &integral,
104  std::vector<csl::Tensor> const &witnessVericesx,
105  FeynruleMomentum &momentumMapping
106  );
107 
108  static void removeZeroDiagrams(
109  std::vector<FeynmanDiagram> &diagrams
110  );
111 
112  static csl::Expr getLSZInsertions(
113  std::vector<mty::QuantumField> const &fields,
114  std::vector<csl::Tensor> const &momenta,
115  bool feynRuleCalculation
116  );
117 
118  static std::vector<csl::Tensor> getVertices(size_t N);
119 
128  static void orderInsertions(
129  std::vector<mty::QuantumField> &insertions,
130  Kinematics &kinematics,
131  FeynOptions &options
132  );
133 
134  static void applyMomentumVertices(
135  std::vector<csl::Tensor> const &witnessVertices,
136  FeynruleMomentum &momentumMapping,
137  csl::Expr &amplitude
138  );
139 
140  private:
141 
142  Amplitude fullQuantumCalculation(
143  std::vector<std::vector<size_t>> const &terms
144  );
145 
146  Amplitude ruledCalculation(
147  std::vector<std::vector<size_t>> const &terms
148  );
149 
150  private:
151 
152  inline static std::vector<mty::Lagrangian::TermType> defaultL{};
153  inline static std::vector<mty::FeynmanRule const*> defaultFR{};
154 
155  mty::Model const *model;
156  mty::FeynOptions options;
157  std::vector<mty::QuantumField> insertions;
158  Kinematics kinematics;
159 
169 
174  std::vector<mty::Lagrangian::TermType> &lagrangian;
175 
180  std::vector<mty::FeynmanRule const*> &feynmanRules;
181  };
182 
183 } // namespace mty
Definition: feynruleMomentum.h:68
std::vector< mty::FeynmanRule const * > & feynmanRules
Reference to the Feynman rules when the calculation does use Feynman rules, reference to an empty vec...
Definition: amplitudeInitializer.h:180
Namespace of MARTY.
Definition: 2HDM.h:31
Contains the mty::Amplitude object that stores the data of an amplitude calculation.
bool feynRuleMode
True if the calculation a calculation of Feynman rules (using the Lagrangian), false if the calculati...
Definition: amplitudeInitializer.h:168
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
static void orderInsertions(std::vector< mty::QuantumField > &insertions, Kinematics &kinematics, FeynOptions &options)
Order the field insertions (important for fermion ordering), applying the permutation to the associat...
Definition: amplitudeInitializer.cpp:430
std::vector< mty::Lagrangian::TermType > & lagrangian
Reference to the lagrangian term when the calculation does not use Feynman rules, reference to an emp...
Definition: amplitudeInitializer.h:174
Class containing a Feynman diagram, symbolic expression and graph included.
Definition: feynmanDiagram.h:50
Stores insertion and momenta data and provides a simple interface to manipulate it.
Definition: kinematics.h:39
Contains the FeynOptions object used by the mty::Model class to set calculation options.
Contains all objects in the theory. In particular QuantumField objects, Gauge, Flavor, Particle...
Definition: model.h:68
Contains the Lagrangian class, that encapsulates all interaction terms for a model.
Definition: amplitudeInitializer.h:36