# Ticket #11599: trac_11599_remaining_fixes.patch

File trac_11599_remaining_fixes.patch, 15.9 KB (added by vbraun, 10 years ago)

Initial patch

• ## doc/en/reference/schemes.rst

# HG changeset patch
# User Volker Braun <vbraun@stp.dias.ie>
# Date 1329691392 28800
# Parent  e7de36bc238097cde068ff033d5c3791cdfe134b
Trac #11599: Toric morphisms

Fixes for various issues that the reviewer brought up

diff --git a/doc/en/reference/schemes.rst b/doc/en/reference/schemes.rst
 a sage/schemes/generic/ambient_space sage/schemes/generic/affine_space sage/schemes/generic/projective_space sage/schemes/generic/toric_variety sage/schemes/generic/fano_toric_variety sage/schemes/generic/toric_variety sage/schemes/generic/fano_toric_variety sage/schemes/generic/toric_variety_library sage/schemes/generic/toric_divisor sage/schemes/generic/toric_chow_group sage/schemes/generic/toric_ideal sage/schemes/generic/toric_morphism sage/schemes/generic/algebraic_scheme sage/schemes/generic/hypersurface
• ## sage/schemes/generic/algebraic_scheme.py

diff --git a/sage/schemes/generic/algebraic_scheme.py b/sage/schemes/generic/algebraic_scheme.py
 a """ return "Subscheme of %s"%self.__A def _homset(self, *args, **kwds): """ Construct the Hom-set INPUT: Same as :class:sage.schemes.generic.homset.SchemeHomset_generic. OUTPUT: The Hom-set of the ambient space. EXAMPLES:: sage: P1. = toric_varieties.P1() sage: type(P1.Hom(P1)) sage: X = P1.subscheme(x-y) sage: type(X.Hom(X)) """ return self.__A._homset(*args, **kwds) def _point_homset(self, *args, **kwds): return self.__A._point_homset(*args, **kwds) INPUT: - same as for :class:~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety. :class:~sage.schemes.generic.toric_morphism.SchemeMorphism_polynomial_toric_variety. OUPUT: - :class:~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety. - :class:~sage.schemes.generic.toric_morphism.SchemeMorphism_polynomial_toric_variety. TESTS:: Defining z0, z1, z2, z3 sage: P1 = P1xP1.subscheme(z0-z2) sage: H = P1.Hom(P1xP1) sage: H([z0,z1,z0,z3]) Scheme morphism: From: Closed subscheme of 2-d toric variety covered by 4 affine patches defined by: z0 - z2 To:   2-d toric variety covered by 4 affine patches Defn: Defined on coordinates by sending [z0 : z1 : z2 : z3] to [z2 : z1 : z2 : z3] sage: P1._morphism(H, [z0,z1,z0,z3]) Scheme morphism: From: Closed subscheme of 2-d toric variety from sage.schemes.generic.toric_morphism import SchemeMorphism_polynomial_toric_variety return SchemeMorphism_polynomial_toric_variety(*args, **kwds) def fan(self): """ Return the fan of the ambient space. OUTPUT: A fan. EXAMPLES:: sage: P2. = toric_varieties.P(2) sage: E = P2.subscheme([x^2+y^2+z^2]) sage: E.fan() Rational polyhedral fan in 2-d lattice N """ return self.ambient_space().fan() def affine_patch(self, i): r""" Return the i-th affine patch of self as an affine
• ## sage/schemes/generic/scheme.py

diff --git a/sage/schemes/generic/scheme.py b/sage/schemes/generic/scheme.py
 a #***************************************************************************** from sage.misc.all import cached_method from sage.structure.parent import Parent from sage.misc.all import cached_method from sage.rings.all import (IntegerRing, is_CommutativeRing,
• ## sage/schemes/generic/toric_homset.py

diff --git a/sage/schemes/generic/toric_homset.py b/sage/schemes/generic/toric_homset.py
 a You should not create the Hom-sets manually. Instead, use the :meth:~sage.structure.parent.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)) """ #***************************************************************************** #       Copyright (C) 2010 Volker Braun #       Copyright (C) 2010 Andrey Novoseltsev # #  Distributed under the terms of the GNU General Public License (GPL) #  as published by the Free Software Foundation; either version 2 of #  the License, or (at your option) any later version. #                  http://www.gnu.org/licenses/ #***************************************************************************** from sage.rings.all import ZZ, is_RingHomomorphism from sage.matrix.matrix import is_Matrix from sage.matrix.matrix_space import MatrixSpace 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: 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) 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 the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N. """ def __init__(self, X, Y, category=None, check=True, base=ZZ): """ The Python constructor. INPUT: The same as for any homset, see :mod:~sage.categories.homset. 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 An integral matrix defines a fan morphism, since we think of the matrix as a linear map on the toric lattice. This is why we need to register_conversion in the constructor below. The result is:: 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. """ SchemeHomset_generic.__init__(self, X, Y, category=category, check=check, base=base) self.register_conversion(MatrixSpace(ZZ, X.fan().dim(), Y.fan().dim())) sage: dP8. = toric_varieties.dP8() sage: P2. = toric_varieties.P2() sage: Hom = dP8.Hom(P2) sage: hom_set = dP8.Hom(P2) sage: fm = FanMorphism(identity_matrix(2), dP8.fan(), P2.fan()) sage: Hom(fm) sage: hom_set(fm)     # calls hom_set._element_constructor_() Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To:   2-d CPR-Fano toric variety covered by 3 affine patches Defn: Defined by sending the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 2-d lattice N. A matrix will automatically be converted to a fan morphism:: sage: Hom(identity_matrix(2)) sage: hom_set(identity_matrix(2)) Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To:   2-d CPR-Fano toric variety covered by 3 affine patches Defn: Defined by sending the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 2-d lattice N. Alternatively, one can use homogeneous polynomials to define morphisms:: Defining y0, y1, y2 sage: dP8.inject_variables() Defining t, x0, x1, x2 sage: Hom([x0,x1,x2]) sage: hom_set([x0,x1,x2]) Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To:   2-d CPR-Fano toric variety covered by 3 affine patches Defn: y0 |--> x0 y1 |--> x1 y2 |--> x2 sage: Hom(ring_hom) sage: hom_set(ring_hom) Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To:   2-d CPR-Fano toric variety covered by 3 affine patches
• ## sage/schemes/generic/toric_morphism.py

diff --git a/sage/schemes/generic/toric_morphism.py b/sage/schemes/generic/toric_morphism.py
 a Scheme morphism: From: 1-d CPR-Fano toric variety covered by 2 affine patches To:   2-d CPR-Fano toric variety covered by 3 affine patches Defn: Defined by sending the Rational polyhedral fan in 1-d lattice N Defn: Defined by sending Rational polyhedral fan in 1-d lattice N to Rational polyhedral fan in 2-d lattice N. The fan morphism map is equivalent to the following polynomial map:: Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To:   2-d CPR-Fano toric variety covered by 3 affine patches Defn: Defined by sending the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 2-d lattice N. sage: type(f) 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 the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N. sage: P1xP1.hom(fm, P1) 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 the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N. """ 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 the Rational polyhedral fan in 2-d lattice N Defn: Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N. """ SchemeMorphism.__init__(self, parent) sage: P1 = toric_varieties.P1() sage: f = P1xP1.hom(matrix([[1],[0]]), P1) sage: f._repr_defn() 'Defined by sending the Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N.' 'Defined by sending Rational polyhedral fan in 2-d lattice N to Rational polyhedral fan in 1-d lattice N.' """ s  = 'Defined by sending the ' s  = 'Defined by sending ' s += str(self.domain().fan()) s += ' to ' s += str(self.codomain().fan())
• ## sage/schemes/generic/toric_variety.py

diff --git a/sage/schemes/generic/toric_variety.py b/sage/schemes/generic/toric_variety.py
 a To:   1-d CPR-Fano toric variety covered by 2 affine patches sage: type(hom_set) """ This is also the Hom-set for algebraic subschemes of toric varieties:: sage: P1xP1.inject_variables() Defining s, t, x, y sage: P1 = P1xP1.subscheme(s-t) sage: hom_set = P1xP1.Hom(P1) sage: hom_set([s,s,x,y]) Scheme morphism: From: 2-d CPR-Fano toric variety covered by 4 affine patches To:   Closed subscheme of 2-d CPR-Fano toric variety covered by 4 affine patches defined by: s - t Defn: Defined on coordinates by sending [s : t : x : y] to [s : s : x : y] sage: hom_set = P1.Hom(P1) sage: hom_set([s,s,x,y]) Scheme endomorphism of Closed subscheme of 2-d CPR-Fano toric variety covered by 4 affine patches defined by: s - t Defn: Defined on coordinates by sending [s : t : x : y] to [t : t : x : y] """ from sage.schemes.generic.toric_homset import SchemeHomset_toric_variety return SchemeHomset_toric_variety(*args, **kwds)