Skip to content

Commit 1810daf

Browse files
author
Matthias Koeppe
committed
sage.rings.finite_rings: Update # needs
1 parent baca60e commit 1810daf

File tree

8 files changed

+244
-160
lines changed

8 files changed

+244
-160
lines changed

src/sage/rings/finite_rings/conway_polynomials.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ def _frobenius_shift(K, generators, check_only=False):
397397
398398
EXAMPLES::
399399
400-
sage: # needs sage.rings.finite_rings
400+
sage: # needs sage.libs.ntl sage.rings.finite_rings
401401
sage: R.<x> = GF(2)[]
402402
sage: f30 = x^30 + x^28 + x^27 + x^25 + x^24 + x^20 + x^19 + x^18 + x^16 + x^15 + x^12 + x^10 + x^7 + x^2 + 1
403403
sage: f20 = x^20 + x^19 + x^15 + x^13 + x^12 + x^11 + x^9 + x^8 + x^7 + x^4 + x^2 + x + 1

src/sage/rings/finite_rings/element_base.pyx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.finite_rings
1+
# sage.doctest: needs sage.rings.finite_rings
22
"""
33
Base class for finite field elements
44
@@ -711,23 +711,23 @@ cdef class FinitePolyExtElement(FiniteRingElement):
711711
712712
EXAMPLES::
713713
714-
sage: k.<a> = FiniteField(9, impl='givaro', modulus='primitive')
715-
sage: a.is_square()
714+
sage: k.<a> = FiniteField(9, impl='givaro', modulus='primitive') # needs sage.libs.linbox
715+
sage: a.is_square() # needs sage.libs.linbox
716716
False
717-
sage: (a**2).is_square()
717+
sage: (a**2).is_square() # needs sage.libs.linbox
718718
True
719-
sage: k.<a> = FiniteField(4, impl='ntl', modulus='primitive')
720-
sage: (a**2).is_square()
719+
sage: k.<a> = FiniteField(4, impl='ntl', modulus='primitive') # needs sage.libs.ntl
720+
sage: (a**2).is_square() # needs sage.libs.ntl
721721
True
722-
sage: k.<a> = FiniteField(17^5, impl='pari_ffelt', modulus='primitive')
723-
sage: a.is_square()
722+
sage: k.<a> = FiniteField(17^5, impl='pari_ffelt', modulus='primitive') # needs sage.libs.pari
723+
sage: a.is_square() # needs sage.libs.pari
724724
False
725-
sage: (a**2).is_square()
725+
sage: (a**2).is_square() # needs sage.libs.pari
726726
True
727727
728728
::
729729
730-
sage: k(0).is_square()
730+
sage: k(0).is_square() # needs sage.libs.linbox
731731
True
732732
"""
733733
K = self.parent()
@@ -1086,7 +1086,7 @@ cdef class Cache_base(SageObject):
10861086
EXAMPLES::
10871087
10881088
sage: k.<a> = GF(2^48)
1089-
sage: k._cache.fetch_int(2^33 + 2 + 1)
1089+
sage: k._cache.fetch_int(2^33 + 2 + 1) # needs sage.libs.ntl
10901090
a^33 + a + 1
10911091
"""
10921092
raise NotImplementedError("this must be implemented by subclasses")

src/sage/rings/finite_rings/finite_field_base.pyx

Lines changed: 26 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.finite_rings
1+
# sage.doctest: needs sage.rings.finite_rings
22
"""
33
Base class for finite fields
44
@@ -1012,7 +1012,7 @@ cdef class FiniteField(Field):
10121012
10131013
The given modulus is always made monic::
10141014
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")
10161016
sage: k.modulus()
10171017
x^2 + 2
10181018
@@ -1022,19 +1022,19 @@ cdef class FiniteField(Field):
10221022
10231023
sage: GF(2, impl="modn").modulus()
10241024
x + 1
1025-
sage: GF(2, impl="givaro").modulus()
1025+
sage: GF(2, impl="givaro").modulus() # needs sage.libs.linbox
10261026
x + 1
1027-
sage: GF(2, impl="ntl").modulus()
1027+
sage: GF(2, impl="ntl").modulus() # needs sage.libs.ntl
10281028
x + 1
10291029
sage: GF(2, impl="modn", modulus=x).modulus()
10301030
x
1031-
sage: GF(2, impl="givaro", modulus=x).modulus()
1031+
sage: GF(2, impl="givaro", modulus=x).modulus() # needs sage.libs.linbox
10321032
x
1033-
sage: GF(2, impl="ntl", modulus=x).modulus()
1033+
sage: GF(2, impl="ntl", modulus=x).modulus() # needs sage.libs.ntl
10341034
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
10361036
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
10381038
x^2 + 2
10391039
"""
10401040
# Normally, this is set by the constructor of the implementation
@@ -1086,6 +1086,7 @@ cdef class FiniteField(Field):
10861086
sage: f(F.gen())
10871087
0
10881088
1089+
sage: # needs sage.libs.ntl
10891090
sage: k.<a> = GF(2^20, impl='ntl')
10901091
sage: k.polynomial()
10911092
a^20 + a^10 + a^9 + a^7 + a^6 + a^5 + a^4 + a + 1
@@ -1234,7 +1235,7 @@ cdef class FiniteField(Field):
12341235
(1, 0)
12351236
(0, 1)
12361237
1237-
sage: F = GF(9, 't', modulus=(x^2+x-1))
1238+
sage: F = GF(9, 't', modulus=x^2 + x - 1)
12381239
sage: E = GF(81)
12391240
sage: h = Hom(F,E).an_element()
12401241
sage: V, from_V, to_V = E.vector_space(h, map=True)
@@ -1514,13 +1515,16 @@ cdef class FiniteField(Field):
15141515
To: Finite Field in b of size 5^2
15151516
Defn: 1 |--> 1
15161517
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
15181521
15191522
Extensions of non-prime finite fields by polynomials are not yet
15201523
supported: we fall back to generic code::
15211524
15221525
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
15241528
15251529
TESTS:
15261530
@@ -1799,12 +1803,14 @@ cdef class FiniteField(Field):
17991803
Ring morphism:
18001804
From: Finite Field in z3 of size 2^3
18011805
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),
18031808
(Finite Field in z7 of size 2^7,
18041809
Ring morphism:
18051810
From: Finite Field in z7 of size 2^7
18061811
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),
18081814
(Finite Field in z21 of size 2^21,
18091815
Identity endomorphism of Finite Field in z21 of size 2^21)]
18101816
"""
@@ -2065,13 +2071,13 @@ cdef class FiniteField(Field):
20652071
sage: e = [a^0, a^1, a^2, a^3, a^4, a^5, a^6, a^7]
20662072
sage: d = F.dual_basis(e, check=False); d
20672073
[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]
20752081
sage: F.dual_basis(d)
20762082
[1, a, a^2, a^3, a^4, a^5, a^6, a^7]
20772083

src/sage/rings/finite_rings/finite_field_constructor.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.finite_rings
1+
# sage.doctest: needs sage.rings.finite_rings
22
r"""
33
Finite fields
44
@@ -125,9 +125,10 @@
125125
126126
::
127127
128-
sage: k = GF(9,'alpha'); type(k) # needs sage.libs.linbox
128+
sage: # needs sage.libs.linbox
129+
sage: k = GF(9,'alpha'); type(k)
129130
<class 'sage.rings.finite_rings.finite_field_givaro.FiniteField_givaro_with_category'>
130-
sage: k.base_ring() # needs sage.libs.linbox
131+
sage: k.base_ring()
131132
Finite Field of size 3
132133
133134
::

src/sage/rings/finite_rings/hom_finite_field.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.finite_rings
1+
# sage.doctest: needs sage.rings.finite_rings
22
"""
33
Finite field morphisms
44

src/sage/rings/finite_rings/homset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.rings.finite_rings
1+
# sage.doctest: needs sage.rings.finite_rings
22
"""
33
Homset for finite fields
44

src/sage/rings/finite_rings/maps_finite_field.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# sage.doctest: needs sage.rings.finite_rings
12
"""
23
Structure maps for finite fields
34

0 commit comments

Comments
 (0)