/* 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![11, 9, -9, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [5, 5, -2*w^3 - 2*w^2 + 13*w + 8], [11, 11, 2*w^3 + 3*w^2 - 12*w - 11], [11, 11, -w^3 - 2*w^2 + 6*w + 9], [11, 11, w^3 + w^2 - 7*w - 4], [11, 11, w - 1], [16, 2, 2], [19, 19, -w^2 + 4], [19, 19, 2*w^3 + 2*w^2 - 13*w - 6], [19, 19, 3*w^3 + 4*w^2 - 18*w - 16], [19, 19, -w^3 - w^2 + 5*w + 3], [49, 7, 2*w^3 + 3*w^2 - 13*w - 15], [59, 59, -3*w^3 - 4*w^2 + 19*w + 14], [59, 59, 3*w^3 + 4*w^2 - 18*w - 17], [59, 59, 2*w^3 + 3*w^2 - 11*w - 13], [59, 59, -w^3 - 2*w^2 + 7*w + 9], [71, 71, 3*w^3 + 3*w^2 - 17*w - 10], [71, 71, -2*w^3 - w^2 + 14*w + 2], [71, 71, 5*w^3 + 7*w^2 - 30*w - 25], [71, 71, -3*w^3 - 4*w^2 + 16*w + 16], [81, 3, -3], [89, 89, -2*w^3 - 2*w^2 + 13*w + 4], [89, 89, 3*w^3 + 4*w^2 - 17*w - 16], [89, 89, 3*w^3 + 4*w^2 - 18*w - 18], [89, 89, -4*w^3 - 5*w^2 + 25*w + 18], [139, 139, -w^3 + 6*w + 1], [139, 139, -3*w^3 - 3*w^2 + 19*w + 8], [139, 139, 4*w^3 + 5*w^2 - 24*w - 21], [139, 139, -2*w^3 - 2*w^2 + 11*w + 5], [151, 151, -6*w^3 - 7*w^2 + 37*w + 27], [151, 151, 3*w^3 + 5*w^2 - 19*w - 17], [151, 151, -6*w^3 - 8*w^2 + 37*w + 31], [151, 151, 4*w^3 + 6*w^2 - 25*w - 26], [191, 191, 5*w^3 + 7*w^2 - 31*w - 26], [191, 191, -2*w^3 - 3*w^2 + 10*w + 13], [191, 191, -5*w^3 - 7*w^2 + 31*w + 29], [191, 191, 2*w^3 + 4*w^2 - 13*w - 17], [199, 199, 2*w^3 + 4*w^2 - 11*w - 20], [199, 199, -2*w^3 - 2*w^2 + 11*w + 3], [199, 199, 3*w^3 + 5*w^2 - 17*w - 17], [199, 199, 3*w^3 + 3*w^2 - 19*w - 6], [211, 211, 3*w^3 + 5*w^2 - 18*w - 19], [211, 211, -3*w^3 - 5*w^2 + 18*w + 21], [211, 211, 2*w^3 + 4*w^2 - 12*w - 17], [211, 211, -4*w^3 - 6*w^2 + 24*w + 23], [229, 229, 2*w^3 + 4*w^2 - 13*w - 19], [229, 229, -2*w^3 - 3*w^2 + 10*w + 15], [229, 229, -5*w^3 - 7*w^2 + 31*w + 24], [229, 229, 2*w^3 + 2*w^2 - 14*w - 3], [269, 269, 2*w^3 + w^2 - 11*w - 1], [269, 269, -6*w^3 - 7*w^2 + 37*w + 24], [269, 269, 5*w^3 + 6*w^2 - 29*w - 24], [269, 269, 3*w^3 + 2*w^2 - 19*w - 7], [281, 281, -4*w^3 - 6*w^2 + 25*w + 25], [281, 281, -5*w^3 - 7*w^2 + 31*w + 27], [281, 281, w^2 + 2*w - 7], [281, 281, 3*w^3 + 5*w^2 - 19*w - 18], [331, 331, -2*w^3 - 3*w^2 + 12*w + 7], [331, 331, w^3 + w^2 - 7*w - 8], [331, 331, w^3 + 2*w^2 - 6*w - 13], [331, 331, w - 5], [349, 349, 2*w^3 + 5*w^2 - 16*w - 12], [349, 349, 2*w^3 + 4*w^2 - 15*w - 10], [349, 349, 8*w^3 + 9*w^2 - 50*w - 32], [349, 349, 2*w^3 + 4*w^2 - 15*w - 9], [401, 401, 4*w^3 + 3*w^2 - 21*w - 12], [401, 401, 3*w^3 + 2*w^2 - 16*w - 9], [401, 401, -3*w^3 - 6*w^2 + 20*w + 19], [401, 401, -4*w^3 - 3*w^2 + 27*w + 9], [409, 409, -5*w^3 - 6*w^2 + 31*w + 20], [409, 409, 3*w^3 + 4*w^2 - 20*w - 12], [409, 409, -3*w^3 - 5*w^2 + 17*w + 23], [409, 409, 4*w^3 + 5*w^2 - 23*w - 21], [419, 419, -4*w^3 - 4*w^2 + 21*w + 18], [419, 419, -4*w^3 - 4*w^2 + 20*w + 19], [419, 419, -3*w^3 - 4*w^2 + 16*w + 18], [419, 419, -2*w^3 - w^2 + 8*w + 10], [421, 421, -6*w^3 - 7*w^2 + 36*w + 26], [421, 421, 5*w^3 + 5*w^2 - 31*w - 17], [421, 421, 3*w^3 + 2*w^2 - 18*w - 6], [421, 421, 4*w^3 + 4*w^2 - 23*w - 14], [431, 431, 6*w^3 + 7*w^2 - 36*w - 25], [431, 431, -3*w^3 - 2*w^2 + 18*w + 5], [431, 431, 4*w^3 + 4*w^2 - 23*w - 15], [431, 431, -5*w^3 - 5*w^2 + 31*w + 18], [439, 439, w^3 + w^2 - 4*w - 1], [439, 439, w^3 + 3*w^2 - 6*w - 10], [439, 439, 3*w^3 + 3*w^2 - 20*w - 7], [439, 439, 5*w^3 + 7*w^2 - 30*w - 30], [479, 479, -4*w^3 - 5*w^2 + 25*w + 15], [479, 479, -5*w^3 - 6*w^2 + 32*w + 21], [479, 479, 5*w^3 + 7*w^2 - 29*w - 28], [479, 479, 2*w^2 + w - 9], [491, 491, 7*w^3 + 8*w^2 - 43*w - 31], [491, 491, 6*w^3 + 6*w^2 - 37*w - 24], [491, 491, 4*w^3 + 3*w^2 - 24*w - 6], [491, 491, 5*w^3 + 5*w^2 - 29*w - 21], [509, 509, -4*w^3 - 5*w^2 + 25*w + 14], [509, 509, -3*w^3 - 4*w^2 + 17*w + 20], [509, 509, -6*w^3 - 7*w^2 + 38*w + 25], [509, 509, -6*w^3 - 8*w^2 + 35*w + 31], [541, 541, 9*w^3 + 12*w^2 - 55*w - 46], [541, 541, w^3 + 4*w^2 - 7*w - 17], [541, 541, -4*w^3 - 5*w^2 + 21*w + 19], [541, 541, -4*w^3 - 3*w^2 + 27*w + 8], [571, 571, -3*w^3 - 6*w^2 + 18*w + 23], [571, 571, 6*w^3 + 9*w^2 - 36*w - 37], [571, 571, 7*w^3 + 10*w^2 - 42*w - 36], [571, 571, 2*w^3 + 5*w^2 - 12*w - 24], [619, 619, -9*w^3 - 11*w^2 + 55*w + 39], [619, 619, -5*w^3 - 4*w^2 + 32*w + 14], [619, 619, 7*w^3 + 9*w^2 - 42*w - 36], [619, 619, 4*w^3 + 6*w^2 - 26*w - 27], [631, 631, 2*w^3 + 5*w^2 - 12*w - 21], [631, 631, -7*w^3 - 10*w^2 + 42*w + 39], [631, 631, 4*w^3 + 4*w^2 - 27*w - 13], [631, 631, w^3 + w^2 - 3*w - 4], [641, 641, -9*w^3 - 10*w^2 + 56*w + 36], [641, 641, -5*w^3 - 9*w^2 + 30*w + 32], [641, 641, -3*w^3 - 6*w^2 + 19*w + 21], [641, 641, 4*w^3 + 3*w^2 - 22*w - 10], [701, 701, -2*w^3 - 5*w^2 + 14*w + 20], [701, 701, -6*w^3 - 7*w^2 + 36*w + 34], [701, 701, 4*w^3 + 6*w^2 - 23*w - 17], [701, 701, -9*w^3 - 12*w^2 + 56*w + 46], [719, 719, 3*w^3 + 5*w^2 - 17*w - 25], [719, 719, -3*w^3 - 2*w^2 + 17*w + 3], [719, 719, 7*w^3 + 8*w^2 - 43*w - 26], [719, 719, -6*w^3 - 7*w^2 + 35*w + 29], [751, 751, 2*w^3 + 2*w^2 - 15*w - 4], [751, 751, 5*w^3 + 8*w^2 - 30*w - 34], [751, 751, w^3 + w^2 - 9*w - 5], [751, 751, -4*w^3 - 7*w^2 + 24*w + 26], [769, 769, 6*w^3 + 8*w^2 - 37*w - 27], [769, 769, -w^3 - 3*w^2 + 7*w + 16], [769, 769, 2*w^3 + w^2 - 14*w - 5], [769, 769, -3*w^3 - 4*w^2 + 16*w + 19], [821, 821, 6*w^3 + 6*w^2 - 37*w - 23], [821, 821, 5*w^3 + 5*w^2 - 29*w - 20], [821, 821, -7*w^3 - 8*w^2 + 42*w + 27], [821, 821, 4*w^3 + 3*w^2 - 24*w - 7], [829, 829, 7*w^3 + 8*w^2 - 44*w - 28], [829, 829, 7*w^3 + 9*w^2 - 41*w - 35], [829, 829, -2*w^3 - w^2 + 10*w + 2], [829, 829, 2*w^3 - 13*w + 2], [839, 839, 4*w^3 + 8*w^2 - 25*w - 26], [839, 839, -3*w^3 - 3*w^2 + 15*w + 16], [839, 839, -w^3 - 4*w^2 + 8*w + 10], [839, 839, -3*w^3 - 7*w^2 + 18*w + 26], [841, 29, -5*w^3 - 5*w^2 + 30*w + 16], [841, 29, -5*w^3 - 5*w^2 + 30*w + 19], [859, 859, 5*w^3 + 6*w^2 - 32*w - 20], [859, 859, -4*w^3 - 5*w^2 + 23*w + 23], [859, 859, -5*w^3 - 6*w^2 + 31*w + 18], [859, 859, -2*w^3 - w^2 + 13*w + 6], [911, 911, 9*w^3 + 12*w^2 - 56*w - 48], [911, 911, 6*w^3 + 5*w^2 - 38*w - 14], [911, 911, 7*w^3 + 8*w^2 - 40*w - 28], [911, 911, 10*w^3 + 12*w^2 - 61*w - 46], [929, 929, -7*w^3 - 10*w^2 + 39*w + 39], [929, 929, -10*w^3 - 13*w^2 + 60*w + 45], [929, 929, -6*w^3 - 7*w^2 + 32*w + 29], [929, 929, -3*w^3 - w^2 + 12*w + 12], [961, 31, -5*w^3 - 5*w^2 + 30*w + 17], [961, 31, -5*w^3 - 5*w^2 + 30*w + 18], [991, 991, 10*w^3 + 12*w^2 - 61*w - 45], [991, 991, -6*w^3 - 9*w^2 + 38*w + 38], [991, 991, 6*w^3 + 8*w^2 - 37*w - 38], [991, 991, -8*w^3 - 11*w^2 + 49*w + 43]]; primes := [ideal : I in primesArray]; heckePol := x^2 - x - 23; K := NumberField(heckePol); heckeEigenvaluesArray := [-4, e, e, -e + 1, -e + 1, -1, -e + 3, e + 2, -e + 3, e + 2, 14, -e - 7, e - 8, e - 8, -e - 7, 6, 6, 6, 6, 2, -e, e - 1, e - 1, -e, 0, 0, 0, 0, 2*e + 8, -2*e + 10, 2*e + 8, -2*e + 10, -18, -18, -18, -18, 2*e + 2, -2*e + 4, 2*e + 2, -2*e + 4, -3*e + 2, -3*e + 2, 3*e - 1, 3*e - 1, -4*e + 4, 4*e, -4*e + 4, 4*e, -2*e + 10, -2*e + 10, 2*e + 8, 2*e + 8, -e - 16, e - 17, e - 17, -e - 16, e - 2, -e - 1, e - 2, -e - 1, 2, 2, 2, 2, -3*e + 17, -3*e + 17, 3*e + 14, 3*e + 14, -3*e + 25, -3*e + 25, 3*e + 22, 3*e + 22, -4*e, 4*e - 4, 4*e - 4, -4*e, -4*e - 12, 4*e - 16, -4*e - 12, 4*e - 16, -2*e + 2, -2*e + 2, 2*e, 2*e, 2*e + 16, -2*e + 18, 2*e + 16, -2*e + 18, 22, 22, 22, 22, -3*e - 2, 3*e - 5, -3*e - 2, 3*e - 5, -2*e - 14, 2*e - 16, -2*e - 14, 2*e - 16, 2*e - 4, 2*e - 4, -2*e - 2, -2*e - 2, -e + 27, -e + 27, e + 26, e + 26, 3*e + 1, -3*e + 4, 3*e + 1, -3*e + 4, -4*e + 22, -4*e + 22, 4*e + 18, 4*e + 18, -7*e + 7, 7*e, 7*e, -7*e + 7, -34, -34, -34, -34, 2*e + 12, -2*e + 14, -2*e + 14, 2*e + 12, -2*e - 10, 2*e - 12, -2*e - 10, 2*e - 12, e - 33, e - 33, -e - 32, -e - 32, -2*e + 20, -2*e + 20, 2*e + 18, 2*e + 18, -4*e - 16, 4*e - 20, -4*e - 16, 4*e - 20, -4*e + 36, -4*e + 36, 4*e + 32, 4*e + 32, -3*e + 34, 3*e + 31, 5*e - 24, -5*e - 19, 5*e - 24, -5*e - 19, -4*e + 32, 4*e + 28, 4*e + 28, -4*e + 32, 4*e + 2, -4*e + 6, -4*e + 6, 4*e + 2, -11*e + 14, 11*e + 3, 4*e - 28, -4*e - 24, -4*e - 24, 4*e - 28]; 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;