Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
fermionChain.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 FERMIONCHAIN_H_INCLUDED
24 #define FERMIONCHAIN_H_INCLUDED
25 
26 #include <csl.h>
27 
28 namespace mty {
29 
30 class DiracSpace;
31 class FermionChain {
32 
33  public:
34 
35  struct Chain {
36  std::vector<size_t> pos;
37  bool cycle = false;
38  };
39 
40  explicit
41  FermionChain(const csl::Space *t_diracSpace);
42 
43  bool applyOn(csl::Expr& prod,
44  bool makeAbbreviation = true) const;
45 
46  static std::vector<Chain> getChains(
47  csl::Expr const& prod,
48  DiracSpace const* diracSpace,
49  bool keepBorders = false);
50 
51  std::vector<csl::Expr>& getTensorsInChain();
52 
53  std::vector<csl::Expr> const& getTensorsInChain() const;
54 
55  private:
56 
57  const mty::DiracSpace *diracSpace;
58  std::vector<csl::Expr> tensors;
59 };
60 
61 }
62 
63 #endif
Namespace of MARTY.
Definition: 2HDM.h:31
Definition: diracology.h:36
Definition: fermionChain.h:35
Definition: fermionChain.h:31