Skip to content

Commit 0040121

Browse files
author
Matthias Koeppe
committed
sage.rings.polynomial: Update # needs, use block tags
1 parent 33c6dd2 commit 0040121

23 files changed

+303
-255
lines changed

src/sage/rings/polynomial/cyclotomic.pyx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,9 @@ def cyclotomic_value(n, x):
271271
6
272272
sage: a.parent()
273273
Ring of integers modulo 11
274-
sage: cyclotomic_value(30, -1.0)
274+
sage: cyclotomic_value(30, -1.0) # needs sage.rings.real_mpfr
275275
1.00000000000000
276+
276277
sage: S.<t> = R.quotient(R.cyclotomic_polynomial(15)) # needs sage.libs.pari
277278
sage: cyclotomic_value(15, t) # needs sage.libs.pari
278279
0

src/sage/rings/polynomial/infinite_polynomial_ring.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1364,12 +1364,13 @@ def key_basis(self):
13641364
EXAMPLES::
13651365
13661366
sage: R.<x> = InfinitePolynomialRing(GF(2))
1367-
sage: R.key_basis() # needs sage.rings.finite_rings
1367+
sage: R.key_basis() # needs sage.combinat
13681368
Key polynomial basis over Finite Field of size 2
13691369
"""
13701370
from sage.combinat.key_polynomial import KeyPolynomialBasis
13711371
return KeyPolynomialBasis(self)
13721372

1373+
13731374
class InfinitePolynomialGen(SageObject):
13741375
"""
13751376
This class provides the object which is responsible for returning

src/sage/rings/polynomial/laurent_polynomial_ideal.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# -*- coding: utf-8 -*-
1+
# sage.doctest: needs sage.libs.singular sage.modules (because all doctests need laurent_polynomial_mpair, Groebner bases)
22
r"""
33
Ideals in Laurent polynomial rings.
44
@@ -58,14 +58,15 @@ def __init__(self, ring, gens, coerce=True, hint=None):
5858
Ideal (x, y) of Multivariate Laurent Polynomial Ring in x, y
5959
over Integer Ring
6060
sage: R.<x0,x1> = LaurentPolynomialRing(GF(3), 2)
61-
sage: R.ideal([x0^2, x1^-3]) # needs sage.rings.finite_rings
61+
sage: R.ideal([x0^2, x1^-3])
6262
Ideal (x0^2, x1^-3) of Multivariate Laurent Polynomial Ring in x0, x1
6363
over Finite Field of size 3
6464
6565
sage: P.<x,y> = LaurentPolynomialRing(QQ, 2)
6666
sage: I = P.ideal([~x + ~y - 1])
6767
sage: print(I)
68-
Ideal (-1 + y^-1 + x^-1) of Multivariate Laurent Polynomial Ring in x, y over Rational Field
68+
Ideal (-1 + y^-1 + x^-1) of
69+
Multivariate Laurent Polynomial Ring in x, y over Rational Field
6970
sage: I.is_zero()
7071
False
7172
sage: (x^(-2) + x^(-1)*y^(-1) - x^(-1)) in I

src/sage/rings/polynomial/laurent_polynomial_ring_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.modules
1+
# sage.doctest: needs sage.modules
22
r"""
33
Ring of Laurent Polynomials (base class)
44
@@ -212,6 +212,7 @@ def completion(self, p=None, prec=20, extras=None):
212212
sage: 1 / g
213213
-x^-1 + 1 + O(x^19)
214214
215+
sage: # needs sage.combinat
215216
sage: PP = P.completion(x, prec=oo); PP
216217
Lazy Laurent Series Ring in x over Rational Field
217218
sage: g = 1 / PP(f); g

src/sage/rings/polynomial/multi_polynomial.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@ cdef class MPolynomial(CommutativePolynomial):
15461546
sage: f = x^5*y + 3*x^2*y^2 - 2*x + y - 1
15471547
sage: f.discriminant(y) # needs sage.libs.singular
15481548
x^10 + 2*x^5 + 24*x^3 + 12*x^2 + 1
1549-
sage: f.polynomial(y).discriminant() # needs sage.libs.singular
1549+
sage: f.polynomial(y).discriminant()
15501550
x^10 + 2*x^5 + 24*x^3 + 12*x^2 + 1
15511551
sage: f.discriminant(y).parent() == f.polynomial(y).discriminant().parent() # needs sage.libs.singular
15521552
False

src/sage/rings/polynomial/multi_polynomial_element.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -660,11 +660,11 @@ def degree(self, x=None, std_grading=False):
660660
::
661661
662662
sage: x, y = ZZ['x','y'].gens()
663-
sage: GF(3037000453)['x','y'].gen(0).degree(x) # needs sage.rings.finie_rings
663+
sage: GF(3037000453)['x','y'].gen(0).degree(x) # needs sage.rings.finite_rings
664664
1
665665
666666
sage: x0, y0 = QQ['x','y'].gens()
667-
sage: GF(3037000453)['x','y'].gen(0).degree(x0) # needs sage.rings.finie_rings
667+
sage: GF(3037000453)['x','y'].gen(0).degree(x0) # needs sage.rings.finite_rings
668668
Traceback (most recent call last):
669669
...
670670
TypeError: x must canonically coerce to parent
@@ -997,6 +997,7 @@ def coefficient(self, degrees):
997997
998998
::
999999
1000+
sage: # needs sage.rings.real_mpfr
10001001
sage: R.<x,y> = RR[]
10011002
sage: f = x*y + 5
10021003
sage: c = f.coefficient({x: 0, y: 0}); c
@@ -2329,7 +2330,7 @@ def resultant(self, other, variable=None):
23292330
sage: R.<x,y> = RR[]
23302331
sage: p = x + y
23312332
sage: q = x*y
2332-
sage: p.resultant(q)
2333+
sage: p.resultant(q) # needs sage.modules
23332334
-y^2
23342335
23352336
Check that this method works over QQbar (:trac:`25351`)::

src/sage/rings/polynomial/multi_polynomial_ideal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# sage.doctest: optional - sage.libs.singular
1+
# sage.doctest: needs sage.libs.singular
22
r"""
33
Ideals in multivariate polynomial rings
44

src/sage/rings/polynomial/multi_polynomial_sequence.py

Lines changed: 30 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -225,11 +225,11 @@ def PolynomialSequence(arg1, arg2=None, immutable=False, cr=False, cr_str=None):
225225
EXAMPLES::
226226
227227
sage: P.<a,b,c,d> = PolynomialRing(GF(127), 4)
228-
sage: I = sage.rings.ideal.Katsura(P) # needs sage.rings.finite_rings
228+
sage: I = sage.rings.ideal.Katsura(P) # needs sage.libs.singular
229229
230230
If a list of tuples is provided, those form the parts::
231231
232-
sage: F = Sequence([I.gens(),I.gens()], I.ring()); F # indirect doctest # needs sage.rings.finite_rings
232+
sage: F = Sequence([I.gens(),I.gens()], I.ring()); F # indirect doctest # needs sage.libs.singular
233233
[a + 2*b + 2*c + 2*d - 1,
234234
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
235235
2*a*b + 2*b*c + 2*c*d - b,
@@ -238,25 +238,25 @@ def PolynomialSequence(arg1, arg2=None, immutable=False, cr=False, cr_str=None):
238238
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
239239
2*a*b + 2*b*c + 2*c*d - b,
240240
b^2 + 2*a*c + 2*b*d - c]
241-
sage: F.nparts() # needs sage.rings.finite_rings
241+
sage: F.nparts() # needs sage.libs.singular
242242
2
243243
244244
If an ideal is provided, the generators are used::
245245
246-
sage: Sequence(I) # needs sage.rings.finite_rings
246+
sage: Sequence(I) # needs sage.libs.singular
247247
[a + 2*b + 2*c + 2*d - 1,
248248
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
249249
2*a*b + 2*b*c + 2*c*d - b,
250250
b^2 + 2*a*c + 2*b*d - c]
251251
252252
If a list of polynomials is provided, the system has only one part::
253253
254-
sage: F = Sequence(I.gens(), I.ring()); F # needs sage.rings.finite_rings
254+
sage: F = Sequence(I.gens(), I.ring()); F # needs sage.libs.singular
255255
[a + 2*b + 2*c + 2*d - 1,
256256
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
257257
2*a*b + 2*b*c + 2*c*d - b,
258258
b^2 + 2*a*c + 2*b*d - c]
259-
sage: F.nparts() # needs sage.rings.finite_rings
259+
sage: F.nparts() # needs sage.libs.singular
260260
1
261261
262262
We test that the ring is inferred correctly::
@@ -720,23 +720,22 @@ def coefficient_matrix(self, sparse=True):
720720
721721
EXAMPLES::
722722
723+
sage: # needs sage.libs.singular
723724
sage: P.<a,b,c,d> = PolynomialRing(GF(127), 4)
724-
sage: I = sage.rings.ideal.Katsura(P) # needs sage.rings.finite_rings
725-
sage: I.gens() # needs sage.rings.finite_rings
725+
sage: I = sage.rings.ideal.Katsura(P)
726+
sage: I.gens()
726727
[a + 2*b + 2*c + 2*d - 1,
727728
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
728729
2*a*b + 2*b*c + 2*c*d - b,
729730
b^2 + 2*a*c + 2*b*d - c]
730-
731-
sage: F = Sequence(I) # needs sage.rings.finite_rings
732-
sage: A,v = F.coefficient_matrix() # needs sage.rings.finite_rings
733-
sage: A # needs sage.rings.finite_rings
731+
sage: F = Sequence(I)
732+
sage: A,v = F.coefficient_matrix()
733+
sage: A
734734
[ 0 0 0 0 0 0 0 0 0 1 2 2 2 126]
735735
[ 1 0 2 0 0 2 0 0 2 126 0 0 0 0]
736736
[ 0 2 0 0 2 0 0 2 0 0 126 0 0 0]
737737
[ 0 0 1 2 0 0 2 0 0 0 0 126 0 0]
738-
739-
sage: v # needs sage.rings.finite_rings
738+
sage: v
740739
[a^2]
741740
[a*b]
742741
[b^2]
@@ -751,8 +750,7 @@ def coefficient_matrix(self, sparse=True):
751750
[ c]
752751
[ d]
753752
[ 1]
754-
755-
sage: A*v # needs sage.rings.finite_rings
753+
sage: A*v
756754
[ a + 2*b + 2*c + 2*d - 1]
757755
[a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a]
758756
[ 2*a*b + 2*b*c + 2*c*d - b]
@@ -806,14 +804,15 @@ def _singular_(self):
806804
807805
EXAMPLES::
808806
807+
sage: # needs sage.libs.singular
809808
sage: P.<a,b,c,d> = PolynomialRing(GF(127))
810-
sage: I = sage.rings.ideal.Katsura(P) # needs sage.rings.finite_rings
811-
sage: F = Sequence(I); F # needs sage.rings.finite_rings
809+
sage: I = sage.rings.ideal.Katsura(P)
810+
sage: F = Sequence(I); F
812811
[a + 2*b + 2*c + 2*d - 1,
813812
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
814813
2*a*b + 2*b*c + 2*c*d - b,
815814
b^2 + 2*a*c + 2*b*d - c]
816-
sage: F._singular_() # needs sage.rings.finite_rings
815+
sage: F._singular_()
817816
a+2*b+2*c+2*d-1,
818817
a^2+2*b^2+2*c^2+2*d^2-a,
819818
2*a*b+2*b*c+2*c*d-b,
@@ -851,9 +850,10 @@ def _repr_(self):
851850
852851
EXAMPLES::
853852
853+
sage: # needs sage.libs.singular
854854
sage: P.<a,b,c,d> = PolynomialRing(GF(127))
855-
sage: I = sage.rings.ideal.Katsura(P) # needs sage.rings.finite_rings
856-
sage: F = Sequence(I); F # indirect doctest # needs sage.rings.finite_rings
855+
sage: I = sage.rings.ideal.Katsura(P)
856+
sage: F = Sequence(I); F # indirect doctest
857857
[a + 2*b + 2*c + 2*d - 1,
858858
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
859859
2*a*b + 2*b*c + 2*c*d - b,
@@ -879,24 +879,25 @@ def __add__(self, right):
879879
880880
EXAMPLES::
881881
882+
sage: # needs sage.libs.singular
882883
sage: P.<a,b,c,d> = PolynomialRing(GF(127))
883-
sage: I = sage.rings.ideal.Katsura(P) # needs sage.rings.finite_rings
884-
sage: F = Sequence(I) # needs sage.rings.finite_rings
885-
sage: F + [a^127 + a] # needs sage.rings.finite_rings
884+
sage: I = sage.rings.ideal.Katsura(P)
885+
sage: F = Sequence(I)
886+
sage: F + [a^127 + a]
886887
[a + 2*b + 2*c + 2*d - 1,
887888
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
888889
2*a*b + 2*b*c + 2*c*d - b,
889890
b^2 + 2*a*c + 2*b*d - c,
890891
a^127 + a]
891892
892-
sage: F + P.ideal([a^127 + a]) # needs sage.rings.finite_rings
893+
sage: F + P.ideal([a^127 + a]) # needs sage.libs.singular
893894
[a + 2*b + 2*c + 2*d - 1,
894895
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
895896
2*a*b + 2*b*c + 2*c*d - b,
896897
b^2 + 2*a*c + 2*b*d - c,
897898
a^127 + a]
898899
899-
sage: F + Sequence([a^127 + a], P) # needs sage.rings.finite_rings
900+
sage: F + Sequence([a^127 + a], P) # needs sage.libs.singular
900901
[a + 2*b + 2*c + 2*d - 1,
901902
a^2 + 2*b^2 + 2*c^2 + 2*d^2 - a,
902903
2*a*b + 2*b*c + 2*c*d - b,
@@ -1029,7 +1030,7 @@ def _groebner_strategy(self):
10291030
10301031
sage: P.<x,y,z> = PolynomialRing(GF(127))
10311032
sage: F = Sequence([x*y + z, y + z + 1])
1032-
sage: F._groebner_strategy() # needs sage.rings.finite_rings
1033+
sage: F._groebner_strategy() # needs sage.libs.singular
10331034
Groebner Strategy for ideal generated by 2 elements over
10341035
Multivariate Polynomial Ring in x, y, z over Finite Field of size 127
10351036
"""
@@ -1044,11 +1045,11 @@ def maximal_degree(self):
10441045
10451046
sage: P.<x,y,z> = PolynomialRing(GF(7))
10461047
sage: F = Sequence([x*y + x, x])
1047-
sage: F.maximal_degree() # needs sage.rings.finite_rings
1048+
sage: F.maximal_degree()
10481049
2
10491050
sage: P.<x,y,z> = PolynomialRing(GF(7))
10501051
sage: F = Sequence([], universe=P)
1051-
sage: F.maximal_degree() # needs sage.rings.finite_rings
1052+
sage: F.maximal_degree()
10521053
-1
10531054
10541055
"""

src/sage/rings/polynomial/omega.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,11 +879,11 @@ def _Omega_factors_denominator_(x, y):
879879
880880
sage: B.<zeta> = ZZ.extension(cyclotomic_polynomial(3)) # needs sage.rings.number_field
881881
sage: L.<x, y> = LaurentPolynomialRing(B) # needs sage.rings.number_field
882-
sage: _Omega_factors_denominator_(((x, -x),), ((y,),))
882+
sage: _Omega_factors_denominator_(((x, -x),), ((y,),)) # needs sage.rings.number_field
883883
(-x^2 + 1, -x^2*y^2 + 1)
884884
sage: _Omega_factors_denominator_(((x, -x),), ((y, zeta*y, zeta^2*y),)) # needs sage.rings.number_field
885885
(-x^2 + 1, -x^6*y^6 + 1)
886-
sage: _Omega_factors_denominator_(((x, -x),), ((y, -y),))
886+
sage: _Omega_factors_denominator_(((x, -x),), ((y, -y),)) # needs sage.rings.number_field
887887
(-x^2 + 1, -x^2*y^2 + 1, -x^2*y^2 + 1)
888888
889889
TESTS::

0 commit comments

Comments
 (0)