Skip to content

Commit bb22dbd

Browse files
author
Matthias Koeppe
committed
Update # optional / # needs
1 parent 7b141f4 commit bb22dbd

File tree

1 file changed

+25
-25
lines changed

1 file changed

+25
-25
lines changed

src/sage/rings/polynomial/infinite_polynomial_element.py

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@
4848
There is a permutation action on Infinite Polynomial Rings by
4949
permuting the indices of the variables::
5050
51-
sage: P = Permutation(((4,5),(2,3))) # optional - sage.combinat
52-
sage: c^P # optional - sage.combinat
51+
sage: P = Permutation(((4,5),(2,3)))
52+
sage: c^P
5353
x_2^3 + x_2*y_5 - 2*y_5^4
5454
5555
Note that ``P(0)==0``, and thus variables of index zero are invariant
@@ -440,13 +440,13 @@ def subs(self, fixed=None, **kwargs):
440440
441441
The substitution can also handle matrices::
442442
443-
sage: M = matrix([[1,0], [0,2]]) # optional - sage.modules
444-
sage: N = matrix([[0,3], [4,0]]) # optional - sage.modules
445-
sage: g = x[0]^2 + 3*x[1] # optional - sage.modules
446-
sage: g.subs({'x_0': M}) # optional - sage.modules
443+
sage: M = matrix([[1,0], [0,2]]) # needs sage.modules
444+
sage: N = matrix([[0,3], [4,0]]) # needs sage.modules
445+
sage: g = x[0]^2 + 3*x[1] # needs sage.modules
446+
sage: g.subs({'x_0': M}) # needs sage.modules
447447
[3*x_1 + 1 0]
448448
[ 0 3*x_1 + 4]
449-
sage: g.subs({x[0]: M, x[1]: N}) # optional - sage.modules
449+
sage: g.subs({x[0]: M, x[1]: N}) # needs sage.modules
450450
[ 1 9]
451451
[12 4]
452452
@@ -464,7 +464,7 @@ def subs(self, fixed=None, **kwargs):
464464
465465
TESTS::
466466
467-
sage: g.subs(fixed=x[0], x_1=N)
467+
sage: g.subs(fixed=x[0], x_1=N) # needs sage.modules
468468
Traceback (most recent call last):
469469
...
470470
ValueError: fixed must be a dict
@@ -540,10 +540,10 @@ def is_nilpotent(self):
540540
541541
EXAMPLES::
542542
543-
sage: R.<x> = InfinitePolynomialRing(QQbar) # optional - sage.rings.number_field
544-
sage: (x[0] + x[1]).is_nilpotent() # optional - sage.rings.number_field
543+
sage: R.<x> = InfinitePolynomialRing(QQbar) # needs sage.rings.number_field
544+
sage: (x[0] + x[1]).is_nilpotent() # needs sage.rings.number_field
545545
False
546-
sage: R(0).is_nilpotent() # optional - sage.rings.number_field
546+
sage: R(0).is_nilpotent() # needs sage.rings.number_field
547547
True
548548
sage: _.<x> = InfinitePolynomialRing(Zmod(4))
549549
sage: (2*x[0]).is_nilpotent()
@@ -656,7 +656,7 @@ def _div_(self, x):
656656
sage: z = 1/(x[2]*(x[1]+x[2]))+1/(x[1]*(x[1]+x[2]))
657657
sage: z.parent()
658658
Fraction Field of Infinite polynomial ring in x over Rational Field
659-
sage: factor(z) # optional - sage.libs.singular
659+
sage: factor(z) # needs sage.libs.singular
660660
x_1^-1 * x_2^-1
661661
"""
662662
if not x.variables():
@@ -896,11 +896,11 @@ def symmetric_cancellation_order(self, other):
896896
sage: X.<x,y> = InfinitePolynomialRing(QQ)
897897
sage: (x[2]*x[1]).symmetric_cancellation_order(x[2]^2)
898898
(None, 1, 1)
899-
sage: (x[2]*x[1]).symmetric_cancellation_order(x[2]*x[3]*y[1]) # optional - sage.combinat
899+
sage: (x[2]*x[1]).symmetric_cancellation_order(x[2]*x[3]*y[1])
900900
(-1, [2, 3, 1], y_1)
901-
sage: (x[2]*x[1]*y[1]).symmetric_cancellation_order(x[2]*x[3]*y[1]) # optional - sage.combinat
901+
sage: (x[2]*x[1]*y[1]).symmetric_cancellation_order(x[2]*x[3]*y[1])
902902
(None, 1, 1)
903-
sage: (x[2]*x[1]*y[1]).symmetric_cancellation_order(x[2]*x[3]*y[2]) # optional - sage.combinat
903+
sage: (x[2]*x[1]*y[1]).symmetric_cancellation_order(x[2]*x[3]*y[2])
904904
(-1, [2, 3, 1], 1)
905905
906906
"""
@@ -1097,23 +1097,23 @@ def reduce(self, I, tailreduce=False, report=None):
10971097
reduction. However, reduction by ``y[1]*x[2]^2`` works, since
10981098
one can change variable index 1 into 2 and 2 into 3::
10991099
1100-
sage: p.reduce([y[1]*x[2]^2]) # optional - sage.libs.singular
1100+
sage: p.reduce([y[1]*x[2]^2]) # needs sage.libs.singular
11011101
y_3*y_1^2
11021102
11031103
The next example shows that tail reduction is not done, unless
11041104
it is explicitly advised. The input can also be a Symmetric
11051105
Ideal::
11061106
11071107
sage: I = (y[3])*X
1108-
sage: p.reduce(I) # optional - sage.libs.singular
1108+
sage: p.reduce(I)
11091109
x_3^3*y_2 + y_3*y_1^2
1110-
sage: p.reduce(I, tailreduce=True) # optional - sage.libs.singular
1110+
sage: p.reduce(I, tailreduce=True) # needs sage.libs.singular
11111111
x_3^3*y_2
11121112
11131113
Last, we demonstrate the ``report`` option::
11141114
11151115
sage: p = x[1]^2 + y[2]^2 + x[1]*x[2]*y[3] + x[1]*y[4]
1116-
sage: p.reduce(I, tailreduce=True, report=True) # optional - sage.libs.singular
1116+
sage: p.reduce(I, tailreduce=True, report=True) # needs sage.libs.singular
11171117
:T[2]:>
11181118
>
11191119
x_1^2 + y_2^2
@@ -1258,8 +1258,8 @@ def __call__(self, *args, **kwargs):
12581258
sage: a(x_1=x[100])
12591259
x_100 + x_0
12601260
1261-
sage: M = matrix([[1,1], [2,0]]) # optional - sage.modules
1262-
sage: a(x_1=M) # optional - sage.modules
1261+
sage: M = matrix([[1,1], [2,0]]) # needs sage.modules
1262+
sage: a(x_1=M) # needs sage.modules
12631263
[x_0 + 1 1]
12641264
[ 2 x_0]
12651265
"""
@@ -1389,8 +1389,8 @@ def __pow__(self, n):
13891389
13901390
sage: X.<x,y> = InfinitePolynomialRing(QQ, implementation='sparse')
13911391
sage: p = x[10]*y[2] + 2*x[1]*y[3]
1392-
sage: P = Permutation(((1,2),(3,4,5))) # optional - sage.combinat
1393-
sage: p^P # indirect doctest # optional - sage.combinat
1392+
sage: P = Permutation(((1,2),(3,4,5)))
1393+
sage: p^P # indirect doctest
13941394
x_10*y_1 + 2*x_2*y_4
13951395
13961396
"""
@@ -1665,8 +1665,8 @@ def __pow__(self, n):
16651665
sage: x[10]^3
16661666
x_10^3
16671667
sage: p = x[10]*y[2] + 2*x[1]*y[3]
1668-
sage: P = Permutation(((1,2),(3,4,5))) # optional - sage.combinat
1669-
sage: p^P # optional - sage.combinat
1668+
sage: P = Permutation(((1,2),(3,4,5)))
1669+
sage: p^P
16701670
x_10*y_1 + 2*x_2*y_4
16711671
16721672
"""

0 commit comments

Comments
 (0)