ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Fri, 27 Dec 2013 02:48:15 -0600morphism between permutation group and matrix grouphttp://ask.sagemath.org/question/10860/morphism-between-permutation-group-and-matrix-group/I can't figure out how to create a morphism between a permutation group and a matrix group (I know this is possible because Sage uses Gap and Gap doesn't have any problem with this, I don't imagine Sage removed the Gap functionality).
sage: flip = PermutationGroupElement("(1,2)")
sage: g = PermutationGroup([flip])
sage: flop = Matrix(GF(3), 1, 1, [2])
sage: k = MatrixGroup([flop])
sage: g.order()
2
sage: k.order()
2
sage: g.hom([flop])
<snip useless error message>
sage: k.hom([flip])
<snip another useless error message>
How can I construct the homomorphisms from g to k and k to g sending flip to flop and vice versa? (Maybe the problem is that Sage thinks g and k are a "permutation group" and "matrix group" respectively: if so, how can I get the underlying groups?)Thu, 26 Dec 2013 12:06:55 -0600http://ask.sagemath.org/question/10860/morphism-between-permutation-group-and-matrix-group/Answer by vdelecroix for <p>I can't figure out how to create a morphism between a permutation group and a matrix group (I know this is possible because Sage uses Gap and Gap doesn't have any problem with this, I don't imagine Sage removed the Gap functionality).</p>
<pre><code> sage: flip = PermutationGroupElement("(1,2)")
sage: g = PermutationGroup([flip])
sage: flop = Matrix(GF(3), 1, 1, [2])
sage: k = MatrixGroup([flop])
sage: g.order()
2
sage: k.order()
2
sage: g.hom([flop])
<snip useless error message>
sage: k.hom([flip])
<snip another useless error message>
</code></pre>
<p>How can I construct the homomorphisms from g to k and k to g sending flip to flop and vice versa? (Maybe the problem is that Sage thinks g and k are a "permutation group" and "matrix group" respectively: if so, how can I get the underlying groups?)</p>
http://ask.sagemath.org/question/10860/morphism-between-permutation-group-and-matrix-group/?answer=15869#post-id-15869Hi,
It is currently not possible to set group morphisms from generators (see also question [3157](http://ask.sagemath.org/question/3157/)). Nevertheless, you can build a morphism by explicitely give the corresponding map
sage: flip = PermutationGroupElement("(1,2)")
sage: g = PermutationGroup([flip])
sage: id3 = Matrix(GF(3), 1, 1, [1])
sage: flop = Matrix(GF(3), 1, 1, [2])
sage: k = MatrixGroup([flop])
sage: H = Hom(g,k)
sage: h = H(lambda x: flop if x == flip else id3)
And then
sage: h
Generic morphism:
From: Permutation Group with generators [(1,2)]
To: Matrix group over Finite Field of size 3 with 1 generators ([2],)
sage: h(flip) == flop
True
In [3157](http://ask.sagemath.org/question/3157/) you can see how to do this for arbitrary finite groups using the Cayley graph.Fri, 27 Dec 2013 02:48:15 -0600http://ask.sagemath.org/question/10860/morphism-between-permutation-group-and-matrix-group/?answer=15869#post-id-15869Answer by Luca for <p>I can't figure out how to create a morphism between a permutation group and a matrix group (I know this is possible because Sage uses Gap and Gap doesn't have any problem with this, I don't imagine Sage removed the Gap functionality).</p>
<pre><code> sage: flip = PermutationGroupElement("(1,2)")
sage: g = PermutationGroup([flip])
sage: flop = Matrix(GF(3), 1, 1, [2])
sage: k = MatrixGroup([flop])
sage: g.order()
2
sage: k.order()
2
sage: g.hom([flop])
<snip useless error message>
sage: k.hom([flip])
<snip another useless error message>
</code></pre>
<p>How can I construct the homomorphisms from g to k and k to g sending flip to flop and vice versa? (Maybe the problem is that Sage thinks g and k are a "permutation group" and "matrix group" respectively: if so, how can I get the underlying groups?)</p>
http://ask.sagemath.org/question/10860/morphism-between-permutation-group-and-matrix-group/?answer=15865#post-id-15865Sage did not remove Gap's functionality, it simply did not interface to it. There seems to be no implementation of Homsets specific to groups, and in particular no implementation of morphisms specified via the images of the generators, like there is for rings, for example. I agree that the error message is not very informative.
I see no easy workaround: either you define your own python functions, or you work directly with gap. This is probably worth a ticket on trac.sagemath.org.Thu, 26 Dec 2013 21:19:21 -0600http://ask.sagemath.org/question/10860/morphism-between-permutation-group-and-matrix-group/?answer=15865#post-id-15865