1 | initial version |
In such cases, it is useful to work in $L$ and only in $L$. All elements can be arranged to be there.
Let $q$ be a prime power, the prime will be denoted by $p$. I will initialize the field $L=\Bbb F_q[w]$ of characteristic $p$, of degree six over $\Bbb F_q$, containing an element $z$ which generates a subfield $L_0$ of degree three inside $L$, so that the following tower is realized: $$ \begin{array}{c} L=\Bbb F_q[w] \\ \uparrow \\ L_0=\Bbb F_q[z] \\ \uparrow \\ K=\Bbb F_q=\Bbb F_p[a] \\ \uparrow \\ F=\Bbb F_p \end{array} $$
p, power = 7, 2
q = p^power
F = GF(p)
R.<X> = PolynomialRing(F)
P1power = R.irreducible_element(power)
P3power = R.irreducible_element(3*power)
P6power = R.irreducible_element(6*power)
L.<w> = GF(q^6, modulus=P6power)
z = P3power.roots(ring=L, multiplicities=False)[0]
a = P1power.roots(ring=L, multiplicities=False)[0]
Alternatively:
p, power = 7, 2
q = p^power
K.<a> = GF(q)
R.<X> = PolynomialRing(K)
P3 = R.irreducible_element(3)
P6 = R.irreducible_element(6)
L.<w> = K.extension(P6)
z = P3.roots(ring=L, multiplicities=False)[0]