Opened 8 years ago
Closed 8 years ago
#16916 closed defect (fixed)
cuspform_lseries() method for a new form has precision issues
Reported by:  tornaria  Owned by:  

Priority:  major  Milestone:  sage6.4 
Component:  modular forms  Keywords:  lseries 
Cc:  Merged in:  
Authors:  Gonzalo Tornaría  Reviewers:  Michael Neururer 
Report Upstream:  N/A  Work issues:  
Branch:  13dbf33 (Commits, GitHub, GitLab)  Commit:  13dbf33c15030e0af2a938e707e46b7d69d90a9b 
Dependencies:  Stopgaps: 
Description
sage: f = Newforms(67, names='a')[0] sage: L = f.cuspform_lseries() ... RuntimeError: Unable to create Lseries, due to precision or other limits in PARI.
This is because the field prec
is used both for the numerical precision and for the number of coefficients computed.
Since the Lfunctions class has a num_coeffs()
method, the proper thing is to use that to know how many coefficients to compute.
Change History (13)
comment:1 Changed 8 years ago by
 Branch set to u/tornaria/16916
 Commit set to 74b6a679543f8dafb58eb53df1d3971bd1dd9f07
 Status changed from new to needs_review
comment:2 Changed 8 years ago by
 Commit changed from 74b6a679543f8dafb58eb53df1d3971bd1dd9f07 to ae26b4a0141de1b89738fb2e3cebd9447f21af12
Branch pushed to git repo; I updated commit sha1. New commits:
ae26b4a  Trac #16916: avoid precision issues in cuspform_lseries

comment:3 Changed 8 years ago by
After the first commit there were a few cases for which the runtime error would still happen. It turns out that
f.q_expansion(num_coeff).list()
is not always a list of length num_coeff, because trailing zeros are removed. Instead we now use
f.q_expansion(num_coeff).padded_list()
which will not drop the trailing zeros.
comment:4 Changed 8 years ago by
 Commit changed from ae26b4a0141de1b89738fb2e3cebd9447f21af12 to 13dbf33c15030e0af2a938e707e46b7d69d90a9b
Branch pushed to git repo; I updated commit sha1. New commits:
13dbf33  remove tabs

comment:5 Changed 8 years ago by
Review: This patch fixes the problem in the description. I tried to calculate L(f,1) for new forms of various levels but even setting the precision very high I was never able to calculate with levels above 100. With the patch I calculated L(f,1) for all new forms with rational coefficients up to level 400 without increasing the precision.
comment:6 Changed 8 years ago by
 Reviewers set to Michael Neururer
comment:7 Changed 8 years ago by
 Status changed from needs_review to positive_review
comment:8 followup: ↓ 9 Changed 8 years ago by
 Status changed from positive_review to needs_work
Author name should be full name, not trac username.
comment:9 in reply to: ↑ 8 Changed 8 years ago by
Replying to vbraun:
Author name should be full name, not trac username.
Isn't that inconsistent with how the "Reported by" field is handled? Also, the "reported by" field links to a query for tickets reported by that person, but the "authors" field doesn't.
By the way, this ticket and #11631 are sooo embarrassing that I hope they can make it into 6.4... (especially since the fixes where kind of trivial).
comment:10 followup: ↓ 11 Changed 8 years ago by
 Status changed from needs_work to positive_review
"reported by" is where trac stores the account that created the ticket.
Author/Reviewer? are not necessarily trac accounts (could have been written by somebody without an account, for example). Also, they end up in the git commit log.
comment:11 in reply to: ↑ 10 Changed 8 years ago by
Replying to vbraun:
"reported by" is where trac stores the account that created the ticket.
Yes, I know, but with the same reason a defect could have been reported by somebody without an account and picked up by someone different.
Author/Reviewer? are not necessarily trac accounts (could have been written by somebody without an account, for example). Also, they end up in the git commit log.
So anybody can change the Author/Reviewer fields without a trac account?
I agree that git commit logs should have full name and email (mine do).
I understand your point, but I still think it's a bit inconsistent, and makes it difficult to search for tickets by name, because the account name is used for some fields (e.g. reported by, comments) but the real name is used for others (author, reviewer). Also, real names are not always canonical (e.g. mine has an accented i and it's not always used consistently  can't be used in sage source code, for instance), while trac login names should be unique.
Anyway, thanks for your work.
comment:12 Changed 8 years ago by
You need a trac account to edit tickets but you might post somebody else's code.
You can use UTF8 in the sources, this should be enough to write your name in your preferred spelling. If you can't decide how to spell your name I can't help you, though ;)
comment:13 Changed 8 years ago by
 Branch changed from u/tornaria/16916 to 13dbf33c15030e0af2a938e707e46b7d69d90a9b
 Resolution set to fixed
 Status changed from positive_review to closed
Fixed as proposed.
See also #11631 (cusp forms of degree > 1) and #12015 (more general implementation of Lseries).
New commits:
Trac #16916: fix precision issues in cuspform_lseries()