The last two lines of the Pari/GP code snippet on classical modular form pages,
L = lfunmf(mf,f);
lfun(L,1)
fail for every newform whose dimension is greater than 1, which is most of them.
To reproduce
Download the Pari/GP commands for 23.2.a.a (level 23, weight 2, dimension 2) and run them. Everything works until the last line:
? L = lfunmf(mf,f);
? lfun(L,1)
*** at top-level: lfun(L,1)
*** ^---------
*** lfun: incorrect type in lfunmisc_to_ldata (t_VEC).
Cause
When the newform has several conjugate embeddings, lfunmf returns a vector of L-functions, one per embedding, rather than a single L-function, and lfun does not accept a vector:
? type(lfunmf(mf,f))
t_VEC
For dimension 1 it returns a bare L-function, which is why the snippet works there (and why the committed 95.1.d.a snippet log looks fine).
Notes for a fix
Any fix has to cover both cases, since the return type depends on the dimension. Options are to take a single embedding, e.g.
L = lfunmf(mf,f);
lfun(if(type(L)=="t_VEC", L[1], L), 1)
or to report the special value for every embedding, which is arguably more useful on a page that lists all of them. Either way the accompanying comment ("L function, special value at s=1") should probably say which embedding is being used.
The snippet lives in the l-function block of lmfdb/classical_modular_forms/code-form.yaml.
Found while adding snippet_test coverage for the newform pages: any newform with a long enough trace list to be interesting for those tests has dimension > 1, so every candidate hit this.
The last two lines of the Pari/GP code snippet on classical modular form pages,
fail for every newform whose dimension is greater than 1, which is most of them.
To reproduce
Download the Pari/GP commands for
23.2.a.a(level 23, weight 2, dimension 2) and run them. Everything works until the last line:Cause
When the newform has several conjugate embeddings,
lfunmfreturns a vector of L-functions, one per embedding, rather than a single L-function, andlfundoes not accept a vector:For dimension 1 it returns a bare L-function, which is why the snippet works there (and why the committed
95.1.d.asnippet log looks fine).Notes for a fix
Any fix has to cover both cases, since the return type depends on the dimension. Options are to take a single embedding, e.g.
or to report the special value for every embedding, which is arguably more useful on a page that lists all of them. Either way the accompanying comment ("L function, special value at s=1") should probably say which embedding is being used.
The snippet lives in the
l-functionblock oflmfdb/classical_modular_forms/code-form.yaml.Found while adding
snippet_testcoverage for the newform pages: any newform with a long enough trace list to be interesting for those tests has dimension > 1, so every candidate hit this.