diff --git a/src/sage/schemes/toric/divisor.py b/src/sage/schemes/toric/divisor.py index fb0bdbbfd17..c928cec4a7a 100644 --- a/src/sage/schemes/toric/divisor.py +++ b/src/sage/schemes/toric/divisor.py @@ -1063,7 +1063,7 @@ def polyhedron(self): (A vertex at (0, 0),) sage: D.is_nef() False - sage: dP7.integrate( D.ch() * dP7.Td() ) + sage: dP7.integrate(D.ch() * dP7.Td()) # needs sage.libs.singular 1 sage: P_antiK = (-dP7.K()).polyhedron(); P_antiK A 2-dimensional polyhedron in QQ^2 defined as the convex hull of 5 vertices @@ -1267,7 +1267,7 @@ def Kodaira_map(self, names='z'): sage: P1. = toric_varieties.P1() sage: D = -P1.K() - sage: D.Kodaira_map() + sage: D.Kodaira_map() # needs fpylll Scheme morphism: From: 1-d CPR-Fano toric variety covered by 2 affine patches To: Closed subscheme of Projective Space of dimension 2 @@ -1276,7 +1276,7 @@ def Kodaira_map(self, names='z'): sage: dP6 = toric_varieties.dP6() sage: D = -dP6.K() - sage: D.Kodaira_map(names='x') + sage: D.Kodaira_map(names='x') # needs fpylll Scheme morphism: From: 2-d CPR-Fano toric variety covered by 6 affine patches To: Closed subscheme of Projective Space of dimension 6 diff --git a/src/sage/schemes/toric/fano_variety.py b/src/sage/schemes/toric/fano_variety.py index a1405c966ec..b7f2c2ab6ac 100644 --- a/src/sage/schemes/toric/fano_variety.py +++ b/src/sage/schemes/toric/fano_variety.py @@ -1518,7 +1518,7 @@ def cohomology_class(self): covered by 8 affine patches defined by: a2*z0^2*z1 + a5*z0*z1*z3 + a1*z1*z3^2 + a3*z0^2*z4 + a4*z0*z3*z4 + a0*z3^2*z4, b1*z1*z2^2 + b2*z2^2*z4 + b5*z1*z2*z5 + b4*z2*z4*z5 + b3*z1*z5^2 + b0*z4*z5^2 - sage: CI.cohomology_class() + sage: CI.cohomology_class() # needs sage.libs.singular [2*z3*z4 + 4*z3*z5 + 2*z4*z5] """ X = self.ambient_space() diff --git a/src/sage/schemes/toric/homset.py b/src/sage/schemes/toric/homset.py index bd535edf932..e02d0b92078 100644 --- a/src/sage/schemes/toric/homset.py +++ b/src/sage/schemes/toric/homset.py @@ -621,6 +621,7 @@ def __iter__(self): EXAMPLES:: + sage: # needs sage.libs.singular sage: P2. = toric_varieties.P2(base_ring=GF(5)) sage: cubic = P2.subscheme([x^3 + y^3 + z^3]) sage: list(cubic.point_set()) @@ -641,6 +642,7 @@ def cardinality(self): EXAMPLES:: + sage: # needs sage.libs.singular sage: P2. = toric_varieties.P2(base_ring=GF(5)) sage: cubic = P2.subscheme([x^3 + y^3 + z^3]) sage: list(cubic.point_set()) diff --git a/src/sage/schemes/toric/points.py b/src/sage/schemes/toric/points.py index f9563bd0acc..4a40aa82ef7 100644 --- a/src/sage/schemes/toric/points.py +++ b/src/sage/schemes/toric/points.py @@ -1007,7 +1007,7 @@ def cardinality(self): sage: X. = ToricVariety(fan, base_ring=GF(7)) sage: Y = X.subscheme(u^3 + v^3 + w^3 + u*v*w) sage: point_set = Y.point_set() - sage: list(point_set) + sage: list(point_set) # needs fpylll [[0 : 1 : 3], [1 : 0 : 3], [1 : 3 : 0], @@ -1015,8 +1015,8 @@ def cardinality(self): [1 : 1 : 4], [1 : 3 : 2], [1 : 3 : 5]] - sage: ffe = point_set._enumerator() - sage: ffe.cardinality() + sage: ffe = point_set._enumerator() # needs fpylll + sage: ffe.cardinality() # needs fpylll 7 """ n = 0 diff --git a/src/sage/schemes/toric/toric_subscheme.py b/src/sage/schemes/toric/toric_subscheme.py index cc5b0e3158a..770e459335e 100644 --- a/src/sage/schemes/toric/toric_subscheme.py +++ b/src/sage/schemes/toric/toric_subscheme.py @@ -270,6 +270,7 @@ def affine_algebraic_patch(self, cone=None, names=None): Closed subscheme of Affine Space of dimension 2 over Rational Field defined by: z0^3 + z1^3 + 1 + sage: # needs fpylll sage: cone = Cone([(0,1), (2,1)]) sage: A2Z2. = AffineToricVariety(cone) sage: A2Z2.affine_algebraic_patch() diff --git a/src/sage/schemes/toric/variety.py b/src/sage/schemes/toric/variety.py index 558900f5119..01064ffbc95 100644 --- a/src/sage/schemes/toric/variety.py +++ b/src/sage/schemes/toric/variety.py @@ -66,7 +66,7 @@ sage: C2 = AffineToricVariety(quadrant, base_field=CC) sage: C2.base_ring() Complex Field with 53 bits of precision - sage: C2(1,2+i) + sage: C2(1, 2+i) # needs sage.symbolic [1.00000000000000 : 2.00000000000000 + 1.00000000000000*I] or even :: @@ -1083,7 +1083,7 @@ def coordinate_ring(self): sage: R = toric_varieties.A1().coordinate_ring(); R Multivariate Polynomial Ring in z over Rational Field - sage: type(R) + sage: type(R) # needs sage.libs.singular <... 'sage.rings.polynomial.multi_polynomial_libsingular.MPolynomialRing_libsingular'> """ if "_coordinate_ring" not in self.__dict__: @@ -1931,6 +1931,7 @@ def cohomology_ring(self): potentially troublesome on unpickling, see :trac:`15050` and :trac:`15149` :: + sage: # needs sage.libs.singular sage: variety = toric_varieties.P(1) sage: a = [variety.cohomology_ring(), variety.cohomology_basis(), variety.volume_class()] sage: b = [variety.Todd_class(), variety.Chern_class(), variety.Chern_character(), variety.Kaehler_cone(), variety.Mori_cone()] @@ -2077,6 +2078,7 @@ def integrate(self, cohomology_class): EXAMPLES:: + sage: # needs sage.libs.singular sage: dP6 = toric_varieties.dP6() sage: HH = dP6.cohomology_ring() sage: D = [ HH(c) for c in dP6.fan(dim=1) ] @@ -2098,6 +2100,7 @@ def integrate(self, cohomology_class): If the toric variety is an orbifold, the intersection numbers are usually fractional:: + sage: # needs sage.libs.singular sage: P2_123 = toric_varieties.P2_123() sage: HH = P2_123.cohomology_ring() sage: D = [ HH(c) for c in P2_123.fan(dim=1) ] @@ -2159,6 +2162,7 @@ def Chern_class(self, deg=None): EXAMPLES:: + sage: # needs sage.libs.singular sage: X = toric_varieties.dP6() sage: X.Chern_class() [-6*w^2 + y + 2*v + 2*z + w + 1] @@ -2204,6 +2208,7 @@ def Chern_character(self, deg=None): EXAMPLES:: + sage: # needs sage.libs.singular sage: dP6 = toric_varieties.dP6() sage: dP6.Chern_character() [3*w^2 + y + 2*v + 2*z + w + 2] @@ -2243,6 +2248,7 @@ def Todd_class(self, deg=None): EXAMPLES:: + sage: # needs sage.libs.singular sage: dP6 = toric_varieties.dP6() sage: dP6.Todd_class() [-w^2 + 1/2*y + v + z + 1/2*w + 1] @@ -2289,6 +2295,7 @@ def Euler_number(self): EXAMPLES:: + sage: # needs sage.libs.singular sage: P1xP1 = toric_varieties.P1xP1() sage: P1xP1.Euler_number() 4 @@ -2320,7 +2327,7 @@ def K(self): sage: HH = dP6.cohomology_ring() sage: dP6.K() -V(x) - V(u) - V(y) - V(v) - V(z) - V(w) - sage: dP6.integrate( HH(dP6.K())^2 ) + sage: dP6.integrate( HH(dP6.K())^2 ) # needs sage.libs.singular 6 """ from sage.schemes.toric.divisor import ToricDivisor @@ -2479,18 +2486,18 @@ def _semigroup_ring(self, cone=None, names=None): EXAMPLES:: sage: A2Z2 = Cone([(0,1), (2,1)]) - sage: AffineToricVariety(A2Z2)._semigroup_ring() + sage: AffineToricVariety(A2Z2)._semigroup_ring() # needs fpylll (Multivariate Polynomial Ring in z0, z1, z2 over Rational Field, Ideal (-z0*z1 + z2^2) of Multivariate Polynomial Ring in z0, z1, z2 over Rational Field, 2-d cone in 2-d lattice M) sage: P2 = toric_varieties.P2() sage: cone = P2.fan().generating_cone(0) - sage: P2._semigroup_ring(cone) + sage: P2._semigroup_ring(cone) # needs fpylll (Multivariate Polynomial Ring in z0, z1 over Rational Field, Ideal (0) of Multivariate Polynomial Ring in z0, z1 over Rational Field, 2-d cone in 2-d lattice M) - sage: P2.change_ring(GF(101))._semigroup_ring(cone) + sage: P2.change_ring(GF(101))._semigroup_ring(cone) # needs fpylll (Multivariate Polynomial Ring in z0, z1 over Finite Field of size 101, Ideal (0) of Multivariate Polynomial Ring in z0, z1 over Finite Field of size 101, 2-d cone in 2-d lattice M) @@ -2560,7 +2567,7 @@ def Spec(self, cone=None, names=None): A more interesting example:: sage: A2Z2 = Cone([(0,1), (2,1)]) - sage: AffineToricVariety(A2Z2).Spec(names='u,v,t') + sage: AffineToricVariety(A2Z2).Spec(names='u,v,t') # needs fpylll Spectrum of Quotient of Multivariate Polynomial Ring in u, v, t over Rational Field by the ideal (-u*v + t^2) """ @@ -2594,10 +2601,10 @@ def affine_algebraic_patch(self, cone=None, names=None): sage: cone = Cone([(0,1), (2,1)]) sage: A2Z2 = AffineToricVariety(cone) - sage: A2Z2.affine_algebraic_patch() + sage: A2Z2.affine_algebraic_patch() # needs fpylll Closed subscheme of Affine Space of dimension 3 over Rational Field defined by: -z0*z1 + z2^2 - sage: A2Z2.affine_algebraic_patch(Cone([(0,1)]), names='x, y, t') + sage: A2Z2.affine_algebraic_patch(Cone([(0,1)]), names='x, y, t') # needs fpylll Closed subscheme of Affine Space of dimension 3 over Rational Field defined by: 1 """ @@ -3085,7 +3092,7 @@ def __init__(self, variety): True sage: TDiv.scheme().cohomology_ring() is X2.cohomology_ring() # this is where it gets tricky True - sage: TDiv.gen(0).Chern_character() * X2.cohomology_ring().one() + sage: TDiv.gen(0).Chern_character() * X2.cohomology_ring().one() # needs sage.libs.singular [1] """ self._variety = variety @@ -3147,6 +3154,7 @@ def _element_constructor_(self,x): EXAMPLES:: + sage: # needs sage.libs.singular sage: dP6 = toric_varieties.dP6() sage: H = dP6.cohomology_ring() sage: cone = dP6.fan().cone_containing(2,3); cone @@ -3164,6 +3172,7 @@ def _element_constructor_(self,x): coefficient is a multiple depending on the orbifold singularity. See also [CLS2011]_, Lemma 12.5.2:: + sage: # needs sage.libs.singular sage: P2_123 = toric_varieties.P2_123() sage: HH = P2_123.cohomology_ring() sage: HH(Cone([(1,0)])) * HH(Cone([(-2,-3)])) @@ -3179,6 +3188,7 @@ def _element_constructor_(self,x): Numbers will be converted into the ring:: + sage: # needs sage.libs.singular sage: P2 = toric_varieties.P2() sage: H = P2.cohomology_ring() sage: H._element_constructor_(1) @@ -3222,6 +3232,7 @@ def __call__(self, x, coerce=True): EXAMPLES:: + sage: # needs sage.libs.singular sage: P2 = toric_varieties.P2() sage: H = P2.cohomology_ring() sage: H(1) @@ -3245,7 +3256,7 @@ def gens(self): EXAMPLES:: sage: P2 = toric_varieties.P2() - sage: P2.cohomology_ring().gens() + sage: P2.cohomology_ring().gens() # needs sage.libs.singular ([z], [z], [z]) """ if "_gens" not in self.__dict__: @@ -3270,7 +3281,7 @@ def gen(self, i): EXAMPLES:: sage: P2 = toric_varieties.P2() - sage: P2.cohomology_ring().gen(2) + sage: P2.cohomology_ring().gen(2) # needs sage.libs.singular [z] """ return CohomologyClass(self, self._polynomial_ring.gen(i)) @@ -3295,9 +3306,9 @@ def is_CohomologyClass(x): sage: P2 = toric_varieties.P2() sage: HH = P2.cohomology_ring() sage: from sage.schemes.toric.variety import is_CohomologyClass - sage: is_CohomologyClass( HH.one() ) + sage: is_CohomologyClass( HH.one() ) # needs sage.libs.singular True - sage: is_CohomologyClass( HH(P2.fan(1)[0]) ) + sage: is_CohomologyClass( HH(P2.fan(1)[0]) ) # needs sage.libs.singular True sage: is_CohomologyClass('z') False @@ -3319,6 +3330,7 @@ class CohomologyClass(QuotientRingElement): EXAMPLES:: + sage: # needs sage.libs.singular sage: P2 = toric_varieties.P2() sage: P2.cohomology_ring().gen(0) [z] @@ -3348,7 +3360,7 @@ def __init__(self, cohomology_ring, representative): sage: P2 = toric_varieties.P2() sage: H = P2.cohomology_ring() sage: from sage.schemes.toric.variety import CohomologyClass - sage: CohomologyClass(H, H.defining_ideal().ring().zero() ) + sage: CohomologyClass(H, H.defining_ideal().ring().zero() ) # needs sage.libs.singular [0] """ assert representative in cohomology_ring.defining_ideal().ring(), \ @@ -3365,7 +3377,7 @@ def _repr_(self): EXAMPLES:: - sage: toric_varieties.P2().cohomology_ring().gen(0)._repr_() + sage: toric_varieties.P2().cohomology_ring().gen(0)._repr_() # needs sage.libs.singular '[z]' """ return '[' + super()._repr_() + ']' @@ -3380,8 +3392,8 @@ def _latex_(self): EXAMPLES:: - sage: cohomology_class = toric_varieties.P2().cohomology_ring().gen(0)^2/2 - sage: cohomology_class._latex_() + sage: cohomology_class = toric_varieties.P2().cohomology_ring().gen(0)^2/2 # needs sage.libs.singular + sage: cohomology_class._latex_() # needs sage.libs.singular '\\left[ \\frac{1}{2} z^{2} \\right]' """ return r'\left[ %s \right]' % latex(self.lift()) @@ -3399,9 +3411,9 @@ def deg(self): EXAMPLES:: sage: P2 = toric_varieties.P2() - sage: P2.cohomology_ring().gen(0).deg() + sage: P2.cohomology_ring().gen(0).deg() # needs sage.libs.singular 1 - sage: P2.cohomology_ring().zero().deg() + sage: P2.cohomology_ring().zero().deg() # needs sage.libs.singular -1 """ return self.lift().degree() @@ -3424,6 +3436,7 @@ def part_of_degree(self, d): EXAMPLES:: + sage: # needs sage.libs.singular sage: P1xP1 = toric_varieties.P1xP1() sage: t = P1xP1.cohomology_ring().gen(0) sage: y = P1xP1.cohomology_ring().gen(2) @@ -3460,6 +3473,7 @@ def exp(self): EXAMPLES:: + sage: # needs sage.libs.singular sage: P2 = toric_varieties.P2() sage: H_class = P2.cohomology_ring().gen(0) sage: H_class diff --git a/src/sage/schemes/toric/weierstrass_covering.py b/src/sage/schemes/toric/weierstrass_covering.py index 13e3c24b2c1..cc9caeeae4d 100644 --- a/src/sage/schemes/toric/weierstrass_covering.py +++ b/src/sage/schemes/toric/weierstrass_covering.py @@ -351,7 +351,7 @@ def WeierstrassMap_P1xP1(polynomial, variables=None): sage: f, g = WeierstrassForm_P1xP1(biquadric, [x0, x1, y0, y1]); (f,g) (-625/48*a^4 + 25/3*a^2 - 16/3, 15625/864*a^6 - 625/36*a^4 - 100/9*a^2 + 128/27) sage: X, Y, Z = WeierstrassMap_P1xP1(biquadric, [x0, x1, y0, y1]) - sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(biquadric)) + sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(biquadric)) # needs sage.libs.singular 0 sage: R = PolynomialRing(QQ, 'x,y,s,t', order='lex') @@ -361,7 +361,7 @@ def WeierstrassMap_P1xP1(polynomial, variables=None): ....: + t^2*(7*x^2+8*x*y+9*y^2)) sage: X, Y, Z = WeierstrassMap_P1xP1(equation, [x,y,s,t]) sage: f, g = WeierstrassForm_P1xP1(equation, variables=[x,y,s,t]) - sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) + sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) # needs sage.libs.singular 0 sage: R = PolynomialRing(QQ, 'x,s', order='lex') @@ -370,7 +370,7 @@ def WeierstrassMap_P1xP1(polynomial, variables=None): sage: equation = s^2*(x^2+2*x+3) + s*(4*x^2+5*x+6) + (7*x^2+8*x+9) sage: X, Y, Z = WeierstrassMap_P1xP1(equation) sage: f, g = WeierstrassForm_P1xP1(equation) - sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) + sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) # needs sage.libs.singular 0 """ x, y, s, t = _check_polynomial_P1xP1(polynomial, variables) @@ -425,7 +425,7 @@ def WeierstrassMap_P2_112(polynomial, variables=None): sage: equation = y^2 + a0*x^4 + 4*a1*x^3 + 6*a2*x^2 + 4*a3*x + a4 sage: X, Y, Z = WeierstrassMap_P2_112(equation, [x,y]) sage: f, g = WeierstrassForm_P2_112(equation, variables=[x,y]) - sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) + sage: (-Y^2 + X^3 + f*X*Z^4 + g*Z^6).reduce(R.ideal(equation)) # needs sage.libs.singular 0 Another example, this time in homogeneous coordinates:: @@ -441,7 +441,7 @@ def WeierstrassMap_P2_112(polynomial, variables=None): sage: WeierstrassForm_P2_112(C_eqn, [x,y,z,t]) (-97/48, 17/864) sage: X, Y, Z = WeierstrassMap_P2_112(C_eqn, [x,y,z,t]) - sage: (-Y^2 + X^3 - 97/48*X*Z^4 + 17/864*Z^6).reduce(C.defining_ideal()) + sage: (-Y^2 + X^3 - 97/48*X*Z^4 + 17/864*Z^6).reduce(C.defining_ideal()) # needs sage.libs.singular 0 """ x, y, z, t = _check_polynomial_P2_112(polynomial, variables)