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, 07 Dec 2012 17:15:48 -0600Explicit finite field extensionshttp://ask.sagemath.org/question/9604/explicit-finite-field-extensions/Hi
I would like to know how I may explicitly create a finite field as an extension of another field which is not the prime field. For example if I have GF(25) as my base field and I would like to create GF(5^6) using a polynomial with coefficients in GF(25) etc. The problem is that if I just create the 2 fields separately, I cannot coerce elements from the big field into the little one unless it is a prime field, and it seems that the galois_group() stuff only works for number field extensions. Sorry if I've missed the obvious.
thanks a lotThu, 06 Dec 2012 02:56:37 -0600http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/Answer by ppurka for <p>Hi
I would like to know how I may explicitly create a finite field as an extension of another field which is not the prime field. For example if I have GF(25) as my base field and I would like to create GF(5^6) using a polynomial with coefficients in GF(25) etc. The problem is that if I just create the 2 fields separately, I cannot coerce elements from the big field into the little one unless it is a prime field, and it seems that the galois_group() stuff only works for number field extensions. Sorry if I've missed the obvious.
thanks a lot</p>
http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?answer=14352#post-id-14352Look at [#11938](http://trac.sagemath.org/11938) which is for coercion from one finite field to another. It needs a review. If you have the background, please review it. :)Thu, 06 Dec 2012 23:38:17 -0600http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?answer=14352#post-id-14352Comment by GaryMak for <p>Look at <a href="http://trac.sagemath.org/11938">#11938</a> which is for coercion from one finite field to another. It needs a review. If you have the background, please review it. :)</p>
http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?comment=18568#post-id-18568hi I looked at this but unfortunately it's way too technical for me (both in terms of programming and the stuff you are actually implementing ie Conway polynomials etc - I have never worked with them). Sorry.Thu, 06 Dec 2012 23:53:55 -0600http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?comment=18568#post-id-18568Comment by ppurka for <p>Look at <a href="http://trac.sagemath.org/11938">#11938</a> which is for coercion from one finite field to another. It needs a review. If you have the background, please review it. :)</p>
http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?comment=18559#post-id-18559FYI: it is not me who wrote that patch. But it would be really nice to get this patch in. :)Fri, 07 Dec 2012 17:15:48 -0600http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?comment=18559#post-id-18559Answer by Francis Clarke for <p>Hi
I would like to know how I may explicitly create a finite field as an extension of another field which is not the prime field. For example if I have GF(25) as my base field and I would like to create GF(5^6) using a polynomial with coefficients in GF(25) etc. The problem is that if I just create the 2 fields separately, I cannot coerce elements from the big field into the little one unless it is a prime field, and it seems that the galois_group() stuff only works for number field extensions. Sorry if I've missed the obvious.
thanks a lot</p>
http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?answer=14359#post-id-14359There can't be a coercion from GF(q) to GF(q^k) if q is not prime since there will be several embeddings, none of which has any reason to be preferred. But it is simple to list the embeddings:
sage: F.<a> = GF(5^2); K.<b> = GF(5^6)
sage: Hom(F, K).list()
[
Ring morphism:
From: Finite Field in a of size 5^2
To: Finite Field in b of size 5^6
Defn: a |--> 4*b^5 + 2*b^4 + 4*b^2 + b,
Ring morphism:
From: Finite Field in a of size 5^2
To: Finite Field in b of size 5^6
Defn: a |--> b^5 + 3*b^4 + b^2 + 4*b + 1
]
It is possible to construct a field of order 5^6 which GF(25) coerces into:
sage: PF.<t> = F[]
sage: f, g = prime_factors(PF(b.minpoly())); f, g
(t^3 + (2*a + 2)*t + 4*a, t^3 + (3*a + 4)*t + a + 4)
sage: L.<c> = F.extension(f)
sage: L.is_field()
True
sage: L.order().factor()
5^6
sage: a + c in L
True
But at present there are limits to what can be done with this field:
sage: K.list()[:7]
[0, b, b^2, b^3, b^4, b^5, 4*b^4 + b^3 + 4*b^2 + 3]
sage: L.list()[:7]
Traceback (most recent call last)
...
NotImplementedError: object does not support iteration
Thu, 06 Dec 2012 21:56:08 -0600http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?answer=14359#post-id-14359Comment by GaryMak for <p>There can't be a coercion from GF(q) to GF(q^k) if q is not prime since there will be several embeddings, none of which has any reason to be preferred. But it is simple to list the embeddings:</p>
<pre><code>sage: F.<a> = GF(5^2); K.<b> = GF(5^6)
sage: Hom(F, K).list()
[
Ring morphism:
From: Finite Field in a of size 5^2
To: Finite Field in b of size 5^6
Defn: a |--> 4*b^5 + 2*b^4 + 4*b^2 + b,
Ring morphism:
From: Finite Field in a of size 5^2
To: Finite Field in b of size 5^6
Defn: a |--> b^5 + 3*b^4 + b^2 + 4*b + 1
]
</code></pre>
<p>It is possible to construct a field of order 5^6 which GF(25) coerces into:</p>
<pre><code>sage: PF.<t> = F[]
sage: f, g = prime_factors(PF(b.minpoly())); f, g
(t^3 + (2*a + 2)*t + 4*a, t^3 + (3*a + 4)*t + a + 4)
sage: L.<c> = F.extension(f)
sage: L.is_field()
True
sage: L.order().factor()
5^6
sage: a + c in L
True
</code></pre>
<p>But at present there are limits to what can be done with this field:</p>
<pre><code>sage: K.list()[:7]
[0, b, b^2, b^3, b^4, b^5, 4*b^4 + b^3 + 4*b^2 + 3]
sage: L.list()[:7]
Traceback (most recent call last)
...
NotImplementedError: object does not support iteration
</code></pre>
http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?comment=18570#post-id-18570Thank you very much - there is a whole load of functionality in your answer I wasn't able to understand before! The lack of listing capability makes things tricky but at least the rudiments of the algebraic substructure are there in what you have created. I cannot help thinking though that just as is done with the choice of a minimal polynomial for each "standard" Galois field, one could make these choices compatible so that coercion within towers was possible?Thu, 06 Dec 2012 22:29:50 -0600http://ask.sagemath.org/question/9604/explicit-finite-field-extensions/?comment=18570#post-id-18570