Exemplo n.º 1
0
    def __init__(self, C):
        """
        Initialize.

        TESTS::

            sage: from sage.schemes.jacobians.abstract_jacobian import Jacobian_generic
            sage: P2.<x, y, z> = ProjectiveSpace(QQ, 2)
            sage: C = Curve(x^3 + y^3 + z^3)
            sage: J = Jacobian_generic(C); J
            Jacobian of Projective Plane Curve over Rational Field defined by x^3 + y^3 + z^3
            sage: type(J)
            <class 'sage.schemes.jacobians.abstract_jacobian.Jacobian_generic_with_category'>

        Note: this is an abstract parent, so we skip element tests::

            sage: TestSuite(J).run(skip =["_test_an_element",\
                                          "_test_elements",\
                                          "_test_elements_eq_reflexive",\
                                          "_test_elements_eq_symmetric",\
                                          "_test_elements_eq_transitive",\
                                          "_test_elements_neq",\
                                          "_test_some_elements"])

        ::

            sage: Jacobian_generic(ZZ)
            Traceback (most recent call last):
            ...
            TypeError: Argument (=Integer Ring) must be a scheme.
            sage: Jacobian_generic(P2)
            Traceback (most recent call last):
            ...
            ValueError: C (=Projective Space of dimension 2 over Rational Field)
            must have dimension 1.

        ::

            sage: P2.<x, y, z> = ProjectiveSpace(Zmod(6), 2)
            sage: C = Curve(x + y + z, P2)
            sage: Jacobian_generic(C)
            Traceback (most recent call last):
            ...
            TypeError: C (=Projective Plane Curve over Ring of integers modulo 6
            defined by x + y + z) must be defined over a field.
        """
        if not is_Scheme(C):
            raise TypeError("Argument (=%s) must be a scheme." % C)
        if C.base_ring() not in _Fields:
            raise TypeError("C (=%s) must be defined over a field." % C)
        if C.dimension() != 1:
            raise ValueError("C (=%s) must have dimension 1." % C)
        self.__curve = C
        Scheme.__init__(self, C.base_scheme())
Exemplo n.º 2
0
    def __init__(self, n, R=ZZ):
        """
        TESTS::

            sage: from sage.schemes.generic.ambient_space import AmbientSpace
            sage: A = AmbientSpace(5, ZZ)
            sage: TestSuite(A).run() # not tested (abstract scheme with no elements?)
        """
        if not isinstance(R, CommutativeRing):
            raise TypeError("R (={}) must be a commutative ring".format(R))
        if n < 0:
            raise ValueError("n (={}) must be nonnegative".format(n))
        self._dimension_relative = Integer(n)
        Scheme.__init__(self, R)
Exemplo n.º 3
0
    def __init__(self, n, R=ZZ):
        """
        TEST::

            sage: from sage.schemes.generic.ambient_space import AmbientSpace
            sage: A = AmbientSpace(5, ZZ)
            sage: TestSuite(A).run() # not tested (abstract scheme with no elements?)
        """
        if not is_CommutativeRing(R):
            raise TypeError, "R (=%s) must be a commutative ring" % R
        n = Integer(n)
        if n < 0:
            raise ValueError, "n (=%s) must be nonnegative" % n
        self._dimension_relative = n
        Scheme.__init__(self, R)
Exemplo n.º 4
0
    def __init__(self, n, R=ZZ):
        """
        TEST::

            sage: from sage.schemes.generic.ambient_space import AmbientSpace
            sage: A = AmbientSpace(5, ZZ)
            sage: TestSuite(A).run() # not tested (abstract scheme with no elements?)
        """
        if not is_CommutativeRing(R):
            raise TypeError, "R (=%s) must be a commutative ring"%R
        n = Integer(n)
        if n < 0:
            raise ValueError, "n (=%s) must be nonnegative"%n
        self._dimension_relative = n
        Scheme.__init__(self, R)
Exemplo n.º 5
0
    def __init__(self, C):
        """
        TESTS::

            sage: from sage.schemes.jacobians.abstract_jacobian import Jacobian_generic
            sage: P2.<x, y, z> = ProjectiveSpace(QQ, 2)
            sage: C = Curve(x^3 + y^3 + z^3)
            sage: J = Jacobian_generic(C); J
            Jacobian of Projective Plane Curve over Rational Field defined by x^3 + y^3 + z^3
            sage: type(J)
            <class 'sage.schemes.jacobians.abstract_jacobian.Jacobian_generic_with_category'>

        Note: this is an abstract parent, so we skip element tests::

            sage: TestSuite(J).run(skip =["_test_an_element",\
                                          "_test_elements",\
                                          "_test_elements_eq_reflexive",\
                                          "_test_elements_eq_symmetric",\
                                          "_test_elements_eq_transitive",\
                                          "_test_elements_neq",\
                                          "_test_some_elements"])

        ::

            sage: Jacobian_generic(ZZ)
            Traceback (most recent call last):
            ...
            TypeError: Argument (=Integer Ring) must be a scheme.
            sage: Jacobian_generic(P2)
            Traceback (most recent call last):
            ...
            ValueError: C (=Projective Space of dimension 2 over Rational Field) must have dimension 1.
            sage: P2.<x, y, z> = ProjectiveSpace(Zmod(6), 2)
            sage: C = Curve(x + y + z)
            sage: Jacobian_generic(C)
            Traceback (most recent call last):
            ...
            TypeError: C (=Projective Plane Curve over Ring of integers modulo 6 defined by x + y + z) must be defined over a field.
        """
        if not is_Scheme(C):
            raise TypeError("Argument (=%s) must be a scheme."%C)
        if C.base_ring() not in _Fields:
            raise TypeError("C (=%s) must be defined over a field."%C)
        if C.dimension() != 1:
            raise ValueError("C (=%s) must have dimension 1."%C)
        self.__curve = C
        Scheme.__init__(self, C.base_scheme())