Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
representation.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 
22 #ifndef REPRESENTATION_H_INCLUDED
23 #define REPRESENTATION_H_INCLUDED
24 
25 #include "semiSimpleAlgebra.h"
26 
27 // Forward declaration of SumIrrep class
28 namespace mty {
29 class SumIrrep;
30 }
31 
32 namespace mty {
33 
42 class Irrep{
43 
44  public:
45 
49  Irrep();
50 
59  Irrep(const SemiSimpleAlgebra* t_algebra,
60  const std::vector<AlgebraState>& t_rep,
61  const std::vector<int>& multiplicities);
62 
66  ~Irrep(){}
67 
76  size_t size() const;
77 
83  bool empty() const;
84 
89  std::vector<AlgebraState>::iterator begin();
90 
95  std::vector<AlgebraState>::const_iterator begin() const;
96 
101  std::vector<AlgebraState>::iterator end();
102 
107  std::vector<AlgebraState>::const_iterator end() const;
108 
112  const SemiSimpleAlgebra* getAlgebra() const;
113 
122  int getDim() const;
123 
134  csl::Expr getCharge() const;
135 
146 
158  std::vector<AlgebraState> getRep() const;
159 
172  std::vector<int> getMult() const;
173 
182  Irrep getConjugatedRep() const;
183 
189  AlgebraState& operator[](int i);
190 
196  AlgebraState operator[](int i) const;
197 
205  bool operator<(const Irrep& other) const;
206 
214  bool operator>(const Irrep& other) const;
215 
223  bool operator>=(const Irrep& other) const;
224 
232  bool operator<=(const Irrep& other) const;
233 
245  bool operator==(const Irrep& other) const;
246 
253  bool operator!=(const Irrep& other) const;
254 
267  SumIrrep operator+(const Irrep& other) const;
268 
279  SumIrrep operator+(const SumIrrep& other) const;
280 
293  SumIrrep operator*(const Irrep& other) const;
294 
306  SumIrrep operator*(const SumIrrep& other) const;
307 
315  friend
316  std::ostream& operator<<(std::ostream& fout,
317  const Irrep& irrep);
318 
319  protected:
320 
325  int dim;
326 
332 
337 
342  std::vector<AlgebraState> rep;
343 
348  std::vector<int> mult;
349 };
350 
363 class SumIrrep: public std::vector<Irrep>{
364 
365  public:
366 
370  SumIrrep();
371 
376  explicit
377  SumIrrep(const std::vector<Irrep>& t_irrep);
378 
383  explicit
384  SumIrrep(const Irrep& other);
385 
390 
398  int getDim() const;
399 
404  const SemiSimpleAlgebra* getAlgebra() const;
405 
411  void insertSort(const Irrep& other);
412 
421  SumIrrep operator+(const Irrep& other) const;
422 
432  SumIrrep operator+(const SumIrrep& other) const;
433 
443  SumIrrep operator*(const Irrep& other) const;
444 
456  SumIrrep operator*(const SumIrrep& other) const;
457 
465  friend
466  std::ostream& operator<<(std::ostream& fout,
467  const SumIrrep& s);
468 
469  protected:
470 
476 };
477 
478 } // End of namespace mty
479 
480 #endif
std::vector< int > getMult() const
Returns the multiplicities in a std::vector of integers.
Definition: representation.cpp:113
std::vector< AlgebraState >::iterator end()
Definition: representation.cpp:73
std::vector< AlgebraState >::iterator begin()
Definition: representation.cpp:63
int dim
Dimension of the Irrep, i.e. the sum of all AlgebraState&#39;s mutiplicities.
Definition: representation.h:325
size_t size() const
Returns the size of the Irrep, i.e. the number of different states.
Definition: representation.cpp:53
bool operator>(const Irrep &other) const
Comparison operator, compares the dimension of the two Irrep in order to sort Irrep objects by their ...
Definition: representation.cpp:162
const SemiSimpleAlgebra * algebra
Pointer to the SemiSimpleAlgebra from which the Irrep is a representation.
Definition: representation.h:331
std::vector< AlgebraState > rep
Set of AlgebraState in the representation, in a std::vector. The highest weight state is in position ...
Definition: representation.h:342
const SemiSimpleAlgebra * getAlgebra() const
Definition: representation.cpp:98
AlgebraState getHighestWeight() const
Returns the highest weight state of the representation.
Definition: representation.cpp:103
Namespace of MARTY.
Definition: 2HDM.h:31
Class inherited from std::vector<int>, dynkin labels for a state of a semi-simple algebra (see docume...
Definition: algebraState.h:35
int getDim() const
The dimension of the representation is the sum of multiplicities of all states in it...
Definition: representation.cpp:83
bool operator<=(const Irrep &other) const
Comparison operator, compares the dimension of the two Irrep in order to sort Irrep objects by their ...
Definition: representation.cpp:167
bool operator!=(const Irrep &other) const
Inverse of Irrep::operator==().
Definition: representation.cpp:183
Contains a sum of Irrep (irreducible representation) of a given SemiSimpleAlgebra.
Definition: representation.h:363
Irrep()
Default constructor. Initializes an empty irrep.
Definition: representation.cpp:29
bool operator<(const Irrep &other) const
Comparison operator, compares the dimension of the two Irrep in order to sort Irrep objects by their ...
Definition: representation.cpp:157
SumIrrep operator+(const Irrep &other) const
Implements the sum of the Irrep with another (other), stores it in a SumIrrep and returns it...
Definition: representation.cpp:189
friend std::ostream & operator<<(std::ostream &fout, const Irrep &irrep)
Overload of the operator<< for Irrep. Displays the highest weight and the dimension.
SumIrrep operator*(const Irrep &other) const
Calculates and returns the product of ***this** and other in the form of a sum of irreducible represe...
Definition: representation.cpp:204
Abstract base class for all semi-simple Lie algebras.
Definition: semiSimpleAlgebra.h:96
~Irrep()
Destructor.
Definition: representation.h:66
bool operator>=(const Irrep &other) const
Comparison operator, compares the dimension of the two Irrep in order to sort Irrep objects by their ...
Definition: representation.cpp:172
std::vector< AlgebraState > getRep() const
Returns all the states in the representation.
Definition: representation.cpp:108
const SemiSimpleAlgebra * algebra
Pointer to the algebra from which the Irreps in the sum are irreducible representations.
Definition: representation.h:475
Handles the irreducible representation of a given semi-simple algebra.
Definition: representation.h:42
Semi simple Lie algebras: calculations of highest weight representations, products and sums of repres...
AlgebraState highestWeight
Highest weight state of the representation.
Definition: representation.h:336
bool empty() const
Tells if the Irrep is empty, i.e. contains no state.
Definition: representation.cpp:58
bool operator==(const Irrep &other) const
Compares two Irreps.
Definition: representation.cpp:177
std::vector< int > mult
Set of multiplicities in the the representation, to each state is associated a multiplicity. The highest weight&#39;s multiplicity is one.
Definition: representation.h:348
AlgebraState & operator[](int i)
Returns the state in position i. Bound checks are done.
Definition: representation.cpp:131
~SumIrrep()
Destructor.
Definition: representation.h:389
csl::Expr getCharge() const
Returns the charge (csl::Expr, can be a fraction) of a representation.
Definition: representation.cpp:88
Irrep getConjugatedRep() const
Creates and returns the conjugated rep, i.e. the rep with inverted dinkin labels. ...
Definition: representation.cpp:118