Set of homomorphisms between two toric varieties#

For schemes $$X$$ and $$Y$$, this module implements the set of morphisms $$Hom(X,Y)$$. This is done by SchemeHomset_generic.

As a special case, the Hom-sets can also represent the points of a scheme. Recall that the $$K$$-rational points of a scheme $$X$$ over $$k$$ can be identified with the set of morphisms $$Spec(K) \to X$$. In Sage, the rational points are implemented by such scheme morphisms. This is done by SchemeHomset_points and its subclasses.

Note

You should not create the Hom-sets manually. Instead, use the Hom() method that is inherited by all schemes.

AUTHORS:

• Volker Braun (2012-02-18): Initial version

EXAMPLES:

Here is a simple example, the projection of $$\mathbb{P}^1\times\mathbb{P}^1\to \mathbb{P}^1$$

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1 = toric_varieties.P1()
sage: hom_set = P1xP1.Hom(P1);  hom_set
Set of morphisms
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches

>>> from sage.all import *
>>> P1xP1 = toric_varieties.P1xP1()
>>> P1 = toric_varieties.P1()
>>> hom_set = P1xP1.Hom(P1);  hom_set
Set of morphisms
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches


In terms of the fan, we can define this morphism by the projection onto the first coordinate. The Hom-set can construct the morphism from the projection matrix alone:

sage: hom_set(matrix([[1],[0]]))
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
Defn: Defined by sending Rational polyhedral fan in 2-d lattice N
to Rational polyhedral fan in 1-d lattice N.
sage: _.as_polynomial_map()
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
Defn: Defined on coordinates by sending [s : t : x : y] to [s : t]

>>> from sage.all import *
>>> hom_set(matrix([[Integer(1)],[Integer(0)]]))
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
Defn: Defined by sending Rational polyhedral fan in 2-d lattice N
to Rational polyhedral fan in 1-d lattice N.
>>> _.as_polynomial_map()
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
Defn: Defined on coordinates by sending [s : t : x : y] to [s : t]


In the case of toric algebraic schemes (defined by polynomials in toric varieties), this module defines the underlying morphism of the ambient toric varieties:

sage: P1xP1.inject_variables()
Defining s, t, x, y
sage: S = P1xP1.subscheme([s*x - t*y])
sage: type(S.Hom(S))
<class 'sage.schemes.toric.homset.SchemeHomset_toric_variety_with_category'>

>>> from sage.all import *
>>> P1xP1.inject_variables()
Defining s, t, x, y
>>> S = P1xP1.subscheme([s*x - t*y])
>>> type(S.Hom(S))
<class 'sage.schemes.toric.homset.SchemeHomset_toric_variety_with_category'>


Finally, you can have morphisms defined through homogeneous coordinates where the codomain is not implemented as a toric variety:

sage: P2_toric.<x,y,z> = toric_varieties.P2()
sage: P2_native.<u,v,w> = ProjectiveSpace(QQ, 2)
sage: toric_to_native = P2_toric.Hom(P2_native);  toric_to_native
Set of morphisms
From: 2-d CPR-Fano toric variety covered by 3 affine patches
To:   Projective Space of dimension 2 over Rational Field
sage: type(toric_to_native)
<class 'sage.schemes.toric.homset.SchemeHomset_toric_variety_with_category'>
sage: toric_to_native([x^2, y^2, z^2])
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 3 affine patches
To:   Projective Space of dimension 2 over Rational Field
Defn: Defined on coordinates by sending [x : y : z] to (x^2 : y^2 : z^2)

sage: native_to_toric = P2_native.Hom(P2_toric);  native_to_toric
Set of morphisms
From: Projective Space of dimension 2 over Rational Field
To:   2-d CPR-Fano toric variety covered by 3 affine patches
sage: type(native_to_toric)
<class 'sage.schemes.projective.projective_homset.SchemeHomset_polynomial_projective_space_with_category'>
sage: native_to_toric([u^2, v^2, w^2])
Scheme morphism:
From: Projective Space of dimension 2 over Rational Field
To:   2-d CPR-Fano toric variety covered by 3 affine patches
Defn: Defined on coordinates by sending (u : v : w) to [u^2 : v^2 : w^2]

>>> from sage.all import *
>>> P2_toric = toric_varieties.P2(names=('x', 'y', 'z',)); (x, y, z,) = P2_toric._first_ngens(3)
>>> P2_native = ProjectiveSpace(QQ, Integer(2), names=('u', 'v', 'w',)); (u, v, w,) = P2_native._first_ngens(3)
>>> toric_to_native = P2_toric.Hom(P2_native);  toric_to_native
Set of morphisms
From: 2-d CPR-Fano toric variety covered by 3 affine patches
To:   Projective Space of dimension 2 over Rational Field
>>> type(toric_to_native)
<class 'sage.schemes.toric.homset.SchemeHomset_toric_variety_with_category'>
>>> toric_to_native([x**Integer(2), y**Integer(2), z**Integer(2)])
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 3 affine patches
To:   Projective Space of dimension 2 over Rational Field
Defn: Defined on coordinates by sending [x : y : z] to (x^2 : y^2 : z^2)

>>> native_to_toric = P2_native.Hom(P2_toric);  native_to_toric
Set of morphisms
From: Projective Space of dimension 2 over Rational Field
To:   2-d CPR-Fano toric variety covered by 3 affine patches
>>> type(native_to_toric)
<class 'sage.schemes.projective.projective_homset.SchemeHomset_polynomial_projective_space_with_category'>
>>> native_to_toric([u**Integer(2), v**Integer(2), w**Integer(2)])
Scheme morphism:
From: Projective Space of dimension 2 over Rational Field
To:   2-d CPR-Fano toric variety covered by 3 affine patches
Defn: Defined on coordinates by sending (u : v : w) to [u^2 : v^2 : w^2]

class sage.schemes.toric.homset.SchemeHomset_points_subscheme_toric_field(X, Y, category=None, check=True, base=Integer Ring)[source]#
cardinality()[source]#

Return the number of points of the toric variety.

OUTPUT:

An integer or infinity. The cardinality of the set of points.

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())
[[0 : 1 : 4], [1 : 0 : 4], [1 : 4 : 0], [1 : 1 : 2], [1 : 2 : 1], [1 : 3 : 3]]
sage: cubic.point_set().cardinality()
6

>>> from sage.all import *
>>> # needs sage.libs.singular
>>> P2 = toric_varieties.P2(base_ring=GF(Integer(5)), names=('x', 'y', 'z',)); (x, y, z,) = P2._first_ngens(3)
>>> cubic = P2.subscheme([x**Integer(3) + y**Integer(3) + z**Integer(3)])
>>> list(cubic.point_set())
[[0 : 1 : 4], [1 : 0 : 4], [1 : 4 : 0], [1 : 1 : 2], [1 : 2 : 1], [1 : 3 : 3]]
>>> cubic.point_set().cardinality()
6

class sage.schemes.toric.homset.SchemeHomset_points_toric_base(X, Y, category=None, check=True, base=Integer Ring)[source]#

Base class for homsets with toric ambient spaces.

INPUT:

OUTPUT: A scheme morphism of type SchemeHomset_points_toric_base.

EXAMPLES:

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1xP1(QQ)
Set of rational points of 2-d CPR-Fano toric variety
covered by 4 affine patches

>>> from sage.all import *
>>> P1xP1 = toric_varieties.P1xP1()
>>> P1xP1(QQ)
Set of rational points of 2-d CPR-Fano toric variety
covered by 4 affine patches

is_finite()[source]#

Return whether there are finitely many points.

OUTPUT: A boolean.

EXAMPLES:

sage: P2 = toric_varieties.P2()
sage: P2.point_set().is_finite()
False
sage: P2.change_ring(GF(7)).point_set().is_finite()
True

>>> from sage.all import *
>>> P2 = toric_varieties.P2()
>>> P2.point_set().is_finite()
False
>>> P2.change_ring(GF(Integer(7))).point_set().is_finite()
True

class sage.schemes.toric.homset.SchemeHomset_points_toric_field(X, Y, category=None, check=True, base=Integer Ring)[source]#

Set of rational points of a toric variety.

You should not use this class directly. Instead, use the point_set() method to construct the point set of a toric variety.

INPUT:

OUTPUT: A scheme morphism of type SchemeHomset_points_toric_field.

EXAMPLES:

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1xP1.point_set()
Set of rational points of 2-d CPR-Fano toric variety
covered by 4 affine patches
sage: P1xP1(QQ)
Set of rational points of 2-d CPR-Fano toric variety
covered by 4 affine patches

>>> from sage.all import *
>>> P1xP1 = toric_varieties.P1xP1()
>>> P1xP1.point_set()
Set of rational points of 2-d CPR-Fano toric variety
covered by 4 affine patches
>>> P1xP1(QQ)
Set of rational points of 2-d CPR-Fano toric variety
covered by 4 affine patches


The quotient $$\mathbb{P}^2 / \ZZ_3$$ over $$GF(7)$$ by the diagonal action. This is tricky because the base field has a 3-rd root of unity:

sage: fan = NormalFan(ReflexivePolytope(2, 0))
sage: X = ToricVariety(fan, base_field=GF(7))
sage: point_set = X.point_set()
sage: point_set.cardinality()
21
sage: sorted(X.point_set().list())
[[0 : 0 : 1], [0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 3],
[1 : 0 : 0], [1 : 0 : 1], [1 : 0 : 3], [1 : 1 : 0],
[1 : 1 : 1], [1 : 1 : 2], [1 : 1 : 3], [1 : 1 : 4],
[1 : 1 : 5], [1 : 1 : 6], [1 : 3 : 0], [1 : 3 : 1],
[1 : 3 : 2], [1 : 3 : 3], [1 : 3 : 4], [1 : 3 : 5],
[1 : 3 : 6]]

>>> from sage.all import *
>>> fan = NormalFan(ReflexivePolytope(Integer(2), Integer(0)))
>>> X = ToricVariety(fan, base_field=GF(Integer(7)))
>>> point_set = X.point_set()
>>> point_set.cardinality()
21
>>> sorted(X.point_set().list())
[[0 : 0 : 1], [0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 3],
[1 : 0 : 0], [1 : 0 : 1], [1 : 0 : 3], [1 : 1 : 0],
[1 : 1 : 1], [1 : 1 : 2], [1 : 1 : 3], [1 : 1 : 4],
[1 : 1 : 5], [1 : 1 : 6], [1 : 3 : 0], [1 : 3 : 1],
[1 : 3 : 2], [1 : 3 : 3], [1 : 3 : 4], [1 : 3 : 5],
[1 : 3 : 6]]


As for a non-compact example, the blow-up of the plane is the line bundle $$O_{\mathbf{P}^1}(-1)$$. Its point set is the Cartesian product of the points on the base $$\mathbf{P}^1$$ with the points on the fiber:

sage: fan = Fan([Cone([(1,0), (1,1)]), Cone([(1,1), (0,1)])])
sage: blowup_plane = ToricVariety(fan, base_ring=GF(3))
sage: point_set = blowup_plane.point_set()
sage: sorted(point_set.list())
[[0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 2],
[1 : 0 : 0], [1 : 0 : 1], [1 : 0 : 2],
[1 : 1 : 0], [1 : 1 : 1], [1 : 1 : 2],
[1 : 2 : 0], [1 : 2 : 1], [1 : 2 : 2]]

>>> from sage.all import *
>>> fan = Fan([Cone([(Integer(1),Integer(0)), (Integer(1),Integer(1))]), Cone([(Integer(1),Integer(1)), (Integer(0),Integer(1))])])
>>> blowup_plane = ToricVariety(fan, base_ring=GF(Integer(3)))
>>> point_set = blowup_plane.point_set()
>>> sorted(point_set.list())
[[0 : 1 : 0], [0 : 1 : 1], [0 : 1 : 2],
[1 : 0 : 0], [1 : 0 : 1], [1 : 0 : 2],
[1 : 1 : 0], [1 : 1 : 1], [1 : 1 : 2],
[1 : 2 : 0], [1 : 2 : 1], [1 : 2 : 2]]


Toric varieties with torus factors (that is, where the fan is not full-dimensional) also work:

sage: F_times_Fstar = ToricVariety(Fan([Cone([(1,0)])]), base_field=GF(3))
sage: sorted(F_times_Fstar.point_set().list())
[[0 : 1], [0 : 2], [1 : 1], [1 : 2], [2 : 1], [2 : 2]]

>>> from sage.all import *
>>> F_times_Fstar = ToricVariety(Fan([Cone([(Integer(1),Integer(0))])]), base_field=GF(Integer(3)))
>>> sorted(F_times_Fstar.point_set().list())
[[0 : 1], [0 : 2], [1 : 1], [1 : 2], [2 : 1], [2 : 2]]

cardinality()[source]#

Return the number of points of the toric variety.

OUTPUT:

An integer or infinity. The cardinality of the set of points.

EXAMPLES:

sage: o = lattice_polytope.cross_polytope(3)
sage: V = ToricVariety(FaceFan(o))
sage: V.change_ring(GF(2)).point_set().cardinality()
27
sage: V.change_ring(GF(8, "a")).point_set().cardinality()                   # needs sage.rings.finite_rings
729
sage: V.change_ring(GF(101)).point_set().cardinality()
1061208

>>> from sage.all import *
>>> o = lattice_polytope.cross_polytope(Integer(3))
>>> V = ToricVariety(FaceFan(o))
>>> V.change_ring(GF(Integer(2))).point_set().cardinality()
27
>>> V.change_ring(GF(Integer(8), "a")).point_set().cardinality()                   # needs sage.rings.finite_rings
729
>>> V.change_ring(GF(Integer(101))).point_set().cardinality()
1061208


For non-smooth varieties over finite fields, the homogeneous rescalings are solved. This is somewhat slower:

sage: fan = NormalFan(ReflexivePolytope(2, 0))
sage: X = ToricVariety(fan, base_field=GF(7))
sage: X.point_set().cardinality()
21

>>> from sage.all import *
>>> fan = NormalFan(ReflexivePolytope(Integer(2), Integer(0)))
>>> X = ToricVariety(fan, base_field=GF(Integer(7)))
>>> X.point_set().cardinality()
21


Fulton’s formula does not apply since the variety is not smooth. And, indeed, naive application gives a different result:

sage: q = X.base_ring().order()
sage: n = X.dimension()
sage: d = map(len, fan().cones())
sage: sum(dk * (q-1)**(n-k) for k, dk in enumerate(d))
57

>>> from sage.all import *
>>> q = X.base_ring().order()
>>> n = X.dimension()
>>> d = map(len, fan().cones())
>>> sum(dk * (q-Integer(1))**(n-k) for k, dk in enumerate(d))
57


Over infinite fields the number of points is not very tricky:

sage: V.count_points()
+Infinity

>>> from sage.all import *
>>> V.count_points()
+Infinity


ALGORITHM:

Uses the formula in Fulton [Ful1993], section 4.5.

AUTHORS:

• Beth Malmskog (2013-07-14)

• Adriana Salerno (2013-07-14)

• Yiwei She (2013-07-14)

• Christelle Vincent (2013-07-14)

• Ursula Whitcher (2013-07-14)

class sage.schemes.toric.homset.SchemeHomset_toric_variety(X, Y, category=None, check=True, base=Integer Ring)[source]#

Set of homomorphisms between two toric varieties.

EXAMPLES:

sage: P1xP1 = toric_varieties.P1xP1()
sage: P1 = toric_varieties.P1()
sage: hom_set = P1xP1.Hom(P1);  hom_set
Set of morphisms
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
sage: type(hom_set)
<class 'sage.schemes.toric.homset.SchemeHomset_toric_variety_with_category'>

sage: hom_set(matrix([[1],[0]]))
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
Defn: Defined by sending Rational polyhedral fan in 2-d lattice N
to Rational polyhedral fan in 1-d lattice N.

>>> from sage.all import *
>>> P1xP1 = toric_varieties.P1xP1()
>>> P1 = toric_varieties.P1()
>>> hom_set = P1xP1.Hom(P1);  hom_set
Set of morphisms
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
>>> type(hom_set)
<class 'sage.schemes.toric.homset.SchemeHomset_toric_variety_with_category'>

>>> hom_set(matrix([[Integer(1)],[Integer(0)]]))
Scheme morphism:
From: 2-d CPR-Fano toric variety covered by 4 affine patches
To:   1-d CPR-Fano toric variety covered by 2 affine patches
Defn: Defined by sending Rational polyhedral fan in 2-d lattice N
to Rational polyhedral fan in 1-d lattice N.