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
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]
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'>
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]
- class sage.schemes.toric.homset.SchemeHomset_points_subscheme_toric_field(X, Y, category=None, check=True, base=Integer Ring)#
Bases:
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)) # optional - sage.rings.finite_rings sage: cubic = P2.subscheme([x^3 + y^3 + z^3]) # optional - sage.rings.finite_rings sage: list(cubic.point_set()) # optional - sage.rings.finite_rings [[0 : 1 : 4], [1 : 0 : 4], [1 : 4 : 0], [1 : 1 : 2], [1 : 2 : 1], [1 : 3 : 3]] sage: cubic.point_set().cardinality() # optional - sage.rings.finite_rings 6
- class sage.schemes.toric.homset.SchemeHomset_points_toric_base(X, Y, category=None, check=True, base=Integer Ring)#
Bases:
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 2-d CPR-Fano toric variety covered by 4 affine patches
- is_finite()#
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() # optional - sage.rings.finite_rings True
- class sage.schemes.toric.homset.SchemeHomset_points_toric_field(X, Y, category=None, check=True, base=Integer Ring)#
Bases:
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 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
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)) # optional - sage.rings.finite_rings sage: point_set = X.point_set() # optional - sage.rings.finite_rings sage: point_set.cardinality() # optional - sage.rings.finite_rings 21 sage: sorted(X.point_set().list()) # optional - sage.rings.finite_rings [[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)) # optional - sage.rings.finite_rings sage: point_set = blowup_plane.point_set() # optional - sage.rings.finite_rings sage: sorted(point_set.list()) # optional - sage.rings.finite_rings [[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)) # optional - sage.rings.finite_rings sage: sorted(F_times_Fstar.point_set().list()) # optional - sage.rings.finite_rings [[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() # optional - sage.rings.finite_rings 27 sage: V.change_ring(GF(8, "a")).point_set().cardinality() # optional - sage.rings.finite_rings 729 sage: V.change_ring(GF(101)).point_set().cardinality() # optional - sage.rings.finite_rings 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)) # optional - sage.rings.finite_rings sage: X.point_set().cardinality() # optional - sage.rings.finite_rings 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() # optional - sage.rings.finite_rings sage: n = X.dimension() # optional - sage.rings.finite_rings sage: d = map(len, fan().cones()) # optional - sage.rings.finite_rings sage: sum(dk * (q-1)**(n-k) for k, dk in enumerate(d)) # optional - sage.rings.finite_rings 57
Over infinite fields the number of points is not very tricky:
sage: 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)#
Bases:
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: 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.