Skip to content

Commit 33c6dd2

Browse files
author
Matthias Koeppe
committed
sage.rings: Update # needs
1 parent b6a3f5a commit 33c6dd2

13 files changed

+108
-94
lines changed

src/sage/rings/polynomial/laurent_polynomial.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ cdef class LaurentPolynomial(CommutativeAlgebraElement):
184184
185185
sage: R.<x, y> = LaurentPolynomialRing(QQ) # needs sage.modules
186186
sage: a = 2*x^2 + 3*x^3 + 4*x^-1 # needs sage.modules
187-
sage: a.change_ring(GF(3)) # needs sage.modules sage.rings.finite_rings
187+
sage: a.change_ring(GF(3)) # needs sage.modules
188188
-x^2 + x^-1
189189
"""
190190
return self._parent.change_ring(R)(self)

src/sage/rings/polynomial/laurent_polynomial_mpair.pyx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -993,7 +993,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
993993
x^2 - x*y^-1 + y^-2
994994
sage: h * (f // h) == f # needs sage.libs.singular
995995
True
996-
sage: f // 1 # needs sage.libs.singular
996+
sage: f // 1
997997
x^3 + y^-3
998998
sage: 1 // f # needs sage.libs.singular
999999
0
@@ -1002,7 +1002,7 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
10021002
10031003
Check that :trac:`19357` is fixed::
10041004
1005-
sage: x // y # needs sage.libs.singular
1005+
sage: x // y
10061006
x*y^-1
10071007
10081008
Check that :trac:`21999` is fixed::
@@ -1047,14 +1047,15 @@ cdef class LaurentPolynomial_mpair(LaurentPolynomial):
10471047
10481048
Verify that :trac:`31257` is fixed::
10491049
1050+
sage: # needs sage.libs.singular
10501051
sage: R.<x,y> = LaurentPolynomialRing(QQ)
1051-
sage: q, r = (1/x).quo_rem(y) # needs sage.libs.singular
1052-
sage: q, r # needs sage.libs.singular
1052+
sage: q, r = (1/x).quo_rem(y)
1053+
sage: q, r
10531054
(x^-1*y^-1, 0)
1054-
sage: q*y + r == 1/x # needs sage.libs.singular
1055+
sage: q*y + r == 1/x
10551056
True
1056-
sage: q, r = (x^-2 - y^2).quo_rem(x - y) # needs sage.libs.singular
1057-
sage: q*(x - y) + r == x^-2 - y^2 # needs sage.libs.singular
1057+
sage: q, r = (x^-2 - y^2).quo_rem(x - y)
1058+
sage: q*(x - y) + r == x^-2 - y^2
10581059
True
10591060
"""
10601061
# make copies of self and right so that the input can be normalized

src/sage/rings/polynomial/laurent_polynomial_ring_base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ def characteristic(self):
463463
464464
sage: LaurentPolynomialRing(QQ, 2, 'x').characteristic()
465465
0
466-
sage: LaurentPolynomialRing(GF(3), 2, 'x').characteristic() # needs sage.libs.pari
466+
sage: LaurentPolynomialRing(GF(3), 2, 'x').characteristic()
467467
3
468468
469469
"""

src/sage/rings/polynomial/multi_polynomial.pyx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1702,13 +1702,13 @@ cdef class MPolynomial(CommutativePolynomial):
17021702
an example of bad reduction at a prime ``p = 5``::
17031703
17041704
sage: R.<x,y,z> = PolynomialRing(QQ, 3)
1705-
sage: y.macaulay_resultant([x^3 + 25*y^2*x, 5*z]) # needs sage.modules
1705+
sage: y.macaulay_resultant([x^3 + 25*y^2*x, 5*z]) # needs sage.libs.pari sage.modules
17061706
125
17071707
17081708
The input can given as an unpacked list of polynomials::
17091709
17101710
sage: R.<x,y,z> = PolynomialRing(QQ, 3)
1711-
sage: y.macaulay_resultant(x^3 + 25*y^2*x, 5*z) # needs sage.modules
1711+
sage: y.macaulay_resultant(x^3 + 25*y^2*x, 5*z) # needs sage.libs.pari sage.modules
17121712
125
17131713
17141714
an example when the coefficients live in a finite field::
@@ -1723,7 +1723,7 @@ cdef class MPolynomial(CommutativePolynomial):
17231723
char polynomials of numerator/denominator)::
17241724
17251725
sage: R.<x,y,z> = PolynomialRing(QQ, 3)
1726-
sage: y.macaulay_resultant([x + z, z^2]) # needs sage.modules
1726+
sage: y.macaulay_resultant([x + z, z^2]) # needs sage.libs.pari sage.modules
17271727
-1
17281728
17291729
When there are only 2 polynomials, the Macaulay resultant degenerates to the traditional resultant::
@@ -2329,7 +2329,7 @@ cdef class MPolynomial(CommutativePolynomial):
23292329
sage: R.<x,h> = PolynomialRing(QQ)
23302330
sage: f = 19*x^8 - 262*x^7*h + 1507*x^6*h^2 - 4784*x^5*h^3 + 9202*x^4*h^4\
23312331
-10962*x^3*h^5 + 7844*x^2*h^6 - 3040*x*h^7 + 475*h^8
2332-
sage: f.reduced_form(prec=200, smallest_coeffs=False) # needs sage.modules
2332+
sage: f.reduced_form(prec=200, smallest_coeffs=False) # needs sage.modules sage.rings.complex_interval_field
23332333
(
23342334
-x^8 - 2*x^7*h + 7*x^6*h^2 + 16*x^5*h^3 + 2*x^4*h^4 - 2*x^3*h^5 + 4*x^2*h^6 - 5*h^8,
23352335
<BLANKLINE>
@@ -2342,7 +2342,7 @@ cdef class MPolynomial(CommutativePolynomial):
23422342
sage: R.<x,y> = PolynomialRing(QQ)
23432343
sage: f = x^3 + 378666*x^2*y - 12444444*x*y^2 + 1234567890*y^3
23442344
sage: j = f * (x-545*y)^9
2345-
sage: j.reduced_form(prec=200, smallest_coeffs=False) # needs sage.modules
2345+
sage: j.reduced_form(prec=200, smallest_coeffs=False) # needs sage.modules sage.rings.complex_interval_field
23462346
Traceback (most recent call last):
23472347
...
23482348
ValueError: cannot have a root with multiplicity >= 12/2
@@ -2351,7 +2351,7 @@ cdef class MPolynomial(CommutativePolynomial):
23512351
23522352
sage: R.<x,y> = PolynomialRing(QQ)
23532353
sage: F = x^6 + 3*x^5*y - 8*x^4*y^2 - 2*x^3*y^3 - 44*x^2*y^4 - 8*x*y^5
2354-
sage: F.reduced_form(smallest_coeffs=False, prec=400) # needs sage.modules
2354+
sage: F.reduced_form(smallest_coeffs=False, prec=400) # needs sage.modules sage.rings.complex_interval_field
23552355
Traceback (most recent call last):
23562356
...
23572357
ArithmeticError: Newton's method converged to z not in the upper half plane
@@ -2360,7 +2360,7 @@ cdef class MPolynomial(CommutativePolynomial):
23602360
23612361
sage: R.<x,y> = PolynomialRing(QQ)
23622362
sage: F = 5*x^2*y - 5*x*y^2 - 30*y^3
2363-
sage: F.reduced_form(smallest_coeffs=False) # needs sage.modules
2363+
sage: F.reduced_form(smallest_coeffs=False) # needs sage.modules sage.rings.complex_interval_field
23642364
(
23652365
[1 1]
23662366
5*x^2*y + 5*x*y^2 - 30*y^3, [0 1]
@@ -2371,12 +2371,12 @@ cdef class MPolynomial(CommutativePolynomial):
23712371
sage: R.<x,y> = PolynomialRing(QQ)
23722372
sage: F = (-16*x^7 - 114*x^6*y - 345*x^5*y^2 - 599*x^4*y^3
23732373
....: - 666*x^3*y^4 - 481*x^2*y^5 - 207*x*y^6 - 40*y^7)
2374-
sage: F.reduced_form(prec=50, smallest_coeffs=False) # needs sage.modules
2374+
sage: F.reduced_form(prec=50, smallest_coeffs=False) # needs sage.modules sage.rings.complex_interval_field
23752375
Traceback (most recent call last):
23762376
...
23772377
ValueError: accuracy of Newton's root not within tolerance(0.000012... > 1e-06),
23782378
increase precision
2379-
sage: F.reduced_form(prec=100, smallest_coeffs=False) # needs sage.modules
2379+
sage: F.reduced_form(prec=100, smallest_coeffs=False) # needs sage.modules sage.rings.complex_interval_field
23802380
(
23812381
[-1 -1]
23822382
-x^5*y^2 - 24*x^3*y^4 - 3*x^2*y^5 - 2*x*y^6 + 16*y^7, [ 1 0]
@@ -2386,14 +2386,14 @@ cdef class MPolynomial(CommutativePolynomial):
23862386
23872387
sage: R.<x,y> = PolynomialRing(QQ)
23882388
sage: F = - 8*x^4 - 3933*x^3*y - 725085*x^2*y^2 - 59411592*x*y^3 - 1825511633*y^4
2389-
sage: F.reduced_form(return_conjugation=False) # needs sage.modules
2389+
sage: F.reduced_form(return_conjugation=False) # needs sage.modules sage.rings.complex_interval_field
23902390
x^4 + 9*x^3*y - 3*x*y^3 - 8*y^4
23912391
23922392
::
23932393
23942394
sage: R.<x,y> = QQ[]
23952395
sage: F = -2*x^3 + 2*x^2*y + 3*x*y^2 + 127*y^3
2396-
sage: F.reduced_form() # needs sage.modules
2396+
sage: F.reduced_form() # needs sage.modules sage.rings.complex_interval_field
23972397
(
23982398
[1 4]
23992399
-2*x^3 - 22*x^2*y - 77*x*y^2 + 43*y^3, [0 1]
@@ -2403,7 +2403,7 @@ cdef class MPolynomial(CommutativePolynomial):
24032403
24042404
sage: R.<x,y> = QQ[]
24052405
sage: F = -2*x^3 + 2*x^2*y + 3*x*y^2 + 127*y^3
2406-
sage: F.reduced_form(norm_type='height') # needs sage.modules
2406+
sage: F.reduced_form(norm_type='height') # needs sage.modules sage.rings.complex_interval_field
24072407
(
24082408
[5 4]
24092409
-58*x^3 - 47*x^2*y + 52*x*y^2 + 43*y^3, [1 1]
@@ -2413,7 +2413,7 @@ cdef class MPolynomial(CommutativePolynomial):
24132413
24142414
sage: R.<x,y,z> = PolynomialRing(QQ)
24152415
sage: F = x^4 + x^3*y*z + y^2*z
2416-
sage: F.reduced_form() # needs sage.modules
2416+
sage: F.reduced_form() # needs sage.modules sage.rings.complex_interval_field
24172417
Traceback (most recent call last):
24182418
...
24192419
ValueError: (=x^3*y*z + x^4 + y^2*z) must have two variables
@@ -2422,7 +2422,7 @@ cdef class MPolynomial(CommutativePolynomial):
24222422
24232423
sage: R.<x,y> = PolynomialRing(ZZ)
24242424
sage: F = - 8*x^6 - 3933*x^3*y - 725085*x^2*y^2 - 59411592*x*y^3 - 99*y^6
2425-
sage: F.reduced_form(return_conjugation=False) # needs sage.modules
2425+
sage: F.reduced_form(return_conjugation=False) # needs sage.modules sage.rings.complex_interval_field
24262426
Traceback (most recent call last):
24272427
...
24282428
ValueError: (=-8*x^6 - 99*y^6 - 3933*x^3*y - 725085*x^2*y^2 -
@@ -2433,7 +2433,7 @@ cdef class MPolynomial(CommutativePolynomial):
24332433
sage: R.<x,y> = PolynomialRing(RR)
24342434
sage: F = (217.992172373276*x^3 + 96023.1505442490*x^2*y
24352435
....: + 1.40987971253579e7*x*y^2 + 6.90016027113216e8*y^3)
2436-
sage: F.reduced_form(smallest_coeffs=False) # tol 1e-8 # needs sage.modules
2436+
sage: F.reduced_form(smallest_coeffs=False) # tol 1e-8 # needs sage.modules sage.rings.complex_interval_field
24372437
(
24382438
-39.5673942565918*x^3 + 111.874026298523*x^2*y
24392439
+ 231.052762985229*x*y^2 - 138.380829811096*y^3,
@@ -2449,7 +2449,7 @@ cdef class MPolynomial(CommutativePolynomial):
24492449
....: + (84.8317207268542 + 93.8840848648033*CC.0)*x^2*y
24502450
....: + (3159.07040755858 + 3475.33037377779*CC.0)*x*y^2
24512451
....: + (39202.5965389079 + 42882.5139724962*CC.0)*y^3)
2452-
sage: F.reduced_form(smallest_coeffs=False) # tol 1e-11 # needs sage.modules sage.rings.real_mpfr
2452+
sage: F.reduced_form(smallest_coeffs=False) # tol 1e-11 # needs sage.modules sage.rings.complex_interval_field sage.rings.real_mpfr
24532453
(
24542454
(-0.759099196558145 - 0.845425869641446*I)*x^3
24552455
+ (-0.571709908900118 - 0.0418133346027929*I)*x^2*y

src/sage/rings/polynomial/multi_polynomial_element.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2329,7 +2329,7 @@ def resultant(self, other, variable=None):
23292329
sage: R.<x,y> = RR[]
23302330
sage: p = x + y
23312331
sage: q = x*y
2332-
sage: p.resultant(q) # needs sage.libs.singular
2332+
sage: p.resultant(q)
23332333
-y^2
23342334
23352335
Check that this method works over QQbar (:trac:`25351`)::

src/sage/rings/polynomial/multi_polynomial_ring.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,12 +268,13 @@ def __call__(self, x=0, check=True):
268268
269269
::
270270
271+
sage: # needs sage.symbolic
271272
sage: R = QQ['x,y,z']
272-
sage: f = (x^3 + y^3 - z^3)^10; f # needs sage.symbolic
273+
sage: f = (x^3 + y^3 - z^3)^10; f
273274
(x^3 + y^3 - z^3)^10
274-
sage: g = R(f); parent(g) # needs sage.symbolic
275+
sage: g = R(f); parent(g)
275276
Multivariate Polynomial Ring in x, y, z over Rational Field
276-
sage: (f - g).expand() # needs sage.symbolic
277+
sage: (f - g).expand()
277278
0
278279
279280
It intelligently handles conversions from polynomial rings in a subset

src/sage/rings/polynomial/multi_polynomial_ring_base.pyx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1638,13 +1638,13 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
16381638
An example of bad reduction at a prime `p = 5`::
16391639
16401640
sage: R.<x,y,z> = PolynomialRing(QQ, 3)
1641-
sage: R.macaulay_resultant([y, x^3 + 25*y^2*x, 5*z]) # needs sage.modules
1641+
sage: R.macaulay_resultant([y, x^3 + 25*y^2*x, 5*z]) # needs sage.libs.pari sage.modules
16421642
125
16431643
16441644
The input can given as an unpacked list of polynomials::
16451645
16461646
sage: R.<x,y,z> = PolynomialRing(QQ, 3)
1647-
sage: R.macaulay_resultant(y, x^3 + 25*y^2*x, 5*z) # needs sage.modules
1647+
sage: R.macaulay_resultant(y, x^3 + 25*y^2*x, 5*z) # needs sage.libs.pari sage.modules
16481648
125
16491649
16501650
An example when the coefficients live in a finite field::
@@ -1659,7 +1659,7 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
16591659
char polynomials of numerator/denominator)::
16601660
16611661
sage: R.<x,y,z> = PolynomialRing(QQ, 3)
1662-
sage: R.macaulay_resultant([y, x + z, z^2]) # needs sage.modules
1662+
sage: R.macaulay_resultant([y, x + z, z^2]) # needs sage.libs.pari sage.modules
16631663
-1
16641664
16651665
When there are only 2 polynomials, the Macaulay resultant degenerates
@@ -1750,9 +1750,9 @@ cdef class MPolynomialRing_base(sage.rings.ring.CommutativeRing):
17501750
EXAMPLES::
17511751
17521752
sage: R = QQ['x,y,z']
1753-
sage: W = R.weyl_algebra(); W # needs sage.combinat sage.modules
1753+
sage: W = R.weyl_algebra(); W # needs sage.modules
17541754
Differential Weyl algebra of polynomials in x, y, z over Rational Field
1755-
sage: W.polynomial_ring() == R # needs sage.combinat sage.modules
1755+
sage: W.polynomial_ring() == R # needs sage.modules
17561756
True
17571757
"""
17581758
from sage.algebras.weyl_algebra import DifferentialWeylAlgebra

src/sage/rings/polynomial/multi_polynomial_sequence.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
We can construct a polynomial sequence for a random plaintext-ciphertext
3131
pair and study it::
3232
33-
sage: set_random_seed(1) # needs sage.rings.polynomial.pbori
33+
sage: set_random_seed(1)
3434
sage: while True: # workaround (see :trac:`31891`) # needs sage.rings.polynomial.pbori
3535
....: try:
3636
....: F, s = sr.polynomial_system()
@@ -1398,13 +1398,14 @@ def _groebner_strategy(self):
13981398
13991399
sage: P.<x,y,z> = PolynomialRing(GF(2))
14001400
sage: F = Sequence([x*y + z, y + z + 1])
1401-
sage: F._groebner_strategy() # needs sage.rings.finite_rings
1401+
sage: F._groebner_strategy()
14021402
Groebner Strategy for ideal generated by 2 elements over
14031403
Multivariate Polynomial Ring in x, y, z over Finite Field of size 2
14041404
1405-
sage: P.<x,y,z> = BooleanPolynomialRing() # needs sage.rings.polynomial.pbori
1406-
sage: F = Sequence([x*y + z, y + z + 1]) # needs sage.rings.polynomial.pbori
1407-
sage: F._groebner_strategy() # needs sage.rings.polynomial.pbori
1405+
sage: # needs sage.rings.polynomial.pbori
1406+
sage: P.<x,y,z> = BooleanPolynomialRing()
1407+
sage: F = Sequence([x*y + z, y + z + 1])
1408+
sage: F._groebner_strategy()
14081409
<sage.rings.polynomial.pbori.pbori.GroebnerStrategy object at 0x...>
14091410
"""
14101411
from sage.rings.polynomial.multi_polynomial_ring_base import BooleanPolynomialRing_base

src/sage/rings/polynomial/polydict.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,10 +1981,11 @@ cdef class ETuple:
19811981
19821982
Verify that :trac:`6428` has been addressed::
19831983
1984+
sage: # needs sage.libs.singular
19841985
sage: R.<y, z> = Frac(QQ['x'])[]
1985-
sage: type(y) # needs sage.libs.singular
1986+
sage: type(y)
19861987
<class 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomial_libsingular'>
1987-
sage: y^(2^32) # needs sage.libs.singular
1988+
sage: y^(2^32)
19881989
Traceback (most recent call last):
19891990
...
19901991
OverflowError: exponent overflow (...) # 64-bit

0 commit comments

Comments
 (0)