diff --git a/permutation.cc b/permutation.cc index db82546..1179708 100644 --- a/permutation.cc +++ b/permutation.cc @@ -779,6 +779,22 @@ for(int i=0; isize(); ++i) {res[i].perm = (*this)[i].perm.cutright(n) ; r return res; } +template +PermutationAlgebra PermutationAlgebra::conjugate_by(const NRPerm &q, bool reverse) const +{ +PermutationAlgebra res(this->size()); +for(int i=0; isize(); ++i) {res[i].perm = (*this)[i].perm.conjugate_by(q,reverse); res[i].weight=(*this)[i].weight;} +return res; +} + +template +PermutationAlgebra PermutationAlgebra::commutator(const NRPerm &q, bool reverse) const +{ +PermutationAlgebra res(this->size()); +for(int i=0; isize(); ++i) {res[i].perm = (*this)[i].perm.commutator(q,reverse); res[i].weight=(*this)[i].weight;} +return res; +} + template PermutationAlgebra PermutationAlgebra::operator&(const NRPerm &rhs) const diff --git a/permutation.h b/permutation.h index 81e83b8..26914ee 100644 --- a/permutation.h +++ b/permutation.h @@ -84,7 +84,7 @@ public: PERM_RANK_TYPE generate_all2(void (*callback)(const NRPerm&)); //recursive method, also not lexicographic PERM_RANK_TYPE generate_all_lex(void (*callback)(const NRPerm&)); //generate in lex order using next() PERM_RANK_TYPE generate_restricted(void (*callback)(const NRPerm&), const NRVec_from1 &classes, int restriction_type=0); - PermutationAlgebra list_restricted(const NRVec_from1 &classes, int restriction_type=0, bool inverted=false); //weight is set to parity (antisymmetrizer) by default + PermutationAlgebra list_restricted(const NRVec_from1 &classes, int restriction_type=0, bool inverted=false); //weight is set to parity (antisymmetrizer) by default, indices are 1...n, classes[index] indicate that it belongs to an equivalence class not to be permuted within PERM_RANK_TYPE rank() const; //counted from 0 to n!-1 NRVec_from1 inversions(const int type, PERM_RANK_TYPE *prank=NULL) const; //inversion tables explicit NRPerm(const int type, const NRVec_from1 &inversions); //compute permutation from inversions @@ -194,6 +194,8 @@ public: PermutationAlgebra operator*(const NRPerm &rhs) const; //applied to all terms PermutationAlgebra cutleft(int n) const; //applied to all terms PermutationAlgebra cutright(int n) const; //applied to all terms + PermutationAlgebra conjugate_by(const NRPerm &q, bool reverse=false) const; //q^-1 p q or q p q^-1 , applied to all terms + PermutationAlgebra commutator(const NRPerm &q, bool inverse=false) const; //applied to all terms PermutationAlgebra operator&(const PermutationAlgebra &rhs) const; //each term with each PermutationAlgebra operator|(const PermutationAlgebra &rhs) const; //each term with each PermutationAlgebra operator*(const PermutationAlgebra &rhs) const; //each term with each @@ -435,8 +437,9 @@ template NRMat RegularRepresentation(const PermutationAlgebra &a, const NRMat &mtable); +//generates a direct product of list_restricted antisymmetrizers template -PermutationAlgebra general_antisymmetrizer(const NRVec > &groups, int restriction_type=0, bool inverted=false); +PermutationAlgebra general_antisymmetrizer(const NRVec > &classgroups, int restriction_type=0, bool inverted=false); template void cast_permutation_algebra(PermutationAlgebra &lhs, const PermutationAlgebra &rhs)