Ticket #11599: trac_11599_rename_morphisms.patch

File trac_11599_rename_morphisms.patch, 57.9 KB (added by vbraun, 10 years ago)

Updated patch

  • sage/categories/schemes.py

    # HG changeset patch
    # User Volker Braun <vbraun@stp.dias.ie>
    # Date 1325186017 0
    # Node ID 52a79e5b812ebdb5ba5c2e171f443755436d00d8
    # Parent  dd7ba3292816a0b666e85d567626efb21f56e045
    Trac #11599: Rename morphism classes
    
    The scheme morphisms that are points are currently called
    SchemeMorphism_coordinates and the more generic
    morphisms are SchemeMorphism_on_points, which I find very
    confusing. Similar with _point_morphism_class which does
    not(!) construct the morphism Spec(K)->X.
    
    This patch renames
    SchemeMorphism_coordinates_... -> SchemeMorphism_point_...
    _point_morphism_class -> _morphism_class
    _homset_class -> _point_homset_class
    
    diff --git a/sage/categories/schemes.py b/sage/categories/schemes.py
    a b  
    163163                the parent for Hom(R, S) to be in a different class::
    164164
    165165                    sage: Hom(Spec(ZZ), Spec(ZZ)).__class__
    166                     <class 'sage.schemes.generic.homset.SchemeHomset_coordinates_with_category'>
     166                    <class 'sage.schemes.generic.homset.SchemeHomset_points_spec_with_category'>
    167167
    168168                Currently, and to minimize the changes, this is done
    169169                by delegating the job to SchemeHomset. This is not
  • sage/schemes/elliptic_curves/ell_generic.py

    diff --git a/sage/schemes/elliptic_curves/ell_generic.py b/sage/schemes/elliptic_curves/ell_generic.py
    a b  
    167167        # purposes.
    168168        from sage.rings.all import is_FiniteField, is_IntegerModRing
    169169        if is_FiniteField(K) or is_IntegerModRing(K):
    170             self._point_morphism_class = self._point_class = ell_point.EllipticCurvePoint_finite_field
     170            self._morphism_class = self._point_class = ell_point.EllipticCurvePoint_finite_field
    171171        elif K.is_field():
    172172            if is_NumberField(K):
    173                 self._point_morphism_class = self._point_class = ell_point.EllipticCurvePoint_number_field
     173                self._morphism_class = self._point_class = ell_point.EllipticCurvePoint_number_field
    174174            else:
    175                 self._point_morphism_class = self._point_class = ell_point.EllipticCurvePoint_field
     175                self._morphism_class = self._point_class = ell_point.EllipticCurvePoint_field
    176176        else:
    177             self._point_morphism_class = self._point_class = ell_point.EllipticCurvePoint
     177            self._morphism_class = self._point_class = ell_point.EllipticCurvePoint
    178178
    179179    def _defining_params_(self):
    180180        r"""
     
    850850        else:
    851851            raise ValueError, "No point with x-coordinate %s on %s"%(x, self)
    852852
    853     def _homset_class(self, *args, **kwds):
     853    def _point_homset_class(self, *args, **kwds):
    854854        r"""
    855855        Internal function. Returns the (abstract) group of points on this
    856856        elliptic curve over a ring.
     
    858858        EXAMPLES::
    859859       
    860860            sage: E=EllipticCurve(GF(5),[1,1])
    861             sage: E._homset_class(Spec(GF(5^10,'a'),GF(5)), E)
     861            sage: E._point_homset_class(Spec(GF(5^10,'a'),GF(5)), E)
    862862            Abelian group of points on Elliptic Curve defined
    863863            by y^2 = x^3 + x + 1 over Finite Field in a of size 5^10
    864864        """
    865         return homset.SchemeHomsetModule_abelian_variety_coordinates_field(*args, **kwds)
     865        return homset.SchemeHomset_points_abelian_variety_field(*args, **kwds)
    866866
    867867    def __getitem__(self, n):
    868868        r"""
  • sage/schemes/elliptic_curves/ell_point.py

    diff --git a/sage/schemes/elliptic_curves/ell_point.py b/sage/schemes/elliptic_curves/ell_point.py
    a b  
    1414fields.
    1515
    1616The class ``EllipticCurvePoint``, which is based on
    17 ``SchemeMorphism_projective_coordinates_ring``, currently has little
    18 extra functionality.
     17``SchemeMorphism_point_projective_ring``, currently has little extra
     18functionality.
    1919
    2020EXAMPLES:
    2121
     
    136136from sage.structure.sequence  import Sequence
    137137
    138138from sage.schemes.plane_curves.projective_curve import Hasse_bounds
    139 from sage.schemes.generic.morphism import (SchemeMorphism_projective_coordinates_ring,
    140                                            SchemeMorphism_abelian_variety_coordinates_field,
    141                                            is_SchemeMorphism, SchemeMorphism_coordinates)
     139from sage.schemes.generic.morphism import (SchemeMorphism_point_projective_ring,
     140                                           SchemeMorphism_point_abelian_variety_field,
     141                                           is_SchemeMorphism)
    142142
    143143from constructor import EllipticCurve
    144144                                           
    145145oo = rings.infinity       # infinity
    146146
    147 class EllipticCurvePoint(SchemeMorphism_projective_coordinates_ring):
     147class EllipticCurvePoint(SchemeMorphism_point_projective_ring):
    148148    """
    149149    A point on an elliptic curve.
    150150    """
     
    171171            return -1
    172172
    173173
    174 class EllipticCurvePoint_field(SchemeMorphism_abelian_variety_coordinates_field):
     174class EllipticCurvePoint_field(SchemeMorphism_point_abelian_variety_field):
    175175    """
    176176    A point on an elliptic curve over a field.  The point has coordinates
    177177    in the base field.
     
    269269            #v = (R.zero(),R.one(),R.zero())
    270270            v = (0,1,0)
    271271        if check:
    272             # mostly from SchemeMorphism_projective_coordinates_field
     272            # mostly from SchemeMorphism_point_projective_field
    273273            d = point_homset.codomain().ambient_space().ngens()
    274274            if not isinstance(v,(list,tuple)):
    275275                raise TypeError, \
     
    303303            if not test == 0:
    304304                raise TypeError, "Coordinates %s do not define a point on %s"%(list(v),curve)
    305305               
    306         SchemeMorphism_abelian_variety_coordinates_field.__init__(self, point_homset, v, check=False)
     306        SchemeMorphism_point_abelian_variety_field.__init__(self, point_homset, v, check=False)
    307307        #AdditiveGroupElement.__init__(self, point_homset)
    308308       
    309309    def _repr_(self):
  • sage/schemes/generic/affine_space.py

    diff --git a/sage/schemes/generic/affine_space.py b/sage/schemes/generic/affine_space.py
    a b  
    240240            raise TypeError, "Second argument (= %s) must be a finite field."%F
    241241        return [ P for P in self.base_extend(F) ]
    242242
    243     def _point_morphism_class(self, *args, **kwds):
    244         return morphism.SchemeMorphism_on_points_affine_space(*args, **kwds)
    245 
    246243    def __cmp__(self, right):
    247244        """
     245        Compare ``self`` with ``right``.
     246
    248247        EXAMPLES::
    249248       
    250249            sage: AffineSpace(QQ, 3, 'a') == AffineSpace(ZZ, 3, 'a')
     
    275274        """
    276275        return "\\mathbf{A}_{%s}^%s"%(latex(self.base_ring()), self.dimension_relative())
    277276   
    278     def _homset_class(self, *args, **kwds):
    279         return homset.SchemeHomset_affine_coordinates(*args, **kwds)
     277    def _morphism_class(self, *args, **kwds):
     278        """
     279        Construct a morphism determined by action on points of ``self``.
     280
     281        INPUT:
     282
     283        Same as for
     284        :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_affine_space`.
     285
     286        OUPUT:
     287
     288        A new instance of
     289        :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_affine_space`.
     290
     291        EXAMPLES::
     292
     293            sage: AA = AffineSpace(QQ, 3, 'a')
     294            sage: AA.inject_variables()
     295            Defining a0, a1, a2
     296            sage: EndAA = AA.Hom(AA)
     297            sage: AA._morphism_class(EndAA, [a0*a1, a1*a2, a0*a2])
     298            Scheme endomorphism of Affine Space of dimension 3 over Rational Field
     299              Defn: Defined on coordinates by sending (a0, a1, a2) to
     300                    (a0*a1, a1*a2, a0*a2)
     301        """
     302        return morphism.SchemeMorphism_polynomial_affine_space(*args, **kwds)
     303
     304    def _point_homset_class(self, *args, **kwds):
     305        """
     306        Construct a Hom-space for ``self``.
     307       
     308        INPUT:
     309
     310        Same as for
     311        :class:`~sage.schemes.generic.homset.SchemeHomset_points_affine`.
     312
     313        OUPUT:
     314
     315        A new instance of
     316        :class:`~sage.schemes.generic.homset.SchemeHomset_points_affine`.
     317
     318        EXAMPLES::
     319         
     320            sage: AA = AffineSpace(QQ, 3, 'a')
     321            sage: AA._point_homset_class(Spec(QQ), AA)
     322            Set of rational points of Affine Space of dimension 3 over Rational Field
     323        """
     324        return homset.SchemeHomset_points_affine(*args, **kwds)
    280325
    281326    def _point_class(self, *args, **kwds):
    282         return morphism.SchemeMorphism_affine_coordinates(*args, **kwds)
     327        r"""
     328        Construct a point of ``self``.
     329
     330        INPUT:
     331
     332        Same as for
     333        :class:`~sage.schemes.generic.morphism.SchemeMorphism_point_affine`.
     334
     335        OUPUT:
     336
     337        A new instance of
     338        :class:`~sage.schemes.generic.morphism.SchemeMorphism_point_affine`.
     339
     340        TESTS::
     341
     342            sage: AA = AffineSpace(QQ, 3, 'a')
     343            sage: AA._point_class(AA.point_homset(), [0,1,2])
     344            (0, 1, 2)
     345        """
     346        return morphism.SchemeMorphism_point_affine(*args, **kwds)
    283347
    284348    def _repr_(self):
    285349        """
  • sage/schemes/generic/algebraic_scheme.py

    diff --git a/sage/schemes/generic/algebraic_scheme.py b/sage/schemes/generic/algebraic_scheme.py
    a b  
    521521        """
    522522        return "Subscheme of %s"%self.__A
    523523
    524     def _homset_class(self, *args, **kwds):
    525         return self.__A._homset_class(*args, **kwds)
     524    def _point_homset_class(self, *args, **kwds):
     525        return self.__A._point_homset_class(*args, **kwds)
    526526
    527527    def _point_class(self, *args, **kwds):
    528528        return self.__A._point_class(*args, **kwds)
     
    14721472          x^2 - y*z
    14731473    """
    14741474
    1475     def _point_morphism_class(self, *args, **kwds):
    1476         return morphism.SchemeMorphism_on_points_affine_space(*args, **kwds)
     1475    def _morphism_class(self, *args, **kwds):
     1476        return morphism.SchemeMorphism_polynomial_affine_space(*args, **kwds)
    14771477
    14781478    def dimension(self):
    14791479        """
     
    16681668          x^2 - y*z
    16691669    """
    16701670
    1671     def _point_morphism_class(self, *args, **kwds):
     1671    def _morphism_class(self, *args, **kwds):
    16721672        r"""
    16731673        Construct a morphism determined by action on points of ``self``.
    16741674
     
    16771677        INPUT:
    16781678
    16791679        - same as for
    1680           :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_projective_space`.
     1680          :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_projective_space`.
    16811681
    16821682        OUPUT:
    16831683
    1684         - :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_projective_space`.
     1684        - :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_projective_space`.
    16851685
    16861686        TESTS::
    16871687
     
    16941694              To:   Projective Space of dimension 2 over Rational Field
    16951695              Defn: Defined on coordinates by sending (x : y) to
    16961696                (x^2 : x*y : y^2)
    1697             sage: P1._point_morphism_class(H12, [x^2,x*y, y^2])
     1697            sage: P1._morphism_class(H12, [x^2,x*y, y^2])
    16981698            Scheme morphism:
    16991699              From: Projective Space of dimension 1 over Rational Field
    17001700              To:   Projective Space of dimension 2 over Rational Field
    17011701              Defn: Defined on coordinates by sending (x : y) to
    17021702                (x^2 : x*y : y^2)
    17031703        """
    1704         return morphism.SchemeMorphism_on_points_projective_space(*args, **kwds)
     1704        return morphism.SchemeMorphism_polynomial_projective_space(*args, **kwds)
    17051705
    17061706    def dimension(self):
    17071707        """
     
    20502050        super(AlgebraicScheme_subscheme_toric, self).__init__(toric_variety,
    20512051                                                              polynomials)
    20522052
    2053     def _point_morphism_class(self, *args, **kwds):
     2053    def _morphism_class(self, *args, **kwds):
    20542054        r"""
    20552055        Construct a morphism determined by action on points of ``self``.
    20562056
    20572057        INPUT:
    20582058
    20592059        - same as for
    2060           :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_toric_variety`.
     2060          :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety`.
    20612061
    20622062        OUPUT:
    20632063
    2064         - :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_toric_variety`.
     2064        - :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety`.
    20652065
    20662066        TESTS::
    20672067
     
    20712071            Defining z0, z1, z2, z3
    20722072            sage: P1 = P1xP1.subscheme(z0-z2)
    20732073            sage: H = P1.Hom(P1xP1)
    2074             sage: P1._point_morphism_class(H, [z0,z1,z0,z3])
     2074            sage: P1._morphism_class(H, [z0,z1,z0,z3])
    20752075            Scheme morphism:
    20762076              From: Closed subscheme of 2-d toric variety
    20772077              covered by 4 affine patches defined by:
     
    20802080              Defn: Defined on coordinates by sending [z0 : z1 : z2 : z3] to
    20812081                    [z2 : z1 : z2 : z3]
    20822082        """
    2083         from sage.schemes.generic.toric_morphism import SchemeMorphism_on_points_toric_variety
    2084         return SchemeMorphism_on_points_toric_variety(*args, **kwds)
     2083        from sage.schemes.generic.toric_morphism import SchemeMorphism_polynomial_toric_variety
     2084        return SchemeMorphism_polynomial_toric_variety(*args, **kwds)
    20852085
    20862086    def affine_patch(self, i):
    20872087        r"""
  • sage/schemes/generic/homset.py

    diff --git a/sage/schemes/generic/homset.py b/sage/schemes/generic/homset.py
    a b  
    1 """
     1r"""
    22Set of homomorphisms between two schemes
    33
     4For schemes `X` and `Y`, this module implements the set of morphisms
     5`Hom(X,Y)`. This is done by :class:`SchemeHomset_generic`.
     6
     7As a special case, the hom sets can also represent the points of a
     8scheme. Recall that the `K`-rational points of a scheme `X` over `k`
     9can be identified with the set of morphisms `Spec(K) \to X`. In Sage,
     10the rational points are implemented by such scheme morphisms. This is
     11done by :class:`SchemeHomset_points` and its subclasses.
     12
    413.. note::
    514
    615    You should not create the homsets manually. Instead, use the
     
    2534from sage.schemes.generic.morphism import (
    2635    SchemeMorphism,
    2736    SchemeMorphism_structure_map, SchemeMorphism_spec,
    28     SchemeMorphism_affine_coordinates,
    29     SchemeMorphism_projective_coordinates_field )
    30 from sage.schemes.generic.toric_morphism import SchemeMorphism_toric_coordinates_field
     37    SchemeMorphism_point_affine,
     38    SchemeMorphism_point_projective_ring,
     39    SchemeMorphism_point_projective_field )
     40from sage.schemes.generic.toric_morphism import SchemeMorphism_point_toric_field
    3141
    3242
    3343
     
    3545def is_SchemeHomset(H):
    3646    r"""
    3747    Test whether ``H`` is a scheme homset.
     48
     49    EXAMPLES::
     50
     51        sage: f = Spec(QQ).identity_morphism();  f
     52        Scheme endomorphism of Spectrum of Rational Field
     53          Defn: Identity map
     54        sage: from sage.schemes.generic.homset import is_SchemeHomset
     55        sage: is_SchemeHomset(f)
     56        False
     57        sage: is_SchemeHomset(f.parent())
     58        True
     59        sage: is_SchemeHomset('a string')
     60        False
    3861    """
    3962    return isinstance(H, SchemeHomset_generic)
    4063
     
    162185        Y = extra_args.pop('Y')
    163186        base_ring = extra_args.pop('base_ring')
    164187        if is_Spec(X):
    165             return Y._homset_class(X, Y, category=category, base=base_ring, **extra_args)
    166         return SchemeHomset_generic(X, Y, category=category, base=base_ring, **extra_args)
     188            return Y._point_homset_class(X, Y, category=category, base=base_ring, **extra_args)
     189        try:
     190            return X._homset_class(X, Y, category=category, base=base_ring, **extra_args)
     191        except AttributeError:
     192            return SchemeHomset_generic(X, Y, category=category, base=base_ring, **extra_args)
    167193
    168194
    169195SchemeHomset = SchemeHomsetFactory('sage.schemes.generic.homset.SchemeHomset')
     
    284310              To:   Rational Field
    285311       
    286312            sage: H = Hom(Spec(QQ, ZZ), Spec(ZZ)); H
    287             Set of rational points of Spectrum of Rational Field
     313            Set of rational points of Spectrum of Integer Ring
    288314       
    289315            sage: phi = H(f); phi
    290316            Affine Scheme morphism:
     
    295321                      To:   Rational Field
    296322
    297323        TESTS:
    298        
     324
     325            sage: H._element_constructor_(f)
     326            Affine Scheme morphism:
     327              From: Spectrum of Rational Field
     328              To:   Spectrum of Integer Ring
     329              Defn: Ring Coercion morphism:
     330                      From: Integer Ring
     331                      To:   Rational Field
     332
    299333        We illustrate input type checking::
    300334       
    301335            sage: R.<x,y> = QQ[]
     
    313347            TypeError: x must be a ring homomorphism, list or tuple
    314348        """
    315349        if isinstance(x, (list, tuple)):
    316             return self.domain()._point_morphism_class(self, x, check=check)
     350            return self.domain()._morphism_class(self, x, check=check)
    317351       
    318352        if is_RingHomomorphism(x):
    319353            return SchemeMorphism_spec(self, x, check=check)
     
    321355        raise TypeError, "x must be a ring homomorphism, list or tuple"
    322356
    323357
    324 
    325 class SchemeHomset_coordinates(SchemeHomset_generic):
     358#*******************************************************************
     359# Base class for points
     360#*******************************************************************
     361class SchemeHomset_points(SchemeHomset_generic):
    326362    """
    327363    Set of rational points of the scheme.
    328364
     
    336372
    337373    EXAMPLES::
    338374
    339         sage: from sage.schemes.generic.homset import SchemeHomset_coordinates
    340         sage: SchemeHomset_coordinates(Spec(QQ), AffineSpace(ZZ,2))
     375        sage: from sage.schemes.generic.homset import SchemeHomset_points
     376        sage: SchemeHomset_points(Spec(QQ), AffineSpace(ZZ,2))
    341377        Set of rational points of Affine Space of dimension 2 over Rational Field
    342378    """
    343379
     
    351387
    352388        EXAMPLES::
    353389
    354             sage: from sage.schemes.generic.homset import SchemeHomset_coordinates
    355             sage: SchemeHomset_coordinates(Spec(QQ), AffineSpace(ZZ,2))
     390            sage: from sage.schemes.generic.homset import SchemeHomset_points
     391            sage: SchemeHomset_points(Spec(QQ), AffineSpace(ZZ,2))
    356392            Set of rational points of Affine Space of dimension 2 over Rational Field
    357393        """
    358394        if check and not is_Spec(X):
    359395            raise ValueError('The domain must be an affine scheme.')
    360396        SchemeHomset_generic.__init__(self, X, Y, category=category, check=check, base=base)
    361397
     398    def _element_constructor_(self, *v, **kwds):
     399        """
     400        The element contstructor.
     401
     402        INPUT:
     403
     404        - ``v`` -- anything that determines a scheme morphism in the
     405          hom set.
     406
     407        OUTPUT:
     408
     409        The scheme morphism determined by ``v``.
     410
     411        EXAMPLES::
     412       
     413            sage: A2 = AffineSpace(ZZ,2)
     414            sage: F = GF(3)
     415            sage: F_points = A2(F);  type(F_points)
     416            <class 'sage.schemes.generic.homset.SchemeHomset_points_affine_with_category'>
     417            sage: F_points([2,5])
     418            (2, 2)
     419
     420            sage: P2 = ProjectiveSpace(GF(3),2)
     421            sage: F.<a> = GF(9,'a')
     422            sage: F_points = P2(F)
     423            sage: type(F_points)
     424            <class 'sage.schemes.generic.homset.SchemeHomset_points_projective_field_with_category'>
     425            sage: F_points([4,2*a])
     426            (1 : 2*a : 1)
     427
     428        TESTS::
     429
     430            sage: F_points._element_constructor_([4,2*a])
     431            (1 : 2*a : 1)
     432        """
     433        if len(v) == 1:
     434            v = v[0]
     435        return self.codomain()._point_class(self, v, **kwds)
     436
    362437    def extended_codomain(self):
    363438        """
    364439        Return the codomain with extended base, if necessary.
     
    412487
    413488    def value_ring(self):
    414489        """
    415         Returns ``R` for a homset `X(Spec(R))`
     490        Returns `R` for a point homset `X(Spec(R))`
    416491
    417492        OUTPUT:
    418493       
     
    432507#*******************************************************************
    433508# Affine varieties
    434509#*******************************************************************
    435 class SchemeHomset_affine_coordinates(SchemeHomset_coordinates):
     510class SchemeHomset_points_spec(SchemeHomset_generic):
    436511    """
    437512    Set of rational points of an affine variety.
    438513
     
    442517
    443518    EXAMPLES::
    444519
    445         sage: from sage.schemes.generic.homset import SchemeHomset_affine_coordinates
    446         sage: SchemeHomset_affine_coordinates(Spec(QQ), AffineSpace(ZZ,2))
    447         Set of rational points of Affine Space of dimension 2 over Rational Field
     520        sage: from sage.schemes.generic.homset import SchemeHomset_points_spec
     521        sage: SchemeHomset_points_spec(Spec(QQ), Spec(QQ))
     522        Set of rational points of Spectrum of Rational Field
    448523    """
    449     def _element_constructor_(self, *v):
     524
     525    def _element_constructor_(self, *args, **kwds):
    450526        """
    451527        The element contstructor.
    452528
    453         INPUT:
     529        EXAMPLES::
    454530
    455         - ``v`` -- anything that determines a scheme morphism in the
    456           hom set.
     531            sage: X = Spec(QQ)
     532            sage: ring_hom = QQ.hom((1,), QQ);  ring_hom
     533            Ring endomorphism of Rational Field
     534              Defn: 1 |--> 1
     535            sage: Hom = X.Hom(X)
     536            sage: Hom(ring_hom)
     537            Affine Scheme endomorphism of Spectrum of Rational Field
     538              Defn: Ring endomorphism of Rational Field
     539                      Defn: 1 |--> 1
     540
     541        TESTS::
     542
     543            sage: Hom._element_constructor_(ring_hom)
     544            Affine Scheme endomorphism of Spectrum of Rational Field
     545              Defn: Ring endomorphism of Rational Field
     546                      Defn: 1 |--> 1
     547        """
     548        return SchemeHomset_generic._element_constructor_(self, *args, **kwds)
     549       
     550    def _repr_(self):
     551        """
     552        Return a string representation of ``self``.
    457553
    458554        OUTPUT:
    459555
    460         The scheme morphism determined by ``v``.
     556        A string.
     557       
     558        EXAMPLES::
    461559
    462         EXAMPLES::
    463        
    464             sage: A2 = AffineSpace(ZZ,2)
    465             sage: F = GF(3)
    466             sage: F_points = A2(F);  type(F_points)
    467             <class 'sage.schemes.generic.homset.SchemeHomset_affine_coordinates_with_category'>
    468             sage: F_points([2,5])
    469             (2, 2)
     560            sage: from sage.schemes.generic.homset import SchemeHomset_points_spec
     561            sage: S = SchemeHomset_points_spec(Spec(QQ), Spec(QQ))
     562            sage: S._repr_()
     563            'Set of rational points of Spectrum of Rational Field'
    470564        """
    471         if len(v) == 1:
    472             v = v[0]
    473         return SchemeMorphism_affine_coordinates(self, v)
     565        return 'Set of rational points of '+str(self.codomain())
    474566
     567
     568
     569#*******************************************************************
     570# Affine varieties
     571#*******************************************************************
     572class SchemeHomset_points_affine(SchemeHomset_points):
     573    """
     574    Set of rational points of an affine variety.
     575
     576    INPUT:
     577   
     578    See :class:`SchemeHomset_generic`.
     579
     580    EXAMPLES::
     581
     582        sage: from sage.schemes.generic.homset import SchemeHomset_points_affine
     583        sage: SchemeHomset_points_affine(Spec(QQ), AffineSpace(ZZ,2))
     584        Set of rational points of Affine Space of dimension 2 over Rational Field
     585    """
    475586    def points(self, B=0):
    476587        r"""
    477588        Return some or all rational points of an affine scheme.
     
    521632#*******************************************************************
    522633# Projective varieties
    523634#*******************************************************************
    524 class SchemeHomset_projective_coordinates_field(SchemeHomset_coordinates):
     635class SchemeHomset_points_projective_field(SchemeHomset_points):
    525636    """
    526637    Set of rational points of a projective variety over a field.
    527638
     
    531642
    532643    EXAMPLES::
    533644
    534         sage: from sage.schemes.generic.homset import SchemeHomset_projective_coordinates_field
    535         sage: SchemeHomset_projective_coordinates_field(Spec(QQ), ProjectiveSpace(QQ,2))
     645        sage: from sage.schemes.generic.homset import SchemeHomset_points_projective_field
     646        sage: SchemeHomset_points_projective_field(Spec(QQ), ProjectiveSpace(QQ,2))
    536647        Set of rational points of Projective Space of dimension 2 over Rational Field
    537648    """
    538     def _element_constructor_(self, *v):
    539         """
    540         The element contstructor.
    541 
    542         INPUT:
    543 
    544         - ``v`` -- anything that determines a scheme morphism in the
    545           hom set.
    546 
    547         OUTPUT:
    548 
    549         The scheme morphism determined by ``v``.
    550 
    551         EXAMPLES::
    552        
    553             sage: P2 = ProjectiveSpace(GF(3),2)
    554             sage: F.<a> = GF(9,'a')
    555             sage: F_points = P2(F)
    556             sage: F_points([4,2*a])
    557             (1 : 2*a : 1)
    558         """
    559         if len(v) == 1:
    560             v = v[0]
    561         X = self.extended_codomain()
    562         return X.point(v)
    563 
    564649    def points(self, B=0):
    565650        """
    566651        Return some or all rational points of a projective scheme.
     
    595680        else:
    596681            raise TypeError, "Unable to enumerate points over %s."%R
    597682
    598 class SchemeHomset_projective_coordinates_ring(SchemeHomset_coordinates):
     683class SchemeHomset_points_projective_ring(SchemeHomset_points):
    599684    """
    600685    Set of rational points of a projective variety over a commutative ring.
    601686
     
    605690
    606691    EXAMPLES::
    607692
    608         sage: from sage.schemes.generic.homset import SchemeHomset_projective_coordinates_ring
    609         sage: SchemeHomset_projective_coordinates_ring(Spec(ZZ), ProjectiveSpace(ZZ,2))
     693        sage: from sage.schemes.generic.homset import SchemeHomset_points_projective_ring
     694        sage: SchemeHomset_points_projective_ring(Spec(ZZ), ProjectiveSpace(ZZ,2))
    610695        Set of rational points of Projective Space of dimension 2 over Integer Ring
    611696    """
    612     def _element_constructor_(self, *v):
     697    def _element_constructor_(self, *v, **kwds):
    613698        r"""
    614699        The element constructor.
    615700       
     
    617702
    618703        EXAMPLES::
    619704
    620             sage: from sage.schemes.generic.homset import SchemeHomset_projective_coordinates_ring
    621             sage: Hom = SchemeHomset_projective_coordinates_ring(Spec(ZZ), ProjectiveSpace(ZZ,2))
     705            sage: from sage.schemes.generic.homset import SchemeHomset_points_projective_ring
     706            sage: Hom = SchemeHomset_points_projective_ring(Spec(ZZ), ProjectiveSpace(ZZ,2))
    622707            sage: Hom(1,2,3)
    623708            Traceback (most recent call last):
    624709            ...
    625710            NotImplementedError
     711
     712        TESTS::
     713
     714            sage: Hom._element_constructor_(1,2,3)
     715            Traceback (most recent call last):
     716            ...
     717            NotImplementedError
    626718        """
     719        check = kwds.get('check', True)
    627720        raise NotImplementedError
    628721
    629722    def points(self, B=0):
     
    641734
    642735        EXAMPLES::
    643736
    644             sage: from sage.schemes.generic.homset import SchemeHomset_projective_coordinates_ring
    645             sage: Hom = SchemeHomset_projective_coordinates_ring(Spec(ZZ), ProjectiveSpace(ZZ,2))
     737            sage: from sage.schemes.generic.homset import SchemeHomset_points_projective_ring
     738            sage: Hom = SchemeHomset_points_projective_ring(Spec(ZZ), ProjectiveSpace(ZZ,2))
    646739            sage: Hom.points(5)
    647740            Traceback (most recent call last):
    648741            ...
     
    662755#*******************************************************************
    663756# Abelian varieties
    664757#*******************************************************************
    665 class SchemeHomsetModule_abelian_variety_coordinates_field(SchemeHomset_projective_coordinates_field):
     758class SchemeHomset_points_abelian_variety_field(SchemeHomset_points_projective_field):
    666759    r"""
    667760    Set of rational points of an abelian variety.
    668761
     
    694787        True
    695788    """
    696789
     790    def _element_constructor_(self, *v, **kwds):
     791        """
     792        The element contstructor.
     793
     794        INPUT:
     795
     796        - ``v`` -- anything that determines a scheme morphism in the
     797          hom set.
     798
     799        OUTPUT:
     800
     801        The scheme morphism determined by ``v``.
     802
     803        EXAMPLES::
     804       
     805            sage: E = EllipticCurve('37a')
     806            sage: X = E(QQ)
     807            sage: P = X([0,1,0]);  P
     808            (0 : 1 : 0)
     809            sage: type(P)
     810            <class 'sage.schemes.elliptic_curves.ell_point.EllipticCurvePoint_number_field'>
     811           
     812        TESTS::
     813
     814            sage: X._element_constructor_([0,1,0])
     815            (0 : 1 : 0)
     816        """
     817        if len(v) == 1:
     818            v = v[0]
     819        return self.codomain()._point_class(self.extended_codomain(), v, **kwds)
     820
    697821    def _repr_(self):
    698822        """
    699823        Return a string representation of ``self``.
     
    713837        return s
    714838
    715839    def base_extend(self, R):
     840        """
     841        Extend the base ring.
     842
     843        This is currently not implemented except for the trivial case
     844        ``R==ZZ``.
     845       
     846        INPUT:
     847       
     848        - ``R`` -- a ring.
     849
     850        EXAMPLES::
     851
     852            sage: E = EllipticCurve('37a')
     853            sage: Hom = E.point_homset();  Hom
     854            Abelian group of points on Elliptic Curve defined
     855            by y^2 + y = x^3 - x over Rational Field
     856            sage: Hom.base_ring()
     857            Integer Ring
     858            sage: Hom.base_extend(QQ)
     859            Traceback (most recent call last):
     860            ...
     861            NotImplementedError: Abelian variety point sets not
     862            implemented as modules over rings other than ZZ.
     863        """
    716864        if not R is ZZ:
    717865            raise NotImplementedError('Abelian variety point sets not implemented '
    718866                                      'as modules over rings other than ZZ.')
    719867        return self
    720868   
    721869
     870from sage.structure.sage_object import register_unpickle_override
     871register_unpickle_override('sage.schemes.generic.homset',
     872                           'SchemeHomsetModule_abelian_variety_coordinates_field',
     873                           SchemeHomset_points_abelian_variety_field)
     874
    722875#*******************************************************************
    723876# Toric varieties
    724877#*******************************************************************
    725 class SchemeHomset_toric_coordinates_field(SchemeHomset_coordinates):
     878class SchemeHomset_points_toric_field(SchemeHomset_points):
    726879    """
    727880    Set of rational points of a toric variety.
    728881
    729882    INPUT:
    730883
    731     - same as for :class:`SchemeHomset_coordinates`.
     884    - same as for :class:`SchemeHomset_points`.
    732885
    733886    OUPUT:
    734887
    735888    A scheme morphism of type
    736     :class:`SchemeHomset_toric_coordinates_field`.
     889    :class:`SchemeHomset_points_toric_field`.
    737890
    738891    EXAMPLES::
    739892
     
    745898    TESTS::
    746899
    747900        sage: import sage.schemes.generic.homset as HOM
    748         sage: HOM.SchemeHomset_toric_coordinates_field(Spec(QQ), P1xP1)
     901        sage: HOM.SchemeHomset_points_toric_field(Spec(QQ), P1xP1)
    749902        Set of rational points of 2-d CPR-Fano toric variety covered by 4 affine patches
    750903    """
    751904    pass
  • sage/schemes/generic/morphism.py

    diff --git a/sage/schemes/generic/morphism.py b/sage/schemes/generic/morphism.py
    a b  
    1 """
     1r"""
    22Scheme morphism
    33
    44.. note::
     
    88    :meth:`~sage.structure.parent.Hom` methods that are inherited by
    99    all schemes.
    1010
     11If you want to extend the Sage library with some new kind of scheme,
     12your new class (say, ``myscheme``) should provide a methods
     13
     14* ``myscheme._morphism_class(*args, **kwds)`` return a morphism
     15  between to schemes in your category, usually defined via
     16  polynomials. Your point class should derive from
     17  :class:`SchemeMorphism_polynomial`. They will usually be elements of
     18  the hom set
     19  :class:`~sage.schemes.generic.homset.SchemeHomset_generic`.
     20
     21Optionally, you can also provide a special hom set for your
     22subcategory of schemes. If you want to do this, you should also
     23provide a method
     24
     25* ``myscheme._homset_class(*args, **kwds)`` (optional) return the
     26  homset, which must be a derived class of
     27  `class:`~sage.schemes.generic.homset.SchemeHomset_generic`. If your
     28  new homset class does not use ``myscheme._morphism_class`` then you
     29  do not have to provide it.
     30
     31Note that points on schemes are morphisms `Spec(K)\to X`, too. But we
     32typically use a different notation, so they are implemented in a
     33different derived class. For this, you should implement a method
     34
     35* ``myscheme._point_class(*args, **kwds)`` return a point, that is,
     36  morphism `Spec(K)\to X`. Your point class should derive from
     37  :class:`SchemeMorphism_point`.
     38
     39Optionally, you can also provide a special hom set for the points, for
     40example the point hom set can provide a method to enumerate all
     41points. If you want to do this, you should also provide a method
     42
     43* ``myscheme._point_homset_class(*args, **kwds)`` (optional) return
     44  the :mod:`~sage.schemes.generic.homset` of points. The hom sets of
     45  points are implemented in classes named ``SchemeHomset_points_...``.
     46  If your new homset class does not use ``myscheme._point_class`` then
     47  you do not have to provide it. 
     48
    1149AUTHORS:
    1250
    1351- David Kohel, William Stein
    1452
    1553- William Stein (2006-02-11): fixed bug where P(0,0,0) was allowed as
    1654  a projective point.
     55
     56- Volker Braun (2011-08-08): Renamed classes, more documentation, misc
     57  cleanups.
    1758"""
    1859
     60# Historical note: in trac #11599, V.B. renamed
     61# * _point_morphism_class -> _morphism_class
     62# * _homset_class -> _point_homset_class
     63
    1964#*****************************************************************************
    2065#  Copyright (C) 2006 David Kohel <kohel@maths.usyd.edu.au>
    2166#  Copyright (C) 2006 William Stein <wstein@gmail.com>
     
    4287
    4388    OUTPUT:
    4489   
    45     Boolean. Return ``True`` if ``f``a is a scheme morphism or a point
     90    Boolean. Return ``True`` if ``f`` is a scheme morphism or a point
    4691    on an elliptic curve.
    4792
    4893    EXAMPLES::
     
    80125    """
    81126    def __init__(self, parent):
    82127        """
    83         The Pyhon constructor.
     128        The Python constructor.
    84129       
    85130        EXAMPLES::
    86131       
     
    212257        A category.
    213258       
    214259        EXAMPLES::
    215 
    216         EXAMPLES::
    217260       
    218261            sage: A2 = AffineSpace(QQ,2)
    219262            sage: A2.structure_morphism().category()
     
    256299            sage: f * g
    257300            Traceback (most recent call last):
    258301            ...
    259             TypeError: unsupported operand type(s) for *: 'SchemeMorphism_structure_map' and 'SchemeMorphism_id'
     302            TypeError: unsupported operand type(s) for *:
     303            'SchemeMorphism_structure_map' and 'SchemeMorphism_id'
    260304        """
    261305        raise NotImplementedError
    262306
     
    282326            sage: id^2
    283327            Traceback (most recent call last):
    284328            ...
    285             TypeError: unsupported operand type(s) for *: 'SchemeMorphism_id' and 'SchemeMorphism_id'
     329            TypeError: unsupported operand type(s) for *:
     330            'SchemeMorphism_id' and 'SchemeMorphism_id'
    286331        """
    287332        if not self.is_endomorphism():
    288333            raise TypeError, "self must be an endomorphism."
     
    614659# The domain can be either affine or projective regardless
    615660# of the class
    616661############################################################################
    617 
    618 class SchemeMorphism_on_points(SchemeMorphism):
     662class SchemeMorphism_polynomial(SchemeMorphism):
    619663    """
    620     A morphism of schemes determined by rational functions that define
    621     what the morphism does on points in the ambient space.
     664    A morphism of schemes determined by polynomials that define what
     665    the morphism does on points in the ambient space.
    622666
    623667    INPUT:
    624668
     
    671715        """
    672716        The Python constructor.
    673717
    674         See :class:`SchemeMorphism_on_points` for details.
     718        See :class:`SchemeMorphism_polynomial` for details.
    675719
    676720        EXAMPLES::
    677721
     
    815859        return "Defined on coordinates by sending %s to\n%s"%(i,o)
    816860
    817861
    818 class SchemeMorphism_on_points_affine_space(SchemeMorphism_on_points):
     862class SchemeMorphism_polynomial_affine_space(SchemeMorphism_polynomial):
    819863    """
    820864    A morphism of schemes determined by rational functions that define
    821865    what the morphism does on points in the ambient affine space.
     
    837881    """
    838882    pass
    839883
    840 class SchemeMorphism_on_points_projective_space(SchemeMorphism_on_points):
     884class SchemeMorphism_polynomial_projective_space(SchemeMorphism_polynomial):
    841885    """
    842886    A morphism of schemes determined by rational functions that define
    843887    what the morphism does on points in the ambient projective space.
     
    907951        """
    908952        The Python constructor.
    909953
    910         See :class:`SchemeMorphism_on_points` for details.
     954        See :class:`SchemeMorphism_polynomial` for details.
    911955
    912956        EXAMPLES::
    913957
     
    918962              Defn: Defined on coordinates by sending (x : y) to
    919963                    (y : 2*x)
    920964        """
    921         SchemeMorphism_on_points.__init__(self, parent, polys, check)
     965        SchemeMorphism_polynomial.__init__(self, parent, polys, check)
    922966        if check:
    923967            # morphisms from projective space are always given by
    924968            # homogeneous polynomials of the same degree
     
    939983# by coordinates.
    940984############################################################################
    941985
    942 class SchemeMorphism_coordinates(SchemeMorphism):
     986class SchemeMorphism_point(SchemeMorphism):
    943987    """
    944988    Base class for rational points on schemes.
    945989
     
    10881132            sage: a != b
    10891133            True
    10901134        """
    1091         if not isinstance(other, SchemeMorphism_coordinates):
     1135        if not isinstance(other, SchemeMorphism_point):
    10921136            try:
    10931137                other = self.codomain().ambient_space()(other)
    10941138            except TypeError:
     
    11161160#*******************************************************************
    11171161# Affine varieties
    11181162#*******************************************************************
    1119 class SchemeMorphism_affine_coordinates(SchemeMorphism_coordinates):
     1163class SchemeMorphism_point_affine(SchemeMorphism_point):
    11201164    """
    11211165    A rational point on an affine scheme.
    11221166   
     
    11391183        """
    11401184        The Python constructor.
    11411185
    1142         See :class:`SchemeMorphism_affine_coordinates` for details.
     1186        See :class:`SchemeMorphism_point_affine` for details.
    11431187
    11441188        TESTS::
    11451189
    1146             sage: from sage.schemes.generic.morphism import SchemeMorphism_affine_coordinates
     1190            sage: from sage.schemes.generic.morphism import SchemeMorphism_point_affine
    11471191            sage: A3.<x,y,z> = AffineSpace(QQ, 3)
    1148             sage: SchemeMorphism_affine_coordinates(A3(QQ), [1,2,3])
     1192            sage: SchemeMorphism_point_affine(A3(QQ), [1,2,3])
    11491193            (1, 2, 3)
    11501194        """
    11511195        SchemeMorphism.__init__(self, X)
     
    11701214#*******************************************************************
    11711215# Projective varieties
    11721216#*******************************************************************
    1173 class SchemeMorphism_projective_coordinates_ring(SchemeMorphism_coordinates):
     1217class SchemeMorphism_point_projective_ring(SchemeMorphism_point):
    11741218    """
    11751219    A rational point of projective space over a ring (how?).
    11761220
     
    11781222
    11791223    EXAMPLES:
    11801224
    1181         sage: from sage.schemes.generic.morphism import SchemeMorphism_projective_coordinates_ring
    1182         sage: SchemeMorphism_projective_coordinates_ring(None, None)
     1225        sage: from sage.schemes.generic.morphism import SchemeMorphism_point_projective_ring
     1226        sage: SchemeMorphism_point_projective_ring(None, None)
    11831227        Traceback (most recent call last):
    11841228        ...
    11851229        NotImplementedError
     
    11911235       
    11921236        EXAMPLES:
    11931237
    1194             sage: from sage.schemes.generic.morphism import SchemeMorphism_projective_coordinates_ring
    1195             sage: SchemeMorphism_projective_coordinates_ring(None, None)
     1238            sage: from sage.schemes.generic.morphism import SchemeMorphism_point_projective_ring
     1239            sage: SchemeMorphism_point_projective_ring(None, None)
    11961240            Traceback (most recent call last):
    11971241            ...
    11981242            NotImplementedError
     
    12001244        raise NotImplementedError
    12011245
    12021246
    1203 class SchemeMorphism_projective_coordinates_field(SchemeMorphism_projective_coordinates_ring):
     1247class SchemeMorphism_point_projective_field(SchemeMorphism_point_projective_ring):
    12041248    """
    12051249    A rational point of projective space over a field.
    12061250   
     
    12321276        """
    12331277        The Python constructor.
    12341278
    1235         See :class:`SchemeMorphism_projective_coordinates_field` for details.
     1279        See :class:`SchemeMorphism_point_projective_field` for details.
    12361280       
    12371281        EXAMPLES::
    12381282
     
    12731317            if all_zero:
    12741318                raise ValueError, "%s does not define a valid point since all entries are 0"%repr(v)
    12751319
    1276             X.codomain()._check_satisfies_equations(v)
     1320            X.extended_codomain()._check_satisfies_equations(v)
    12771321               
    12781322        self._coords = v
    12791323
     
    12821326#*******************************************************************
    12831327# Abelian varieties
    12841328#*******************************************************************
    1285 class SchemeMorphism_abelian_variety_coordinates_field\
    1286         (AdditiveGroupElement, SchemeMorphism_projective_coordinates_field):
     1329class SchemeMorphism_point_abelian_variety_field\
     1330        (AdditiveGroupElement, SchemeMorphism_point_projective_field):
    12871331    """
    12881332    A rational point of an abelian variety over a field.
    12891333
  • sage/schemes/generic/projective_space.py

    diff --git a/sage/schemes/generic/projective_space.py b/sage/schemes/generic/projective_space.py
    a b  
    314314                raise TypeError("%s is not a homogeneous polynomial!" % f)
    315315        return polynomials
    316316
    317     def _point_morphism_class(self, *args, **kwds):
    318         return morphism.SchemeMorphism_on_points_projective_space(*args, **kwds)
    319 
    320317    def __cmp__(self, right):
    321318        """
    322319        EXAMPLES::
     
    351348        """
    352349        return "{\\mathbf P}_{%s}^%s"%(latex(self.base_ring()), self.dimension_relative())
    353350
    354     def _homset_class(self, *args, **kwds):
    355         return homset.SchemeHomset_projective_coordinates_ring(*args, **kwds)
     351    def _morphism_class(self, *args, **kwds):
     352        return morphism.SchemeMorphism_polynomial_projective_space(*args, **kwds)
     353
     354    def _point_homset_class(self, *args, **kwds):
     355        return homset.SchemeHomset_points_projective_ring(*args, **kwds)
    356356
    357357    def _point_class(self, *args, **kwds):
    358         return morphism.SchemeMorphism_projective_coordinates_ring(*args, **kwds)
     358        return morphism.SchemeMorphism_point_projective_ring(*args, **kwds)
    359359
    360360    def _repr_(self):
    361361        """
     
    550550
    551551
    552552class ProjectiveSpace_field(ProjectiveSpace_ring):
    553     def _homset_class(self, *args, **kwds):
    554         return homset.SchemeHomset_projective_coordinates_field(*args, **kwds)
     553    def _point_homset_class(self, *args, **kwds):
     554        return homset.SchemeHomset_points_projective_field(*args, **kwds)
    555555
    556556    def _point_class(self, *args, **kwds):
    557         return morphism.SchemeMorphism_projective_coordinates_field(*args, **kwds)
     557        return morphism.SchemeMorphism_point_projective_field(*args, **kwds)
    558558
    559559   
    560560class ProjectiveSpace_finite_field(ProjectiveSpace_field):
  • sage/schemes/generic/scheme.py

    diff --git a/sage/schemes/generic/scheme.py b/sage/schemes/generic/scheme.py
    a b  
    170170
    171171    __add__ = union
    172172
    173     def _point_morphism_class(self, *args, **kwds):
     173    def _morphism_class(self, *args, **kwds):
    174174        """
     175        Construct a morphism determined by action on points of ``self``.
     176
    175177        EXAMPLES::
    176178       
    177179            sage: X = Spec(QQ)
    178             sage: X._point_morphism_class()
     180            sage: X._morphism_class()
    179181            Traceback (most recent call last):
    180182            ...
    181183            NotImplementedError
     
    271273            return self.point_homset(S)
    272274        if is_Scheme(S):
    273275            return S.Hom(self)
    274         from sage.schemes.generic.morphism import SchemeMorphism_coordinates
     276        from sage.schemes.generic.morphism import SchemeMorphism_point
    275277        if isinstance(S, (list, tuple)):
    276278            args = S
    277         elif isinstance(S, SchemeMorphism_coordinates):
     279        elif isinstance(S, SchemeMorphism_point):
    278280            if S.codomain() == self:
    279281                return S
    280282        else:
     
    353355        if is_EllipticCurve(self):
    354356            return self._point_class(self, v, check=check)
    355357
    356         return self._point_class(self.point_homset(), v, check=check)
     358        return self.point_homset() (v, check=check)
    357359   
    358360    def _point_class(self):
    359361        """
     
    373375        """
    374376        raise NotImplementedError
    375377
    376     def _homset_class(self, *args, **kwds):
     378    def _point_homset_class(self, *args, **kwds):
    377379        """
    378380        Return the Hom set from ``self`` to another scheme.
    379381
     
    381383       
    382384            sage: from sage.schemes.generic.scheme import Scheme
    383385            sage: X = Scheme(QQ)
    384             sage: X._homset_class()
     386            sage: X._point_homset_class()
    385387            Traceback (most recent call last):
    386388            ...
    387389            NotImplementedError
  • sage/schemes/generic/spec.py

    diff --git a/sage/schemes/generic/spec.py b/sage/schemes/generic/spec.py
    a b  
    365365        return Spec(self.coordinate_ring().base_extend(new_base.coordinate_ring()),
    366366                    self.base_ring())
    367367
    368     def _homset_class(self, *args, **kwds):
     368    def _point_homset_class(self, *args, **kwds):
    369369        """
    370370        Return the Hom set class.
    371371       
    372372        EXAMPLES::
    373373       
    374             sage: Spec(QQ)._homset_class(Spec(QQ), Spec(ZZ))
    375             Set of rational points of Spectrum of Rational Field
     374            sage: Spec(QQ)._point_homset_class(Spec(QQ), Spec(ZZ))
     375            Set of rational points of Spectrum of Integer Ring
    376376        """
    377         from sage.schemes.generic.homset import SchemeHomset_coordinates
    378         return SchemeHomset_coordinates(*args, **kwds)
     377        from sage.schemes.generic.homset import SchemeHomset_points_spec
     378        return SchemeHomset_points_spec(*args, **kwds)
    379379
    380380
    381381SpecZ = Spec(ZZ)
  • sage/schemes/generic/toric_morphism.py

    diff --git a/sage/schemes/generic/toric_morphism.py b/sage/schemes/generic/toric_morphism.py
    a b  
    1818import scheme     
    1919from sage.schemes.generic.morphism import (
    2020    is_SchemeMorphism,
    21     SchemeMorphism_coordinates, SchemeMorphism_on_points
     21    SchemeMorphism_point, SchemeMorphism_polynomial
    2222)
    2323
    2424
    2525
    26 class SchemeMorphism_toric_coordinates_field(SchemeMorphism_coordinates):
     26class SchemeMorphism_point_toric_field(SchemeMorphism_point):
    2727    """
    2828    Construct a morphism determined by giving coordinates in a field.
    2929
     
    4242
    4343    OUTPUT:
    4444
    45     - :class:`SchemeMorphism_toric_coordinates_field`.
     45    - :class:`SchemeMorphism_point_toric_field`.
    4646
    4747    TESTS::
    4848
     
    5454    # Mimicking affine/projective classes
    5555    def __init__(self, X, coordinates, check=True):
    5656        r"""
    57         See :class:`SchemeMorphism_toric_coordinates_field` for documentation.
     57        See :class:`SchemeMorphism_point_toric_field` for documentation.
    5858
    5959        TESTS::
    6060
     
    6666        # Convert scheme to its set of points over the base ring
    6767        if scheme.is_Scheme(X):
    6868            X = X(X.base_ring())
    69         super(SchemeMorphism_toric_coordinates_field, self).__init__(X)
     69        super(SchemeMorphism_point_toric_field, self).__init__(X)
    7070        if check:
    7171            # Verify that there are the right number of coords
    7272            # Why is it not done in the parent?
     
    8787
    8888
    8989
    90 class SchemeMorphism_on_points_toric_variety(SchemeMorphism_on_points):
     90class SchemeMorphism_polynomial_toric_variety(SchemeMorphism_polynomial):
    9191    """
    92     Construct a morphism determined by action on points.
     92    Construct a morphism determined by homogeneous polynomials.
    9393
    9494    .. WARNING::
    9595
     
    9898    INPUT:
    9999
    100100    - same as for
    101       :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points`.
     101      :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial`.
    102102
    103103    OUPUT:
    104104
    105     - :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_toric_variety`.
     105    - :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety`.
    106106
    107107    TESTS::
    108108
     
    113113        sage: P1 = P1xP1.subscheme(z0-z2)
    114114        sage: H = P1xP1.Hom(P1)
    115115        sage: import sage.schemes.generic.toric_morphism as MOR
    116         sage: MOR.SchemeMorphism_on_points_toric_variety(H, [z0,z1,z0,z3])
     116        sage: MOR.SchemeMorphism_polynomial_toric_variety(H, [z0,z1,z0,z3])
    117117        Scheme morphism:
    118118          From: 2-d toric variety covered by 4 affine patches
    119119          To:   Closed subscheme of 2-d toric variety
     
    125125
    126126    def __init__(self, parent, polynomials, check=True):
    127127        r"""
    128         See :class:`SchemeMorphism_on_points_toric_variety` for documentation.
     128        See :class:`SchemeMorphism_polynomial_toric_variety` for documentation.
    129129
    130130        TESTS::
    131131
     
    136136            sage: P1 = P1xP1.subscheme(z0-z2)
    137137            sage: H = P1xP1.Hom(P1)
    138138            sage: import sage.schemes.generic.toric_morphism as MOR
    139             sage: MOR.SchemeMorphism_on_points_toric_variety(H, [z0,z1,z0,z3])
     139            sage: MOR.SchemeMorphism_polynomial_toric_variety(H, [z0,z1,z0,z3])
    140140            Scheme morphism:
    141141              From: 2-d toric variety covered by 4 affine patches
    142142              To:   Closed subscheme of 2-d toric variety
     
    145145              Defn: Defined on coordinates by sending
    146146                    [z0 : z1 : z2 : z3] to [z0 : z1 : z0 : z3]
    147147        """
    148         SchemeMorphism_on_points.__init__(self, parent, polynomials, check)
     148        SchemeMorphism_polynomial.__init__(self, parent, polynomials, check)
    149149        if check:
    150150            # Check that defining polynomials are homogeneous (degrees can be
    151151            # different if the target uses weighted coordinates)
  • sage/schemes/generic/toric_variety.py

    diff --git a/sage/schemes/generic/toric_variety.py b/sage/schemes/generic/toric_variety.py
    a b  
    244244from sage.rings.quotient_ring_element import QuotientRingElement
    245245from sage.rings.quotient_ring import QuotientRing_generic
    246246from sage.schemes.generic.ambient_space import AmbientSpace
    247 from sage.schemes.generic.homset import (SchemeHomset_coordinates,
    248                                          SchemeHomset_toric_coordinates_field)
    249 from sage.schemes.generic.toric_morphism import (SchemeMorphism_on_points_toric_variety,
    250                                                  SchemeMorphism_toric_coordinates_field)
     247from sage.schemes.generic.homset import SchemeHomset_points_toric_field
     248from sage.schemes.generic.toric_morphism import (SchemeMorphism_polynomial_toric_variety,
     249                                                 SchemeMorphism_point_toric_field)
    251250
    252251
    253252
     
    619618        raise TypeError("coordinates %s are in the exceptional set!"
    620619                        % str(coordinates)) # Need str, coordinates is a tuple
    621620
    622     def _homset_class(self, *args, **kwds):
     621    def _point_homset_class(self, *args, **kwds):
    623622        r"""
    624623        Construct a `Hom`-space for ``self``.
    625624
    626625        INPUT:
    627626
    628627        - same as for
    629           :class:`~sage.schemes.generic.homset.SchemeHomset_toric_coordinates_field`.
     628          :class:`~sage.schemes.generic.homset.SchemeHomset_points_toric_field`.
    630629
    631630        OUPUT:
    632631
    633632        -
    634           :class:`~sage.schemes.generic.homset.SchemeHomset_toric_coordinates_field`.
     633          :class:`~sage.schemes.generic.homset.SchemeHomset_points_toric_field`.
    635634
    636635        TESTS::
    637636
    638637            sage: fan = FaceFan(lattice_polytope.octahedron(2))
    639638            sage: P1xP1 = ToricVariety(fan)
    640             sage: P1xP1._homset_class(Spec(QQ), P1xP1)
     639            sage: P1xP1._point_homset_class(Spec(QQ), P1xP1)
    641640            Set of rational points of 2-d toric variety
    642641            covered by 4 affine patches
    643642        """
    644         return SchemeHomset_toric_coordinates_field(*args, **kwds)
     643        return SchemeHomset_points_toric_field(*args, **kwds)
    645644
    646645    def _latex_(self):
    647646        r"""
     
    694693        INPUT:
    695694
    696695        - same as for
    697           :class:`~sage.schemes.generic.morphism.SchemeMorphism_toric_coordinates_field`.
     696          :class:`~sage.schemes.generic.morphism.SchemeMorphism_point_toric_field`.
    698697
    699698        OUPUT:
    700699
    701         :class:`~sage.schemes.generic.morphism.SchemeMorphism_toric_coordinates_field`.
     700        :class:`~sage.schemes.generic.morphism.SchemeMorphism_point_toric_field`.
    702701
    703702        TESTS::
    704703
     
    707706            sage: P1xP1._point_class(P1xP1, [1,2,3,4])
    708707            [1 : 2 : 3 : 4]
    709708        """
    710         return SchemeMorphism_toric_coordinates_field(*args, **kwds)
    711 
    712     def _point_morphism_class(self, *args, **kwds):
     709        return SchemeMorphism_point_toric_field(*args, **kwds)
     710
     711    def _morphism_class(self, *args, **kwds):
    713712        r"""
    714713        Construct a morphism determined by action on points of ``self``.
    715714
    716715        INPUT:
    717716
    718717        - same as for
    719           :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_toric_variety`.
     718          :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety`.
    720719
    721720        OUPUT:
    722721
    723         :class:`~sage.schemes.generic.morphism.SchemeMorphism_on_points_toric_variety`.
     722        :class:`~sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety`.
    724723
    725724        TESTS::
    726725
     
    730729            Defining z0, z1, z2, z3
    731730            sage: P1 = P1xP1.subscheme(z0-z2)
    732731            sage: H = P1xP1.Hom(P1)
    733             sage: P1xP1._point_morphism_class(H, [z0,z1,z0,z3])
     732            sage: P1xP1._morphism_class(H, [z0,z1,z0,z3])
    734733            Scheme morphism:
    735734              From: 2-d toric variety covered by 4 affine patches
    736735              To:   Closed subscheme of 2-d toric variety
     
    739738              Defn: Defined on coordinates by sending
    740739                    [z0 : z1 : z2 : z3] to [z0 : z1 : z0 : z3]
    741740        """
    742         return SchemeMorphism_on_points_toric_variety(*args, **kwds)
     741        return SchemeMorphism_polynomial_toric_variety(*args, **kwds)
    743742
    744743    def _repr_(self):
    745744        r"""
     
    977976        OUTPUT:
    978977
    979978        - :class:`scheme morphism
    980           <sage.schemes.generic.morphism.SchemeMorphism_on_points_toric_variety>`
     979          <sage.schemes.generic.morphism.SchemeMorphism_polynomial_toric_variety>`
    981980          if the default embedding morphism was defined for ``self``,
    982981          otherwise a ``ValueError`` exception is raised.
    983982
  • sage/schemes/hyperelliptic_curves/jacobian_generic.py

    diff --git a/sage/schemes/hyperelliptic_curves/jacobian_generic.py b/sage/schemes/hyperelliptic_curves/jacobian_generic.py
    a b  
    129129        except AttributeError:
    130130            raise ValueError, "Arguments must determine a valid Mumford divisor."
    131131
    132     def _homset_class(self, *args, **kwds):
     132    def _point_homset_class(self, *args, **kwds):
    133133        return jacobian_homset.JacobianHomset_divisor_classes(*args, **kwds)
    134134
    135135    def _point_class(self, *args, **kwds):
  • sage/schemes/hyperelliptic_curves/jacobian_homset.py

    diff --git a/sage/schemes/hyperelliptic_curves/jacobian_homset.py b/sage/schemes/hyperelliptic_curves/jacobian_homset.py
    a b  
    4848#*****************************************************************************
    4949
    5050from sage.rings.all import is_Polynomial, PolynomialRing, Integer, is_Integer, ZZ
    51 from sage.schemes.generic.homset import SchemeHomset_coordinates
     51from sage.schemes.generic.homset import SchemeHomset_points
    5252from sage.schemes.generic.morphism import is_SchemeMorphism
    5353from sage.schemes.generic.spec import Spec, is_Spec
    5454from jacobian_morphism import JacobianMorphism_divisor_class_field
    5555
    56 class JacobianHomset_divisor_classes(SchemeHomset_coordinates):
     56class JacobianHomset_divisor_classes(SchemeHomset_points):
    5757    def __init__(self, Y, X, **kwds):
    5858        R = X.base_ring()
    5959        S = Y.coordinate_ring()
    60         SchemeHomset_coordinates.__init__(self, Y, X, **kwds)
     60        SchemeHomset_points.__init__(self, Y, X, **kwds)
    6161        P2 = X.curve()._printing_ring
    6262        if S != R:
    6363            y = str(P2.gen())
     
    156156        else:
    157157            return -1
    158158
    159     def _point_morphism_class(self, *args, **kwds):
     159    def _morphism_class(self, *args, **kwds):
    160160        return JacobianMorphism_divisor_class_field(*args, **kwds)
    161161
    162162    def curve(self):
  • sage/schemes/plane_conics/constructor.py

    diff --git a/sage/schemes/plane_conics/constructor.py b/sage/schemes/plane_conics/constructor.py
    a b  
    3333                            is_RationalField)
    3434from sage.rings.number_field.number_field import is_NumberField                           
    3535from sage.schemes.generic.all import ProjectiveSpace
    36 from sage.schemes.generic.morphism import (SchemeMorphism_affine_coordinates,
    37                             SchemeMorphism_projective_coordinates_field)
     36from sage.schemes.generic.morphism import (
     37    SchemeMorphism_point_affine, SchemeMorphism_point_projective_field)
    3838from sage.structure.all import Sequence
    3939from sage.structure.element import is_Matrix
    4040
     
    148148        if len(F) == 5:
    149149            L=[]
    150150            for f in F:
    151                 if isinstance(f, SchemeMorphism_affine_coordinates):
     151                if isinstance(f, SchemeMorphism_point_affine):
    152152                    C = Sequence(f, universe = base_field)
    153153                    if len(C) != 2:
    154154                        raise TypeError, "points in F (=%s) must be planar"%F
    155155                    C.append(1)
    156                 elif isinstance(f, SchemeMorphism_projective_coordinates_field):
     156                elif isinstance(f, SchemeMorphism_point_projective_field):
    157157                    C = Sequence(f, universe = base_field)
    158158                elif isinstance(f, (list, tuple)):
    159159                    C = Sequence(f, universe = base_field)