Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
momentumConservation.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 <vector>
27 #include "quantumField.h"
28 
29 namespace mty {
30 
32 
33  public:
34 
36  std::vector<mty::QuantumField> const &insertions,
37  std::vector<csl::Tensor> const &t_momenta
38  );
39  bool apply(csl::Expr &expr);
40 
41  private:
42 
43  int findMomentum(csl::Expr const &sub);
44  std::vector<csl::Expr> isMomentumSum(csl::Expr const &sub);
45  std::optional<csl::Expr> applyOnMomentumSum(
46  std::vector<csl::Expr> &factors
47  );
48 
49  std::pair<int, csl::Expr> getMomentumStructure(csl::Expr const &term);
50  bool simplify(std::vector<csl::Expr> &factors);
51  csl::Expr recoverExpr(std::vector<csl::Expr> const &factors);
52 
53  private:
54 
55  std::vector<bool> signs;
56  std::vector<csl::Tensor> momenta;
57  size_t posSimplestMomenta;
58  csl::Index mu;
59  };
60 }
Namespace of MARTY.
Definition: 2HDM.h:31
Definition: momentumConservation.h:31
Contains QuantumField and QuantumFieldParent, basic objects handling quantum fields as csl expression...