Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
expander.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 "lagrangian.h"
27 #include "insertion.h"
28 #include "feynOptions.h"
29 
30 namespace mty {
31 
32  class Model;
33  class FeynmanDiagram;
34 
35  enum Order {
36  TreeLevel,
37  OneLoop
38  };
39 
40  class Expander {
41 
42  public:
43 
44  Expander(
45  mty::Model const *t_model,
46  FeynOptions const &t_options,
47  std::vector<mty::Lagrangian::TermType> const &lagrangian,
48  std::vector<mty::QuantumField> const &t_insertions
49  );
50 
51  std::vector<std::vector<size_t>> findNonZeroDiagrams();
52 
53  template<class ...Args>
54  static std::vector<std::vector<size_t>> getDiagrams(
55  Args &&...args
56  )
57  {
58  Expander exp(std::forward<Args>(args)...);
59  return exp.findNonZeroDiagrams();
60  }
61 
62  private:
63 
64  bool contractionPossible(
65  std::vector<size_t> const &fieldPos,
66  std::vector<bool> const &insertionsPaired,
67  std::vector<QuantumField> const &newFields,
68  std::vector<bool> &newPairing,
69  int order,
70  int maxOrder,
71  size_t nLoops,
72  size_t maxInteractionLegs
73  );
74 
75  void addVertexCarefully(
76  size_t iTerm,
77  std::vector<size_t> const &terms,
78  std::vector<std::vector<size_t>> &numbers,
79  std::vector<std::vector<bool>> &newPairings,
80  std::vector<bool> const &pairing,
81  std::map<std::vector<size_t>, bool> &vertexMap
82  );
83 
84  private:
85 
86  mty::Model const *model;
87 
88  FeynOptions const &options;
89  std::vector<mty::Lagrangian::TermType> effectiveLagrangian;
90  std::vector<mty::QuantumField> insertions;
91  };
92 
93 } // namespace mty
Definition: expander.h:40
Namespace of MARTY.
Definition: 2HDM.h:31
Instances of this class can be given to mty::Model when launching a calculation to customize the outp...
Definition: feynOptions.h:44
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.