/* 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, -1, -6, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [2, 2, w^3 - w^2 - 6*w - 2], [3, 3, -w^3 + 2*w^2 + 4*w - 2], [4, 2, w^3 - w^2 - 5*w - 2], [17, 17, -w^3 + w^2 + 6*w - 1], [17, 17, -w + 2], [29, 29, -w^3 + 2*w^2 + 4*w - 4], [29, 29, w^3 - 2*w^2 - 4*w], [31, 31, -w^2 + 2], [31, 31, -w^3 + 7*w + 5], [41, 41, -2*w^3 + 2*w^2 + 13*w - 2], [41, 41, 3*w^3 - 4*w^2 - 17*w + 5], [67, 67, 3*w^3 - 4*w^2 - 17*w + 1], [67, 67, -w^2 + 4*w + 2], [83, 83, 2*w^2 - 5*w - 2], [83, 83, -w^3 + 8*w + 6], [83, 83, w^3 - 2*w^2 - 2*w - 2], [83, 83, w^3 - 2*w^2 - 6*w], [97, 97, -3*w^3 + 2*w^2 + 17*w + 7], [97, 97, w^3 - 4*w^2 + 3*w + 1], [97, 97, -5*w^3 + 8*w^2 + 24*w - 8], [97, 97, 2*w^3 - 2*w^2 - 13*w - 4], [101, 101, -w^3 + 6*w + 6], [101, 101, -w^3 + 6*w + 2], [103, 103, -4*w^3 + 3*w^2 + 26*w + 12], [103, 103, -w^3 + 2*w^2 + 9*w + 3], [107, 107, 2*w^3 - 2*w^2 - 11*w], [107, 107, -w^3 + 2*w^2 + 3*w - 3], [107, 107, w^3 - w^2 - 4*w - 3], [107, 107, 2*w^3 - 3*w^2 - 10*w], [121, 11, -2*w^3 + 3*w^2 + 8*w + 2], [149, 149, -3*w^3 + 5*w^2 + 14*w - 3], [149, 149, -2*w^3 + 4*w^2 + 7*w - 4], [157, 157, 2*w^3 - 2*w^2 - 10*w - 1], [157, 157, 2*w^3 - 3*w^2 - 8*w + 2], [157, 157, 2*w^3 - 2*w^2 - 10*w - 3], [157, 157, -3*w^3 + 4*w^2 + 15*w + 1], [163, 163, -2*w^2 + 4*w + 5], [163, 163, 2*w^3 - 4*w^2 - 10*w + 5], [169, 13, 2*w^3 - 3*w^2 - 12*w + 2], [169, 13, -w^3 + 9*w + 3], [173, 173, 3*w^3 - 2*w^2 - 17*w - 9], [173, 173, -2*w^3 + 14*w + 7], [197, 197, 2*w^3 - 2*w^2 - 12*w + 1], [197, 197, 3*w^3 - 3*w^2 - 18*w - 1], [199, 199, 3*w^3 - 4*w^2 - 18*w + 8], [199, 199, 4*w^3 - 5*w^2 - 24*w + 6], [223, 223, w^3 - 2*w^2 - 3*w - 3], [223, 223, 2*w^3 - 3*w^2 - 10*w + 6], [227, 227, -w^3 + 2*w^2 + 6*w - 8], [227, 227, 3*w + 4], [227, 227, 3*w^3 - 3*w^2 - 18*w - 7], [227, 227, -2*w^3 + 3*w^2 + 12*w - 6], [229, 229, -w - 4], [229, 229, w^2 - 2*w + 2], [229, 229, -w^3 + w^2 + 6*w + 5], [229, 229, -w^3 + 2*w^2 + 5*w - 7], [233, 233, -2*w^3 + 3*w^2 + 8*w - 4], [233, 233, -3*w^3 + 4*w^2 + 15*w + 3], [281, 281, -2*w^3 + 3*w^2 + 10*w + 2], [281, 281, -w^3 + 2*w^2 + 3*w - 5], [289, 17, -2*w^3 + 2*w^2 + 14*w + 5], [293, 293, w^2 - 6], [293, 293, w^3 - 7*w - 1], [331, 331, -6*w^3 + 10*w^2 + 27*w - 6], [331, 331, 2*w^3 - 2*w^2 - 12*w - 7], [347, 347, 3*w^3 - 2*w^2 - 18*w - 6], [347, 347, -4*w^3 + 2*w^2 + 23*w + 10], [347, 347, 2*w^3 - 6*w^2 - w + 4], [347, 347, -4*w^3 + 3*w^2 + 24*w + 8], [359, 359, -3*w^3 + 4*w^2 + 17*w + 1], [359, 359, w^2 - 4*w - 4], [359, 359, w^3 - 8*w], [359, 359, -w^3 + 2*w^2 + 6*w - 6], [367, 367, 2*w^2 - 3*w - 4], [367, 367, -w^3 + 3*w^2 + 4*w - 7], [379, 379, 3*w^3 - 3*w^2 - 16*w - 3], [379, 379, 2*w^3 - 2*w^2 - 9*w - 2], [461, 461, -2*w^3 + 5*w^2 + 2*w + 2], [461, 461, 4*w^3 - 4*w^2 - 26*w - 11], [463, 463, -2*w^3 + 13*w + 8], [463, 463, -w^3 - w^2 + 6*w + 7], [487, 487, 2*w^3 - 17*w - 8], [487, 487, -w^3 + 10*w + 4], [491, 491, -5*w^3 + 3*w^2 + 30*w + 13], [491, 491, -5*w^3 + 4*w^2 + 28*w + 14], [491, 491, 3*w^3 - 8*w^2 - 4*w + 4], [491, 491, 7*w^3 - 12*w^2 - 33*w + 15], [499, 499, -2*w^3 + 2*w^2 + 12*w - 5], [499, 499, 2*w^2 - 7*w], [529, 23, -w^3 + 3*w^2 + 4*w - 5], [529, 23, 2*w^2 - 3*w - 6], [557, 557, -2*w^3 + 3*w^2 + 12*w + 4], [557, 557, w^3 - 9*w - 9], [569, 569, 4*w^3 - 5*w^2 - 22*w + 4], [569, 569, -3*w^3 + 2*w^2 + 20*w + 4], [577, 577, 3*w^3 - 3*w^2 - 20*w + 3], [577, 577, -4*w^3 + 8*w^2 + 16*w - 9], [577, 577, 7*w^3 - 11*w^2 - 34*w + 9], [577, 577, -4*w^3 + 6*w^2 + 22*w - 11], [593, 593, -6*w^3 + 10*w^2 + 29*w - 14], [593, 593, -w^3 + 4*w^2 - w - 7], [619, 619, -3*w^3 + 5*w^2 + 12*w - 1], [619, 619, -4*w^3 + 8*w^2 + 18*w - 15], [625, 5, -5], [631, 631, -3*w^3 + 8*w^2 + 6*w - 4], [631, 631, -2*w^3 + 8*w^2 - 3*w - 8], [643, 643, 3*w^3 - 4*w^2 - 14*w + 2], [643, 643, -3*w^3 + 4*w^2 + 14*w + 2], [661, 661, w^3 - 8*w - 10], [661, 661, -3*w^3 + 2*w^2 + 21*w + 3], [661, 661, w^3 - 2*w^2 - 6*w - 4], [661, 661, 2*w^3 - 3*w^2 - 14*w + 4], [677, 677, -9*w^3 + 12*w^2 + 50*w - 10], [677, 677, 3*w^3 - 4*w^2 - 17*w - 7], [691, 691, 3*w^3 - 2*w^2 - 21*w - 9], [691, 691, 2*w^3 - 3*w^2 - 14*w - 2], [701, 701, -9*w^3 + 13*w^2 + 48*w - 15], [701, 701, 2*w^3 - 6*w^2 + w - 2], [709, 709, 2*w^2 - 2*w - 5], [709, 709, 2*w^2 - 2*w - 7], [709, 709, 4*w^3 - 5*w^2 - 20*w - 4], [709, 709, -3*w^3 + 6*w^2 + 14*w - 10], [727, 727, 7*w^3 - 10*w^2 - 36*w + 8], [727, 727, 3*w^2 - 6*w - 8], [743, 743, 9*w^3 - 12*w^2 - 51*w + 13], [743, 743, w^3 - 2*w^2 - w - 5], [743, 743, -4*w^3 + 4*w^2 + 27*w - 8], [743, 743, -3*w^3 + 4*w^2 + 21*w + 9], [751, 751, -w^3 + 10*w + 2], [751, 751, 3*w^3 - 4*w^2 - 18*w + 2], [761, 761, 4*w^3 - 4*w^2 - 23*w - 2], [761, 761, -3*w^3 + 2*w^2 + 19*w + 5], [809, 809, -3*w^3 + 5*w^2 + 10*w + 5], [809, 809, -w^3 - w^2 + 10*w + 3], [821, 821, -w^3 + 3*w^2 + 2*w - 9], [821, 821, 2*w^2 - 4*w - 9], [823, 823, w^3 - 6*w^2 + 9*w + 1], [823, 823, -3*w^3 + 2*w^2 + 15*w + 5], [827, 827, 3*w^3 - 3*w^2 - 18*w + 1], [827, 827, 2*w^3 - 16*w - 11], [827, 827, 3*w^3 - 24*w - 14], [827, 827, 3*w - 4], [829, 829, w^2 - 6*w - 2], [829, 829, 2*w^3 - 2*w^2 - 10*w - 9], [829, 829, 5*w^3 - 6*w^2 - 29*w - 1], [829, 829, w^3 + 2*w^2 - 14*w - 6], [841, 29, -2*w^3 + 2*w^2 + 14*w + 3], [857, 857, -3*w^3 + 6*w^2 + 11*w - 7], [857, 857, -4*w^3 + 7*w^2 + 18*w - 4], [859, 859, -w^3 + w^2 + 6*w - 5], [859, 859, w - 6], [883, 883, 5*w^3 - 5*w^2 - 26*w - 11], [883, 883, -3*w^3 + 3*w^2 + 14*w + 5], [887, 887, 5*w^3 - 2*w^2 - 34*w - 16], [887, 887, -w^3 + 4*w^2 - 10], [887, 887, 4*w^3 - 2*w^2 - 26*w - 11], [887, 887, 2*w^3 - 8*w^2 + 4*w + 7], [907, 907, 6*w^3 - 8*w^2 - 34*w + 7], [907, 907, -w^3 + w^2 + 8*w - 7], [941, 941, 2*w^3 - 2*w^2 - 8*w - 5], [941, 941, -3*w^3 + 23*w + 11], [953, 953, 2*w^3 - 10*w - 3], [953, 953, -4*w^3 + 2*w^2 + 24*w + 15], [961, 31, -2*w^3 + 2*w^2 + 14*w - 7], [991, 991, -3*w^3 + 4*w^2 + 13*w + 3], [991, 991, 4*w^3 - 5*w^2 - 20*w + 2]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 58*x^2 + 784; K := NumberField(heckePol); heckeEigenvaluesArray := [1/28*e^3 - 15/14*e, -1, -1, 1/28*e^3 - 29/14*e, e, 3/28*e^3 - 59/14*e, 1/14*e^3 - 8/7*e, e^2 - 26, -e^2 + 32, -1/14*e^3 + 8/7*e, -3/28*e^3 + 59/14*e, -e^2 + 32, e^2 - 26, -5/28*e^3 + 75/14*e, 1/14*e^3 - 15/7*e, -5/28*e^3 + 75/14*e, 1/14*e^3 - 15/7*e, 2, 2, 14, 14, -3/14*e^3 + 38/7*e, -1/4*e^3 + 17/2*e, -e^2 + 30, e^2 - 28, 3/28*e^3 - 73/14*e, 1/7*e^3 - 30/7*e, 1/28*e^3 + 13/14*e, 1/7*e^3 - 30/7*e, 2, -3/14*e^3 + 52/7*e, -5/28*e^3 + 61/14*e, e^2 - 28, 2*e^2 - 66, -e^2 + 30, -2*e^2 + 50, -3*e^2 + 88, 3*e^2 - 86, -10, -10, 1/28*e^3 - 1/14*e, 1/14*e^3 - 22/7*e, 9/28*e^3 - 121/14*e, 5/14*e^3 - 82/7*e, -e^2 + 26, e^2 - 32, -e^2 + 40, e^2 - 18, -11/28*e^3 + 165/14*e, -1/7*e^3 + 30/7*e, -1/7*e^3 + 30/7*e, -11/28*e^3 + 165/14*e, e^2 - 24, 2*e^2 - 62, -e^2 + 34, -2*e^2 + 54, 3/7*e^3 - 83/7*e, 13/28*e^3 - 209/14*e, 1/4*e^3 - 21/2*e, 1/7*e^3 - 9/7*e, 4, -1/2*e^3 + 14*e, -15/28*e^3 + 239/14*e, 2*e^2 - 48, -2*e^2 + 68, 5/14*e^3 - 75/7*e, 1/4*e^3 - 11/2*e, 9/28*e^3 - 163/14*e, 5/14*e^3 - 75/7*e, 19/28*e^3 - 313/14*e, 17/28*e^3 - 227/14*e, -9/28*e^3 + 135/14*e, -9/28*e^3 + 135/14*e, 3*e^2 - 82, -3*e^2 + 92, -e^2 + 54, e^2 - 4, 5/28*e^3 - 173/14*e, -1/14*e^3 + 64/7*e, -2*e^2 + 40, 2*e^2 - 76, -8, -8, 6/7*e^3 - 180/7*e, -5/28*e^3 + 47/14*e, 6/7*e^3 - 180/7*e, -1/4*e^3 + 19/2*e, 2*e^2 - 68, -2*e^2 + 48, -4*e^2 + 128, 4*e^2 - 104, -11/28*e^3 + 179/14*e, -5/14*e^3 + 68/7*e, -5/28*e^3 + 61/14*e, -3/14*e^3 + 52/7*e, -e^2 + 4, -e^2 + 16, e^2 - 42, e^2 - 54, 9/28*e^3 - 233/14*e, 1/14*e^3 + 34/7*e, -4*e^2 + 124, 4*e^2 - 108, -2, -2*e^2 + 68, 2*e^2 - 48, e^2 - 2, -e^2 + 56, 2*e^2 - 54, 2*e^2 - 42, -2*e^2 + 62, -2*e^2 + 74, -15/28*e^3 + 239/14*e, -1/2*e^3 + 14*e, -2*e^2 + 76, 2*e^2 - 40, -5/28*e^3 + 61/14*e, -3/14*e^3 + 52/7*e, 24, 24, -4*e^2 + 122, 4*e^2 - 110, -e^2 + 28, e^2 - 30, -1/28*e^3 + 127/14*e, -13/28*e^3 + 223/14*e, 1/4*e^3 - 31/2*e, -11/28*e^3 + 137/14*e, 16, 16, 3/7*e^3 - 55/7*e, 17/28*e^3 - 325/14*e, 6/7*e^3 - 159/7*e, 27/28*e^3 - 447/14*e, -17/28*e^3 + 241/14*e, -9/14*e^3 + 142/7*e, 3*e^2 - 68, -3*e^2 + 106, 31/28*e^3 - 465/14*e, 4*e, 1/7*e^3 - 58/7*e, 31/28*e^3 - 465/14*e, -4*e^2 + 112, -2*e^2 + 54, 4*e^2 - 120, 2*e^2 - 62, -38, 13/14*e^3 - 202/7*e, 25/28*e^3 - 361/14*e, -3*e^2 + 100, 3*e^2 - 74, 2*e^2 - 96, -2*e^2 + 20, 1/7*e^3 - 2/7*e, -1/2*e^3 + 19*e, 2/7*e^3 - 88/7*e, -5/14*e^3 + 47/7*e, -2*e^2 + 76, 2*e^2 - 40, 17/28*e^3 - 297/14*e, 1/2*e^3 - 12*e, -1/14*e^3 - 48/7*e, -11/28*e^3 + 291/14*e, 28, -4*e^2 + 136, 4*e^2 - 96]; 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;