Skip to content

Commit f4a10a0

Browse files
author
Matthias Koeppe
committed
sage.rings.polynomial: Many more block tags
1 parent 266e4e0 commit f4a10a0

20 files changed

+483
-449
lines changed

src/sage/rings/polynomial/cyclotomic.pyx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,14 @@ def cyclotomic_value(n, x):
274274
sage: cyclotomic_value(30, -1.0) # needs sage.rings.real_mpfr
275275
1.00000000000000
276276
277-
sage: S.<t> = R.quotient(R.cyclotomic_polynomial(15)) # needs sage.libs.pari
278-
sage: cyclotomic_value(15, t) # needs sage.libs.pari
277+
sage: # needs sage.libs.pari
278+
sage: S.<t> = R.quotient(R.cyclotomic_polynomial(15))
279+
sage: cyclotomic_value(15, t)
279280
0
280-
sage: cyclotomic_value(30, t) # needs sage.libs.pari
281+
sage: cyclotomic_value(30, t)
281282
2*t^7 - 2*t^5 - 2*t^3 + 2*t
282-
sage: S.<t> = R.quotient(x^10) # needs sage.libs.pari
283-
sage: cyclotomic_value(2^128 - 1, t) # needs sage.libs.pari
283+
sage: S.<t> = R.quotient(x^10)
284+
sage: cyclotomic_value(2^128 - 1, t)
284285
-t^7 - t^6 - t^5 + t^2 + t + 1
285286
sage: cyclotomic_value(10, mod(3,4))
286287
1

src/sage/rings/polynomial/laurent_polynomial.pyx

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -266,29 +266,29 @@ cdef class LaurentPolynomial(CommutativeAlgebraElement):
266266
267267
Examples with different base ring::
268268
269-
sage: # needs sage.rings.finite_rings
269+
sage: # needs sage.modules sage.rings.finite_rings
270270
sage: R.<r> = GF(9); S.<s> = GF(81)
271271
sage: h = Hom(R, S)[0]; h
272272
Ring morphism:
273273
From: Finite Field in r of size 3^2
274274
To: Finite Field in s of size 3^4
275275
Defn: r |--> 2*s^3 + 2*s^2 + 1
276-
sage: T.<X,Y> = LaurentPolynomialRing(R, 2) # needs sage.modules
277-
sage: f = r*X + Y # needs sage.modules
278-
sage: g = f.map_coefficients(h); g # needs sage.modules
276+
sage: T.<X,Y> = LaurentPolynomialRing(R, 2)
277+
sage: f = r*X + Y
278+
sage: g = f.map_coefficients(h); g
279279
(2*s^3 + 2*s^2 + 1)*X + Y
280-
sage: g.parent() # needs sage.modules
280+
sage: g.parent()
281281
Multivariate Laurent Polynomial Ring in X, Y
282282
over Finite Field in s of size 3^4
283283
sage: h = lambda x: x.trace()
284-
sage: g = f.map_coefficients(h); g # needs sage.modules
284+
sage: g = f.map_coefficients(h); g
285285
X - Y
286-
sage: g.parent() # needs sage.modules
286+
sage: g.parent()
287287
Multivariate Laurent Polynomial Ring in X, Y
288288
over Finite Field in r of size 3^2
289-
sage: g = f.map_coefficients(h, new_base_ring=GF(3)); g # needs sage.modules
289+
sage: g = f.map_coefficients(h, new_base_ring=GF(3)); g
290290
X - Y
291-
sage: g.parent() # needs sage.modules
291+
sage: g.parent()
292292
Multivariate Laurent Polynomial Ring in X, Y over Finite Field of size 3
293293
294294
"""
@@ -335,12 +335,12 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
335335
336336
sage: # needs sage.rings.padics
337337
sage: S.<s> = LaurentPolynomialRing(GF(5))
338-
sage: T.<t> = PolynomialRing(pAdicRing(5)) # needs sage.rings.finite_rings
339-
sage: S(t) # needs sage.rings.finite_rings
338+
sage: T.<t> = PolynomialRing(pAdicRing(5))
339+
sage: S(t)
340340
s
341-
sage: parent(S(t)) # needs sage.rings.finite_rings
341+
sage: parent(S(t))
342342
Univariate Laurent Polynomial Ring in s over Finite Field of size 5
343-
sage: parent(S(t)[1]) # needs sage.rings.finite_rings
343+
sage: parent(S(t)[1])
344344
Finite Field of size 5
345345
346346
::
@@ -817,22 +817,22 @@ cdef class LaurentPolynomial_univariate(LaurentPolynomial):
817817
"""
818818
EXAMPLES::
819819
820+
sage: # needs sage.symbolic
820821
sage: R.<x> = LaurentPolynomialRing(QQ)
821822
sage: f = x^3 + 2/x
822-
sage: g = f._symbolic_(SR); g # needs sage.symbolic
823+
sage: g = f._symbolic_(SR); g
823824
(x^4 + 2)/x
824-
sage: g(x=2) # needs sage.symbolic
825+
sage: g(x=2)
825826
9
826-
827-
sage: g = SR(f) # needs sage.symbolic
828-
sage: g(x=2) # needs sage.symbolic
827+
sage: g = SR(f)
828+
sage: g(x=2)
829829
9
830830
831831
Since :trac:`24072` the symbolic ring does not accept positive
832832
characteristic::
833833
834834
sage: R.<w> = LaurentPolynomialRing(GF(7))
835-
sage: SR(2*w^3 + 1) # needs sage.rings.finite_rings sage.symbolic
835+
sage: SR(2*w^3 + 1) # needs sage.symbolic
836836
Traceback (most recent call last):
837837
...
838838
TypeError: positive characteristic not allowed in symbolic computations

src/sage/rings/polynomial/laurent_polynomial_mpair.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1349,15 +1349,15 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
13491349
"""
13501350
EXAMPLES::
13511351
1352+
sage: # needs sage.symbolic
13521353
sage: R.<x,y> = LaurentPolynomialRing(QQ)
13531354
sage: f = x^3 + y/x
1354-
sage: g = f._symbolic_(SR); g # needs sage.symbolic
1355+
sage: g = f._symbolic_(SR); g
13551356
(x^4 + y)/x
1356-
sage: g(x=2, y=2) # needs sage.symbolic
1357+
sage: g(x=2, y=2)
13571358
9
1358-
1359-
sage: g = SR(f) # needs sage.symbolic
1360-
sage: g(x=2, y=2) # needs sage.symbolic
1359+
sage: g = SR(f)
1360+
sage: g(x=2, y=2)
13611361
9
13621362
"""
13631363
d = {repr(g): R.var(g) for g in self._parent.gens()}

src/sage/rings/polynomial/laurent_polynomial_ring.py

Lines changed: 27 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -481,16 +481,17 @@ def _element_constructor_(self, x):
481481
482482
::
483483
484+
sage: # needs sage.modules
484485
sage: U = LaurentPolynomialRing(QQ, 'a')
485486
sage: V = LaurentPolynomialRing(QQ, 'c')
486-
sage: L.<a, b, c, d> = LaurentPolynomialRing(QQ) # needs sage.modules
487-
sage: M = LaurentPolynomialRing(QQ, 'c, d') # needs sage.modules
488-
sage: Mc, Md = M.gens() # needs sage.modules
489-
sage: N = LaurentPolynomialRing(M, 'a, b') # needs sage.modules
490-
sage: Na, Nb = N.gens() # needs sage.modules
491-
sage: U(Na) # needs sage.modules
487+
sage: L.<a, b, c, d> = LaurentPolynomialRing(QQ)
488+
sage: M = LaurentPolynomialRing(QQ, 'c, d')
489+
sage: Mc, Md = M.gens()
490+
sage: N = LaurentPolynomialRing(M, 'a, b')
491+
sage: Na, Nb = N.gens()
492+
sage: U(Na)
492493
a
493-
sage: V(Mc) # needs sage.modules
494+
sage: V(Mc)
494495
c
495496
496497
sage: # needs sage.modules
@@ -691,34 +692,37 @@ def _element_constructor_(self, x, mon=None):
691692
sage: L(N(0))
692693
0
693694
695+
sage: # needs sage.modules
694696
sage: U = LaurentPolynomialRing(QQ, 'a')
695697
sage: Ua = U.gen()
696698
sage: V = LaurentPolynomialRing(QQ, 'c')
697699
sage: Vc = V.gen()
698-
sage: L(Ua) # needs sage.modules
700+
sage: L(Ua)
699701
a
700-
sage: L(Vc) # needs sage.modules
702+
sage: L(Vc)
701703
c
702-
sage: N(Ua) # needs sage.modules
704+
sage: N(Ua)
703705
a
704-
sage: M(Vc) # needs sage.modules
706+
sage: M(Vc)
705707
c
706708
707-
sage: P = LaurentPolynomialRing(QQ, 'a, b') # needs sage.modules
708-
sage: Q = LaurentPolynomialRing(P, 'c, d') # needs sage.modules
709-
sage: Q(P.0) # needs sage.modules
709+
sage: # needs sage.modules
710+
sage: P = LaurentPolynomialRing(QQ, 'a, b')
711+
sage: Q = LaurentPolynomialRing(P, 'c, d')
712+
sage: Q(P.0)
710713
a
711714
712715
::
713716
717+
sage: # needs sage.modules
714718
sage: A.<a> = LaurentPolynomialRing(QQ)
715719
sage: B.<b> = LaurentPolynomialRing(A)
716-
sage: C = LaurentPolynomialRing(QQ, 'a, b') # needs sage.modules
717-
sage: C(B({1: a})) # needs sage.modules
720+
sage: C = LaurentPolynomialRing(QQ, 'a, b')
721+
sage: C(B({1: a}))
718722
a*b
719-
sage: D.<d, e> = LaurentPolynomialRing(B) # needs sage.modules
720-
sage: F.<f, g> = LaurentPolynomialRing(D) # needs sage.modules
721-
sage: D(F(d*e)) # needs sage.modules
723+
sage: D.<d, e> = LaurentPolynomialRing(B)
724+
sage: F.<f, g> = LaurentPolynomialRing(D)
725+
sage: D(F(d*e))
722726
d*e
723727
724728
::
@@ -735,9 +739,10 @@ def _element_constructor_(self, x, mon=None):
735739
736740
::
737741
738-
sage: RL = R.localization(x + 1) # needs sage.modules
739-
sage: xi = RL(~x) # needs sage.modules
740-
sage: R(xi) == ~x # indirect doctests # needs sage.modules
742+
sage: # needs sage.modules
743+
sage: RL = R.localization(x + 1)
744+
sage: xi = RL(~x)
745+
sage: R(xi) == ~x # indirect doctests
741746
True
742747
"""
743748
from sage.structure.element import Expression

0 commit comments

Comments
 (0)