Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 7ebd25ac536d248d499a3ce2acda963a > files > 4377

Macaulay2-1.3.1-8.fc15.i686.rpm

<?xml version="1.0" encoding="utf-8" ?>  <!-- for emacs: -*- coding: utf-8 -*- -->
<!-- Apache may like this line in the file .htaccess: AddCharset utf-8 .html -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"	 "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg-flat.dtd" >
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head><title>finite fields</title>
<link rel="stylesheet" type="text/css" href="../../../../Macaulay2/Style/doc.css"/>
</head>
<body>
<table class="buttons">
  <tr>
    <td><div><a href="_polynomial_springs.html">next</a> | <a href="_integers_spmodulo_spa_spprime.html">previous</a> | <a href="_polynomial_springs.html">forward</a> | <a href="_integers_spmodulo_spa_spprime.html">backward</a> | <a href="_rings.html">up</a> | <a href="index.html">top</a> | <a href="master.html">index</a> | <a href="toc.html">toc</a> | <a href="http://www.math.uiuc.edu/Macaulay2/">Macaulay2 web site</a></div>

    </td>
  </tr>
</table>
<div><a href="index.html" title="">Macaulay2Doc</a> > <a href="_rings.html" title="">rings</a> > <a href="_finite_spfields.html" title="">finite fields</a></div>
<hr/>
<div><h1>finite fields</h1>
<div>Two basic finite fields are:<ul><li><a href="_integers_spmodulo_spa_spprime.html">ZZ/p</a></li>
<li><tt>GF(p^n)</tt></li>
</ul>
Create a finite field with q = p^n elements using<table class="examples"><tr><td><pre>i1 : F = GF(81,Variable=>a)

o1 = F

o1 : GaloisField</pre>
</td></tr>
</table>
This creates the ring of characteristic 3, having 3^4 = 81 elements.  The elements of this ring are 0, a, a^2, a^3, ..., a^80.<table class="examples"><tr><td><pre>i2 : a^80

o2 = 1

o2 : F</pre>
</td></tr>
<tr><td><pre>i3 : a^40

o3 = -1

o3 : F</pre>
</td></tr>
</table>
Use <a href="_ambient.html" title="ambient free module of a subquotient, or ambient ring">ambient</a> to see the quotient ring the field is made from.<table class="examples"><tr><td><pre>i4 : ambient F

        ZZ
        --[a]
         3
o4 = -----------
      4    3
     a  - a  - 1

o4 : QuotientRing</pre>
</td></tr>
</table>
Now check that <tt>a</tt> satisfies this equation.<table class="examples"><tr><td><pre>i5 : a^4 + a - 1

      3
o5 = a  + a

o5 : F</pre>
</td></tr>
</table>
It is often preferable to view elements of <tt>F</tt> as polynomials in <tt>a</tt> rather than as powers of <tt>a</tt>.  This can be accomplished by lifting the elements back to this ambient ring.<table class="examples"><tr><td><pre>i6 : lift(a^20, ambient F)

        3    2
o6 = - a  - a  - 1

        ZZ
        --[a]
         3
o6 : -----------
      4    3
     a  - a  - 1</pre>
</td></tr>
<tr><td><pre>i7 : apply({20,40,80}, i -> lift(a^i, ambient F))

         3    2
o7 = {- a  - a  - 1, -1, 1}

o7 : List</pre>
</td></tr>
</table>
(for more details on lift, see , <a href="_working_spwith_spmultiple_springs.html" title="">working with multiple rings</a>).<p/>
Finite fields can be used as base rings for polynomial rings.<table class="examples"><tr><td><pre>i8 : R = F[x,y,z]

o8 = R

o8 : PolynomialRing</pre>
</td></tr>
<tr><td><pre>i9 : f = random(2,R)

         3    2          2                    2          2       3          
o9 = (- a  + a  - a + 1)x  + (- a - 1)x*y + (a  + a - 1)y  + (- a  + a)x*z +
     ------------------------------------------------------------------------
       2                 3      2
     (a  + a - 1)y*z + (a  - 1)z

o9 : R</pre>
</td></tr>
<tr><td><pre>i10 : f = (leadCoefficient f)^(-1) * f

       2     3    2                 3    2          2       3              
o10 = x  + (a  + a  - a - 1)x*y + (a  - a  + a + 1)y  + (- a  - a + 1)x*z +
      -----------------------------------------------------------------------
        3    2                 2          2
      (a  - a  + a + 1)y*z + (a  - a + 1)z

o10 : R</pre>
</td></tr>
</table>
Gröbner bases, and all related computations work in these rings.<p/>
The prime finite fields can be made easily as quotient rings of <a href="___Z__Z.html" title="the class of all integers">ZZ</a>.<table class="examples"><tr><td><pre>i11 : ZZ/101

       ZZ
o11 = ---
      101

o11 : QuotientRing</pre>
</td></tr>
</table>
In general, to make a finite field with <tt>q</tt> elements, we use <a href="___G__F.html" title="make a finite field">GF</a>.<table class="examples"><tr><td><pre>i12 : k = GF 81

o12 = k

o12 : GaloisField</pre>
</td></tr>
</table>
The generator of the field can be obtained as usual.<table class="examples"><tr><td><pre>i13 : k_0

o13 = a

o13 : k</pre>
</td></tr>
</table>
Notice that the name of the generator is displayed with a <tt>$</tt> in it to indicate that it is not accessible by typing.  Of course, you could assign the generator to the symbol of your choice, but it will still print the same way.<table class="examples"><tr><td><pre>i14 : a = k_0

o14 = a

o14 : k</pre>
</td></tr>
<tr><td><pre>i15 : a^20+1

         3    2
o15 = - a  - a

o15 : k</pre>
</td></tr>
</table>
You may use <a href="_ambient.html" title="ambient free module of a subquotient, or ambient ring">ambient</a> to see the quotient ring the field is made from.<table class="examples"><tr><td><pre>i16 : ambient k

         ZZ
         --[a]
          3
o16 = -----------
       4    3
      a  - a  - 1

o16 : QuotientRing</pre>
</td></tr>
</table>
Use <a href="_ideal.html" title="make an ideal">ideal</a> to see the ideal that defined that quotient ring.<table class="examples"><tr><td><pre>i17 : ideal oo

             4    3
o17 = ideal(a  - a  - 1)

               ZZ
o17 : Ideal of --[a]
                3</pre>
</td></tr>
</table>
Finally, you may use <a href="__us.html" title="a binary operator, used for subscripting and access to elements">_</a> to recover the generator of the ideal.<table class="examples"><tr><td><pre>i18 : oo_0

       4    3
o18 = a  - a  - 1

      ZZ
o18 : --[a]
       3</pre>
</td></tr>
</table>
To specify a different name for the generator when the field is created, use the <a href="___Variable.html" title="specify a name for a variable">Variable</a> option.<table class="examples"><tr><td><pre>i19 : F = GF(16, Variable => b)

o19 = F

o19 : GaloisField</pre>
</td></tr>
<tr><td><pre>i20 : b^20 + 1

       2
o20 = b  + b + 1

o20 : F</pre>
</td></tr>
<tr><td><pre>i21 : random F

o21 = b

o21 : F</pre>
</td></tr>
</table>
Finite fields can be used as base rings for polynomial rings.<table class="examples"><tr><td><pre>i22 : R = F[x,y,z]

o22 = R

o22 : PolynomialRing</pre>
</td></tr>
<tr><td><pre>i23 : random(2,R)

        3    2      2     2                         2             3    2  
o23 = (b  + b  + 1)x  + (b  + b + 1)x*y + b*x*z + (b  + b)y*z + (b  + b  +
      -----------------------------------------------------------------------
         2
      b)z

o23 : R</pre>
</td></tr>
</table>
If you have a quotient ring that you know is a finite field, then you can convert it to ring that is known by the system to be a finite field.<table class="examples"><tr><td><pre>i24 : GF (ZZ/2[T]/(T^9+T+1), Variable => T)

o24 = GF 512

o24 : GaloisField</pre>
</td></tr>
</table>
You may also provide your own choice of primitive element.  Internally, elements of the finite field are stored as powers of the primitive element.  First we assign our quotient ring to a global variable to ensure that <tt>T</tt> gets set to a value in the quotient ring, and then we call <tt>GF</tt>.<table class="examples"><tr><td><pre>i25 : A = ZZ/2[T]/(T^9+T+1)

o25 = A

o25 : QuotientRing</pre>
</td></tr>
<tr><td><pre>i26 : k = GF (A, PrimitiveElement => T^3+1)

o26 = k

o26 : GaloisField</pre>
</td></tr>
</table>
Notice that <tt>T</tt> is now recorded as an element of this finite field.<table class="examples"><tr><td><pre>i27 : T

o27 = T

o27 : k</pre>
</td></tr>
</table>
The generator of A can be obtained this way:<table class="examples"><tr><td><pre>i28 : A_0

o28 = T

o28 : A</pre>
</td></tr>
</table>
Use <a href="_substitute.html" title="substituting values for variables">substitute</a> to see map it to an element of the finite field.<table class="examples"><tr><td><pre>i29 : substitute(A_0,k)

o29 = T

o29 : k</pre>
</td></tr>
</table>
Conversely, a given element of the finite field can be transferred back to the quotient ring with <a href="_lift.html" title="lift to another ring">lift</a>.<table class="examples"><tr><td><pre>i30 : lift(k_0, ring T)

o30 = T

o30 : k</pre>
</td></tr>
</table>
We can even lift it back to the polynomial ring.<table class="examples"><tr><td><pre>i31 : lift(k_0, ambient ring T)

o31 = T

o31 : A</pre>
</td></tr>
</table>
For more information see <a href="___Galois__Field.html" title="the class of all Galois fields">GaloisField</a>.</div>
</div>
</body>
</html>