Opened 12 years ago

Closed 12 years ago

#10450 closed defect (fixed)

Problem computing Hecke matrices on subspaces of modular forms spaces

Reported by: David Loeffler Owned by: Craig Citro
Priority: major Milestone: sage-4.6.2
Component: modular forms Keywords: hecke operator
Cc: Merged in: sage-4.6.2.alpha3
Authors: David Loeffler Reviewers: Alex Ghitza
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by David Loeffler)

Sage seems to have trouble computing Hecke matrices on subspaces of Gamma1 modular forms spaces, which is absurd, since it has no trouble computing Hecke matrices on the parent spaces:

sage: S = CuspForms(Gamma1(22))
sage: S.new_submodule().hecke_matrix(5)
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)

/home/masiao/<ipython console> in <module>()

/usr/local/sage/sage-4.6/local/lib/python2.6/site-packages/sage/modular/hecke/module.pyc in hecke_matrix(self, n)
   1288             raise IndexError, "n must be positive."
   1289         if not self._hecke_matrices.has_key(n):
-> 1290             T = self._compute_hecke_matrix(n)
   1291             T.set_immutable()
   1292             self._hecke_matrices[n] = T

/usr/local/sage/sage-4.6/local/lib/python2.6/site-packages/sage/modular/modform/space.pyc in _compute_hecke_matrix(self, n)
   1311         """
   1312         if hasattr(self, '_compute_q_expansion_basis'):
-> 1313             return hecke.HeckeModule_generic._compute_hecke_matrix(self, n)
   1314         else:
   1315             return hecke.HeckeSubmodule._compute_hecke_matrix(self, n)

/usr/local/sage/sage-4.6/local/lib/python2.6/site-packages/sage/modular/hecke/module.pyc in _compute_hecke_matrix(self, n, **kwds)
    214         
    215         if arith.is_prime(n):
--> 216             return self._compute_hecke_matrix_prime(n, **kwds)
    217 
    218         F = arith.factor(n)

/usr/local/sage/sage-4.6/local/lib/python2.6/site-packages/sage/modular/modform/space.pyc in _compute_hecke_matrix_prime(self, p, prec)
   1281         eps = self.character()
   1282         if eps is None:
-> 1283             raise NotImplementedError
   1284         try:
   1285             return hecke_operator_on_qexp.hecke_operator_on_basis(B, p,

NotImplementedError: 

Attachments (3)

trac_10450.patch (1.4 KB) - added by David Loeffler 12 years ago.
patch against 4.6.1.alpha3
trac_10450_new.patch (4.3 KB) - added by David Loeffler 12 years ago.
apply only this patch
trac_10450-extra_doctests.patch (2.0 KB) - added by David Loeffler 12 years ago.

Download all attachments as: .zip

Change History (12)

comment:1 Changed 12 years ago by David Loeffler

Description: modified (diff)

comment:2 Changed 12 years ago by David Loeffler

Authors: David Loeffler
Status: newneeds_review

Here's a 1/1/1 fix: one line, one comment and one doctest.

Changed 12 years ago by David Loeffler

Attachment: trac_10450.patch added

patch against 4.6.1.alpha3

comment:3 Changed 12 years ago by Alex Ghitza

Status: needs_reviewneeds_info

This looks good with one exception: we (still) can't have the action of Tn with n not squarefree:

sage: CuspForms(Gamma1(22), 2).new_submodule().hecke_matrix(9)
...
NotImplementedError: either character or _compute_hecke_matrix_prime_power must be overloaded in a derived class

Do you want to try to fix this here as well, or put this into a new ticket?

Changed 12 years ago by David Loeffler

Attachment: trac_10450_new.patch added

apply only this patch

comment:4 Changed 12 years ago by David Loeffler

Status: needs_infoneeds_review

Here's a new patch which should correct the prime power case as well. The new version does all of the factoring tricks etc at the level of the ambient space (or, where possible, its eisenstein or cuspidal submodule), and just restricts the answer to the given subspace at the end. Along the way, I've fixed a tiny bug in eisenstein_submodule and cuspidal_submodule, and added is_eisenstein and is_cuspidal, for generic mod forms spaces.

comment:5 Changed 12 years ago by Alex Ghitza

Great stuff, and good catch on the two missing return statements.

Of course, these would never have made it in if there were doctests to check those parts of the code. May I suggest adding some now? Here is an easy example:

sage: M = ModularForms(6, 10)
sage: S = M.cuspidal_submodule()
sage: W = S.span_of_basis(S.basis()[0:2])
sage: W.cuspidal_submodule()
Modular Forms subspace of dimension 2 of Modular Forms space of dimension 11 for Congruence Subgroup Gamma0(6) of weight 10 over Rational Field

and something along the same lines for eisenstein_submodule.

Changed 12 years ago by David Loeffler

comment:6 Changed 12 years ago by David Loeffler

OK, here's an additional patch adding those two doctests.

comment:7 Changed 12 years ago by Alex Ghitza

Reviewers: Alex Ghitza
Status: needs_reviewpositive_review

Looks good to me.

comment:8 Changed 12 years ago by David Loeffler

Thanks!

comment:9 Changed 12 years ago by Jeroen Demeyer

Merged in: sage-4.6.2.alpha3
Resolution: fixed
Status: positive_reviewclosed
Note: See TracTickets for help on using tickets.