Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
feynmanRule.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 
23 #ifndef FEYNMANRULE_H_INCLUDED
24 #define FEYNMANRULE_H_INCLUDED
25 
26 #include <csl.h>
27 #include "graph.h"
28 #include "interactionTerm.h"
29 
30 namespace mty {
31 
32 class Model;
33 
42 class FeynmanRule {
43 
44  public:
45 
47 
48  FeynmanRule(mty::Model &model,
49  TermType const &interactionTerm);
50 
51  FeynmanRule();
52  FeynmanRule(FeynmanRule const& other);
53  FeynmanRule& operator=(FeynmanRule const& other);
54  FeynmanRule(FeynmanRule && other) = default;
55  FeynmanRule& operator=(FeynmanRule && other) = default;
56 
57  std::vector<QuantumField>& getFieldProduct();
58  std::vector<QuantumField> const& getFieldProduct() const;
59  csl::Expr getFieldProduct(
60  csl::Tensor const& point,
61  std::vector<csl::Tensor>::iterator &first,
62  std::vector<csl::Tensor>::iterator last);
63  TermType& getInteractionTerm();
64  TermType const& getInteractionTerm() const;
65  std::shared_ptr<wick::Graph>& getDiagram();
66  std::shared_ptr<wick::Graph> const& getDiagram() const;
67  csl::Expr getExpr() const;
68  bool contains(mty::QuantumFieldParent const *parent) const;
69  size_t count(mty::QuantumFieldParent const *parent) const;
70  bool contains(mty::Particle const &p) const {
71  return contains(p.get());
72  }
73  bool containsWeakly(mty::QuantumFieldParent const *parent) const;
74  bool containsWeakly(mty::Particle const &p) const {
75  return containsWeakly(p.get());
76  }
77  size_t count(mty::Particle const &p) const {
78  return count(p.get());
79  }
80 
81  void setFieldProduct(std::vector<QuantumField> const& fieldProduct);
82  void setInteractionTerm(TermType const& term);
83  void setDiagram(std::shared_ptr<wick::Graph> const& diagram);
84  void setExpr(csl::Expr const& expr);
85 
86  void renameIndices();
87 
88  bool isZero() const;
89  bool isEmpty() const;
90  bool isSame(FeynmanRule const& other) const;
91  size_t getSize() const;
92 
93  bool operator==(FeynmanRule const&) const;
94  bool operator!=(FeynmanRule const&) const;
95  bool operator< (FeynmanRule const&) const;
96  bool operator> (FeynmanRule const&) const;
97  bool operator<=(FeynmanRule const&) const;
98  bool operator>=(FeynmanRule const&) const;
99 
100  friend
101  std::ostream& operator<<(std::ostream& out,
102  FeynmanRule const& rule);
103 
104  private:
105 
106  void directCMatrix(csl::Expr &rule);
107 
108  private:
109 
110  std::vector<QuantumField> fieldProduct;
111  TermType term;
113  csl::Expr expr;
114 };
115 
116 int fermionicFactor(std::vector<mty::QuantumField> const &fieldProduct);
117 
118 }
119 
120 
121 #endif
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
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
Base class for parents of QuantumField objects.
Definition: quantumField.h:152
Class mty::InteractionTerm, general purpose container for Lagrangian terms in MARTY.