23 #ifndef SYMMETRY_H_INCLUDED 24 #define SYMMETRY_H_INCLUDED 39 IMPLEMENTS_STD_VECTOR(
int, permutation)
65 std::vector<int> permutation;
89 explicit Permutation(
const std::vector<int>& t_permutation);
102 Permutation(
int n,
const std::vector<int>& list,
int sym);
113 const std::vector<std::vector<int> >& list);
160 void adjustToSize(
size_t newSize);
162 void applyRedefinition(
const std::vector<size_t>& redefinition);
213 friend std::ostream&
operator<<(std::ostream& fout,
226 std::vector<std::vector<int> >
permutations(std::vector<int> init);
256 std::vector<Permutation>
getSpan(
const std::vector<Permutation>& init);
268 void getSpan(std::vector<Permutation >& spanned,
288 bool mustGetSpan =
true;
332 size_t getNPermutation()
const;
339 int getSymmetryOf(
int i,
int j)
const;
349 void addSymmetry(
const Permutation& newPermutation,
int sym=1);
361 void addSymmetry(
const std::vector<int>& newPermutation,
int sym=1);
374 const std::vector<std::vector<int>>& newPermutation,
377 void adjustPermutationSize();
379 void setMustGetSpan(
bool t_must);
412 friend std::ostream&
operator<<(std::ostream& fout,
434 void addSymmetry(
const Index& i1,
437 void addSymmetry(
const std::pair<Index, Index>& perm,
440 void addAntiSymmetry(
const Index& i1,
443 void addAntiSymmetry(
const std::pair<Index, Index>& perm);
454 csl::vector_expr applySymmetry(
const Expr& expr)
const;
462 size_t findPos(
const Index& index,
466 std::pair<Symmetry, Symmetry> getCorrespondingSymmetries(
Permutation operator*(const Permutation &t_permutation) const
operator*, Compose two Permutation objects and returns the result in a new Permutation.
Definition: symmetry.cpp:212
std::vector< Permutation > getSpan(const std::vector< Permutation > &init)
Calculates all permutations spanned by an ensemble of initial Permutations init.
Definition: symmetry.cpp:324
Namespace for csl library.
Definition: abreviation.h:34
Handles a std::vector of integers that represents the permutation of n indices, with a possible symme...
Definition: symmetry.h:37
Index object that is used for indicial objects.
Definition: index.h:75
Handles the full symmetry properties of an TensorElement, i.e. a vector of Permutation objects...
Definition: symmetry.h:277
friend std::ostream & operator<<(std::ostream &fout, const Permutation &permutation)
operator<<, displays the Permutation t_permutation in the output fout.
Definition: symmetry.cpp:236
Expr operator+(const Expr &a, const Expr &b)
Shortcut function that allows to use arithmetic operator + with Expr (== shared_ptr<Abstract>).
Definition: abstract.cpp:1298
Permutation & operator=(const Permutation &t_permutation)=default
Assignement operator. Copies t_permutation and returns a reference to *this.
Permutation()
Default constructor.
Definition: symmetry.cpp:33
std::vector< int > getPermutation() const
Definition: symmetry.cpp:194
void setSymmetry(int t_symmetry)
Definition: symmetry.cpp:153
~Permutation()
Destructor.
Definition: symmetry.h:125
bool operator!=(const Permutation &t_permuation) const
operator!=, tells if two Permutation objects are not equal.
Definition: symmetry.cpp:208
int dim
Dimension of the symmetry, i.e. number of indices of the TensorElement.
Definition: symmetry.h:286
int getOrder()
This function calculates the order of the permutation the first time, or just return it if it has alr...
Definition: symmetry.cpp:113
std::vector< Permutation > permutation
List of the permutations for which the TensorElement have a symmetry or an antisymmetry property...
Definition: symmetry.h:294
bool operator==(const Permutation &t_permutation) const
operator==, tells if two Permutation objects are equal.
Definition: symmetry.cpp:198
~Symmetry()
Destructor.
Definition: symmetry.h:318
void reducePermutation(std::vector< Permutation > &permutation)
Takes a vector of Permutation objects and erase the redundant ones, i.e. the permutations present sev...
Definition: symmetry.cpp:313
int getSymmetry() const
Definition: symmetry.cpp:149
std::vector< std::vector< int > > permutations(std::vector< int > init)
Gets all permutations (int the form of vectors of integers) of n elements, n beeing the size of init...
int getSign()
This function calculates the sign of the permutation the first time, or just return it if it has alre...
Definition: symmetry.cpp:128
Manages a std::vector of Index, to be used by an TensorElement.
Definition: index.h:472
Expression type/.
Definition: abstract.h:1573
Definition: symmetry.h:416