Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
flavor.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 FLAVOR_H_INCLUDED
24 #define FLAVOR_H_INCLUDED
25 
26 #include <string_view>
27 #include "representation.h"
28 #include "group.h"
29 
30 namespace mty {
31 
32 class SemiSimpleGroup;
33 class QuantumFieldParent;
34 class Irrep;
35 class FlavorIrrep;
36 
37 class FlavorGroup {
38 
39  public:
40 
41  FlavorGroup(std::string const& name,
42  int nFlavors,
43  bool complexFields = true);
44 
45  size_t getDim() const;
46 
47  std::string_view getName() const;
48 
49  csl::Index getCorrespondingIndex(
50  const std::string& index_name,
51  const QuantumFieldParent& parent);
52 
53  const csl::Space* getVectorSpace(const Irrep& irrep) const;
54 
55  const csl::Space* getFundamentalSpace() const;
56 
57  Irrep getTrivialRep() const;
58 
59  Irrep getFundamentalRep() const;
60 
61  SemiSimpleGroup* getGroup() const;
62 
63  bool isComplex() const;
64 
65  private:
66 
67  std::string name;
68 
69  std::unique_ptr<SemiSimpleGroup> group;
70 };
71 
72 class Flavor {
73 
74  typedef std::vector<mty::FlavorGroup*> FlavList;
75 
76  public:
77 
78  ~Flavor();
79 
80  FlavorIrrep getTrivialRep() const;
81 
82  FlavorIrrep getFundamentalRep() const;
83 
84  bool empty() const {
85  return flavors.empty();
86  }
87 
88  size_t size() const {
89  return flavors.size();
90  }
91 
92  FlavList::iterator begin() {
93  return flavors.begin();
94  }
95 
96  FlavList::iterator end() {
97  return flavors.end();
98  }
99 
100  FlavList::const_iterator begin() const {
101  return flavors.begin();
102  }
103 
104  FlavList::const_iterator end() const {
105  return flavors.end();
106  }
107 
108  void addGroup(std::unique_ptr<FlavorGroup>& newPtr) {
109  flavors.push_back(newPtr.release());
110  }
111 
112  void addGroup(std::unique_ptr<FlavorGroup>&& newPtr) {
113  flavors.push_back(newPtr.release());
114  }
115 
116  void push_back(std::unique_ptr<FlavorGroup>& newPtr) {
117  flavors.push_back(newPtr.release());
118  }
119 
120  void push_back(std::unique_ptr<FlavorGroup>&& newPtr) {
121  flavors.push_back(newPtr.release());
122  }
123 
124  FlavorGroup* operator[](size_t i) const {
125  return flavors[i];
126  }
127 
128  private:
129 
130  FlavList flavors;
131 };
132 
133 class FlavorIrrep {
134 
135  IMPLEMENTS_STD_VECTOR(Irrep, rep);
136 
137  public:
138 
139  FlavorIrrep() = default;
140 
141  FlavorIrrep(Flavor const* t_flavors);
142 
143  FlavorIrrep(Flavor const* t_flavors,
144  FlavorIrrep const& other);
145 
146  FlavorIrrep(FlavorIrrep const& other) = default;
147 
148  FlavorIrrep& operator=(FlavorIrrep const& other) = default;
149 
150  const Flavor* getFlavor() const;
151 
152  void setTrivialRepresentation(FlavorGroup const* flavorGroup);
153 
154  void setFundamentalRepresentation(FlavorGroup const* flavorGroup);
155 
156  void setRepresentation(FlavorGroup const* flavorGroup,
157  Irrep const& irrep);
158 
159  bool operator==(FlavorIrrep const &other) const;
160  bool operator!=(FlavorIrrep const &other) const {
161  return !(*this == other);
162  }
163 
164  friend std::ostream& operator<<(std::ostream& fout,
165  const FlavorIrrep& irrep);
166 
167  private:
168 
169  Flavor const* flavors;
170 
171  std::vector<Irrep> rep;
172 };
173 
174 } // End of namespace mty
175 
176 #endif
Base class for all Semi simple groups, i.e. groups that has a SemiSimpleAlgebra.
Definition: group.h:219
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
Classes handling irreducible representations of semi simple Lie algebras, using the Cartan formalism:...
Definition: flavor.h:37
Definition: flavor.h:133
bool operator==(const Expr &a, const Expr &b)
Definition: flavor.h:72
Handles the irreducible representation of a given semi-simple algebra.
Definition: representation.h:42
Base class for parents of QuantumField objects.
Definition: quantumField.h:152
bool operator!=(const Expr &a, const Expr &b)