Opened 7 years ago

Last modified 6 years ago

#15031 new defect

Counter-intuitive mismatch between permutations and permutation group elements — at Version 1

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 darij)

sage: T = Tableau([[1,2],[3,4]])
sage: for p in T.column_stabilizer():
....:     print p
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)

/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
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 transforming the Permutation(p) typecast takes an ungodly amount of time...

Change History (1)

comment:1 Changed 7 years ago by darij

  • Description modified (diff)
Note: See TracTickets for help on using tickets.