Opened 6 years ago
Last modified 5 years ago
#15031 new defect
Counter-intuitive mismatch between permutations and permutation group elements
Reported by: | darij | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-6.4 |
Component: | combinatorics | Keywords: | permutation, permutation group, symmetric group, sage-combinat, groups |
Cc: | tscrim, sage-combinat, nthiery, ncohen | Merged in: | |
Authors: | Reviewers: | ||
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description (last modified by )
sage: T = Tableau([[1,2],[3,4]]) sage: for p in T.column_stabilizer(): ....: print p ....: () (2,4) (1,3) (1,3)(2,4) sage: for p in T.column_stabilizer(): ....: print T.symmetric_group_action_on_values(p) ....: --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-2-657a6c3879e0> in <module>() 1 for p in T.column_stabilizer(): ----> 2 print T.symmetric_group_action_on_entries(p) 3 /home/darij/sage-5.11.beta3/local/lib/python2.7/site-packages/sage/combinat/tableau.pyc in symmetric_group_action_on_entries(self, w) 2631 Category of elements of Tableaux 2632 """ -> 2633 w = w + [i+1 for i in range(len(w), self.size())] #need to ensure that it belongs to Sym_size 2634 try: 2635 return self.parent()([[w[entry-1] for entry in row] for row in self]) TypeError: object of type 'sage.groups.perm_gps.permgroup_element.PermutationGroupElement' has no len()
(This is when #14884 is applied; otherwise it would throw a different error.) What is going on is that the column_stabilizer
method of a tableau returns permutation group elements rather than honest standard permutations, whereas the symmetric_group_action_on_entries
method only eats standard permutations.
Of course, type casting does solve the problem, but this is ugly and not completely trivial:
sage: p (1,3)(2,4) sage: parent(p) Permutation Group with generators [(), (2,4), (1,3)] sage: parent(SymmetricGroup(4)(p)) Symmetric group of order 4! as a permutation group sage: parent(Permutation(p)) Standard permutations
So T.symmetric_group_action_on_entries(SymmetricGroup(4)(p))
wouldn't work either, but T.symmetric_group_action_on_entries(Permutation(p))
works.
This is not an error in the classical meaning of the word, but I think this is something that should be fixed. How?
Incidentally, it seems that the Permutation(p)
typecast takes an ungodly amount of time...
Change History (5)
comment:1 Changed 6 years ago by
- Description modified (diff)
comment:2 Changed 6 years ago by
- Description modified (diff)
comment:3 Changed 5 years ago by
- Milestone changed from sage-6.1 to sage-6.2
comment:4 Changed 5 years ago by
- Milestone changed from sage-6.2 to sage-6.3
comment:5 Changed 5 years ago by
- Milestone changed from sage-6.3 to sage-6.4