/* This code can be loaded, or copied and pasted, into Magma. It will load the data associated to the HMF, including the field, level, and Hecke and Atkin-Lehner eigenvalue data. At the *bottom* of the file, there is code to recreate the Hilbert modular form in Magma, by creating the HMF space and cutting out the corresponding Hecke irreducible subspace. From there, you can ask for more eigenvalues or modify as desired. It is commented out, as this computation may be lengthy. */ P := PolynomialRing(Rationals()); g := P![-1, -3, 6, 4, -5, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [13, 13, w^5 - 5*w^3 + 4*w], [25, 5, w^5 - 5*w^3 + 6*w - 1], [25, 5, -w^3 + w^2 + 3*w - 1], [25, 5, w^5 - 4*w^3 - w^2 + 3*w + 2], [27, 3, w^4 - w^3 - 4*w^2 + 2*w + 2], [27, 3, w^4 - w^3 - 4*w^2 + 2*w + 3], [53, 53, -w^4 + w^3 + 3*w^2 - 2*w + 1], [53, 53, -w^4 + w^3 + 4*w^2 - 3*w - 4], [53, 53, -w^5 + w^4 + 4*w^3 - 4*w^2 - 3*w + 1], [53, 53, w^3 - 2*w - 2], [53, 53, w^5 - 5*w^3 - w^2 + 5*w], [53, 53, -w^4 + 4*w^2 + w - 4], [64, 2, -2], [79, 79, -2*w^5 + w^4 + 9*w^3 - 3*w^2 - 9*w + 2], [79, 79, -w^5 - w^4 + 5*w^3 + 4*w^2 - 6*w - 1], [79, 79, w^3 - w^2 - 4*w + 1], [79, 79, -2*w^5 + 2*w^4 + 9*w^3 - 7*w^2 - 9*w + 3], [79, 79, -2*w^4 + w^3 + 7*w^2 - 3*w - 3], [79, 79, -w^5 + 6*w^3 - w^2 - 8*w + 1], [103, 103, 2*w^4 - 7*w^2 - w + 3], [103, 103, w^5 - w^4 - 4*w^3 + 5*w^2 + 2*w - 4], [103, 103, -w^5 - w^4 + 4*w^3 + 4*w^2 - 2*w - 3], [103, 103, w^5 - 2*w^4 - 4*w^3 + 6*w^2 + 4*w - 1], [103, 103, -w^4 + w^3 + 5*w^2 - 3*w - 4], [103, 103, 2*w^5 - w^4 - 10*w^3 + 3*w^2 + 10*w - 1], [131, 131, w^5 - w^4 - 5*w^3 + 3*w^2 + 4*w - 1], [131, 131, -w^5 + 2*w^4 + 4*w^3 - 6*w^2 - 4*w + 2], [131, 131, w^5 - w^4 - 4*w^3 + 5*w^2 + 2*w - 5], [131, 131, 2*w^4 - 7*w^2 - w + 2], [131, 131, -2*w^5 + w^4 + 9*w^3 - 2*w^2 - 8*w], [131, 131, 2*w^5 - w^4 - 10*w^3 + 3*w^2 + 10*w], [157, 157, -w^5 - w^4 + 5*w^3 + 5*w^2 - 6*w - 3], [157, 157, -2*w^3 + w^2 + 5*w - 2], [157, 157, -w^5 - w^4 + 4*w^3 + 5*w^2 - 3*w - 3], [157, 157, -w^5 + 5*w^3 - 7*w], [157, 157, -2*w^5 + w^4 + 8*w^3 - 3*w^2 - 6*w + 2], [157, 157, -w^5 + w^4 + 5*w^3 - 4*w^2 - 7*w + 2], [181, 181, w^2 - 2*w - 2], [181, 181, 2*w^5 - 9*w^3 + 7*w], [181, 181, -w^5 + 2*w^4 + 5*w^3 - 8*w^2 - 5*w + 4], [181, 181, -w^5 + w^4 + 6*w^3 - 3*w^2 - 9*w + 1], [181, 181, 2*w^5 - 2*w^4 - 8*w^3 + 6*w^2 + 5*w - 2], [181, 181, w^4 - 2*w^2 - 2], [233, 233, 2*w^3 - w^2 - 5*w + 1], [233, 233, -w^5 - w^4 + 6*w^3 + 3*w^2 - 8*w], [233, 233, w^5 - w^4 - 5*w^3 + 4*w^2 + 7*w - 3], [233, 233, w^5 + w^4 - 5*w^3 - 5*w^2 + 6*w + 4], [233, 233, -w^5 + 4*w^3 + 2*w^2 - 2*w - 3], [233, 233, 2*w^5 - w^4 - 8*w^3 + 3*w^2 + 6*w - 1], [311, 311, 2*w^5 - 2*w^4 - 9*w^3 + 6*w^2 + 8*w - 2], [311, 311, w^4 + w^3 - 3*w^2 - 4*w + 1], [311, 311, -w^5 + 2*w^4 + 5*w^3 - 7*w^2 - 5*w + 2], [311, 311, w^5 - w^4 - 4*w^3 + 4*w^2 + w - 3], [311, 311, w^4 - 2*w^2 - w - 2], [311, 311, -2*w^5 + w^4 + 9*w^3 - 4*w^2 - 7*w + 2], [313, 313, -w^5 + 5*w^3 + w^2 - 4*w - 3], [313, 313, -w^5 + 6*w^3 - 7*w + 1], [313, 313, -w^4 + w^3 + 5*w^2 - 3*w - 3], [313, 313, -w^5 + w^4 + 3*w^3 - 4*w^2 + 4], [313, 313, -w^5 + 2*w^4 + 4*w^3 - 7*w^2 - 4*w + 2], [313, 313, -2*w^4 + w^3 + 7*w^2 - 2*w - 4], [337, 337, 2*w^5 - w^4 - 7*w^3 + 2*w^2 + 2*w + 2], [337, 337, w^5 - 2*w^4 - 3*w^3 + 7*w^2 + 2*w - 3], [337, 337, 2*w^5 - w^4 - 9*w^3 + 2*w^2 + 10*w - 1], [337, 337, -2*w^5 - w^4 + 9*w^3 + 4*w^2 - 8*w], [337, 337, 3*w^5 - 2*w^4 - 13*w^3 + 7*w^2 + 11*w - 5], [337, 337, w^4 - w^3 - 2*w^2 + 4*w], [389, 389, 2*w^5 - w^4 - 9*w^3 + 4*w^2 + 7*w], [389, 389, -2*w^5 + 3*w^4 + 8*w^3 - 9*w^2 - 7*w + 3], [389, 389, -w^5 + 2*w^4 + 5*w^3 - 7*w^2 - 5*w], [389, 389, -2*w^5 + 3*w^4 + 9*w^3 - 10*w^2 - 8*w + 2], [389, 389, -3*w^5 + w^4 + 14*w^3 - 2*w^2 - 12*w], [389, 389, -w^5 + w^4 + 5*w^3 - 3*w^2 - 3*w + 1], [443, 443, -2*w^5 + w^4 + 8*w^3 - w^2 - 7*w - 3], [443, 443, 2*w^5 - w^4 - 9*w^3 + 4*w^2 + 8*w], [443, 443, w^5 - 3*w^4 - 4*w^3 + 11*w^2 + 2*w - 4], [443, 443, 2*w^5 - w^4 - 9*w^3 + 2*w^2 + 8*w - 2], [443, 443, -2*w^4 + 2*w^3 + 7*w^2 - 4*w - 3], [443, 443, -3*w^5 + w^4 + 15*w^3 - 3*w^2 - 17*w + 2], [467, 467, 2*w^5 - 2*w^4 - 9*w^3 + 6*w^2 + 10*w - 1], [467, 467, w^5 + w^4 - 5*w^3 - 6*w^2 + 6*w + 5], [467, 467, -w^5 - 2*w^4 + 5*w^3 + 7*w^2 - 5*w - 3], [467, 467, -2*w^5 + w^4 + 11*w^3 - 4*w^2 - 13*w + 3], [467, 467, 3*w^5 - 2*w^4 - 13*w^3 + 6*w^2 + 11*w - 1], [467, 467, -2*w^5 + w^4 + 9*w^3 - w^2 - 8*w - 3], [521, 521, w^5 + 2*w^4 - 6*w^3 - 7*w^2 + 7*w + 3], [521, 521, 2*w^5 - 2*w^4 - 8*w^3 + 6*w^2 + 7*w - 1], [521, 521, -w^5 + w^4 + 6*w^3 - 4*w^2 - 10*w + 3], [521, 521, 2*w^5 - 3*w^4 - 9*w^3 + 10*w^2 + 9*w - 3], [521, 521, -2*w^5 + 11*w^3 - 13*w + 1], [521, 521, 3*w^5 - w^4 - 13*w^3 + 3*w^2 + 11*w - 1], [547, 547, w^4 + w^3 - 5*w^2 - 3*w + 1], [547, 547, -2*w^5 + 3*w^4 + 9*w^3 - 11*w^2 - 10*w + 6], [547, 547, w^4 - w^3 - w^2 + 3*w - 3], [547, 547, 2*w^4 + w^3 - 9*w^2 - 2*w + 6], [547, 547, 3*w^5 - w^4 - 13*w^3 + 3*w^2 + 11*w - 2], [547, 547, -w^5 + w^4 + 6*w^3 - 4*w^2 - 10*w + 2], [571, 571, -w^5 + 4*w^3 + 3*w^2 - 3*w - 4], [571, 571, -w^5 - w^4 + 3*w^3 + 6*w^2 - 5], [571, 571, w^5 - 6*w^3 + 2*w^2 + 9*w - 4], [571, 571, 2*w^5 - 9*w^3 - w^2 + 10*w + 1], [571, 571, 2*w^5 - 11*w^3 + w^2 + 13*w - 3], [571, 571, -w^5 + 7*w^3 - w^2 - 12*w + 2], [599, 599, -2*w^5 + w^4 + 8*w^3 - 5*w^2 - 5*w + 5], [599, 599, w^5 - w^4 - 6*w^3 + 4*w^2 + 6*w - 2], [599, 599, w^4 - 2*w^3 - 5*w^2 + 7*w + 4], [599, 599, -2*w^5 + 10*w^3 - w^2 - 11*w + 3], [599, 599, w^5 - 3*w^4 - 5*w^3 + 11*w^2 + 7*w - 5], [599, 599, -w^5 + w^4 + 6*w^3 - 3*w^2 - 8*w + 3], [677, 677, -w^5 - 2*w^4 + 6*w^3 + 8*w^2 - 9*w - 4], [677, 677, -3*w^5 + 2*w^4 + 13*w^3 - 7*w^2 - 12*w + 4], [677, 677, w^4 + w^3 - 5*w^2 - 5*w + 4], [677, 677, -2*w^5 + 9*w^3 - w^2 - 7*w + 1], [677, 677, w^5 - 5*w^3 + 2*w^2 + 5*w - 5], [677, 677, -w^5 - w^4 + 7*w^3 + 2*w^2 - 10*w + 1], [701, 701, w^5 - 3*w^4 - 3*w^3 + 11*w^2 + 2*w - 6], [701, 701, w^5 + w^4 - 6*w^3 - 5*w^2 + 6*w + 4], [701, 701, -w^5 - w^4 + 3*w^3 + 4*w^2 + 2*w - 2], [701, 701, 3*w^5 - 2*w^4 - 14*w^3 + 5*w^2 + 14*w], [701, 701, 3*w^5 - 2*w^4 - 14*w^3 + 8*w^2 + 13*w - 5], [701, 701, -w^5 + 2*w^4 + 3*w^3 - 7*w^2 + 2*w + 3], [727, 727, w^5 + 2*w^4 - 5*w^3 - 8*w^2 + 6*w + 3], [727, 727, -w^5 + 4*w^3 + 3*w^2 - 3*w - 6], [727, 727, -w^5 - w^4 + 5*w^3 + 2*w^2 - 4*w + 2], [727, 727, 3*w^5 - 2*w^4 - 13*w^3 + 6*w^2 + 12*w - 3], [727, 727, -2*w^5 + 11*w^3 - w^2 - 13*w + 1], [727, 727, w^5 - 3*w^4 - 4*w^3 + 10*w^2 + 5*w - 4], [857, 857, -w^5 + 3*w^4 + 5*w^3 - 11*w^2 - 5*w + 5], [857, 857, -w^5 - 2*w^4 + 4*w^3 + 9*w^2 - 3*w - 7], [857, 857, 2*w^5 + w^4 - 9*w^3 - 4*w^2 + 6*w + 3], [857, 857, 2*w^5 - 3*w^4 - 7*w^3 + 10*w^2 + 2*w - 5], [857, 857, -w^5 + 6*w^3 - 2*w^2 - 8*w + 2], [857, 857, -3*w^3 + w^2 + 9*w], [859, 859, 2*w^4 - 2*w^3 - 5*w^2 + 5*w - 2], [859, 859, -2*w^5 + 9*w^3 - 6*w - 2], [859, 859, -w^4 - w^3 + 2*w^2 + 3*w + 4], [859, 859, -w^5 - 2*w^4 + 6*w^3 + 9*w^2 - 7*w - 7], [859, 859, -2*w^5 - w^4 + 10*w^3 + 4*w^2 - 9*w - 4], [859, 859, -w^5 - w^4 + 4*w^3 + 4*w^2 - 3*w + 1], [883, 883, 2*w^5 + w^4 - 10*w^3 - 4*w^2 + 11*w], [883, 883, -2*w^5 + w^4 + 9*w^3 - 3*w^2 - 10*w + 3], [883, 883, 3*w^5 - w^4 - 13*w^3 + 2*w^2 + 12*w + 1], [883, 883, 3*w^5 - 2*w^4 - 12*w^3 + 6*w^2 + 8*w - 3], [883, 883, w^5 - 6*w^3 + w^2 + 10*w - 3], [883, 883, -2*w^5 + 11*w^3 - w^2 - 14*w + 3], [911, 911, -3*w^5 + 15*w^3 - 15*w + 1], [911, 911, -2*w^5 + 2*w^4 + 8*w^3 - 8*w^2 - 6*w + 3], [911, 911, -2*w^5 + 11*w^3 - 13*w + 2], [911, 911, -2*w^5 + 10*w^3 + 2*w^2 - 10*w - 1], [911, 911, 2*w^4 - 2*w^3 - 8*w^2 + 6*w + 7], [911, 911, -3*w^4 + 12*w^2 - 7], [937, 937, 3*w^4 - w^3 - 10*w^2 + 2*w + 4], [937, 937, -w^5 + 2*w^4 + 5*w^3 - 9*w^2 - 6*w + 5], [937, 937, -w^5 + 2*w^4 + 2*w^3 - 6*w^2 + 3*w + 3], [937, 937, 2*w^5 - w^4 - 11*w^3 + 4*w^2 + 12*w - 3], [937, 937, -2*w^5 + 11*w^3 + w^2 - 14*w], [937, 937, 2*w^5 + w^4 - 9*w^3 - 5*w^2 + 7*w + 5], [961, 31, -3*w^5 + w^4 + 12*w^3 - 3*w^2 - 8*w + 2], [961, 31, -2*w^5 + 2*w^4 + 10*w^3 - 7*w^2 - 13*w + 3], [961, 31, -w^5 + w^4 + 7*w^3 - 5*w^2 - 10*w + 4]]; primes := [ideal : I in primesArray]; heckePol := x; K := Rationals(); e := 1; heckeEigenvaluesArray := [0, -6, -4, -6, 8, -8, -10, -2, -6, 0, 6, -6, -3, 8, -8, 1, 8, 0, -14, -4, 0, -8, -10, -4, 2, 10, 18, -16, -20, 4, -2, 6, 2, -18, -14, -16, -22, 12, 10, 10, 10, -16, -26, 10, 18, -10, 18, 0, -6, 24, 24, 24, -20, 16, -14, 6, -2, 26, 22, -26, -4, -26, 32, -8, 30, 4, 6, 2, 34, -10, 30, 18, -12, -24, -12, -26, 4, 26, 24, -12, 18, -12, 40, 26, -36, -18, 10, 24, 4, -26, -30, 10, -28, -26, 36, 28, -38, -8, 20, -30, -20, -26, -44, 8, -22, -16, 48, -28, 24, 22, 26, -38, -28, -42, 16, -30, -12, 34, -18, -20, 46, -24, 2, 28, -8, -16, -28, -18, 18, 4, -18, 30, 6, -24, -36, 6, 36, -4, -14, 36, -6, 44, 28, 32, 44, -32, -2, -20, -8, 18, -48, 2, 32, 48, -10, -58, -20, -12, -6, -22]; heckeEigenvalues := AssociativeArray(); for i := 1 to #heckeEigenvaluesArray do heckeEigenvalues[primes[i]] := heckeEigenvaluesArray[i]; end for; ALEigenvalues := AssociativeArray(); ALEigenvalues[ideal] := -1; // EXAMPLE: // pp := Factorization(2*ZF)[1][1]; // heckeEigenvalues[pp]; print "To reconstruct the Hilbert newform f, type f, iso := Explode(make_newform());"; function make_newform(); M := HilbertCuspForms(F, NN); S := NewSubspace(M); // SetVerbose("ModFrmHil", 1); NFD := NewformDecomposition(S); newforms := [* Eigenform(U) : U in NFD *]; if #newforms eq 0 then; print "No Hilbert newforms at this level"; return 0; end if; print "Testing ", #newforms, " possible newforms"; newforms := [* f: f in newforms | IsIsomorphic(BaseField(f), K) *]; print #newforms, " newforms have the correct Hecke field"; if #newforms eq 0 then; print "No Hilbert newform found with the correct Hecke field"; return 0; end if; autos := Automorphisms(K); xnewforms := [* *]; for f in newforms do; if K eq RationalField() then; Append(~xnewforms, [* f, autos[1] *]); else; flag, iso := IsIsomorphic(K,BaseField(f)); for a in autos do; Append(~xnewforms, [* f, a*iso *]); end for; end if; end for; newforms := xnewforms; for P in primes do; xnewforms := [* *]; for f_iso in newforms do; f, iso := Explode(f_iso); if HeckeEigenvalue(f,P) eq iso(heckeEigenvalues[P]) then; Append(~xnewforms, f_iso); end if; end for; newforms := xnewforms; if #newforms eq 0 then; print "No Hilbert newform found which matches the Hecke eigenvalues"; return 0; else if #newforms eq 1 then; print "success: unique match"; return newforms[1]; end if; end if; end for; print #newforms, "Hilbert newforms found which match the Hecke eigenvalues"; return newforms[1]; end function;