Esempio n. 1
0
    def module(self):
        """
        Return the underlying free module corresponding to this space
        of modular forms.

        If the dimension of self can be computed reasonably quickly,
        then this function returns a free module (viewed as a tuple
        space) of the same dimension as self over the same base ring.
        Otherwise, the dimension of self.module() may be smaller.  For
        example, in the case of weight 1 forms, in some cases the
        dimension can't easily be computed so self.module() is of
        smaller dimension.
        
        EXAMPLES::
        
            sage: m = ModularForms(Gamma1(13),10)
            sage: m.free_module()
            Vector space of dimension 69 over Rational Field
            sage: ModularForms(Gamma1(13),4, GF(49,'b')).free_module()
            Vector space of dimension 27 over Finite Field in b of size 7^2

        Note that in the following example the dimension can't be
        (quickly) computed, so M.module() returns a space of different
        dimension than M::
        
            sage: M = ModularForms(Gamma1(57), 1); M
            Modular Forms space of dimension (unknown) for Congruence ...
            sage: M.module()
            Vector space of dimension 36 over Rational Field
            sage: M.basis()
            Traceback (most recent call last):
            ...
            NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general
        """
        if hasattr(self, "__module"): return self.__module
        try:
            d = self.dimension()
        except NotImplementedError:

            # This only comes up for weight 1 forms, where we want to be able
            # to embed Eisenstein forms (which we know how to calculate) into
            # some suitable ambient space. Because we can't even calculate the
            # dimension of the weight 1 cusp forms in general, we just map
            # Eisenstein series onto basis vectors, and then make it clear by
            # raising errors in appropriate places that some cusp forms might
            # exist but we don't know how to compute them.

            d = self._dim_eisenstein()
        self.__module = free_module.VectorSpace(self.base_ring(), d)
        return self.__module
Esempio n. 2
0
    def module(self):
        """
        Return the underlying free module corresponding to this space
        of modular forms.

        EXAMPLES::

            sage: m = ModularForms(Gamma1(13),10)
            sage: m.free_module()
            Vector space of dimension 69 over Rational Field
            sage: ModularForms(Gamma1(13),4, GF(49,'b')).free_module()
            Vector space of dimension 27 over Finite Field in b of size 7^2
        """
        d = self.dimension()
        return free_module.VectorSpace(self.base_ring(), d)