Example #1
0
    def __init__(self, X, Y, category=None):
        r"""
        Create the space of homomorphisms between X and Y, which must have the
        same base ring.

        EXAMPLE::

            sage: M = ModularForms(Gamma0(7), 4)
            sage: M.Hom(M)
            Set of Morphisms from ... to ... in Category of Hecke modules over Rational Field
            sage: sage.modular.hecke.homspace.HeckeModuleHomspace(M, M.base_extend(Qp(13)))
            Traceback (most recent call last):
            ...
            TypeError: X and Y must have the same base ring
            sage: M.Hom(M) == loads(dumps(M.Hom(M)))
            True
        """
        if not module.is_HeckeModule(X) or not module.is_HeckeModule(Y):
            raise TypeError, "X and Y must be Hecke modules"
        if X.base_ring() != Y.base_ring():
            raise TypeError, "X and Y must have the same base ring"
        if category is None:
            category = X.category()
        sage.categories.homset.HomsetWithBase.__init__(self,
                                                       X,
                                                       Y,
                                                       category=category)
Example #2
0
    def __init__(self, X, Y, category = None):
        r"""
        Create the space of homomorphisms between X and Y, which must have the
        same base ring.

        EXAMPLE::

            sage: M = ModularForms(Gamma0(7), 4)
            sage: M.Hom(M)
            Set of Morphisms from ... to ... in Category of Hecke modules over Rational Field
            sage: sage.modular.hecke.homspace.HeckeModuleHomspace(M, M.base_extend(Qp(13)))
            Traceback (most recent call last):
            ...
            TypeError: X and Y must have the same base ring
            sage: M.Hom(M) == loads(dumps(M.Hom(M)))
            True
        """
        if not module.is_HeckeModule(X) or not module.is_HeckeModule(Y):
            raise TypeError("X and Y must be Hecke modules")
        if X.base_ring() != Y.base_ring():
            raise TypeError("X and Y must have the same base ring")
        if category is None:
            category = X.category()
        sage.categories.homset.HomsetWithBase.__init__(self, X, Y, category = category)
Example #3
0
    def __init__(self, M):
        """
        INPUT:

        -  ``M`` - a Hecke module

        EXAMPLE::

            sage: CuspForms(1, 12).hecke_algebra() # indirect doctest
            Full Hecke algebra acting on Cuspidal subspace of dimension 1 of Modular Forms space of dimension 2 for Modular Group SL(2,Z) of weight 12 over Rational Field
        """
        if not module.is_HeckeModule(M):
            raise TypeError("M (=%s) must be a HeckeModule"%M)
        self.__M = M
        sage.rings.commutative_algebra.CommutativeAlgebra.__init__(self, M.base_ring())