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 Homsets 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 Homsets manually. Instead, use the
Hom()
method that is inherited by all
schemes.
AUTHORS:
 Volker Braun (20120218): 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: 2d CPRFano toric variety covered by 4 affine patches
To: 1d CPRFano 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 Homset can construct the morphism from the projection matrix alone:
sage: hom_set(matrix([[1],[0]]))
Scheme morphism:
From: 2d CPRFano toric variety covered by 4 affine patches
To: 1d CPRFano toric variety covered by 2 affine patches
Defn: Defined by sending Rational polyhedral fan in 2d lattice N
to Rational polyhedral fan in 1d lattice N.
sage: _.as_polynomial_map()
Scheme morphism:
From: 2d CPRFano toric variety covered by 4 affine patches
To: 1d CPRFano 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*xt*y])
sage: 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: 2d CPRFano 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: 2d CPRFano 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: 2d CPRFano toric variety covered by 3 affine patches
sage: type(native_to_toric)
<class 'sage.schemes.generic.homset.SchemeHomset_generic_with_category'>
sage: native_to_toric([u^2, v^2, w^2])
Scheme morphism:
From: Projective Space of dimension 2 over Rational Field
To: 2d CPRFano 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)¶ Bases:
sage.schemes.toric.homset.SchemeHomset_points_toric_base

cardinality
()¶ Return the number of points of the toric variety.
OUTPUT:
An integer or infinity. The cardinality of the set of points.
EXAMPLES:
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 : 2 : 1], [1 : 1 : 2], [1 : 3 : 3]] sage: cubic.point_set().cardinality() 6


class
sage.schemes.toric.homset.
SchemeHomset_points_toric_base
(X, Y, category=None, check=True, base=Integer Ring)¶ Bases:
sage.schemes.generic.homset.SchemeHomset_points
Base class for homsets with toric ambient spaces
INPUT:
 same as for
SchemeHomset_points
.
OUTPUT:
A scheme morphism of type
SchemeHomset_points_toric_base
.EXAMPLES:
sage: P1xP1 = toric_varieties.P1xP1() sage: P1xP1(QQ) Set of rational points of 2d CPRFano toric variety covered by 4 affine patches

is_finite
()¶ Return whether there are finitely many points.
OUTPUT:
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
 same as for

class
sage.schemes.toric.homset.
SchemeHomset_points_toric_field
(X, Y, category=None, check=True, base=Integer Ring)¶ Bases:
sage.schemes.toric.homset.SchemeHomset_points_toric_base
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:
 same as for
SchemeHomset_points
.
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 2d CPRFano toric variety covered by 4 affine patches sage: P1xP1(QQ) Set of rational points of 2d CPRFano 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 3rd 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]]
As for a noncompact example, the blowup 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]]
Toric varieties with torus factors (that is, where the fan is not fulldimensional) 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]]

cardinality
()¶ 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() 729 sage: V.change_ring(GF(101)).point_set().cardinality() 1061208
For nonsmooth 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
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 * (q1)**(nk) for k, dk in enumerate(d)) 57
Over infinite fields the number of points is not very tricky:
sage: V.count_points() +Infinity
ALGORITHM:
Uses the formula in Fulton [F], section 4.5.
REFERENCES:
[F] Fulton, W., “Introduction to Toric Varieties”, Princeton University Press, 1993. AUTHORS:
 Beth Malmskog (20130714)
 Adriana Salerno (20130714)
 Yiwei She (20130714)
 Christelle Vincent (20130714)
 Ursula Whitcher (20130714)
 same as for

class
sage.schemes.toric.homset.
SchemeHomset_toric_variety
(X, Y, category=None, check=True, base=Integer Ring)¶ Bases:
sage.schemes.generic.homset.SchemeHomset_generic
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: 2d CPRFano toric variety covered by 4 affine patches To: 1d CPRFano 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: 2d CPRFano toric variety covered by 4 affine patches To: 1d CPRFano toric variety covered by 2 affine patches Defn: Defined by sending Rational polyhedral fan in 2d lattice N to Rational polyhedral fan in 1d lattice N.