/* 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, 5, -5, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [5, 5, w^3 - 4*w], [7, 7, w + 1], [7, 7, -w^3 + 4*w - 1], [13, 13, -w^2 + 3], [16, 2, 2], [17, 17, w^3 + w^2 - 4*w - 2], [17, 17, -w^3 + 5*w - 2], [19, 19, -w^2 - w + 4], [19, 19, -w^2 - w + 1], [29, 29, 2*w^3 - w^2 - 9*w + 5], [41, 41, -w^3 + w^2 + 5*w - 3], [43, 43, w^3 - w^2 - 4*w + 2], [43, 43, w^3 - 6*w], [47, 47, -w^3 - w^2 + 5*w], [49, 7, w^2 + 2*w - 2], [59, 59, 2*w^3 - 8*w + 3], [67, 67, w^2 - w - 4], [79, 79, w^3 - w^2 - 4*w + 1], [81, 3, -3], [97, 97, w^3 + w^2 - 5*w + 1], [107, 107, -2*w^3 + 3*w^2 + 10*w - 12], [109, 109, 2*w^3 - w^2 - 9*w + 3], [125, 5, -3*w^3 - w^2 + 12*w + 1], [127, 127, -2*w^3 + w^2 + 10*w - 8], [137, 137, -w^3 + w^2 + 3*w - 5], [139, 139, w^3 - w^2 - 5*w + 1], [149, 149, 2*w^2 - w - 6], [149, 149, 2*w^3 + w^2 - 9*w], [163, 163, w^3 - 5*w - 3], [163, 163, 2*w^3 - 7*w], [173, 173, -2*w^3 + 11*w - 3], [173, 173, -w^3 + w^2 + 4*w - 8], [179, 179, 2*w^3 - w^2 - 8*w + 5], [181, 181, 2*w^3 - w^2 - 8*w], [181, 181, 2*w^3 - 9*w - 3], [191, 191, 2*w^2 - 5], [191, 191, -2*w^2 - w + 10], [193, 193, w^3 + w^2 - 3*w - 4], [193, 193, -w^3 + 2*w^2 + 3*w - 3], [197, 197, -2*w^3 + 9*w - 4], [197, 197, w^2 - 7], [199, 199, 3*w^3 - 13*w + 1], [199, 199, w^3 + 2*w^2 - 5*w - 7], [227, 227, -3*w^3 + w^2 + 13*w - 4], [227, 227, -w^3 + 2*w^2 + 7*w - 6], [241, 241, -2*w^3 + 7*w - 1], [257, 257, -2*w^3 + w^2 + 7*w - 5], [257, 257, 2*w^3 - w^2 - 7*w + 2], [263, 263, -w^3 + 7*w - 3], [269, 269, -2*w^3 + 2*w^2 + 11*w - 8], [271, 271, w^2 + 3*w - 2], [271, 271, w^2 + 2*w - 7], [277, 277, -2*w^3 + 11*w - 2], [281, 281, 2*w^3 - 11*w + 1], [283, 283, 2*w^3 - 9*w + 5], [283, 283, -2*w^3 + w^2 + 11*w - 7], [289, 17, -w^3 + 2*w^2 + 4*w - 4], [293, 293, -2*w^3 - w^2 + 7*w + 3], [307, 307, -3*w^3 + 2*w^2 + 13*w - 9], [311, 311, -w^3 + w^2 + 3*w - 7], [313, 313, -w^3 + 2*w^2 + 3*w - 2], [313, 313, w^2 - w - 8], [317, 317, -2*w^3 - w^2 + 9*w - 1], [331, 331, w^3 + 2*w^2 - 5*w - 3], [337, 337, w^3 + 2*w^2 - 6*w - 4], [337, 337, w^3 - 2*w^2 - 6*w + 5], [347, 347, 2*w^3 + 2*w^2 - 9*w - 3], [347, 347, -2*w^3 + w^2 + 7*w - 4], [349, 349, w^2 - 2*w - 4], [353, 353, -w^3 + 2*w^2 + 2*w - 6], [359, 359, -w^3 + w^2 + 7*w - 6], [359, 359, -w^2 - w - 2], [361, 19, 2*w^3 - w^2 - 11*w], [367, 367, -2*w^3 + 2*w^2 + 8*w - 5], [373, 373, w^3 + w^2 - 2*w - 4], [379, 379, 2*w^3 - w^2 - 11*w + 4], [389, 389, 3*w^2 + w - 11], [397, 397, 3*w^3 - 13*w + 5], [401, 401, w - 5], [409, 409, 3*w^3 - 12*w + 4], [409, 409, 3*w^3 + 2*w^2 - 14*w - 4], [421, 421, 2*w^3 - w^2 - 10*w + 1], [421, 421, w^3 + 2*w^2 - 5*w - 4], [439, 439, -2*w^3 + 10*w - 5], [443, 443, -2*w^3 + 12*w - 5], [443, 443, -4*w^3 + w^2 + 18*w - 9], [443, 443, -2*w^3 + w^2 + 7*w - 9], [443, 443, 3*w^3 + 2*w^2 - 14*w - 5], [449, 449, w^3 + 2*w^2 - 2*w - 6], [449, 449, -2*w^3 + w^2 + 11*w - 5], [461, 461, 2*w^3 + 2*w^2 - 9*w - 4], [467, 467, -w^3 + w^2 + 7*w - 5], [487, 487, 2*w^2 + 4*w - 7], [491, 491, -w^3 + w^2 + 7*w - 4], [503, 503, 2*w^3 + w^2 - 9*w + 2], [521, 521, w^2 - 3*w - 3], [523, 523, -w^3 + 2*w^2 + 5*w - 4], [523, 523, -w^3 + 8*w - 5], [563, 563, w^3 + 3*w^2 - w - 8], [563, 563, w^3 - 2*w^2 - 8*w + 4], [563, 563, -w^3 + w^2 + 2*w - 5], [563, 563, -3*w^3 - w^2 + 10*w - 2], [577, 577, 3*w^3 - 16*w], [587, 587, w^3 + 2*w^2 - 6], [587, 587, -w^3 + 4*w - 6], [601, 601, -w - 5], [607, 607, w^3 - 2*w^2 - 4*w + 1], [613, 613, 4*w^3 - 17*w], [617, 617, -3*w^3 + w^2 + 14*w - 2], [617, 617, -4*w^3 + 17*w - 4], [619, 619, -3*w^3 + 12*w - 2], [643, 643, 3*w^3 - w^2 - 12*w + 3], [643, 643, -2*w^3 - w^2 + 11*w - 2], [647, 647, 2*w^3 + w^2 - 9*w + 3], [653, 653, w^3 + w^2 - 7*w - 4], [661, 661, -w^3 + 4*w^2 + 6*w - 15], [661, 661, 3*w^3 - 2*w^2 - 12*w + 10], [677, 677, -3*w^2 - 2*w + 12], [691, 691, -2*w^3 + 3*w^2 + 11*w - 10], [691, 691, -3*w^3 + 16*w - 3], [701, 701, 3*w^3 - 13*w + 6], [719, 719, -3*w^2 + w + 10], [727, 727, w^3 - 3*w^2 - 4*w + 6], [743, 743, -w^3 + 2*w^2 + 5*w - 3], [761, 761, -w^3 + 3*w^2 + 3*w - 12], [761, 761, 3*w^3 - 2*w^2 - 14*w + 7], [769, 769, -3*w^3 + 3*w^2 + 16*w - 13], [769, 769, w^3 + 2*w^2 - 7*w - 6], [773, 773, w^3 - 8*w + 4], [773, 773, 4*w^2 + w - 16], [787, 787, w^2 + 4*w - 2], [797, 797, -2*w^3 + 3*w^2 + 10*w - 10], [797, 797, -w^3 - w^2 + 4*w - 4], [797, 797, w^3 + 2*w^2 - 3*w - 9], [797, 797, -3*w^3 + 3*w^2 + 11*w - 10], [821, 821, w^2 + w - 9], [827, 827, w^3 - 8*w + 1], [827, 827, -2*w^3 + w^2 + 9*w - 11], [827, 827, 3*w^3 - 14*w + 5], [827, 827, 2*w^3 + w^2 - 7*w - 5], [829, 829, -2*w^3 - 2*w^2 + 9*w - 1], [839, 839, -3*w^3 + 15*w - 5], [853, 853, -4*w^3 + 15*w - 8], [853, 853, -w^3 + 2*w^2 + 6*w - 3], [859, 859, -w^3 + w^2 + w - 4], [859, 859, w^3 + w^2 - w - 5], [881, 881, -w^3 + w^2 + 2*w - 6], [881, 881, w^3 + w^2 - 2*w - 6], [883, 883, w^3 + 3*w^2 - 3*w - 6], [887, 887, w^3 + 3*w^2 - 3*w - 8], [919, 919, 2*w^3 - w^2 - 13*w], [929, 929, -w^3 - 3*w^2 + 2*w + 10], [929, 929, w^3 + w^2 - 5*w - 8], [941, 941, w^3 + 2*w^2 - 3*w - 10], [953, 953, -w^3 + 5*w - 7], [953, 953, -2*w^3 + 3*w^2 + 9*w - 9], [953, 953, -2*w^3 - w^2 + 10*w - 3], [953, 953, -3*w^3 + 11*w - 1], [961, 31, -w^3 + 3*w^2 + 2*w - 10], [961, 31, -3*w^2 + 2*w + 7], [967, 967, w^3 + 3*w^2 - 3*w - 7], [967, 967, 4*w^3 + w^2 - 20*w + 1], [983, 983, 2*w^3 - w^2 - 12*w + 8], [983, 983, 2*w^3 + w^2 - 6*w - 4], [991, 991, 2*w^3 - 12*w + 3]]; primes := [ideal : I in primesArray]; heckePol := x^3 + 2*x^2 - 5*x - 8; K := NumberField(heckePol); heckeEigenvaluesArray := [1, e, 1, -2*e - 2, -e^2 + e + 9, 2*e + 2, -2*e^2 - e + 10, 2*e + 4, -e^2 + 4, -2*e - 2, 2*e^2 - 6, 2*e^2 + e - 12, 2*e^2 + 2*e - 4, -e + 8, -e^2 + 2*e + 2, 2*e - 4, -4*e^2 + 20, 6*e^2 + 3*e - 24, 2*e^2 + 2*e + 2, -e^2 - 8*e + 2, -2*e - 4, -e^2 - 2, -4*e^2 - 6*e + 14, 6*e^2 - 32, 2*e^2 - 6, 2*e^2 - 4*e - 20, -2*e^2 - 6*e + 6, -6*e^2 - 4*e + 22, -4*e + 4, 2*e^2 + 2*e - 12, 4*e^2 - 2*e - 34, 4*e^2 + 2*e - 2, 3*e^2 + 4*e + 4, -3*e^2 - 8*e + 6, -2*e^2 - 6*e + 6, -7*e^2 - 2*e + 32, -3*e^2 - 4*e, -2*e^2 + 2*e + 18, -8*e^2 - 2*e + 34, 4*e + 6, 4*e^2 - 2*e - 10, -4*e^2 - 7*e + 16, 2*e + 8, 4*e^2 + 4*e - 12, 6*e^2 + 4*e - 28, e^2 + 6*e + 2, 2*e^2 - 30, e^2 + 6*e + 2, -e, 6*e^2 + 2*e - 34, 2*e^2 - 8*e - 16, 2*e^2 - 8*e - 16, -6*e + 6, 7*e^2 + 2*e - 22, 2*e^2 - 6*e - 20, -4*e^2 - 8*e + 28, -8*e^2 - 4*e + 18, 10*e^2 + 6*e - 42, -6*e^2 + 2*e + 20, -4*e^2 - 8*e + 24, 6*e^2 + 12*e - 22, e + 2, -2, 4*e - 4, e^2 + 4*e + 18, e^2 + 4*e - 14, 2*e^2 - 4*e - 20, -4*e - 4, 4*e^2 + 4*e - 18, 6*e^2 - 3*e - 22, -2*e - 8, -4*e^2 - 8*e + 8, 8*e^2 + 6*e - 22, -2*e^2 - 6*e + 16, -5*e^2 - 6*e + 6, 2*e^2 - 9*e - 12, -8*e^2 - 2*e + 38, -7*e^2 - 6*e + 30, -10*e^2 - 9*e + 42, e^2 + 6*e - 6, 6*e^2 - 4*e - 54, -4*e^2 - 12*e + 6, 4*e^2 + 2*e + 6, -10*e^2 - 2*e + 40, e^2 - 8*e - 4, 10*e^2 + 12*e - 36, 3*e^2 - 8*e - 36, -4, -6*e^2 - e + 26, 4*e + 2, 2*e^2 + 3*e + 6, -7*e^2 - 12*e + 20, 10*e - 8, -10*e^2 - 12*e + 44, 5*e^2 - 8, -8*e^2 + 58, -8*e^2 - 8*e + 44, e^2 + 8*e + 12, -2*e^2 - 4*e + 20, 4*e - 12, -12*e^2 - 8*e + 36, 8*e^2 + 10*e - 44, 10*e^2 + 2*e - 46, 11*e^2 - 4*e - 52, -10*e^2 - 8*e + 44, 4*e^2 + 2*e - 22, -6*e^2 - e + 40, -4*e^2 + 2*e + 6, 10*e^2 - 8*e - 70, -8*e^2 - 6*e + 42, -4, -5*e^2 + 8*e + 52, 8*e^2 + 8*e - 28, 12*e^2 - 56, -14*e^2 - 6*e + 46, 8*e^2 - 4*e - 42, 8*e^2 + 4*e - 26, 11*e^2 - 4*e - 58, -11*e^2 + 10*e + 68, 8*e^2 + 14*e - 28, -8*e^2 + 30, 2*e^2 - 8*e, 12*e^2 + 2*e - 72, 4*e^2 + 13*e - 32, -10*e^2 + 2*e + 42, 4*e^2 - 14*e - 38, 4*e^2 - 6*e - 14, 5*e^2 - 2*e - 30, -4*e + 6, 2*e^2 + 4*e - 26, 14*e^2 + 14*e - 60, 2*e^2 - e - 10, 10*e^2 + 5*e - 58, -2*e^2 - 8*e + 30, -6*e^2 + 6*e + 62, -6*e^2 + 8*e + 54, -18*e^2 + 4*e + 92, -4*e^2 - 4*e - 4, -6*e^2 - 4*e - 4, 10*e^2 + 14*e - 52, 4*e^2 - 5*e - 10, 2*e^2 - 8*e - 24, 6*e^2 - 42, -16*e^2 - 8*e + 54, -6*e^2 - e + 52, -6*e^2 + 11*e + 20, 6*e^2 + 8*e - 46, -6*e^2 - 4*e - 14, -12*e^2 - 3*e + 76, 10*e^2 + 18*e - 40, 6*e^2 - 12*e - 40, 4*e^2 + 5*e - 22, -4*e^2 + 8*e + 34, e^2 - 12*e + 14, 11*e^2 - 70, 12*e^2 + 12*e - 54, 4*e^2 + 14*e - 22, 2*e^2 - 10*e - 22, -12*e^2 + 6*e + 66, -8*e^2 - 18*e + 18, -11*e^2 - 2*e + 72, -11*e^2 - 16*e + 40, 14*e^2 + 18*e - 56, 16*e^2 - 72, 10*e^2 + 18*e - 48]; heckeEigenvalues := AssociativeArray(); for i := 1 to #heckeEigenvaluesArray do heckeEigenvalues[primes[i]] := heckeEigenvaluesArray[i]; end for; ALEigenvalues := AssociativeArray(); ALEigenvalues[ideal] := -1; 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;