Ejemplo n.º 1
0
    def _Hom_(self, Y, category=None, check=True):
        """
        Return the set of scheme morphisms from ``self`` to ``Y``.

        INPUT:

        - ``Y`` -- a scheme. The codomain of the Hom-set.

        - ``category`` -- a category (optional). The category of the
          Hom-set.

        - ``check`` -- boolean (optional, default=``True``). Whether
          to check the defining data for consistency.

        OUTPUT:

        The set of morphisms from ``self`` to ``Y``.

        EXAMPLES::

            sage: P = ProjectiveSpace(ZZ, 3)
            sage: S = Spec(ZZ)
            sage: S._Hom_(P)
            Set of rational points of Projective Space of dimension 3 over Integer Ring
        """
        from sage.schemes.generic.homset import SchemeHomset
        return SchemeHomset(self, Y, category=category, check=check)
Ejemplo n.º 2
0
    def _Hom_(self, Y, category=None, check=True):
        """
        Return the set of scheme morphisms from ``self`` to ``Y``.

        INPUT:

        - ``Y`` -- a scheme; the codomain of the Hom-set

        - ``category`` -- a category (optional); the category of the
          Hom-set

        - ``check`` -- boolean (optional, default: ``True``); whether
          to check the defining data for consistency.

        OUTPUT:

        The set of morphisms from ``self`` to ``Y``.

        EXAMPLES::

            sage: P = ProjectiveSpace(ZZ, 3)
            sage: S = Spec(ZZ)
            sage: S._Hom_(P)
            Set of morphisms
              From: Spectrum of Integer Ring
              To:   Projective Space of dimension 3 over Integer Ring

        TESTS::

            sage: S._Hom_(P).__class__
            <class 'sage.schemes.generic.homset.SchemeHomset_generic_with_category'>

            sage: E = EllipticCurve('37a1')
            sage: Hom(E, E).__class__
            <class 'sage.schemes.generic.homset.SchemeHomset_generic_with_category'>

            sage: Hom(Spec(ZZ), Spec(ZZ)).__class__
            <class 'sage.schemes.generic.homset.SchemeHomset_generic_with_category_with_equality_by_id'>
        """
        from sage.schemes.generic.homset import SchemeHomset
        return SchemeHomset(self, Y, category=category, check=check)
Ejemplo n.º 3
0
    def _Hom_(self, Y, category=None, check=True):
        """
        Return the set of scheme morphisms from ``self`` to ``Y``.

        INPUT:

        - ``Y`` -- a scheme. The codomain of the Hom-set.

        - ``category`` -- a category (optional). The category of the
          Hom-set.

        - ``check`` -- boolean (optional, default=``True``). Whether
          to check the defining data for consistency.

        OUTPUT:

        The set of morphisms from ``self`` to ``Y``.

        EXAMPLES::

            sage: P = ProjectiveSpace(ZZ, 3)
            sage: S = Spec(ZZ)
            sage: S._Hom_(P)
            Set of rational points of Projective Space of dimension 3 over Integer Ring

        TESTS::

            sage: S._Hom_(P).__class__
            <class 'sage.schemes.projective.projective_homset.SchemeHomset_points_projective_ring_with_category'>

            sage: E = EllipticCurve('37a1')
            sage: Hom(E, E).__class__
            <class 'sage.schemes.generic.homset.SchemeHomset_generic_with_category'>

            sage: Hom(Spec(ZZ), Spec(ZZ)).__class__
            <class 'sage.schemes.affine.affine_homset.SchemeHomset_points_spec_with_category'>
        """
        from sage.schemes.generic.homset import SchemeHomset
        return SchemeHomset(self, Y, category=category, check=check)
Ejemplo n.º 4
0
    def point_homset(self, S=None):
        """
        Return the set of S-valued points of this scheme.

        INPUT:

        - ``S`` -- a commutative ring.

        OUTPUT:

        The set of morphisms `Spec(S)\to X`.

        EXAMPLES::

            sage: P = ProjectiveSpace(ZZ, 3)
            sage: P.point_homset(ZZ)
            Set of rational points of Projective Space of dimension 3 over Integer Ring
            sage: P.point_homset(QQ)
            Set of rational points of Projective Space of dimension 3 over Rational Field
            sage: P.point_homset(GF(11))
            Set of rational points of Projective Space of dimension 3 over
            Finite Field of size 11

        TESTS::

            sage: P = ProjectiveSpace(QQ,3)
            sage: P.point_homset(GF(11))
            Traceback (most recent call last):
            ...
            ValueError: There must be a natural map S --> R, but
            S = Rational Field and R = Finite Field of size 11
        """
        if S is None:
            S = self.base_ring()
        from sage.schemes.generic.spec import Spec
        SpecS = Spec(S, self.base_ring())
        from sage.schemes.generic.homset import SchemeHomset
        return SchemeHomset(SpecS, self)
Ejemplo n.º 5
0
            def __new__(cls, R, S, category):
                """
                TESTS::

                    sage: E = EllipticCurve('37a1')
                    sage: Hom(E, E).__class__
                    <class 'sage.schemes.generic.homset.SchemeHomset_generic_with_category'>

                If both schemes R and S are actually specs, we want
                the parent for Hom(R, S) to be in a different class::

                    sage: Hom(Spec(ZZ), Spec(ZZ)).__class__
                    <class 'sage.schemes.generic.homset.SchemeHomset_points_spec_with_category'>

                Currently, and to minimize the changes, this is done
                by delegating the job to SchemeHomset. This is not
                very robust: for example, only one category can do
                this hack.

                FIXME: this might be better handled by an extra Spec category
                """
                from sage.schemes.generic.homset import SchemeHomset
                return SchemeHomset(R, S, category=category)