Skip to content

Commit

Permalink
sage.schemes: Update # needs
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Sep 16, 2023
1 parent 485b707 commit 37d1671
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 32 deletions.
6 changes: 3 additions & 3 deletions src/sage/schemes/toric/divisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1267,7 +1267,7 @@ def Kodaira_map(self, names='z'):
sage: P1.<u,v> = 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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/sage/schemes/toric/fano_variety.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 2 additions & 0 deletions src/sage/schemes/toric/homset.py
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ def __iter__(self):
EXAMPLES::
sage: # needs sage.libs.singular
sage: P2.<x,y,z> = toric_varieties.P2(base_ring=GF(5))
sage: cubic = P2.subscheme([x^3 + y^3 + z^3])
sage: list(cubic.point_set())
Expand All @@ -641,6 +642,7 @@ def cardinality(self):
EXAMPLES::
sage: # needs sage.libs.singular
sage: P2.<x,y,z> = toric_varieties.P2(base_ring=GF(5))
sage: cubic = P2.subscheme([x^3 + y^3 + z^3])
sage: list(cubic.point_set())
Expand Down
6 changes: 3 additions & 3 deletions src/sage/schemes/toric/points.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,16 +1007,16 @@ def cardinality(self):
sage: X.<u,v,w> = 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],
[1 : 1 : 6],
[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
Expand Down
1 change: 1 addition & 0 deletions src/sage/schemes/toric/toric_subscheme.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.<x,y> = AffineToricVariety(cone)
sage: A2Z2.affine_algebraic_patch()
Expand Down
54 changes: 34 additions & 20 deletions src/sage/schemes/toric/variety.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 ::
Expand Down Expand Up @@ -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__:
Expand Down Expand Up @@ -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()]
Expand Down Expand Up @@ -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) ]
Expand All @@ -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) ]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -2289,6 +2295,7 @@ def Euler_number(self):
EXAMPLES::
sage: # needs sage.libs.singular
sage: P1xP1 = toric_varieties.P1xP1()
sage: P1xP1.Euler_number()
4
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
"""
Expand Down Expand Up @@ -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
"""
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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)]))
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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__:
Expand All @@ -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))
Expand All @@ -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
Expand All @@ -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]
Expand Down Expand Up @@ -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(), \
Expand All @@ -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_() + ']'
Expand All @@ -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())
Expand All @@ -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()
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/sage/schemes/toric/weierstrass_covering.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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')
Expand All @@ -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)
Expand Down Expand Up @@ -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::
Expand All @@ -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)
Expand Down

0 comments on commit 37d1671

Please sign in to comment.