Ask Your Question

Matrices as MatrixGroupElements - coercion error

asked 2023-03-07 08:19:07 +0100

Andrei Smolensky gravatar image

How does one transform a matrix over GF(q^2) into an element of a matrix group? Specifically, how to get access to the base field of SU(3, q), which is GF(q^2)?

Consider the following script:

from sage.all import *

q = 3
f0 = GF(q)
f = GF(q**2, 'x')
x = f('x')
z = f0(0)
e = f0(1)
g = SU(3, q)
y = x**2
a = matrix([[e, z, y], [z, e, z], [z, z, e]])

The output is

[    1     0 x + 1]
[    0     1     0]
[    0     0     1]

followed by

TypeError: unable to coerce from a finite field other than the prime subfield

with a rather deep stacktrace.

My initial guess was that the problem is that I specialized 'x' as the generator for GF(q^2), but changing this to

f = GF(q**2)
x = f.gens()[0]

produces the same result.

How to get around this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2023-03-07 08:36:40 +0100

Andrei Smolensky gravatar image

updated 2023-03-07 15:14:47 +0100

Max Alekseyev gravatar image

As it usually happens, figured it out myself soon after posting a question. Posting as answer for completeness.

The field can be accessed via g.base(). If a specific symbol for generator is needed, the group constructor can be called as g = SU(3, q, var='x'), then set x = g.base().gens()[0] or simply as f = g.base() and x = f('x').

edit flag offensive delete link more



sage: a in g
Emmanuel Charpentier gravatar imageEmmanuel Charpentier ( 2023-03-07 13:35:28 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2023-03-07 08:19:07 +0100

Seen: 19,889 times

Last updated: Mar 07 '23