#10510: ModularSymbols(Gamma1(29), 
2).cuspidal_subspace().hecke_algebra().basis()
doesn't terminate
-----------------------------+----------------------------------------------
   Reporter:  mderickx       |       Owner:  craigcitro
       Type:  defect         |      Status:  new       
   Priority:  major          |   Milestone:            
  Component:  modular forms  |    Keywords:            
     Author:  mderickx       |    Upstream:  N/A       
   Reviewer:                 |      Merged:            
Work_issues:                 |  
-----------------------------+----------------------------------------------
Description changed by was:

Old description:

> It also doesn't terminate for other primes then 29, but here is a more
> detailed example of the case 29 which should illustrate everything
>
> The sourcecode which determines the basis is currently:
>
> {{{
> def basis(self):
>     try:
>         return self.__basis_cache
>     except AttributeError:
>         pass
>     level = self.level()
>     bound = self.__M.hecke_bound()
>     dim = self.__M.rank()
>     if dim == 0:
>         basis = []
>     elif dim == 1:
>         basis = [self.hecke_operator(1)]
>     else:
>         span = [self.hecke_operator(n) for n in range(1, bound+1) if not
> self.is_anemic() or gcd(n, level) == 1]
>         rand_max = 5
>         while True:
>             # Project the full Hecke module to a random submodule to ease
> the HNF reduction.
>             v = (ZZ**dim).random_element(x=rand_max)
>             proj_span = matrix([T.matrix()*v for T in
> span])._clear_denom()[0]
>             proj_basis = proj_span.hermite_form()
>             if proj_basis[dim-1] == 0:
>                 # We got unlucky, choose another projection.
>                 rand_max *= 2
>                 continue
>             # Lift the projected basis to a basis in the Hecke algebra.
>             trans = proj_span.solve_left(proj_basis)
>             basis = [sum(c*T for c,T in zip(row,span) if c != 0) for row
> in trans[:dim]]
>             break
>
>     self.__basis_cache = tuple(basis)
>     return basis
> }}}
>
> Now dim equals 44 and the hecke bound 140 in this example:
> {{{
> sage: G29=Gamma1(29)
> sage: M=ModularSymbols(G29,2)
> sage: m=M.cuspidal_subspace()
> sage: m.rank()
> 44
> sage: m.hecke_bound()
> 140
> }}}
>
> Now we see that the hecke algebra has rank 22 over ZZ
> {{{
> sage: HA=m.hecke_algebra()
> sage: span = [HA.hecke_operator(n) for n in range(1, 140+1) if not
> HA.is_anemic() or gcd(n, 29) == 1]
> sage: (ZZ^(44^2)).span([i.matrix().list() for i in span])
> Free module of degree 1936 and rank 22 over Integer Ring
> Echelon basis matrix:
> 22 x 1936 dense matrix over Rational Field
> }}}
> So as the comment say's we are unlucky since proj_basis[43] will always
> be zero since the hecke algebra has only rank 22
> {{{
>             if proj_basis[dim-1] == 0:
>                 # We got unlucky, choose another projection.
>                 rand_max *= 2
>                 continue
> }}}
> I suspect there is a problem in that the rank of m is 44 over QQ. But
> that the rank of the hecke algebra will be the dimension of m as a
> complex vector space so dim should actually be half of what it is now.
>
> I don't know enough of modular symbols yet to know how it should be done
> in other weight's and other modular groups but I suspect there will be
> problems there also.

New description:

 It also doesn't terminate for other primes then 29, but here is a more
 detailed example of the case 29 which should illustrate everything

 The sourcecode which determines the basis is currently:

 {{{
 def basis(self):
     try:
         return self.__basis_cache
     except AttributeError:
         pass
     level = self.level()
     bound = self.__M.hecke_bound()
     dim = self.__M.rank()
     if dim == 0:
         basis = []
     elif dim == 1:
         basis = [self.hecke_operator(1)]
     else:
         span = [self.hecke_operator(n) for n in range(1, bound+1) if not
 self.is_anemic() or gcd(n, level) == 1]
         rand_max = 5
         while True:
             # Project the full Hecke module to a random submodule to ease
 the HNF reduction.
             v = (ZZ**dim).random_element(x=rand_max)
             proj_span = matrix([T.matrix()*v for T in
 span])._clear_denom()[0]
             proj_basis = proj_span.hermite_form()
             if proj_basis[dim-1] == 0:
                 # We got unlucky, choose another projection.
                 rand_max *= 2
                 continue
             # Lift the projected basis to a basis in the Hecke algebra.
             trans = proj_span.solve_left(proj_basis)
             basis = [sum(c*T for c,T in zip(row,span) if c != 0) for row
 in trans[:dim]]
             break

     self.__basis_cache = tuple(basis)
     return basis
 }}}

 Now dim equals 44 and the hecke bound 140 in this example:
 {{{
 sage: G29=Gamma1(29)
 sage: M=ModularSymbols(G29,2)
 sage: m=M.cuspidal_subspace()
 sage: m.rank()
 44
 sage: m.hecke_bound()
 140
 }}}

 Now we see that the hecke algebra has rank 22 over ZZ
 {{{
 sage: HA=m.hecke_algebra()
 sage: span = [HA.hecke_operator(n) for n in range(1, 140+1) if not
 HA.is_anemic() or gcd(n, 29) == 1]
 sage: (ZZ^(44^2)).span([i.matrix().list() for i in span])
 Free module of degree 1936 and rank 22 over Integer Ring
 Echelon basis matrix:
 22 x 1936 dense matrix over Rational Field
 }}}
 So as the comment say's we are unlucky since proj_basis[43] will always be
 zero since the hecke algebra has only rank 22
 {{{
             if proj_basis[dim-1] == 0:
                 # We got unlucky, choose another projection.
                 rand_max *= 2
                 continue
 }}}
 I suspect there is a problem in that the rank of m is 44 over QQ. But that
 the rank of the hecke algebra will be the dimension of m as a complex
 vector space so dim should actually be half of what it is now.

 I don't know enough of modular symbols yet to know how it should be done
 in other weights and other modular groups but I suspect there will be
 problems there also.

--

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10510#comment:2>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to