Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
traceIdentities.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 TRACE_IDENTITIES_H_INCLUDED
24 #define TRACE_IDENTITIES_H_INCLUDED
25 
26 #include <csl.h>
27 #include "group.h"
28 
29 namespace mty {
30 
32 
33 public:
34 
35  struct Tensor {
36  size_t finalSize;
37  std::vector<size_t> indices;
38 
39  Tensor(size_t t_finalSize)
40  :finalSize(t_finalSize)
41  {
42  indices.reserve(finalSize);
43  }
44 
45  Tensor(Tensor const &other) = default;
46  Tensor(Tensor &&other) = default;
47  Tensor &operator=(Tensor const &other) = default;
48  Tensor &operator=(Tensor &&other) = default;
49  ~Tensor() = default;
50 
51  IMPLEMENTS_STD_VECTOR(size_t, indices);
52  };
53 
54  IMPLEMENTS_STD_VECTOR(std::vector<Tensor>, terms)
55 
56  TraceIdentity(std::vector<size_t> const &t_tensorSize);
57 
58  TraceIdentity &operator*=(csl::Expr const &t_factor);
59  TraceIdentity &operator/=(csl::Expr const &t_factor);
60 
61  bool isSame(TraceIdentity const &other) const;
62 
63  TraceIdentity &operator+=(TraceIdentity const &other);
64 
65  friend std::ostream &operator<<(
66  std::ostream &out,
67  TraceIdentity const &identity
68  );
69 
70 private:
71 
72  std::vector<std::vector<Tensor>> step(
73  std::vector<Tensor> const &term) const;
74 
75  size_t totalIndices(std::vector<Tensor> const &term) const;
76 
77  bool isFull(Tensor const &tensor) const;
78 
79  bool isFull(std::vector<Tensor> const &tensors) const;
80 
81 public:
82 
83  csl::Expr factor = CSL_1;
84 
85 private:
86 
87  size_t n;
88  std::vector<size_t> tensorSize;
89  std::vector<std::vector<Tensor>> terms;
90 };
91 
92 struct PartitionPair {
93  size_t ni;
94  size_t mi;
95 };
96 
97 std::ostream &operator<<(
98  std::ostream &out,
99  std::vector<PartitionPair> const &partition
100  );
101 
102 std::vector<std::vector<PartitionPair>> evenPartition(size_t n);
103 
104 std::vector<TraceIdentity> traceIdentity(
105  algebra::Type type,
106  size_t n
107  );
108 std::vector<TraceIdentity> traceIdentity(
109  algebra::Type type,
110  size_t l,
111  size_t n
112  );
113 
114 std::vector<TraceIdentity> ATraceIdentity(
115  size_t l,
116  size_t n
117  );
118 std::vector<TraceIdentity> BTraceIdentity(
119  size_t l,
120  size_t n
121  );
122 std::vector<TraceIdentity> CTraceIdentity(
123  size_t l,
124  size_t n
125  );
126 std::vector<TraceIdentity> DTraceIdentity(
127  size_t l,
128  size_t n
129  );
130 std::vector<TraceIdentity> E6TraceIdentity(
131  size_t n
132  );
133 std::vector<TraceIdentity> E7TraceIdentity(
134  size_t n
135  );
136 std::vector<TraceIdentity> E8TraceIdentity(
137  size_t n
138  );
139 std::vector<TraceIdentity> F4TraceIdentity(
140  size_t n
141  );
142 std::vector<TraceIdentity> G2TraceIdentity(
143  size_t n
144  );
145 
146 }
147 
148 #endif
Group objects handling different possible symmetry groups. For now only semi-simple groups have repre...
std::ostream & operator<<(std::ostream &fout, csl::Type type)
Namespace of MARTY.
Definition: 2HDM.h:31
Definition: traceIdentities.h:31
Definition: traceIdentities.h:35
Type
Different types of semi-simple Lie algebras.
Definition: semiSimpleAlgebra.h:52
Definition: traceIdentities.h:92