#5664: [with patch, needs review] Bugs in PermutationGroup_subgroup.__cmp__
--------------------------+-------------------------------------------------
Reporter: SimonKing | Owner: SimonKing
Type: defect | Status: new
Priority: critical | Milestone: sage-3.4.2
Component: group_theory | Keywords: comparison subgroup
--------------------------+-------------------------------------------------
Comment(by SimonKing):
Replying to [comment:14 wdj]:
> How is this behaviour (after your patch is attached) explained?
This is since comparison in gap apparently has nothing to do with the
subgroup structure.
Without my patch, {{{PermutationGroup.__cmp__(self, right)}}} returns
{{{
right._gap_().__cmp__(self._gap_())
}}}
which means that the trivial group may be ''bigger'' than a non-trivial
group:
{{{
# without my patch
sage: G = PermutationGroup([[(1,2)]])
sage: H = PermutationGroup([[()]])
sage: G<H
True
}}}
This example is the reason why I suggested to let
{{{PermutationGroup.__cmp__(self, right)}}} return
{{{
self._gap_().__cmp__(right._gap_())
}}}
But then, your example gives a strange result. I think gap is to blame for
this.
So, our choice is:
* Either we want that the trivial group is ''greater'' than the cyclic
group of order two; nasty!!
* or {{{PermutationGroup([[(1,2,3),(4,5)],[(3,4)]]) <
PermutationGroup([[(1,2,3),(4,5)]])}}}; nasty as well!
* or {{{G.__cmp__(H)}}} for PermutationGroups should do the following:
1. Test if G is a subgroup of H; if yes, return -1
2. Test if H is a subgroup of G; if yes, return +1
3. Now, G and H are mutually not subgroups. Then, return whatever gap
provides.
The last option seems best to me, from a mathematical point of view.
However, the subgroup test might be long.
What do you think?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5664#comment:15>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---