Skip to content

Commit

Permalink
Trac #13445: Cuspidal subspace of modular forms over finite field con…
Browse files Browse the repository at this point in the history
…tains forms that are not cuspidal

Executing:
{{{
M=ModularForms(Gamma1(29),base_ring=GF(29))
S=M.cuspidal_subspace()
S.basis()
}}}
gives:
{{{
[
1 + O(q^6),
q + O(q^6),
q^2 + O(q^6),
q^3 + O(q^6),
q^4 + O(q^6),
q^5 + O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6),
O(q^6)
]
}}}

The first element is clearly not cuspidal

URL: http://trac.sagemath.org/13445
Reported by: mderickx
Ticket author(s): Alex Ghitza
Reviewer(s): Peter Bruin
  • Loading branch information
Release Manager authored and vbraun committed May 12, 2014
2 parents faef6e8 + cf1c1bf commit ddfcd0d
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 10 deletions.
4 changes: 2 additions & 2 deletions src/sage/modular/modform/ambient.py
Expand Up @@ -182,9 +182,9 @@ def change_ring(self, base_ring):
sage: M3 = M.change_ring(GF(3))
sage: M3.basis()
[
1 + q^3 + q^4 + 2*q^5 + O(q^6),
q + q^3 + q^4 + O(q^6),
q^2 + 2*q^3 + q^4 + q^5 + O(q^6)
q^2 + 2*q^3 + q^4 + q^5 + O(q^6),
1 + q^3 + q^4 + 2*q^5 + O(q^6)
]
"""
import constructor
Expand Down
55 changes: 47 additions & 8 deletions src/sage/modular/modform/ambient_R.py
Expand Up @@ -85,21 +85,60 @@ def _compute_q_expansion_basis(self, prec=None):
"""
Compute q-expansions for a basis of self to precision prec.
EXAMPLES:
EXAMPLES::
sage: M = ModularForms(23,2,base_ring=GF(7))
sage: M._compute_q_expansion_basis(5)
[1 + 5*q^3 + 5*q^4 + O(q^5),
q + 6*q^3 + 6*q^4 + O(q^5),
q^2 + 5*q^3 + 6*q^4 + O(q^5)]
sage: M._compute_q_expansion_basis(10)
[q + 6*q^3 + 6*q^4 + 5*q^6 + 2*q^7 + 6*q^8 + 2*q^9 + O(q^10),
q^2 + 5*q^3 + 6*q^4 + 2*q^5 + q^6 + 2*q^7 + 5*q^8 + O(q^10),
1 + 5*q^3 + 5*q^4 + 5*q^6 + 3*q^8 + 5*q^9 + O(q^10)]
TESTS:
This checks that :trac:`13445` is fixed::
sage: M = ModularForms(Gamma1(29), base_ring=GF(29))
sage: S = M.cuspidal_subspace()
sage: 0 in [f.valuation() for f in S.basis()]
False
sage: len(S.basis()) == dimension_cusp_forms(Gamma1(29), 2)
True
"""
if prec == None:
prec = self.prec()
if self.base_ring().characteristic() == 0:
R = self._q_expansion_ring()
c = self.base_ring().characteristic()
if c == 0:
B = self.__M.q_expansion_basis(prec)
return [R(f) for f in B]
elif c.is_prime_power():
K = self.base_ring()
p = K.characteristic().prime_factors()[0]
from sage.rings.all import GF
Kp = GF(p)
newB = [f.change_ring(K) for f in list(self.__M.cuspidal_subspace().q_integral_basis(prec))]
A = Kp**prec
gens = [f.padded_list(prec) for f in newB]
V = A.span(gens)
B = [f.change_ring(K) for f in self.__M.q_integral_basis(prec)]
for f in B:
fc = f.padded_list(prec)
gens.append(fc)
if not A.span(gens) == V:
newB.append(f)
V = A.span(gens)
if len(newB) != self.dimension():
raise RuntimeError("The dimension of the space is %s but the basis we computed has %s elements"%(self.dimension(), len(newB)))
lst = [R(f) for f in newB]
return [f/f[f.valuation()] for f in lst]
else:
# this returns a basis of q-expansions, without guaranteeing that
# the first vectors form a basis of the cuspidal subspace
# TODO: bring this in line with the other cases
# simply using the above code fails because free modules over
# general rings do not have a .span() method
B = self.__M.q_integral_basis(prec)
R = self._q_expansion_ring()
return [R(f) for f in B]
return [R(f) for f in B]

def cuspidal_submodule(self):
r"""
Expand Down

0 comments on commit ddfcd0d

Please sign in to comment.