Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generators given by as_permutation_group in the wrong order #19438

Closed
sagetrac-pguillot mannequin opened this issue Oct 20, 2015 · 19 comments
Closed

generators given by as_permutation_group in the wrong order #19438

sagetrac-pguillot mannequin opened this issue Oct 20, 2015 · 19 comments

Comments

@sagetrac-pguillot
Copy link
Mannequin

sagetrac-pguillot mannequin commented Oct 20, 2015

sage: MS=MatrixSpace(QQ,2)
sage: A=MS([0,1,1,0])
sage: B=MS.identity_matrix()
sage: G = MatrixGroup([A,B])
sage: G
Matrix group over Rational Field with 2 generators (
[0 1]  [1 0]
[1 0], [0 1]
)
sage: P = G.as_permutation_group()
sage: P
Permutation Group with generators [(), (2,3)]

One can see that the generators of the permutation group do not correspond to those of the matrix group. They should be given in the very same order.

This is a one-line change.

CC: @fchapoton @nathanncohen @dimpase

Component: group theory

Keywords: permutation groups

Author: Pierre Guillot

Branch: ffeb721

Reviewer: Frédéric Chapoton, Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/19438

@sagetrac-pguillot sagetrac-pguillot mannequin added this to the sage-6.10 milestone Oct 20, 2015
@sagetrac-pguillot
Copy link
Mannequin Author

sagetrac-pguillot mannequin commented Dec 7, 2015

New commits:

929d605trac #19438 bug corrected in as_permutation_group method
cd3e801Fixed the bug described in the ticket.

@sagetrac-pguillot
Copy link
Mannequin Author

sagetrac-pguillot mannequin commented Dec 7, 2015

Branch: u/pguillot/ticket_19438

@sagetrac-pguillot
Copy link
Mannequin Author

sagetrac-pguillot mannequin commented Dec 7, 2015

Commit: cd3e801

@dimpase
Copy link
Member

dimpase commented Dec 7, 2015

comment:4

the whole thing looks a but dodgy, as permutation groups are handled by GAP's Group(), which is not guaranteed to create a group with exactly the same generators. Let me see...

@dimpase
Copy link
Member

dimpase commented Dec 7, 2015

comment:5

LGTM

@fchapoton
Copy link
Contributor

comment:6

there should be a blank line after TESTS::

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 7, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

9d7c09dAdded a blank line after TESTS::

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 7, 2015

Changed commit from cd3e801 to 9d7c09d

@dimpase
Copy link
Member

dimpase commented Dec 7, 2015

comment:8

Could you trim the whitespaces on the empty lines you added? (we don't need any spaces there).

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 7, 2015

Branch pushed to git repo; I updated commit sha1. New commits:

ffeb721Trimmed the spaces on the blank lines.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Dec 7, 2015

Changed commit from 9d7c09d to ffeb721

@fchapoton
Copy link
Contributor

Reviewer: Frédéric Chapoton, ​Dima Pasechnik

@fchapoton
Copy link
Contributor

comment:10

ok, good to go.

Bravo, voila ton premier ticket !

@nbruin
Copy link
Contributor

nbruin commented Dec 7, 2015

comment:11

Should it return the same generators literally? The basic routine doesn't do that:

sage: PermutationGroup([[2,3,1],[3,1,2],[2,1,3],[3,2,1],[1,3,2],[2,3,1]])
Permutation Group with generators [(2,3), (1,2), (1,2,3), (1,3,2), (1,3)]

It doesn't matter so much how the permutation group is represented, as long as the isomorphism to the permutation group is given. You should probably check if the cost of "canonicalize=false" is acceptable.

@sagetrac-pguillot
Copy link
Mannequin Author

sagetrac-pguillot mannequin commented Dec 7, 2015

comment:12
sage: PermutationGroup([[2,3,1],[3,1,2],[2,1,3],[3,2,1],[1,3,2],[2,3,1]])
Permutation Group with generators [(2,3), (1,2), (1,2,3), (1,3,2), (1,3)]

Precisely, here canonicalize=True is assumed. Adding canonicalize= False forces it to return the same generators, literally, yes.

I had assumed that canonicalize= False actually reduced the time needed for the computation, since it simply does a little less. This is confirmed by

(a) looking at the code for the class PermutationGroup_generic, which has

if canonicalize:
            gens = sorted(set(gens))

and as far as I can tell, this is the one and only place where the flag is used.

(b) When using GAP directly, if you try

G:= Group([(1,2,3), (1,3,2), (1,2), (1,3), (2,3), (1,2,3)]);
GeneratorsOfGroup(G);

then you get

[ (1,2,3), (1,3,2), (1,2), (1,3), (2,3), (1,2,3) ]

that is, they are kept in the same order by default.

It doesn't matter so much how the permutation group is represented, as long as the isomorphism to the permutation group is given.

It would be best to just return the isomorphism itself (that is what GAP does), yes. I'm not sure that Sage has anything on group homomorphisms, though.

@nbruin
Copy link
Contributor

nbruin commented Dec 8, 2015

comment:13

OK, thanks.

The basic infrastructure for homomorphisms and isomorphisms is there, so it should be fairly straightforward to interface with the gap computations. That's for another ticket, though.

@vbraun
Copy link
Member

vbraun commented Dec 9, 2015

Changed branch from u/pguillot/ticket_19438 to ffeb721

@jdemeyer
Copy link

Changed commit from ffeb721 to none

@jdemeyer
Copy link

Changed reviewer from Frédéric Chapoton, ​Dima Pasechnik to Frédéric Chapoton, Dima Pasechnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants