ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Tue, 16 Jan 2024 07:03:54 +0100Matrix multiplication not working for MatrixGroupElement_Gap objecthttps://ask.sagemath.org/question/75486/matrix-multiplication-not-working-for-matrixgroupelement_gap-object/Hi, I want to do a really simple multiplication between two matrices that are each independently defined from different matrix groups, but does have the same underlying structure.
sage: G
Subgroup with 3 generators(blah, blah, blah) of General Linear Group of degree 4 over Finite Field of size 2
sage: H
Subgroup with 5 generators(blah, ... , blah) of General Linear Group of degree 4 over Finite Field of size 2
sage: g = G.random_element(); h = H.random_element();
g
[0 1 0 0]
[1 0 0 0]
[0 0 0 1]
[1 1 1 0]
h
[1 0 0 0]
[0 1 0 0]
[1 0 1 0]
[1 1 1 1]
But when I do g*h in the sage command, it says
TypeError: unsupported operand parent(s) for *: G and H
What is the problem here? How can I solve it?Tue, 16 Jan 2024 06:02:47 +0100https://ask.sagemath.org/question/75486/matrix-multiplication-not-working-for-matrixgroupelement_gap-object/Comment by woojoshua78 for <p>Hi, I want to do a really simple multiplication between two matrices that are each independently defined from different matrix groups, but does have the same underlying structure.</p>
<pre><code>sage: G
Subgroup with 3 generators(blah, blah, blah) of General Linear Group of degree 4 over Finite Field of size 2
sage: H
Subgroup with 5 generators(blah, ... , blah) of General Linear Group of degree 4 over Finite Field of size 2
sage: g = G.random_element(); h = H.random_element();
g
[0 1 0 0]
[1 0 0 0]
[0 0 0 1]
[1 1 1 0]
h
[1 0 0 0]
[0 1 0 0]
[1 0 1 0]
[1 1 1 1]
</code></pre>
<p>But when I do g*h in the sage command, it says</p>
<pre><code>TypeError: unsupported operand parent(s) for *: G and H
</code></pre>
<p>What is the problem here? How can I solve it?</p>
https://ask.sagemath.org/question/75486/matrix-multiplication-not-working-for-matrixgroupelement_gap-object/?comment=75488#post-id-75488Ahh I was dumb, matrix(g)*matrix(h) works.Tue, 16 Jan 2024 07:03:54 +0100https://ask.sagemath.org/question/75486/matrix-multiplication-not-working-for-matrixgroupelement_gap-object/?comment=75488#post-id-75488