#5664: Bugs in PermutationGroup_subgroup.__cmp__
--------------------------+-------------------------------------------------
Reporter: SimonKing | Owner: SimonKing
Type: defect | Status: new
Priority: critical | Milestone: sage-3.4.1
Component: group_theory | Keywords: comparison subgroup
--------------------------+-------------------------------------------------
Comment(by SimonKing):
I have a suggestion for a fix.
1. For comparing PermutationGroup_generic, rely on gap, without reversion
of the output.
2. For ``PermutationGroup_subgroup.__cmp__(self,other)``:
a) Compare self and other as PermutationGroup_generic. If they are not
equal, return the result.
b) Otherwise, return the comparison of the ambient group of self with
the ambient group of other (or with other, itself, if it is not given as a
subgroup).
I had to modify the doc-test example of
``PermutationGroup_generic.__cmp__``. And then, we have:
{{{
sage: G=SymmetricGroup(6)
sage: G1=G.subgroup([G((1,2,3,4,5)),G((1,2))])
sage: G2=G.subgroup([G((1,2,3,4)),G((1,2))])
sage: K=G2.subgroup([G2((1,2,3))])
sage: H=G1.subgroup([G1(())])
sage: H<K
True
sage: K<H
False
sage: H2=G2.subgroup([G2(())])
sage: H<H2
True # because the ambient group of H is a subgroup of the ambient
group of H2
sage: G = PermutationGroup([[(1,2)]])
sage: H = PermutationGroup([[()]])
sage: G<H
False
sage: G = SymmetricGroup(4)
sage: H = G.subgroup([G((1,2,3))])
sage: K = G.subgroup([G((2,3,1))])
sage: H==K
True
# Here comes an oddity
sage: G = SymmetricGroup(4)
sage: H = G.subgroup([G((1,2,3)),G((1,2))])
sage: K = SymmetricGroup(3)
sage: K < H
False # this is comparison as PermutationGroup_generic
sage: K == H
True
sage: H < K
False
sage: H == K
False
}}}
The last example is comparison as PermutationGroup_subgroup, and comes
from the fact that the ambient group of K (which is assumed to be K
itself) is strictly smaller than the ambient group of H.
Does this way of comparison makes kind of sense?
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5664#comment:7>
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
-~----------~----~----~----~------~----~------~--~---