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.Fri, 13 May 2022 16:51:17 +0200Subextension over non-prime subfield as a quotienthttps://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/ Hi!
I am looking for a light and easy way to build the following objects:
- a finite (possibly non prime) field `Fq`;
- an irreducible polynomial `p` in `Fq[X]`;
- and a finite extension `L` of `Fq` which contains `L0 = Fq[X]/p` as a subfield.
Crucially, I want to be able to manipulate the generator `z = L0(X)` (i.e. the
image of `X` in `L0`) as an element of `L`. I also need to view these extensions
as extension over `Fq` (e.g. using `.over(Fq)`) and *not* the prime subfield
(in particular, I do *not* want to see `L` as an extension of `L0`).
Let me know if this is not clear and you need more explanations.
For this, I can define my extensions as follows:
sage: Fq = GF(7^2)
sage: FqX.<X> = Fq[]
sage: p = FqX.irreducible_element(3)
sage: L0 = Fq.extension(modulus=p).over(Fq); L0
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^3 + z2*X + z2 + 3 over its base
sage: L = Fq.extension(modulus=FqX.irreducible_element(6)).over(Fq); L
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^6 + (6*z2 + 4)*X + 4*z2 + 6 over its base
Now I can define `z = L0(X)`:
sage: z = L0(X)
sage: assert z == L0.gen()
sage:
But I can't manage to see `z` as an element of `L`. In the following snippet,
it seems that casting `z` as an element of `L` converts it to a generator of
`L`:
sage: zL = L(z)
sage: zL == L.gen()
True
I tried other ways to create the extensions. Sometimes coercion is a problem. Sometimes some methods are available on a method but not the other. Does anybody has any idea?Wed, 04 May 2022 14:32:52 +0200https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/Comment by rburing for <p>Hi!</p>
<p>I am looking for a light and easy way to build the following objects:</p>
<ul>
<li>a finite (possibly non prime) field <code>Fq</code>;</li>
<li>an irreducible polynomial <code>p</code> in <code>Fq[X]</code>;</li>
<li>and a finite extension <code>L</code> of <code>Fq</code> which contains <code>L0 = Fq[X]/p</code> as a subfield.</li>
</ul>
<p>Crucially, I want to be able to manipulate the generator <code>z = L0(X)</code> (i.e. the
image of <code>X</code> in <code>L0</code>) as an element of <code>L</code>. I also need to view these extensions
as extension over <code>Fq</code> (e.g. using <code>.over(Fq)</code>) and <em>not</em> the prime subfield
(in particular, I do <em>not</em> want to see <code>L</code> as an extension of <code>L0</code>).</p>
<p>Let me know if this is not clear and you need more explanations.</p>
<p>For this, I can define my extensions as follows:</p>
<pre><code>sage: Fq = GF(7^2)
sage: FqX.<X> = Fq[]
sage: p = FqX.irreducible_element(3)
sage: L0 = Fq.extension(modulus=p).over(Fq); L0
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^3 + z2*X + z2 + 3 over its base
sage: L = Fq.extension(modulus=FqX.irreducible_element(6)).over(Fq); L
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^6 + (6*z2 + 4)*X + 4*z2 + 6 over its base
</code></pre>
<p>Now I can define <code>z = L0(X)</code>:</p>
<pre><code>sage: z = L0(X)
sage: assert z == L0.gen()
sage:
</code></pre>
<p>But I can't manage to see <code>z</code> as an element of <code>L</code>. In the following snippet,
it seems that casting <code>z</code> as an element of <code>L</code> converts it to a generator of
<code>L</code>:</p>
<pre><code>sage: zL = L(z)
sage: zL == L.gen()
True
</code></pre>
<p>I tried other ways to create the extensions. Sometimes coercion is a problem. Sometimes some methods are available on a method but not the other. Does anybody has any idea?</p>
https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?comment=62314#post-id-62314You can map `z` in `L0` to one of `z.minpoly().change_ring(L).roots(multiplicities=False)` in `L`. Unfortunately defining a homomorphism via `L0.hom` seems to be broken for a relative extension `L0`.Wed, 04 May 2022 16:42:36 +0200https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?comment=62314#post-id-62314Comment by slelievre for <p>Hi!</p>
<p>I am looking for a light and easy way to build the following objects:</p>
<ul>
<li>a finite (possibly non prime) field <code>Fq</code>;</li>
<li>an irreducible polynomial <code>p</code> in <code>Fq[X]</code>;</li>
<li>and a finite extension <code>L</code> of <code>Fq</code> which contains <code>L0 = Fq[X]/p</code> as a subfield.</li>
</ul>
<p>Crucially, I want to be able to manipulate the generator <code>z = L0(X)</code> (i.e. the
image of <code>X</code> in <code>L0</code>) as an element of <code>L</code>. I also need to view these extensions
as extension over <code>Fq</code> (e.g. using <code>.over(Fq)</code>) and <em>not</em> the prime subfield
(in particular, I do <em>not</em> want to see <code>L</code> as an extension of <code>L0</code>).</p>
<p>Let me know if this is not clear and you need more explanations.</p>
<p>For this, I can define my extensions as follows:</p>
<pre><code>sage: Fq = GF(7^2)
sage: FqX.<X> = Fq[]
sage: p = FqX.irreducible_element(3)
sage: L0 = Fq.extension(modulus=p).over(Fq); L0
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^3 + z2*X + z2 + 3 over its base
sage: L = Fq.extension(modulus=FqX.irreducible_element(6)).over(Fq); L
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^6 + (6*z2 + 4)*X + 4*z2 + 6 over its base
</code></pre>
<p>Now I can define <code>z = L0(X)</code>:</p>
<pre><code>sage: z = L0(X)
sage: assert z == L0.gen()
sage:
</code></pre>
<p>But I can't manage to see <code>z</code> as an element of <code>L</code>. In the following snippet,
it seems that casting <code>z</code> as an element of <code>L</code> converts it to a generator of
<code>L</code>:</p>
<pre><code>sage: zL = L(z)
sage: zL == L.gen()
True
</code></pre>
<p>I tried other ways to create the extensions. Sometimes coercion is a problem. Sometimes some methods are available on a method but not the other. Does anybody has any idea?</p>
https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?comment=62313#post-id-62313Welcome to Ask Sage! Thank you for your question.Wed, 04 May 2022 14:33:34 +0200https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?comment=62313#post-id-62313Answer by dan_fulea for <p>Hi!</p>
<p>I am looking for a light and easy way to build the following objects:</p>
<ul>
<li>a finite (possibly non prime) field <code>Fq</code>;</li>
<li>an irreducible polynomial <code>p</code> in <code>Fq[X]</code>;</li>
<li>and a finite extension <code>L</code> of <code>Fq</code> which contains <code>L0 = Fq[X]/p</code> as a subfield.</li>
</ul>
<p>Crucially, I want to be able to manipulate the generator <code>z = L0(X)</code> (i.e. the
image of <code>X</code> in <code>L0</code>) as an element of <code>L</code>. I also need to view these extensions
as extension over <code>Fq</code> (e.g. using <code>.over(Fq)</code>) and <em>not</em> the prime subfield
(in particular, I do <em>not</em> want to see <code>L</code> as an extension of <code>L0</code>).</p>
<p>Let me know if this is not clear and you need more explanations.</p>
<p>For this, I can define my extensions as follows:</p>
<pre><code>sage: Fq = GF(7^2)
sage: FqX.<X> = Fq[]
sage: p = FqX.irreducible_element(3)
sage: L0 = Fq.extension(modulus=p).over(Fq); L0
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^3 + z2*X + z2 + 3 over its base
sage: L = Fq.extension(modulus=FqX.irreducible_element(6)).over(Fq); L
Univariate Quotient Polynomial Ring in X over Finite Field in z2 of size 7^2 with modulus X^6 + (6*z2 + 4)*X + 4*z2 + 6 over its base
</code></pre>
<p>Now I can define <code>z = L0(X)</code>:</p>
<pre><code>sage: z = L0(X)
sage: assert z == L0.gen()
sage:
</code></pre>
<p>But I can't manage to see <code>z</code> as an element of <code>L</code>. In the following snippet,
it seems that casting <code>z</code> as an element of <code>L</code> converts it to a generator of
<code>L</code>:</p>
<pre><code>sage: zL = L(z)
sage: zL == L.gen()
True
</code></pre>
<p>I tried other ways to create the extensions. Sometimes coercion is a problem. Sometimes some methods are available on a method but not the other. Does anybody has any idea?</p>
https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?answer=62346#post-id-62346In 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]
Fri, 06 May 2022 20:52:57 +0200https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?answer=62346#post-id-62346Comment by YesIsBetterThanCrimson for <p>In such cases, it is useful to work in $L$ and only in $L$. All elements can be arranged to be there. </p>
<p>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>
<pre><code>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]
</code></pre>
<p>Alternatively:</p>
<pre><code>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]
</code></pre>
https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?comment=62427#post-id-62427Thank you two for those solutions. I think that they are the easiest way to achieve the result, and they are fairly simple, as we can always work in `L`. I will be using this!Fri, 13 May 2022 16:51:17 +0200https://ask.sagemath.org/question/62312/subextension-over-non-prime-subfield-as-a-quotient/?comment=62427#post-id-62427