def apply(self, g): r""" Act on this symbol by the element `g \in {\rm GL}_2(\QQ)`. INPUT: - ``g`` -- a list ``[a,b,c,d]``, corresponding to the 2x2 matrix `\begin{pmatrix} a & b \\ c & d \end{pmatrix} \in {\rm GL}_2(\QQ)`. OUTPUT: - ``FormalSum`` -- a formal sum `\sum_i c_i x_i`, where `c_i` are scalars and `x_i` are ModularSymbol objects, such that the sum `\sum_i c_i x_i` is the image of this symbol under the action of g. No reduction is performed modulo the relations that hold in self.space(). The action of `g` on symbols is by .. MATH:: P(X,Y)\{\alpha, \beta\} \mapsto P(dX-bY, -cx+aY) \{g(\alpha), g(\beta)\}. Note that for us we have `P=X^i Y^{k-2-i}`, which simplifies computation of the polynomial part slightly. EXAMPLES:: sage: s = ModularSymbols(11,2).1.modular_symbol_rep()[0][1]; s {-1/8, 0} sage: a=1;b=2;c=3;d=4; s.apply([a,b,c,d]) {15/29, 1/2} sage: x = -1/8; (a*x+b)/(c*x+d) 15/29 sage: x = 0; (a*x+b)/(c*x+d) 1/2 sage: s = ModularSymbols(11,4).1.modular_symbol_rep()[0][1]; s X^2*{-1/6, 0} sage: s.apply([a,b,c,d]) 16*X^2*{11/21, 1/2} - 16*X*Y*{11/21, 1/2} + 4*Y^2*{11/21, 1/2} sage: P = s.polynomial_part() sage: X,Y = P.parent().gens() sage: P(d*X-b*Y, -c*X+a*Y) 16*X^2 - 16*X*Y + 4*Y^2 sage: x=-1/6; (a*x+b)/(c*x+d) 11/21 sage: x=0; (a*x+b)/(c*x+d) 1/2 sage: type(s.apply([a,b,c,d])) <class 'sage.structure.formal_sum.FormalSum'> """ space = self.__space i = self.__i k = space.weight() a,b,c,d = tuple(g) coeffs = apply_to_monomial(i, k-2, d, -b, -c, a) g_alpha = self.__alpha.apply(g) g_beta = self.__beta.apply(g) return formal_sum.FormalSum([(coeffs[j], ModularSymbol(space, j, g_alpha, g_beta)) \ for j in reversed(range(k-1)) if coeffs[j] != 0])
def apply(self, g): r""" Act on this symbol by the element `g \in {\rm GL}_2(\QQ)`. INPUT: - ``g`` -- a list ``[a,b,c,d]``, corresponding to the 2x2 matrix `\begin{pmatrix} a & b \\ c & d \end{pmatrix} \in {\rm GL}_2(\QQ)`. OUTPUT: - ``FormalSum`` -- a formal sum `\sum_i c_i x_i`, where `c_i` are scalars and `x_i` are ModularSymbol objects, such that the sum `\sum_i c_i x_i` is the image of this symbol under the action of g. No reduction is performed modulo the relations that hold in self.space(). The action of `g` on symbols is by .. math:: P(X,Y)\{\alpha, \beta\} \mapsto P(dX-bY, -cx+aY) \{g(\alpha), g(\beta)\}. Note that for us we have `P=X^i Y^{k-2-i}`, which simplifies computation of the polynomial part slightly. EXAMPLES:: sage: s = ModularSymbols(11,2).1.modular_symbol_rep()[0][1]; s {-1/8, 0} sage: a=1;b=2;c=3;d=4; s.apply([a,b,c,d]) {15/29, 1/2} sage: x = -1/8; (a*x+b)/(c*x+d) 15/29 sage: x = 0; (a*x+b)/(c*x+d) 1/2 sage: s = ModularSymbols(11,4).1.modular_symbol_rep()[0][1]; s X^2*{-1/6, 0} sage: s.apply([a,b,c,d]) 16*X^2*{11/21, 1/2} - 16*X*Y*{11/21, 1/2} + 4*Y^2*{11/21, 1/2} sage: P = s.polynomial_part() sage: X,Y = P.parent().gens() sage: P(d*X-b*Y, -c*X+a*Y) 16*X^2 - 16*X*Y + 4*Y^2 sage: x=-1/6; (a*x+b)/(c*x+d) 11/21 sage: x=0; (a*x+b)/(c*x+d) 1/2 sage: type(s.apply([a,b,c,d])) <class 'sage.structure.formal_sum.FormalSum'> """ space = self.__space i = self.__i k = space.weight() a,b,c,d = tuple(g) coeffs = apply_to_monomial(i, k-2, d, -b, -c, a) g_alpha = self.__alpha.apply(g) g_beta = self.__beta.apply(g) return formal_sum.FormalSum([(coeffs[j], ModularSymbol(space, j, g_alpha, g_beta)) \ for j in reversed(range(k-1)) if coeffs[j] != 0])
def __manin_symbol_rep(self, alpha): """ Return Manin symbol representation of X^i*Y^(k-2-i){0,alpha}. EXAMPLES:: sage: s = ModularSymbols(11,2).1.modular_symbol_rep()[0][1]; s {-1/8, 0} sage: s.manin_symbol_rep() # indirect doctest -(1,1) - (-8,1) sage: M = ModularSymbols(11,2) sage: s = M( (1,9) ); s (1,9) sage: t = s.modular_symbol_rep()[0][1].manin_symbol_rep(); t -(1,1) - (-9,1) sage: M(t) (1,9) """ space = self.__space i = self.__i k = space.weight() v = [(0,1), (1,0)] if not alpha.is_infinity(): cf = alpha._rational_().continued_fraction() v.extend((cf.p(k),cf.q(k)) for k in range(len(cf))) sign = 1 z = formal_sum.FormalSum(0) for j in range(1,len(v)): c = sign*v[j][1] d = v[j-1][1] coeffs = apply_to_monomial(i, k-2, sign*v[j][0], v[j-1][0], sign*v[j][1], v[j-1][1]) w = [(coeffs[j], ManinSymbol(space, (j, c, d))) for j in range(k-1) if coeffs[j] != 0] z += formal_sum.FormalSum(w) sign *= -1 return z
def __manin_symbol_rep(self, alpha): """ Return Manin symbol representation of X^i*Y^(k-2-i){0,alpha}. EXAMPLES:: sage: s = ModularSymbols(11,2).1.modular_symbol_rep()[0][1]; s {-1/8, 0} sage: s.manin_symbol_rep() # indirect doctest -(-8,1) - (1,1) sage: M = ModularSymbols(11,2) sage: s = M( (1,9) ); s (1,9) sage: t = s.modular_symbol_rep()[0][1].manin_symbol_rep(); t -(-9,1) - (1,1) sage: M(t) (1,9) """ space = self.__space i = self.__i k = space.weight() v = [(0,1), (1,0)] if not alpha.is_infinity(): cf = alpha._rational_().continued_fraction() v.extend((cf.p(k),cf.q(k)) for k in range(len(cf))) sign = 1 z = formal_sum.FormalSum(0) for j in range(1,len(v)): c = sign*v[j][1] d = v[j-1][1] coeffs = apply_to_monomial(i, k-2, sign*v[j][0], v[j-1][0], sign*v[j][1], v[j-1][1]) w = [(coeffs[j], ManinSymbol(space, (j, c, d))) for j in range(k-1) if coeffs[j] != 0] z += formal_sum.FormalSum(w) sign *= -1 return z