/* 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![3, 0, -5, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [3, 3, w], [4, 2, w^2 - w - 1], [9, 3, -w^2 + 2], [13, 13, w^3 - 4*w + 2], [13, 13, -w^3 + 4*w + 2], [17, 17, w^3 - 3*w - 1], [17, 17, -w^3 + 3*w - 1], [29, 29, w^3 + w^2 - 4*w - 2], [29, 29, w^3 - w^2 - 4*w + 2], [43, 43, w^2 + w - 4], [43, 43, w^2 - w - 4], [53, 53, w^3 - 2*w - 2], [53, 53, -w^3 + 2*w - 2], [79, 79, w^3 - w^2 - 4*w + 1], [79, 79, -w^3 - w^2 + 4*w + 1], [101, 101, -w^3 + w^2 + 3*w - 5], [101, 101, w^3 + w^2 - 3*w - 5], [103, 103, 2*w^2 - w - 4], [103, 103, 2*w^2 + w - 4], [107, 107, 2*w^2 + w - 5], [107, 107, 3*w^2 - 3*w - 4], [107, 107, 2*w^2 - 2*w - 1], [107, 107, 2*w^2 - w - 5], [113, 113, w^3 - w^2 - 5*w + 1], [113, 113, -w^3 - w^2 + 5*w + 1], [121, 11, w^3 - 2*w^2 - 3*w + 2], [121, 11, -2*w^3 + w^2 + 7*w - 4], [127, 127, -2*w^3 + 7*w - 2], [127, 127, 2*w^3 - 7*w - 2], [131, 131, w^3 - w^2 - 1], [131, 131, -w^3 + w^2 + 4*w + 1], [131, 131, -2*w^3 + 3*w^2 + 4*w - 2], [131, 131, -2*w^3 + w^2 + 4*w + 2], [139, 139, w^2 - 2*w - 4], [139, 139, w^2 + 2*w - 4], [173, 173, 2*w^2 - 3*w - 5], [173, 173, 2*w^2 + 3*w - 5], [179, 179, -w^2 - 3*w + 4], [179, 179, 2*w^3 - w^2 - 9*w + 2], [179, 179, -2*w^3 - w^2 + 9*w + 2], [179, 179, w^2 - 3*w - 4], [199, 199, -3*w^3 + w^2 + 12*w - 4], [199, 199, -3*w^3 - w^2 + 12*w + 4], [211, 211, 2*w^3 - 7*w + 1], [211, 211, -2*w^3 + 7*w + 1], [233, 233, -w^2 - w - 2], [233, 233, -w^2 + w - 2], [257, 257, -3*w^2 - w + 10], [257, 257, 3*w^2 - w - 10], [263, 263, -w^3 + w^2 + 6*w + 1], [263, 263, w^2 + 2*w - 5], [263, 263, w^2 - 2*w - 5], [263, 263, w^3 + w^2 - 6*w + 1], [269, 269, -2*w^3 - w^2 + 6*w + 1], [269, 269, 2*w^3 - w^2 - 6*w + 1], [277, 277, w^3 - w^2 - 2], [277, 277, -w^3 + 2*w^2 + 3*w - 8], [277, 277, w^3 + 2*w^2 - 3*w - 8], [277, 277, -w^3 - w^2 - 2], [283, 283, -2*w^3 + w^2 + 8*w - 1], [283, 283, 2*w^3 + w^2 - 8*w - 1], [289, 17, w^2 - 7], [313, 313, w^3 + 2*w^2 - 4*w - 2], [313, 313, 2*w^3 - w^2 - 6*w + 2], [313, 313, -2*w^3 - w^2 + 6*w + 2], [313, 313, -w^3 + 2*w^2 + 4*w - 2], [337, 337, -w^3 - 2*w^2 + 7*w + 2], [337, 337, -2*w^3 + 4*w + 1], [337, 337, 2*w^3 - 4*w + 1], [337, 337, -w^3 + 2*w^2 + 7*w - 2], [367, 367, -w^3 + 3*w^2 - 2*w - 5], [367, 367, 2*w^3 - 3*w^2 - 2*w + 4], [373, 373, -2*w^3 + 10*w + 1], [373, 373, -3*w^3 - w^2 + 14*w + 5], [373, 373, 3*w^3 - w^2 - 14*w + 5], [373, 373, 2*w^3 - 10*w + 1], [389, 389, 2*w^3 - 6*w - 1], [389, 389, -2*w^3 + 6*w - 1], [419, 419, 2*w^3 - 11*w - 4], [419, 419, 2*w^2 - 2*w - 7], [419, 419, 2*w^2 + 2*w - 7], [419, 419, -2*w^3 + 11*w - 4], [439, 439, 3*w^2 - w - 14], [439, 439, -3*w^2 - w + 14], [443, 443, w^3 + 3*w^2 - 4*w - 10], [443, 443, 3*w^3 + w^2 - 14*w - 4], [443, 443, 3*w^3 - w^2 - 14*w + 4], [443, 443, -w^3 + 3*w^2 + 4*w - 10], [503, 503, -w - 5], [503, 503, 3*w^3 + w^2 - 12*w - 1], [503, 503, 3*w^3 - w^2 - 12*w + 1], [503, 503, w - 5], [521, 521, w^3 + 2*w^2 - 5*w - 2], [521, 521, -w^3 + 2*w^2 + 5*w - 2], [523, 523, 3*w^2 - 2*w - 10], [523, 523, w^3 + 3*w^2 - 6*w - 11], [529, 23, 2*w^2 - 11], [529, 23, 3*w^2 - 10], [547, 547, -2*w^3 + w^2 + 6*w - 7], [547, 547, 2*w^3 + w^2 - 6*w - 7], [563, 563, -2*w^3 + w^2 + 4*w - 4], [563, 563, -3*w^3 + 10*w - 4], [563, 563, 3*w^3 - 10*w - 4], [563, 563, 2*w^3 + w^2 - 4*w - 4], [569, 569, w^3 + 2*w^2 - 6*w - 10], [569, 569, -w^3 + 2*w^2 + 6*w - 10], [571, 571, -2*w^3 + 3*w^2 + 5*w - 2], [571, 571, -2*w^3 + 2*w^2 + 6*w + 1], [599, 599, 3*w^3 - 11*w - 2], [599, 599, 2*w^3 + w^2 - 6*w - 8], [599, 599, 2*w^3 - w^2 - 6*w + 8], [599, 599, 3*w^3 - 11*w + 2], [601, 601, -w^3 - 2*w^2 + 6*w + 2], [601, 601, 4*w^3 - w^2 - 16*w + 5], [601, 601, 4*w^3 + w^2 - 16*w - 5], [601, 601, w^3 - 2*w^2 - 6*w + 2], [607, 607, -w^3 + w^2 + 4*w - 8], [607, 607, -w^3 - w^2 + 4*w + 8], [625, 5, -5], [641, 641, w^2 + 4*w - 1], [641, 641, w^2 - 4*w - 1], [647, 647, w^3 + 3*w^2 - 4*w - 8], [647, 647, -w^3 + 7*w + 2], [647, 647, w^3 - 7*w + 2], [647, 647, -w^3 + 3*w^2 + 4*w - 8], [653, 653, 2*w^3 - 3*w^2 - 12*w + 10], [653, 653, 2*w^3 + 3*w^2 - 12*w - 10], [677, 677, 3*w^2 + w - 8], [677, 677, 3*w^2 - w - 8], [701, 701, 2*w^3 - 2*w^2 - 7*w + 2], [701, 701, -2*w^3 - 2*w^2 + 7*w + 2], [727, 727, -2*w^3 - 2*w^2 + 11*w + 7], [727, 727, -2*w^3 + 2*w^2 + 11*w - 7], [751, 751, -4*w^2 + 3*w + 7], [751, 751, w^3 - 2*w^2 - w - 2], [797, 797, 3*w^3 - 11*w + 1], [797, 797, 3*w^3 - 11*w - 1], [809, 809, -w^3 + 7*w - 1], [809, 809, w^3 - 7*w - 1], [823, 823, -2*w^3 + 4*w^2 + 9*w - 14], [823, 823, 2*w^3 + 4*w^2 - 9*w - 14], [841, 29, 3*w^2 - 7], [857, 857, w^3 + w^2 - w - 5], [857, 857, -w^3 + w^2 + w - 5], [859, 859, 5*w^3 + w^2 - 20*w - 2], [859, 859, -5*w^3 + w^2 + 20*w - 2], [881, 881, w^3 + 3*w^2 - 2*w - 10], [881, 881, -w^3 + 3*w^2 + 2*w - 10], [883, 883, 2*w^3 - w^2 - 8*w - 2], [883, 883, 2*w^3 + w^2 - 8*w + 2], [907, 907, 3*w^3 - 2*w^2 - 13*w + 5], [907, 907, 3*w^3 + 2*w^2 - 13*w - 5], [919, 919, 3*w^3 - w^2 - 15*w + 1], [919, 919, 3*w^3 + 3*w^2 - 10*w - 5], [953, 953, w^3 + 2*w^2 - 2*w - 8], [953, 953, -w^3 + 2*w^2 + 2*w - 8], [991, 991, -w^3 - w^2 + 4*w - 4], [991, 991, w^3 - w^2 - 4*w - 4], [997, 997, w^3 + 4*w^2 - 3*w - 16], [997, 997, -3*w^3 + 3*w^2 + 11*w - 13], [997, 997, 3*w^3 + 3*w^2 - 11*w - 13], [997, 997, w^3 - 4*w^2 - 3*w + 16]]; primes := [ideal : I in primesArray]; heckePol := x^3 + x^2 - 4*x - 3; K := NumberField(heckePol); heckeEigenvaluesArray := [e, e - 1, -e - 1, 1, -e - 4, -2*e^2 + e + 4, e^2 - 3*e - 4, e^2 - 4, e^2 - 4, 3*e, -2*e^2 - 4*e + 4, -4*e^2 + 3*e + 18, 2*e - 1, 4*e^2 - 3*e - 9, -4*e^2 - 2*e + 11, -6*e^2 - 2*e + 15, 4*e^2 + 4*e - 9, -3*e^2 - 6*e + 9, 3*e^2 - 14, -4*e^2 + 5*e + 17, 4*e^2 - 5*e - 17, -4*e^2 - 4*e + 3, -2*e^2 - 3*e + 2, -e^2 - 3*e - 5, 4*e^2 - 17, 7*e^2 + 5*e - 18, -2*e^2 + 3*e + 13, 2*e^2 + 7*e - 6, -2, 3*e^2 + 5*e - 8, 4*e^2 - e - 18, -5*e^2 - 3*e + 13, -7*e^2 - e + 16, -e^2 - 10*e + 4, -5*e^2 + 5*e + 16, -5*e^2 + 3*e + 21, 6*e^2 - 3*e - 25, 3*e^2 - 8, 6*e - 9, 3*e^2 + 2*e - 17, 7*e^2 - 9, 5*e^2 - 3*e - 19, -3*e^2 - 2*e + 1, 7*e^2 + 7*e - 23, -3*e^2 + e + 1, 5*e^2 + 9*e - 13, 5*e^2 + 9*e - 13, 4*e^2 - 3*e - 14, -4*e^2 - 2*e + 6, e^2 - e + 17, -e^2 - e - 11, e^2 + 7*e + 3, 2*e^2 + e - 12, -2*e^2 + 7*e + 7, 4*e^2 + 9, 11*e^2 + 5*e - 25, -2*e^2 - 12*e + 10, 6*e^2 + e - 17, 10*e + 3, -4*e^2 + 14*e + 18, -2*e^2 + 7*e + 21, -6*e^2 - 11*e + 20, 3*e^2 - e - 2, -11*e^2 + 3*e + 42, -2*e^2 + 4*e - 7, 2*e - 12, -2*e^2 - 4*e, 9*e^2 + e - 37, -5*e^2 - 4*e + 6, 10*e^2 - 6*e - 39, -2*e^2 - e - 24, 6*e^2 - e - 26, -12*e^2 + 5*e + 41, 6*e^2 - 6*e - 32, 11*e^2 - 2*e - 26, -11*e^2 - 7*e + 19, -8*e^2 - 8*e + 14, -7*e^2 - 3*e + 39, 4*e - 5, -4*e^2 - 3*e + 10, 4*e^2 - 5*e - 28, -13*e^2 + 3*e + 45, e^2 + 3*e - 26, -e^2 - e + 32, 6*e^2 - 9, 11*e^2 - 5*e - 45, 9*e^2 + 4*e - 12, 14*e^2 - e - 29, 4*e^2 + 9*e - 28, -7*e^2 - 17*e + 30, 8*e^2 + 6*e - 13, 3*e^2 + 7*e + 1, -7*e^2 - 10*e + 12, 10*e^2 + 7*e - 10, -7*e^2 - 2*e + 5, 13*e^2 - 4*e - 36, -9*e^2 - 2*e + 15, -10*e^2 + 2*e + 19, e^2 + 2*e - 13, 14*e^2 + 4*e - 45, 9*e^2 + 13*e - 32, -6*e^2 - 5*e + 9, 2*e^2 + 8*e - 18, e^2 + e + 13, 14*e^2 + 2*e - 31, 7*e^2 - 9*e - 33, 6*e^2 - 7*e - 17, 4*e^2 + 15*e - 9, 12*e^2 - 29, -15*e^2 - 9*e + 27, 5*e^2 + 5*e + 15, -14*e^2 - 18*e + 42, -19*e^2 - 6*e + 35, 16*e^2 - 5*e - 52, -2*e + 6, 3*e - 2, 10*e^2 + 5*e - 43, 5*e^2 - 12*e - 24, -4*e^2 + 7*e + 4, -16*e^2 + e + 38, -17*e^2 - 2*e + 49, 11*e^2 + 6*e - 15, 2*e^2 + e - 25, -7*e^2 - e + 6, -2*e^2 - 12*e - 12, -e^2 - 2*e + 26, -12*e^2 - 13*e + 25, 2*e^2 - e - 44, -e^2 + 5*e, -6*e^2 - 6*e, -13*e^2 - e + 27, 14*e^2 - 8*e - 46, -4*e^2 - 13*e - 2, -11*e^2 + 5*e + 38, -12*e^2 + e + 31, 7*e^2 - 4*e - 58, -2*e^2 - 2*e + 45, 7*e^2 + 19*e - 27, -4*e^2 + 9*e - 10, 18*e^2 + 13*e - 56, -9*e^2 - 8*e + 26, 9*e^2 + 10*e - 4, 9*e^2 - e - 32, 2*e^2 + 18*e - 12, 6*e^2 - 12*e - 52, e^2 + 2*e + 7, 11*e^2 - 2*e - 16, 23*e^2 + 10*e - 62, -5*e^2 - 10*e + 17, -10*e^2 + 16*e + 33, 11*e^2 + 22*e - 44, -10*e^2 - 7*e + 22, -12*e^2 - 3*e + 9, 4*e^2 + 11*e - 2, 2*e^2 + 23*e + 6, -3*e^2 + 5*e + 7, -3*e^2 - 18*e + 2, 7*e^2 + 4*e + 7, e^2 - 3*e + 18, -e + 28, -18*e^2 - 8*e + 36, -10*e^2 + 10]; 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;