Trouble with PermutationGroupElement

2 views
Skip to first unread message

epple

unread,
Mar 16, 2009, 4:27:23 PM3/16/09
to sage-support
I am slightly confused about Permutation groups. The following, I
think, is part of the problem.
Version: 3.4 (Sage on the web)
Code:
sage: h=PermutationGroupElement('()')
sage: k=PermutationGroupElement('(1,2)')
sage: k^2==h,h==k^2
(False, True)

Can someone explain to me why the comparisons give different results?
Thanks.

Robert Bradshaw

unread,
Mar 16, 2009, 5:17:33 PM3/16/09
to sage-s...@googlegroups.com

This is a bug, probably something wrong with the empty permutation.

- Robert

epple

unread,
Mar 16, 2009, 5:25:04 PM3/16/09
to sage-support
Actually I am getting the same result for other permutations, like:

sage: h=PermutationGroupElement('(1,3,2)')
sage: k=PermutationGroupElement('(1,2,3),(4,5)')
sage: k^2==h,h==k^2
(False, True)

Robert Bradshaw

unread,
Mar 16, 2009, 5:26:44 PM3/16/09
to sage-s...@googlegroups.com

Hmm... looks like permutation groups aren't being properly coerced
from one Parent to another.

- Robert


John H Palmieri

unread,
Mar 16, 2009, 5:40:08 PM3/16/09
to sage-support


On Mar 16, 2:26 pm, Robert Bradshaw <rober...@math.washington.edu>
wrote:
Should they be? I mean, should h and k^2 be equal, or not, in this
case?

John

John H Palmieri

unread,
Mar 16, 2009, 5:46:36 PM3/16/09
to sage-support
In particular, I wouldn't mind this behavior:

sage: h = PermutationGroupElement('(1,3,2)') # in S(3)
sage: k = PermutationGroupElement('(1,2,3),(4,5)') # in S(5)
sage: k^2 == h, h == k^2
(False, False)
sage: S5 = k.parent()
sage: h5 = S5(h)
sage: k^2 == h5, h5 == k^2
(True, True)

John

Robert Bradshaw

unread,
Mar 16, 2009, 5:49:28 PM3/16/09
to sage-s...@googlegroups.com

There's a whole thread on this topic...

In any case, as the "Parent" has not been specified, I wouldn't want
it to prevent them being equal. But the current asymmetric behavior
is particularly bad.

- Robert


John H Palmieri

unread,
Mar 16, 2009, 7:12:53 PM3/16/09
to sage-support
On Mar 16, 2:49 pm, Robert Bradshaw <rober...@math.washington.edu>
wrote:
> On Mar 16, 2009, at 2:46 PM, John H Palmieri wrote:
>
> There's a whole thread on this topic...

Which didn't really help me to decide one way or the other...

> In any case, as the "Parent" has not been specified, I wouldn't want  
> it to prevent them being equal. But the current asymmetric behavior  
> is particularly bad.

See <http://trac.sagemath.org/sage_trac/ticket/5537>.

John

Rob Beezer

unread,
Mar 17, 2009, 2:30:19 PM3/17/09
to sage-support
It's even worse:

sage: G=SymmetricGroup(8)
sage: H=SymmetricGroup(2)
sage: a=H('(1,2)')
sage: b=G('(1,2)(3,4)')
sage: a==b
True

I don't think any interpretation would suggest this behavior as
correct. The problem is that the current compare only runs through
checking equality of the images for the two permutations as far as the
length of the first.

John's patch at Trac 5537 should correct this. I'll have some timings
and a review up later today.

Rob

Reply all
Reply to author
Forward
0 new messages