@@ -347,9 +347,10 @@ def _magma_init_(self, magma):
347
347
348
348
EXAMPLES::
349
349
350
- sage: R.<a,b,c,d,e,f,g,h,i,j> = PolynomialRing(GF(127),10)
351
- sage: I = sage.rings.ideal.Cyclic(R,4) # indirect doctest # needs sage.rings.finite_rings
352
- sage: magma(I) # optional - magma # needs sage.rings.finite_rings
350
+ sage: # optional - magma
351
+ sage: R.<a,b,c,d,e,f,g,h,i,j> = PolynomialRing(GF(127), 10)
352
+ sage: I = sage.rings.ideal.Cyclic(R,4) # indirect doctest
353
+ sage: magma(I)
353
354
Ideal of Polynomial ring of rank 10 over GF(127)
354
355
Order: Graded Reverse Lexicographical
355
356
Variables: a, b, c, d, e, f, g, h, i, j
@@ -384,20 +385,20 @@ def _groebner_basis_magma(self, deg_bound=None, prot=False, magma=magma_default)
384
385
385
386
EXAMPLES::
386
387
387
- sage: # needs sage.rings.finite_rings
388
+ sage: # optional - magma
388
389
sage: R.<a,b,c,d,e,f,g,h,i,j> = PolynomialRing(GF(127), 10)
389
390
sage: I = sage.rings.ideal.Cyclic(R, 6)
390
- sage: gb = I.groebner_basis('magma:GroebnerBasis') # optional - magma
391
- sage: len(gb) # optional - magma
391
+ sage: gb = I.groebner_basis('magma:GroebnerBasis')
392
+ sage: len(gb)
392
393
45
393
394
394
395
We may also pass a degree bound to Magma::
395
396
396
- sage: # needs sage.rings.finite_rings
397
+ sage: # optional - magma
397
398
sage: R.<a,b,c,d,e,f,g,h,i,j> = PolynomialRing(GF(127), 10)
398
399
sage: I = sage.rings.ideal.Cyclic(R, 6)
399
- sage: gb = I.groebner_basis('magma:GroebnerBasis', deg_bound=4) # optional - magma
400
- sage: len(gb) # optional - magma
400
+ sage: gb = I.groebner_basis('magma:GroebnerBasis', deg_bound=4)
401
+ sage: len(gb)
401
402
5
402
403
"""
403
404
R = self .ring ()
@@ -1354,14 +1355,14 @@ def _groebner_basis_ginv(self, algorithm="TQ", criteria='CritPartially', divisio
1354
1355
1355
1356
Currently, only `\GF{p}` and `\QQ` are supported as base fields::
1356
1357
1357
- sage: P.<x,y,z> = PolynomialRing(QQ,order='degrevlex')
1358
+ sage: # optional - ginv
1359
+ sage: P.<x,y,z> = PolynomialRing(QQ, order='degrevlex')
1358
1360
sage: I = sage.rings.ideal.Katsura(P)
1359
- sage: I.groebner_basis(algorithm='ginv') # optional - ginv
1361
+ sage: I.groebner_basis(algorithm='ginv')
1360
1362
[z^3 - 79/210*z^2 + 1/30*y + 1/70*z, y^2 - 3/5*z^2 - 1/5*y + 1/5*z, y*z + 6/5*z^2 - 1/10*y - 2/5*z, x + 2*y + 2*z - 1]
1361
-
1362
1363
sage: P.<x,y,z> = PolynomialRing(GF(127), order='degrevlex')
1363
- sage: I = sage.rings.ideal.Katsura(P) # needs sage.rings.finite_rings
1364
- sage: I.groebner_basis(algorithm='ginv') # optional - ginv # needs sage.rings.finite_rings
1364
+ sage: I = sage.rings.ideal.Katsura(P)
1365
+ sage: I.groebner_basis(algorithm='ginv')
1365
1366
...
1366
1367
[z^3 + 22*z^2 - 55*y + 49*z, y^2 - 26*z^2 - 51*y + 51*z, y*z + 52*z^2 + 38*y + 25*z, x + 2*y + 2*z - 1]
1367
1368
@@ -1979,7 +1980,7 @@ def interreduced_basis(self):
1979
1980
The interreduced basis of 0 is 0::
1980
1981
1981
1982
sage: P.<x,y,z> = GF(2)[]
1982
- sage: Ideal(P(0)).interreduced_basis() # needs sage.rings.finite_rings
1983
+ sage: Ideal(P(0)).interreduced_basis()
1983
1984
[0]
1984
1985
1985
1986
ALGORITHM:
@@ -2526,8 +2527,6 @@ def variety(self, ring=None, *, algorithm="triangular_decomposition", proof=True
2526
2527
y^48 + y^41 - y^40 + y^37 - y^36 - y^33 + y^32 - y^29 + y^28
2527
2528
- y^25 + y^24 + y^2 + y + 1)
2528
2529
of Multivariate Polynomial Ring in x, y over Finite Field in w of size 3^3
2529
-
2530
- sage: # needs sage.rings.finite_rings
2531
2530
sage: V = I.variety();
2532
2531
sage: sorted(V, key=str)
2533
2532
[{y: w^2 + 2*w, x: 2*w + 2}, {y: w^2 + 2, x: 2*w}, {y: w^2 + w, x: 2*w + 1}]
@@ -2610,9 +2609,10 @@ def variety(self, ring=None, *, algorithm="triangular_decomposition", proof=True
2610
2609
If the ground field's characteristic is too large for
2611
2610
Singular, we resort to a toy implementation::
2612
2611
2613
- sage: R.<x,y> = PolynomialRing(GF(2147483659^3), order='lex') # needs sage.rings.finite_rings
2614
- sage: I = ideal([x^3 - 2*y^2, 3*x + y^4]) # needs sage.rings.finite_rings
2615
- sage: I.variety() # needs sage.rings.finite_rings
2612
+ sage: # needs sage.rings.finite_rings
2613
+ sage: R.<x,y> = PolynomialRing(GF(2147483659^3), order='lex')
2614
+ sage: I = ideal([x^3 - 2*y^2, 3*x + y^4])
2615
+ sage: I.variety()
2616
2616
verbose 0 (...: multi_polynomial_ideal.py, groebner_basis) Warning: falling back to very slow toy implementation.
2617
2617
verbose 0 (...: multi_polynomial_ideal.py, dimension) Warning: falling back to very slow toy implementation.
2618
2618
verbose 0 (...: multi_polynomial_ideal.py, variety) Warning: falling back to very slow toy implementation.
@@ -2623,22 +2623,23 @@ def variety(self, ring=None, *, algorithm="triangular_decomposition", proof=True
2623
2623
But the mapping will also accept generators of the original ring,
2624
2624
or even generator names as strings, when provided as keys::
2625
2625
2626
+ sage: # needs sage.rings.number_field
2626
2627
sage: K.<x,y> = QQ[]
2627
2628
sage: I = ideal([x^2 + 2*y - 5, x + y + 3])
2628
- sage: v = I.variety(AA)[0]; v[x], v[y] # needs sage.rings.number_field
2629
+ sage: v = I.variety(AA)[0]; v[x], v[y]
2629
2630
(4.464101615137755?, -7.464101615137755?)
2630
- sage: list(v)[0].parent() # needs sage.rings.number_field
2631
+ sage: list(v)[0].parent()
2631
2632
Multivariate Polynomial Ring in x, y over Algebraic Real Field
2632
- sage: v[x] # needs sage.rings.number_field
2633
+ sage: v[x]
2633
2634
4.464101615137755?
2634
- sage: v["y"] # needs sage.rings.number_field
2635
+ sage: v["y"]
2635
2636
-7.464101615137755?
2636
2637
2637
2638
``msolve`` also works over finite fields::
2638
2639
2639
2640
sage: R.<x, y> = PolynomialRing(GF(536870909), 2, order='lex') # needs sage.rings.finite_rings
2640
2641
sage: I = Ideal([x^2 - 1, y^2 - 1]) # needs sage.rings.finite_rings
2641
- sage: sorted(I.variety(algorithm='msolve', # optional - msolve # needs sage.rings.finite_rings
2642
+ sage: sorted(I.variety(algorithm='msolve', # optional - msolve, needs sage.rings.finite_rings
2642
2643
....: proof=False),
2643
2644
....: key=str)
2644
2645
[{x: 1, y: 1},
@@ -2651,7 +2652,7 @@ def variety(self, ring=None, *, algorithm="triangular_decomposition", proof=True
2651
2652
2652
2653
sage: R.<x, y> = PolynomialRing(GF(3), 2, order='lex')
2653
2654
sage: I = Ideal([x^2 - 1, y^2 - 1])
2654
- sage: I.variety(algorithm='msolve', proof=False) # optional - msolve, needs sage.rings.finite_rings
2655
+ sage: I.variety(algorithm='msolve', proof=False) # optional - msolve
2655
2656
Traceback (most recent call last):
2656
2657
...
2657
2658
NotImplementedError: characteristic 3 too small
@@ -2710,10 +2711,10 @@ def _variety_triangular_decomposition(self, ring):
2710
2711
x11^2 + x11, x12^2 + x12, x13^2 + x13, x14^2 + x14, x15^2 + x15, \
2711
2712
x16^2 + x16, x17^2 + x17, x18^2 + x18, x19^2 + x19, x20^2 + x20, \
2712
2713
x21^2 + x21, x22^2 + x22, x23^2 + x23, x24^2 + x24, x25^2 + x25, \
2713
- x26^2 + x26, x27^2 + x27, x28^2 + x28, x29^2 + x29, x30^2 + x30]) # optional - sage.rings.finite_rings
2714
- sage: I.basis_is_groebner() # needs sage.rings.finite_rings
2714
+ x26^2 + x26, x27^2 + x27, x28^2 + x28, x29^2 + x29, x30^2 + x30])
2715
+ sage: I.basis_is_groebner()
2715
2716
True
2716
- sage: sorted("".join(str(V[g]) for g in R.gens()) for V in I.variety()) # long time (6s on sage.math, 2011), needs sage.rings.finite_rings
2717
+ sage: sorted("".join(str(V[g]) for g in R.gens()) for V in I.variety()) # long time (6s on sage.math, 2011)
2717
2718
['101000100000000110001000100110',
2718
2719
'101000100000000110001000101110',
2719
2720
'101000100100000101001000100110',
@@ -2748,10 +2749,10 @@ def _variety_triangular_decomposition(self, ring):
2748
2749
2749
2750
Check that the issue at :trac:`7425` is fixed::
2750
2751
2751
- sage: S.<t>= PolynomialRing(QQ)
2752
- sage: F.<q>= QQ.extension(t^4+ 1)
2753
- sage: R.<x,y>= PolynomialRing(F)
2754
- sage: I= R.ideal(x,y^4+ 1)
2752
+ sage: S.<t> = PolynomialRing(QQ)
2753
+ sage: F.<q> = QQ.extension(t^4 + 1)
2754
+ sage: R.<x,y> = PolynomialRing(F)
2755
+ sage: I = R.ideal(x, y^4 + 1)
2755
2756
sage: I.variety()
2756
2757
[...{y: -q^3, x: 0}...]
2757
2758
@@ -2765,7 +2766,7 @@ def _variety_triangular_decomposition(self, ring):
2765
2766
Check that the issue at :trac:`16485` is fixed::
2766
2767
2767
2768
sage: R.<a,b,c> = PolynomialRing(QQ, order='lex')
2768
- sage: I = R.ideal(c^2- 2, b- c, a)
2769
+ sage: I = R.ideal(c^2 - 2, b - c, a)
2769
2770
sage: I.variety(QQbar) # needs sage.rings.number_field
2770
2771
[...a: 0...]
2771
2772
@@ -4649,10 +4650,10 @@ def groebner_basis(self, algorithm='', deg_bound=None, mult_bound=None, prot=Fal
4649
4650
if not algorithm :
4650
4651
try :
4651
4652
gb = self ._groebner_basis_libsingular ("groebner" , deg_bound = deg_bound , mult_bound = mult_bound , * args , ** kwds )
4652
- except (TypeError , NameError , ImportError ): # conversion to Singular not supported
4653
+ except (TypeError , NameError , ImportError ): # conversion to Singular not supported
4653
4654
try :
4654
4655
gb = self ._groebner_basis_singular ("groebner" , deg_bound = deg_bound , mult_bound = mult_bound , * args , ** kwds )
4655
- except (TypeError , NameError , NotImplementedError , ImportError ): # conversion to Singular not supported
4656
+ except (TypeError , NameError , NotImplementedError , ImportError ): # conversion to Singular not supported
4656
4657
R = self .ring ()
4657
4658
B = R .base_ring ()
4658
4659
if R .ngens () == 0 :
@@ -5420,8 +5421,7 @@ def weil_restriction(self):
5420
5421
sage: J += sage.rings.ideal.FieldIdeal(J.ring()) # ensure radical ideal
5421
5422
sage: J.variety()
5422
5423
[{y1: 1, y0: 0, x1: 1, x0: 1}]
5423
-
5424
- sage: J.weil_restriction() # returns J # needs sage.rings.finite_rings
5424
+ sage: J.weil_restriction() # returns J
5425
5425
Ideal (x0*y0 + x1*y1 + 1, x1*y0 + x0*y1 + x1*y1, x1 + 1, x0 + x1,
5426
5426
x0^2 + x0, x1^2 + x1, y0^2 + y0, y1^2 + y1) of Multivariate
5427
5427
Polynomial Ring in x0, x1, y0, y1 over Finite Field of size 2
@@ -5434,8 +5434,7 @@ def weil_restriction(self):
5434
5434
0
5435
5435
sage: I.variety()
5436
5436
[{z: 0, y: 0, x: 1}]
5437
-
5438
- sage: J = I.weil_restriction(); J # needs sage.rings.finite_rings
5437
+ sage: J = I.weil_restriction(); J
5439
5438
Ideal (x0 - y0 - z0 - 1,
5440
5439
x1 - y1 - z1, x2 - y2 - z2, x3 - y3 - z3, x4 - y4 - z4,
5441
5440
x0^2 + x2*x3 + x1*x4 - y0^2 - y2*y3 - y1*y4 - z0^2 - z2*z3 - z1*z4 - x0,
@@ -5460,9 +5459,9 @@ def weil_restriction(self):
5460
5459
- y4*z0 - y3*z1 - y2*z2 - y1*z3 - y0*z4 - y4*z4 - y4)
5461
5460
of Multivariate Polynomial Ring in x0, x1, x2, x3, x4, y0, y1, y2, y3, y4,
5462
5461
z0, z1, z2, z3, z4 over Finite Field of size 3
5463
- sage: J += sage.rings.ideal.FieldIdeal(J.ring()) # ensure radical ideal # needs sage.rings.finite_rings
5462
+ sage: J += sage.rings.ideal.FieldIdeal(J.ring()) # ensure radical ideal
5464
5463
sage: from sage.doctest.fixtures import reproducible_repr
5465
- sage: print(reproducible_repr(J.variety())) # needs sage.rings.finite_rings
5464
+ sage: print(reproducible_repr(J.variety()))
5466
5465
[{x0: 1, x1: 0, x2: 0, x3: 0, x4: 0,
5467
5466
y0: 0, y1: 0, y2: 0, y3: 0, y4: 0,
5468
5467
z0: 0, z1: 0, z2: 0, z3: 0, z4: 0}]
0 commit comments