id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
15031 Counter-intuitive mismatch between permutations and permutation group elements darij "{{{
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)
in ()
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..." defect new major sage-6.4 combinatorics permutation, permutation group, symmetric group, sage-combinat, groups tscrim sage-combinat nthiery ncohen N/A