48
48
There is a permutation action on Infinite Polynomial Rings by
49
49
permuting the indices of the variables::
50
50
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
53
53
x_2^3 + x_2*y_5 - 2*y_5^4
54
54
55
55
Note that ``P(0)==0``, and thus variables of index zero are invariant
@@ -440,13 +440,13 @@ def subs(self, fixed=None, **kwargs):
440
440
441
441
The substitution can also handle matrices::
442
442
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
447
447
[3*x_1 + 1 0]
448
448
[ 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
450
450
[ 1 9]
451
451
[12 4]
452
452
@@ -464,7 +464,7 @@ def subs(self, fixed=None, **kwargs):
464
464
465
465
TESTS::
466
466
467
- sage: g.subs(fixed=x[0], x_1=N)
467
+ sage: g.subs(fixed=x[0], x_1=N) # needs sage.modules
468
468
Traceback (most recent call last):
469
469
...
470
470
ValueError: fixed must be a dict
@@ -540,10 +540,10 @@ def is_nilpotent(self):
540
540
541
541
EXAMPLES::
542
542
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
545
545
False
546
- sage: R(0).is_nilpotent() # optional - sage.rings.number_field
546
+ sage: R(0).is_nilpotent() # needs sage.rings.number_field
547
547
True
548
548
sage: _.<x> = InfinitePolynomialRing(Zmod(4))
549
549
sage: (2*x[0]).is_nilpotent()
@@ -656,7 +656,7 @@ def _div_(self, x):
656
656
sage: z = 1/(x[2]*(x[1]+x[2]))+1/(x[1]*(x[1]+x[2]))
657
657
sage: z.parent()
658
658
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
660
660
x_1^-1 * x_2^-1
661
661
"""
662
662
if not x .variables ():
@@ -896,11 +896,11 @@ def symmetric_cancellation_order(self, other):
896
896
sage: X.<x,y> = InfinitePolynomialRing(QQ)
897
897
sage: (x[2]*x[1]).symmetric_cancellation_order(x[2]^2)
898
898
(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])
900
900
(-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])
902
902
(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])
904
904
(-1, [2, 3, 1], 1)
905
905
906
906
"""
@@ -1097,23 +1097,23 @@ def reduce(self, I, tailreduce=False, report=None):
1097
1097
reduction. However, reduction by ``y[1]*x[2]^2`` works, since
1098
1098
one can change variable index 1 into 2 and 2 into 3::
1099
1099
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
1101
1101
y_3*y_1^2
1102
1102
1103
1103
The next example shows that tail reduction is not done, unless
1104
1104
it is explicitly advised. The input can also be a Symmetric
1105
1105
Ideal::
1106
1106
1107
1107
sage: I = (y[3])*X
1108
- sage: p.reduce(I) # optional - sage.libs.singular
1108
+ sage: p.reduce(I)
1109
1109
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
1111
1111
x_3^3*y_2
1112
1112
1113
1113
Last, we demonstrate the ``report`` option::
1114
1114
1115
1115
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
1117
1117
:T[2]:>
1118
1118
>
1119
1119
x_1^2 + y_2^2
@@ -1258,8 +1258,8 @@ def __call__(self, *args, **kwargs):
1258
1258
sage: a(x_1=x[100])
1259
1259
x_100 + x_0
1260
1260
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
1263
1263
[x_0 + 1 1]
1264
1264
[ 2 x_0]
1265
1265
"""
@@ -1389,8 +1389,8 @@ def __pow__(self, n):
1389
1389
1390
1390
sage: X.<x,y> = InfinitePolynomialRing(QQ, implementation='sparse')
1391
1391
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
1394
1394
x_10*y_1 + 2*x_2*y_4
1395
1395
1396
1396
"""
@@ -1665,8 +1665,8 @@ def __pow__(self, n):
1665
1665
sage: x[10]^3
1666
1666
x_10^3
1667
1667
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
1670
1670
x_10*y_1 + 2*x_2*y_4
1671
1671
1672
1672
"""
0 commit comments