Skip to content

Commit 1c688e8

Browse files
author
Matthias Koeppe
committed
sage.rings.polynomial: ./sage -fixdoctests --long --distribution 'sagemath-modules' --only-tags --probe=sage.rings.finite_rings --overwrite src/sage/rings/polynomial/*.{py,pyx}
1 parent bbc8d69 commit 1c688e8

25 files changed

+686
-688
lines changed

src/sage/rings/polynomial/ideal.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ def residue_class_degree(self):
3232
3333
EXAMPLES::
3434
35-
sage: R.<t> = GF(5)[] # optional - sage.rings.finite_rings
36-
sage: P = R.ideal(t^4 + t + 1) # optional - sage.rings.finite_rings
37-
sage: P.residue_class_degree() # optional - sage.rings.finite_rings
35+
sage: R.<t> = GF(5)[]
36+
sage: P = R.ideal(t^4 + t + 1)
37+
sage: P.residue_class_degree()
3838
4
3939
"""
4040
return self.gen().degree()
@@ -45,7 +45,7 @@ def residue_field(self, names=None, check=True):
4545
4646
EXAMPLES::
4747
48-
sage: R.<t> = GF(17)[]; P = R.ideal(t^3 + 2*t + 9) # optional - sage.rings.finite_rings
48+
sage: R.<t> = GF(17)[]; P = R.ideal(t^3 + 2*t + 9)
4949
sage: k.<a> = P.residue_field(); k # optional - sage.rings.finite_rings
5050
Residue field in a of Principal ideal (t^3 + 2*t + 9) of
5151
Univariate Polynomial Ring in t over Finite Field of size 17

src/sage/rings/polynomial/infinite_polynomial_element.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -299,16 +299,16 @@ def polynomial(self):
299299
300300
EXAMPLES::
301301
302-
sage: X.<x,y> = InfinitePolynomialRing(GF(7)) # optional - sage.rings.finite_rings
303-
sage: p = x[2]*y[1] + 3*y[0] # optional - sage.rings.finite_rings
304-
sage: p # optional - sage.rings.finite_rings
302+
sage: X.<x,y> = InfinitePolynomialRing(GF(7))
303+
sage: p = x[2]*y[1] + 3*y[0]
304+
sage: p
305305
x_2*y_1 + 3*y_0
306-
sage: p.polynomial() # optional - sage.rings.finite_rings
306+
sage: p.polynomial()
307307
x_2*y_1 + 3*y_0
308-
sage: p.polynomial().parent() # optional - sage.rings.finite_rings
308+
sage: p.polynomial().parent()
309309
Multivariate Polynomial Ring in x_2, x_1, x_0, y_2, y_1, y_0
310310
over Finite Field of size 7
311-
sage: p.parent() # optional - sage.rings.finite_rings
311+
sage: p.parent()
312312
Infinite polynomial ring in x, y over Finite Field of size 7
313313
314314
"""
@@ -1480,10 +1480,10 @@ def _richcmp_(self, x, op):
14801480
14811481
An example in which a previous version had failed::
14821482
1483-
sage: X.<x,y> = InfinitePolynomialRing(GF(3), order='degrevlex', implementation='sparse') # optional - sage.rings.finite_rings
1484-
sage: p = Y('x_3*x_0^2 + x_0*y_3*y_0') # optional - sage.rings.finite_rings
1485-
sage: q = Y('x_1*x_0^2 + x_0*y_1*y_0') # optional - sage.rings.finite_rings
1486-
sage: p < q # indirect doctest # optional - sage.rings.finite_rings
1483+
sage: X.<x,y> = InfinitePolynomialRing(GF(3), order='degrevlex', implementation='sparse')
1484+
sage: p = Y('x_3*x_0^2 + x_0*y_3*y_0')
1485+
sage: q = Y('x_1*x_0^2 + x_0*y_1*y_0')
1486+
sage: p < q
14871487
False
14881488
14891489
"""
@@ -1583,10 +1583,10 @@ def _richcmp_(self, x, op):
15831583
15841584
An example in which a previous version had failed::
15851585
1586-
sage: X.<x,y> = InfinitePolynomialRing(GF(3), order='degrevlex', implementation='dense') # optional - sage.rings.finite_rings
1587-
sage: p = Y('x_3*x_0^2 + x_0*y_3*y_0') # optional - sage.rings.finite_rings
1588-
sage: q = Y('x_1*x_0^2 + x_0*y_1*y_0') # optional - sage.rings.finite_rings
1589-
sage: p < q # optional - sage.rings.finite_rings
1586+
sage: X.<x,y> = InfinitePolynomialRing(GF(3), order='degrevlex', implementation='dense')
1587+
sage: p = Y('x_3*x_0^2 + x_0*y_3*y_0')
1588+
sage: q = Y('x_1*x_0^2 + x_0*y_1*y_0')
1589+
sage: p < q
15901590
False
15911591
15921592
"""

src/sage/rings/polynomial/infinite_polynomial_ring.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -810,8 +810,8 @@ def construction(self):
810810
811811
EXAMPLES::
812812
813-
sage: R.<x,y> = InfinitePolynomialRing(GF(5)) # optional - sage.rings.finite_rings
814-
sage: R.construction() # optional - sage.rings.finite_rings
813+
sage: R.<x,y> = InfinitePolynomialRing(GF(5))
814+
sage: R.construction()
815815
[InfPoly{[x,y], "lex", "dense"}, Finite Field of size 5]
816816
817817
"""
@@ -1109,10 +1109,10 @@ def is_noetherian(self):
11091109
11101110
TESTS::
11111111
1112-
sage: R = InfinitePolynomialRing(GF(2)) # optional - sage.rings.finite_rings
1113-
sage: R # optional - sage.rings.finite_rings
1112+
sage: R = InfinitePolynomialRing(GF(2))
1113+
sage: R
11141114
Infinite polynomial ring in x over Finite Field of size 2
1115-
sage: R.is_noetherian() # optional - sage.rings.finite_rings
1115+
sage: R.is_noetherian()
11161116
False
11171117
11181118
sage: R.<x> = InfinitePolynomialRing(QQ)
@@ -1136,10 +1136,10 @@ def is_field(self, *args, **kwds):
11361136
11371137
TESTS::
11381138
1139-
sage: R = InfinitePolynomialRing(GF(2)) # optional - sage.rings.finite_rings
1140-
sage: R # optional - sage.rings.finite_rings
1139+
sage: R = InfinitePolynomialRing(GF(2))
1140+
sage: R
11411141
Infinite polynomial ring in x over Finite Field of size 2
1142-
sage: R.is_field() # optional - sage.rings.finite_rings
1142+
sage: R.is_field()
11431143
False
11441144
11451145
:trac:`9443`::
@@ -1230,8 +1230,8 @@ def gen(self, i=None):
12301230
x_1
12311231
sage: X.gen() is X.gen(0)
12321232
True
1233-
sage: XX = InfinitePolynomialRing(GF(5)) # optional - sage.rings.finite_rings
1234-
sage: XX.gen(0) is XX.gen() # optional - sage.rings.finite_rings
1233+
sage: XX = InfinitePolynomialRing(GF(5))
1234+
sage: XX.gen(0) is XX.gen()
12351235
True
12361236
"""
12371237
if i is not None and i > len(self._names):
@@ -1349,8 +1349,8 @@ def order(self):
13491349
13501350
EXAMPLES::
13511351
1352-
sage: R.<x> = InfinitePolynomialRing(GF(2)) # optional - sage.rings.finite_rings
1353-
sage: R.order() # optional - sage.rings.finite_rings
1352+
sage: R.<x> = InfinitePolynomialRing(GF(2))
1353+
sage: R.order()
13541354
+Infinity
13551355
"""
13561356
from sage.rings.infinity import Infinity
@@ -1363,7 +1363,7 @@ def key_basis(self):
13631363
13641364
EXAMPLES::
13651365
1366-
sage: R.<x> = InfinitePolynomialRing(GF(2)) # optional - sage.rings.finite_rings
1366+
sage: R.<x> = InfinitePolynomialRing(GF(2))
13671367
sage: R.key_basis() # optional - sage.rings.finite_rings
13681368
Key polynomial basis over Finite Field of size 2
13691369
"""
@@ -1572,8 +1572,8 @@ def construction(self):
15721572
15731573
EXAMPLES::
15741574
1575-
sage: R.<x,y> = InfinitePolynomialRing(GF(5)) # optional - sage.rings.finite_rings
1576-
sage: R.construction() # optional - sage.rings.finite_rings
1575+
sage: R.<x,y> = InfinitePolynomialRing(GF(5))
1576+
sage: R.construction()
15771577
[InfPoly{[x,y], "lex", "dense"}, Finite Field of size 5]
15781578
"""
15791579
return [InfinitePolynomialFunctor(self._names, self._order, 'dense'), self._base]

src/sage/rings/polynomial/laurent_polynomial.pyx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ cdef class LaurentPolynomial(CommutativeAlgebraElement):
175175
176176
sage: R.<x> = LaurentPolynomialRing(QQ)
177177
sage: a = x^2 + 3*x^3 + 5*x^-1
178-
sage: a.change_ring(GF(3)) # optional - sage.rings.finite_rings
178+
sage: a.change_ring(GF(3))
179179
2*x^-1 + x^2
180180
181181
Check that :trac:`22277` is fixed::
@@ -329,7 +329,7 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
329329
330330
::
331331
332-
sage: S.<s> = LaurentPolynomialRing(GF(5)) # optional - sage.rings.finite_rings sage.rings.padics
332+
sage: S.<s> = LaurentPolynomialRing(GF(5)) # optional - sage.rings.padics
333333
sage: T.<t> = PolynomialRing(pAdicRing(5)) # optional - sage.rings.finite_rings sage.rings.padics
334334
sage: S(t) # optional - sage.rings.finite_rings sage.rings.padics
335335
s
@@ -385,7 +385,7 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
385385
sage: Pxy = PolynomialRing(QQ, "x,y")
386386
sage: Paxb = PolynomialRing(QQ, "a,x,b")
387387
sage: Qx = PolynomialRing(ZZ, "x")
388-
sage: Rx = PolynomialRing(GF(2), "x") # optional - sage.rings.finite_rings
388+
sage: Rx = PolynomialRing(GF(2), "x")
389389
sage: p1 = Lx.gen()
390390
sage: p2 = Lx.zero()
391391
sage: p3 = Lx.one()
@@ -395,7 +395,7 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
395395
396396
sage: Pxes = [(Px, Px.gen()), (Qx, Qx.gen()),
397397
....: (Pxy, Pxy.gen(0)), (Paxb, Paxb.gen(1))]
398-
sage: Pxes += [(Rx, Rx.gen())] # optional - sage.rings.finite_rings
398+
sage: Pxes += [(Rx, Rx.gen())]
399399
sage: for P, x in Pxes:
400400
....: assert P(p1) == x and parent(P(p1)) is P
401401
....: assert P(p2) == P.zero() and parent(P(p2)) is P
@@ -825,7 +825,7 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
825825
Since :trac:`24072` the symbolic ring does not accept positive
826826
characteristic::
827827
828-
sage: R.<w> = LaurentPolynomialRing(GF(7)) # optional - sage.rings.finite_rings
828+
sage: R.<w> = LaurentPolynomialRing(GF(7))
829829
sage: SR(2*w^3 + 1) # optional - sage.rings.finite_rings sage.symbolic
830830
Traceback (most recent call last):
831831
...
@@ -1046,10 +1046,10 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
10461046
"""
10471047
EXAMPLES::
10481048
1049-
sage: R.<x> = LaurentPolynomialRing(GF(2)) # optional - sage.rings.finite_rings
1050-
sage: f = 1/x^3 + x + x^2 + 3*x^4 # optional - sage.rings.finite_rings
1051-
sage: g = 1 - x + x^2 - x^4 # optional - sage.rings.finite_rings
1052-
sage: f*g # optional - sage.rings.finite_rings
1049+
sage: R.<x> = LaurentPolynomialRing(GF(2))
1050+
sage: f = 1/x^3 + x + x^2 + 3*x^4
1051+
sage: g = 1 - x + x^2 - x^4
1052+
sage: f*g
10531053
x^-3 + x^-2 + x^-1 + x^8
10541054
"""
10551055
cdef LaurentPolynomial_univariate right = <LaurentPolynomial_univariate>right_r

src/sage/rings/polynomial/laurent_polynomial_ideal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __init__(self, ring, gens, coerce=True, hint=None):
5757
sage: R.ideal([x, y])
5858
Ideal (x, y) of Multivariate Laurent Polynomial Ring in x, y
5959
over Integer Ring
60-
sage: R.<x0,x1> = LaurentPolynomialRing(GF(3), 2) # optional - sage.rings.finite_rings
60+
sage: R.<x0,x1> = LaurentPolynomialRing(GF(3), 2)
6161
sage: R.ideal([x0^2, x1^-3]) # optional - sage.rings.finite_rings
6262
Ideal (x0^2, x1^-3) of Multivariate Laurent Polynomial Ring in x0, x1
6363
over Finite Field of size 3

src/sage/rings/polynomial/laurent_polynomial_mpair.pyx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,8 +1633,8 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
16331633
sage: p = x^-2*y + x*y^-2
16341634
sage: p.rescale_vars({0: 2, 1: 3})
16351635
2/9*x*y^-2 + 3/4*x^-2*y
1636-
sage: F = GF(2) # optional - sage.rings.finite_rings
1637-
sage: p.rescale_vars({0: 3, 1: 7}, new_ring=L.change_ring(F)) # optional - sage.rings.finite_rings
1636+
sage: F = GF(2)
1637+
sage: p.rescale_vars({0: 3, 1: 7}, new_ring=L.change_ring(F))
16381638
x*y^-2 + x^-2*y
16391639
16401640
Test for :trac:`30331`::
@@ -1695,8 +1695,8 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
16951695
sage: p = 2*x^2 + y - x*y
16961696
sage: p.toric_coordinate_change(Matrix([[1,-3], [1,1]]))
16971697
2*x^2*y^2 - x^-2*y^2 + x^-3*y
1698-
sage: F = GF(2) # optional - sage.rings.finite_rings
1699-
sage: p.toric_coordinate_change(Matrix([[1,-3], [1,1]]), # optional - sage.rings.finite_rings
1698+
sage: F = GF(2)
1699+
sage: p.toric_coordinate_change(Matrix([[1,-3], [1,1]]),
17001700
....: new_ring=L.change_ring(F))
17011701
x^-2*y^2 + x^-3*y
17021702

src/sage/rings/polynomial/laurent_polynomial_ring.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def LaurentPolynomialRing(base_ring, *args, **kwds):
163163
sage: R.<abc> = LaurentPolynomialRing(QQ, sparse=True); R
164164
Univariate Laurent Polynomial Ring in abc over Rational Field
165165
166-
sage: R.<w> = LaurentPolynomialRing(PolynomialRing(GF(7),'k')); R # optional - sage.rings.finite_rings
166+
sage: R.<w> = LaurentPolynomialRing(PolynomialRing(GF(7),'k')); R
167167
Univariate Laurent Polynomial Ring in w over
168168
Univariate Polynomial Ring in k over Finite Field of size 7
169169
@@ -215,7 +215,7 @@ def LaurentPolynomialRing(base_ring, *args, **kwds):
215215
Multivariate Laurent Polynomial Ring in x0, x1, x2, x3, x4, x5, x6, x7, x8, x9
216216
over Rational Field
217217
218-
sage: LaurentPolynomialRing(GF(7), 'y', 5) # optional - sage.modules sage.rings.finite_rings
218+
sage: LaurentPolynomialRing(GF(7), 'y', 5) # optional - sage.modules
219219
Multivariate Laurent Polynomial Ring in y0, y1, y2, y3, y4
220220
over Finite Field of size 7
221221
@@ -226,12 +226,12 @@ def LaurentPolynomialRing(base_ring, *args, **kwds):
226226
:meth:`~sage.structure.category_object.CategoryObject.inject_variables`
227227
method, all those variable names are available for interactive use::
228228
229-
sage: R = LaurentPolynomialRing(GF(7), 15, 'w'); R # optional - sage.modules sage.rings.finite_rings
229+
sage: R = LaurentPolynomialRing(GF(7), 15, 'w'); R # optional - sage.modules
230230
Multivariate Laurent Polynomial Ring in w0, w1, w2, w3, w4, w5, w6, w7,
231231
w8, w9, w10, w11, w12, w13, w14 over Finite Field of size 7
232-
sage: R.inject_variables() # optional - sage.modules sage.rings.finite_rings
232+
sage: R.inject_variables() # optional - sage.modules
233233
Defining w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14
234-
sage: (w0 + 2*w8 + w13)^2 # optional - sage.modules sage.rings.finite_rings
234+
sage: (w0 + 2*w8 + w13)^2 # optional - sage.modules
235235
w0^2 + 4*w0*w8 + 4*w8^2 + 2*w0*w13 + 4*w8*w13 + w13^2
236236
"""
237237
from sage.rings.polynomial.polynomial_ring import is_PolynomialRing

0 commit comments

Comments
 (0)