1
- # sage.doctest: optional - sage.rings.finite_rings
1
+ # sage.doctest: needs sage.rings.finite_rings
2
2
"""
3
3
Base class for finite fields
4
4
@@ -1012,7 +1012,7 @@ cdef class FiniteField(Field):
1012
1012
1013
1013
The given modulus is always made monic::
1014
1014
1015
- sage: k. <a> = GF( 7^ 2, modulus=2* x^ 2- 3, impl="pari_ffelt")
1015
+ sage: k. <a> = GF( 7^ 2, modulus=2* x^ 2 - 3, impl="pari_ffelt")
1016
1016
sage: k. modulus( )
1017
1017
x^ 2 + 2
1018
1018
@@ -1022,19 +1022,19 @@ cdef class FiniteField(Field):
1022
1022
1023
1023
sage: GF( 2, impl="modn") . modulus( )
1024
1024
x + 1
1025
- sage: GF( 2, impl="givaro") . modulus( )
1025
+ sage: GF( 2, impl="givaro") . modulus( ) # needs sage . libs . linbox
1026
1026
x + 1
1027
- sage: GF( 2, impl="ntl") . modulus( )
1027
+ sage: GF( 2, impl="ntl") . modulus( ) # needs sage . libs . ntl
1028
1028
x + 1
1029
1029
sage: GF( 2, impl="modn", modulus=x) . modulus( )
1030
1030
x
1031
- sage: GF( 2, impl="givaro", modulus=x) . modulus( )
1031
+ sage: GF( 2, impl="givaro", modulus=x) . modulus( ) # needs sage . libs . linbox
1032
1032
x
1033
- sage: GF( 2, impl="ntl", modulus=x) . modulus( )
1033
+ sage: GF( 2, impl="ntl", modulus=x) . modulus( ) # needs sage . libs . ntl
1034
1034
x
1035
- sage: GF( 13^ 2, 'a', impl="givaro", modulus=x^ 2+ 2) . modulus( )
1035
+ sage: GF( 13^ 2, 'a', impl="givaro", modulus=x^ 2 + 2) . modulus( ) # needs sage . libs . linbox
1036
1036
x^ 2 + 2
1037
- sage: GF( 13^ 2, 'a', impl="pari_ffelt", modulus=x^ 2+ 2) . modulus( )
1037
+ sage: GF( 13^ 2, 'a', impl="pari_ffelt", modulus=x^ 2 + 2) . modulus( ) # needs sage . libs . pari
1038
1038
x^ 2 + 2
1039
1039
"""
1040
1040
# Normally, this is set by the constructor of the implementation
@@ -1086,6 +1086,7 @@ cdef class FiniteField(Field):
1086
1086
sage: f( F. gen( ))
1087
1087
0
1088
1088
1089
+ sage: # needs sage. libs. ntl
1089
1090
sage: k. <a> = GF( 2^ 20, impl='ntl')
1090
1091
sage: k. polynomial( )
1091
1092
a^ 20 + a^ 10 + a^ 9 + a^ 7 + a^ 6 + a^ 5 + a^ 4 + a + 1
@@ -1234,7 +1235,7 @@ cdef class FiniteField(Field):
1234
1235
(1, 0)
1235
1236
(0, 1)
1236
1237
1237
- sage: F = GF(9, 't', modulus=( x^2+x-1) )
1238
+ sage: F = GF(9, 't', modulus=x^2 + x - 1 )
1238
1239
sage: E = GF(81)
1239
1240
sage: h = Hom(F,E).an_element()
1240
1241
sage: V, from_V, to_V = E.vector_space(h, map=True)
@@ -1514,13 +1515,16 @@ cdef class FiniteField(Field):
1514
1515
To: Finite Field in b of size 5^2
1515
1516
Defn: 1 |--> 1
1516
1517
sage: f.parent()
1517
- Set of field embeddings from Finite Field of size 5 to Finite Field in b of size 5^2
1518
+ Set of field embeddings
1519
+ from Finite Field of size 5
1520
+ to Finite Field in b of size 5^2
1518
1521
1519
1522
Extensions of non-prime finite fields by polynomials are not yet
1520
1523
supported: we fall back to generic code::
1521
1524
1522
1525
sage: k.extension(x^5 + x^2 + x - 1)
1523
- Univariate Quotient Polynomial Ring in x over Finite Field in z4 of size 3^4 with modulus x^5 + x^2 + x + 2
1526
+ Univariate Quotient Polynomial Ring in x over Finite Field in z4 of size 3^4
1527
+ with modulus x^5 + x^2 + x + 2
1524
1528
1525
1529
TESTS:
1526
1530
@@ -1799,12 +1803,14 @@ cdef class FiniteField(Field):
1799
1803
Ring morphism:
1800
1804
From: Finite Field in z3 of size 2^3
1801
1805
To: Finite Field in z21 of size 2^21
1802
- Defn: z3 |--> z21^20 + z21^19 + z21^17 + z21^15 + z21^11 + z21^9 + z21^8 + z21^6 + z21^2),
1806
+ Defn: z3 |--> z21^20 + z21^19 + z21^17 + z21^15 + z21^11
1807
+ + z21^9 + z21^8 + z21^6 + z21^2),
1803
1808
(Finite Field in z7 of size 2^7,
1804
1809
Ring morphism:
1805
1810
From: Finite Field in z7 of size 2^7
1806
1811
To: Finite Field in z21 of size 2^21
1807
- Defn: z7 |--> z21^20 + z21^19 + z21^17 + z21^15 + z21^14 + z21^6 + z21^4 + z21^3 + z21),
1812
+ Defn: z7 |--> z21^20 + z21^19 + z21^17 + z21^15 + z21^14
1813
+ + z21^6 + z21^4 + z21^3 + z21),
1808
1814
(Finite Field in z21 of size 2^21,
1809
1815
Identity endomorphism of Finite Field in z21 of size 2^21)]
1810
1816
"""
@@ -2065,13 +2071,13 @@ cdef class FiniteField(Field):
2065
2071
sage: e = [a^0, a^1, a^2, a^3, a^4, a^5, a^6, a^7 ]
2066
2072
sage: d = F. dual_basis( e, check=False) ; d
2067
2073
[6*a^6 + 4*a^5 + 4*a^4 + a^3 + 6*a^2 + 3,
2068
- 6*a^7 + 4*a^6 + 4*a^5 + 2*a^4 + a^2,
2069
- 4*a^6 + 5*a^5 + 5*a^4 + 4*a^3 + 5*a^2 + a + 6,
2070
- 5*a^7 + a^6 + a^4 + 4*a^3 + 4*a^2 + 1,
2071
- 2*a^7 + 5*a^6 + a^5 + a^3 + 5*a^2 + 2*a + 4,
2072
- a^7 + 2*a^6 + 5*a^5 + a^4 + 5*a^2 + 4*a + 4,
2073
- a^7 + a^6 + 2*a^5 + 5*a^4 + a^3 + 4*a^2 + 4*a + 6,
2074
- 5*a^7 + a^6 + a^5 + 2*a^4 + 5*a^3 + 6*a ]
2074
+ 6*a^7 + 4*a^6 + 4*a^5 + 2*a^4 + a^2,
2075
+ 4*a^6 + 5*a^5 + 5*a^4 + 4*a^3 + 5*a^2 + a + 6,
2076
+ 5*a^7 + a^6 + a^4 + 4*a^3 + 4*a^2 + 1,
2077
+ 2*a^7 + 5*a^6 + a^5 + a^3 + 5*a^2 + 2*a + 4,
2078
+ a^7 + 2*a^6 + 5*a^5 + a^4 + 5*a^2 + 4*a + 4,
2079
+ a^7 + a^6 + 2*a^5 + 5*a^4 + a^3 + 4*a^2 + 4*a + 6,
2080
+ 5*a^7 + a^6 + a^5 + 2*a^4 + 5*a^3 + 6*a ]
2075
2081
sage: F. dual_basis( d)
2076
2082
[1, a, a^2, a^3, a^4, a^5, a^6, a^7 ]
2077
2083
0 commit comments