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.Sat, 04 Mar 2017 04:37:42 +0100construction of extension field over GF(2^3)https://ask.sagemath.org/question/34508/construction-of-extension-field-over-gf23/My base field is GF(2^3) and to construct the field i am using irreducible polynomial p(x)=x^3+x+1. the extension field is GF(2^3)^2 and i want to construct this field using irreducible polynomial p(z)= z^2+(a^2+a+1)*z+a^2 where (a^2+a+1 and a^2 are the elements of field GF(2^3)) where a is represent theta that is root of irreducible polynomial over GF(2^3) .
i have written the code in sage but it gives me error .
K.<a>=GF(2^3);K.modulus()
for i in enumerate(K): print i
K1.<b> = GF(K,'modulus=x^2+(a^2+a+1)*x+a^2');K1.modulus()Thu, 18 Aug 2016 08:36:53 +0200https://ask.sagemath.org/question/34508/construction-of-extension-field-over-gf23/Comment by B r u n o for <p>My base field is GF(2^3) and to construct the field i am using irreducible polynomial p(x)=x^3+x+1. the extension field is GF(2^3)^2 and i want to construct this field using irreducible polynomial p(z)= z^2+(a^2+a+1)*z+a^2 where (a^2+a+1 and a^2 are the elements of field GF(2^3)) where a is represent theta that is root of irreducible polynomial over GF(2^3) .
i have written the code in sage but it gives me error .</p>
<pre><code>K.<a>=GF(2^3);K.modulus()
for i in enumerate(K): print i
K1.<b> = GF(K,'modulus=x^2+(a^2+a+1)*x+a^2');K1.modulus()
</code></pre>
https://ask.sagemath.org/question/34508/construction-of-extension-field-over-gf23/?comment=34509#post-id-345091. The code you give should be indented since it is completely unreadable, and you should mention the error(s) you get.
2. Have you read my answer to [your previous question](http://ask.sagemath.org/question/34229)?Thu, 18 Aug 2016 10:01:26 +0200https://ask.sagemath.org/question/34508/construction-of-extension-field-over-gf23/?comment=34509#post-id-34509Answer by dan_fulea for <p>My base field is GF(2^3) and to construct the field i am using irreducible polynomial p(x)=x^3+x+1. the extension field is GF(2^3)^2 and i want to construct this field using irreducible polynomial p(z)= z^2+(a^2+a+1)*z+a^2 where (a^2+a+1 and a^2 are the elements of field GF(2^3)) where a is represent theta that is root of irreducible polynomial over GF(2^3) .
i have written the code in sage but it gives me error .</p>
<pre><code>K.<a>=GF(2^3);K.modulus()
for i in enumerate(K): print i
K1.<b> = GF(K,'modulus=x^2+(a^2+a+1)*x+a^2');K1.modulus()
</code></pre>
https://ask.sagemath.org/question/34508/construction-of-extension-field-over-gf23/?answer=36822#post-id-36822There are many reasons, why errors occur for the above code, it is hard to guess which is the first one, the one given by the interpreter. First of all, the following works in the sense of the title, and is closest to the posted code:
sage: K.<a> = GF(2^3)
sage: a.minpoly()
x^3 + x + 1
sage: K.modulus()
x^3 + x + 1
sage: R.<x> = PolynomialRing( K )
sage: L.<b> = K.extension( x^2 + (a^2+a+1)*x + a^2 )
sage: L.order()
64
sage: b.minpoly()
x^2 + (a^2 + a + 1)*x + a^2
sage: L.modulus()
b^2 + (a^2 + a + 1)*b + a^2
sage: L.base()
Univariate Polynomial Ring in b over Finite Field in a of size 2^3
Let us compare with:
GF( K, 'modulus=x^2+(a^2+a+1)*x+a^2' ); # errors
The first argument of GF is... a field, not a prime power.
The second argument is... not optional, but a string, and inside the string there is a substring modulus... No chance.
Note:
Now the above sample lines produce a field L where a, b liven in, but it is not simple to work there. For instance, if one calls the multiplicative order on b, there are problems. So it may be better to first construct in a row L as the field with 2^6 elements, then pick inside two elements playing the roles of a and b. (Instead of L, a, b the following code uses the notations M, A, B.)
sage: M = GF( 2^6 )
sage: R.<x> = PolynomialRing( M )
sage: A = ( x^3 + x + 1 ).roots( multiplicities=False )[0]
sage: B = ( x^2 + (A^2+A+1)*x + A^2 ).roots( multiplicities=False )[0]
sage: B.multiplicative_order()
63
sage: A.multiplicative_order()
7
sage: A.minpoly()
x^3 + x + 1
sage: B.minpoly() # over the prime field
x^6 + x^5 + x^2 + x + 1
Sat, 04 Mar 2017 04:37:42 +0100https://ask.sagemath.org/question/34508/construction-of-extension-field-over-gf23/?answer=36822#post-id-36822