def __call__(self, A, name=''): r""" Create an element of the homspace ``self`` from `A`. INPUT: - ``A`` -- one of the following: - an element of a Hecke algebra - a Hecke module morphism - a matrix - a list of elements of the codomain specifying the images of the basis elements of the domain. EXAMPLES:: sage: M = ModularForms(Gamma0(7), 4) sage: H = M.Hom(M) sage: H(M.hecke_operator(7)) Hecke module morphism T_7 defined by the matrix [ -7 0 0] [ 0 1 240] [ 0 0 343] Domain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... Codomain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... sage: H(H(M.hecke_operator(7))) Hecke module morphism T_7 defined by the matrix [ -7 0 0] [ 0 1 240] [ 0 0 343] Domain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... Codomain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... sage: H(matrix(QQ, 3, srange(9))) Hecke module morphism defined by the matrix [0 1 2] [3 4 5] [6 7 8] Domain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... Codomain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... """ try: if A.parent() == self: A._set_parent(self) return A A = A.hecke_module_morphism() if A.parent() == self: A._set_parent(self) return A else: raise TypeError("unable to coerce A to self") except AttributeError: pass if isinstance(A, (list, tuple)): from sage.matrix.constructor import matrix A = matrix([f.element() for f in A]) return morphism.HeckeModuleMorphism_matrix(self, A, name)
def __call__(self, A, name=''): r""" Create an element of this space from A, which should be an element of a Hecke algebra, a Hecke module morphism, or a matrix. EXAMPLES:: sage: M = ModularForms(Gamma0(7), 4) sage: H = M.Hom(M) sage: H(M.hecke_operator(7)) Hecke module morphism T_7 defined by the matrix [ -7 0 0] [ 0 1 240] [ 0 0 343] Domain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... Codomain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... sage: H(H(M.hecke_operator(7))) Hecke module morphism T_7 defined by the matrix [ -7 0 0] [ 0 1 240] [ 0 0 343] Domain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... Codomain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... sage: H(matrix(QQ, 3, srange(9))) Hecke module morphism defined by the matrix [0 1 2] [3 4 5] [6 7 8] Domain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... Codomain: Modular Forms space of dimension 3 for Congruence Subgroup Gamma0(7) ... """ try: if A.parent() == self: A._set_parent(self) return A A = A.hecke_module_morphism() if A.parent() == self: A._set_parent(self) return A else: raise TypeError("unable to coerce A to self") except AttributeError: pass return morphism.HeckeModuleMorphism_matrix(self, A, name)
def hecke_module_morphism(self): """ Return the endomorphism of Hecke modules defined by the matrix attached to this Hecke operator. EXAMPLES:: sage: M = ModularSymbols(Gamma1(13)) sage: t = M.hecke_operator(2) sage: t Hecke operator T_2 on Modular Symbols space of dimension 15 for Gamma_1(13) of weight 2 with sign 0 and over Rational Field sage: t.hecke_module_morphism() Hecke module morphism T_2 defined by the matrix [ 2 1 0 0 0 0 0 0 0 0 0 0 0 0 -1] [ 0 2 0 1 0 0 0 -1 0 0 0 0 0 0 0] [ 0 0 2 0 0 1 -1 1 0 -1 0 1 -1 0 0] [ 0 0 0 2 1 0 1 0 0 0 1 -1 0 0 0] [ 0 0 1 0 2 0 0 0 0 1 -1 0 0 0 1] [ 1 0 0 0 0 2 0 0 0 0 0 0 1 0 0] [ 0 0 0 0 0 0 0 1 -1 1 -1 0 -1 1 1] [ 0 0 0 0 0 0 0 -1 1 1 0 0 -1 1 0] [ 0 0 0 0 0 0 -1 -1 0 1 -1 -1 1 0 -1] [ 0 0 0 0 0 0 -2 0 2 -2 0 2 -2 1 -1] [ 0 0 0 0 0 0 0 0 2 -1 1 0 0 1 -1] [ 0 0 0 0 0 0 -1 1 2 -1 1 0 -2 2 0] [ 0 0 0 0 0 0 0 0 1 1 0 -1 0 0 0] [ 0 0 0 0 0 0 -1 1 1 0 1 1 -1 0 0] [ 0 0 0 0 0 0 2 0 0 0 2 -1 0 1 -1] Domain: Modular Symbols space of dimension 15 for Gamma_1(13) of weight ... Codomain: Modular Symbols space of dimension 15 for Gamma_1(13) of weight ... """ try: return self.__hecke_module_morphism except AttributeError: T = self.matrix() M = self.domain() H = End(M) if isinstance(self, HeckeOperator): name = "T_%s" % self.index() else: name = "" self.__hecke_module_morphism = morphism.HeckeModuleMorphism_matrix( H, T, name) return self.__hecke_module_morphism