Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #16916: fix precision issues in cuspform_lseries()
Browse files Browse the repository at this point in the history
  • Loading branch information
tornaria committed Sep 1, 2014
1 parent 79d9c2f commit 74b6a67
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/sage/modular/modform/element.py
Expand Up @@ -736,6 +736,19 @@ def cuspform_lseries(self, prec=53,
(0.725681061936153, 0.725681061936153)
sage: CuspForms(1, 30).0.cuspform_lseries().eps
-1
We can change the precision (in bits)
sage: f = Newforms(389, names='a')[0]
sage: L = f.cuspform_lseries(prec=30)
sage: abs(L(1)) < 2^-30
True
sage: L = f.cuspform_lseries(prec=53)
sage: abs(L(1)) < 2^-53
True
sage: L = f.cuspform_lseries(prec=100)
sage: abs(L(1)) < 2^-100
True
"""
if self.q_expansion().list()[0] != 0:
raise TypeError("f = %s is not a cusp form" % self)
Expand All @@ -752,7 +765,10 @@ def cuspform_lseries(self, prec=53,
weight = l,
eps = e,
prec = prec)
s = 'coeff = %s;'%self.q_expansion(prec).list()
# Find out how many coefficients of the Dirichlet series are needed
# in order to compute to the required precision
num_coeffs = L.num_coeffs()
s = 'coeff = %s;'%self.q_expansion(num_coeffs+2).list()
L.init_coeffs('coeff[k+1]',pari_precode = s,
max_imaginary_part=max_imaginary_part,
max_asymp_coeffs=max_asymp_coeffs)
Expand Down

0 comments on commit 74b6a67

Please sign in to comment.