I wrote the following function, which does the job. Function below takes as input a positive integer N and outputs two objects: the first output is a list [g_i] of hyperbolic elements in Gamma0(N) which generate the abelianized (Gamma0(N)_hyp)_ab of the quotient Gamma0(N)_hyp of Gamma0(N) by the subgroup generated by parabolic and elliptic elements. Group (Gamma0(N)_hyp)_ab is naturally isomorphic to H_1(X_0(N), ZZ) and is therefore free of rank 2g over ZZ, where g stands for the genus of the curve. It can also be regarded as the cuspidal subspace of the module of modular symbols of level N and weight 2. The second output is the matrix of the coordinates of each of the modular symbols {oo, g_i(oo)}, expressed in the basis given by Sage of the space of modular symbols of level N and weight 2.
Since I don't have much experience in programming, the algorithm below is most probably not the most efficient one, I'll be happy if anybody suggests an improved version of it. In any case, I computed the elements g_i in such a way that the entry c in the lower-left corner is N or -N. This is something I needed in order to make my subsequent computations faster. def hypgens(N): a=1; G=Gamma0(N); M=ModularSymbols(G); d=M.cuspidal_subspace().dimension(); Gens=[]; GensM=[]; Mat=[]; MatAux=[]; rnext=matrix(Mat).rank(); while rnext<d: a=a+1; rant=rnext; g=G.are_equivalent_cusps(Cusp(Infinity),Cusp(a/N),trans=True); if g: if (g.a()+g.d()).abs()>2: m=M.modular_symbol([Infinity,g.a()/g.c()]); c=m.list(); MatAux.append(c); rnext=matrix(MatAux).rank(); if rnext>rant: if rnext <= d: Mat.append(c); Gens.append(g); GensM.append(m); return Gens,Matrix(Mat) ------------- Example: sage: Gens11,Mat11=hypgens(11); Gens11;Mat11 [[ 2 -1][11 -5], [ 3 1][11 4]] [ 0 0 1] [ 0 -1 1] Given a cuspidal modular symbol m in ModularSymbols(11), if one now wishes to find an element g in Gamma0(11) such that {oo, g(oo)} = m, one can do the following: sage: M=ModularSymbols(11); m = M.modular_symbol([8/177,-61/571]); X = Mat11.transpose().solve_right(vector(m.list()));X g=prod(Gens11[i]^(X[i]) for i in [0..len(X)-1]);g [-1453 377] [-3091 802] And one also has the factoization of this matrix as a product of the generating matrices g_i with c_i= 11 or -11. ---- On 21 dic, 18:37, victor <victor.rotger.ce...@gmail.com> wrote: > Let m be a modular symbol for the congruence subgroup G=Gamma0(N) for > some N. > > If one assumes m is cuspidal, there exist elements g in G such that m > is equivalent to the symbol {0,g(0)}. > > How can I compute one such g with sage? If possible, I'd like to find > g with as small coefficients as possible. I'd particularly interested > in finding g=[[a,b],[c,d]] with c small. > > If m={c1,c2} then we can just type > G.are_equivalent_cusps(c1,c2,trans=True) and the answer is True, > because cuspidality means that c1 and c2 are equivalent cusps under G. > > How can we compute g when, say, m={c1,c2}+{c3,c4} is cuspidal but c1 > is not equivalent to c2, and c3 is not equivalent to c4? Is there an > optimal way of computing it? -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org