Skip to content

CMF Pari/GP snippet: lfun(L,1) fails for newforms of dimension greater than 1 #7134

Description

@roed-math

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions