/* 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, 7, -6, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [5, 5, -w^2 + 2*w + 3], [9, 3, w^3 - 3*w^2 - 2*w + 9], [9, 3, -w^3 + 5*w + 5], [11, 11, w], [11, 11, w - 1], [16, 2, 2], [19, 19, -w^3 + 2*w^2 + 3*w - 2], [19, 19, w^3 - w^2 - 4*w + 2], [29, 29, w^3 - 4*w^2 - w + 10], [29, 29, -w^3 + 3*w^2 + w - 7], [41, 41, 3*w^2 - 2*w - 10], [49, 7, -2*w^2 + 3*w + 8], [49, 7, w^3 - 2*w^2 - 2*w + 5], [71, 71, -w - 3], [71, 71, w - 4], [79, 79, -w^3 + w^2 + 3*w + 3], [79, 79, -w^3 + 2*w^2 + 2*w - 6], [89, 89, w^3 - 3*w^2 - 3*w + 7], [89, 89, w^3 - 6*w - 2], [101, 101, 2*w^3 - 5*w^2 - 3*w + 9], [101, 101, -w^3 + 3*w^2 + 3*w - 12], [109, 109, -w^3 + 4*w^2 + w - 9], [109, 109, -w^3 + 2*w^2 + 4*w - 2], [121, 11, -3*w^2 + 3*w + 10], [131, 131, -2*w^3 + 5*w^2 + 4*w - 9], [131, 131, -w^3 + w^2 + 3*w + 5], [131, 131, -w^3 + 2*w^2 + 2*w - 8], [131, 131, -w^3 + 6*w^2 - 18], [149, 149, -w^3 - 2*w^2 + 7*w + 8], [149, 149, -2*w^3 + 6*w^2 + 5*w - 16], [151, 151, w^2 + w - 5], [151, 151, w^2 - 3*w - 3], [169, 13, w^3 - 4*w^2 - w + 6], [169, 13, 2*w^3 - 5*w^2 - 4*w + 6], [179, 179, w^3 - 4*w - 6], [179, 179, -w^3 + 3*w^2 + w - 9], [181, 181, w^3 + 3*w^2 - 7*w - 15], [181, 181, w^3 - 6*w^2 + 2*w + 18], [191, 191, 5*w^2 - 7*w - 15], [191, 191, -4*w^2 + 5*w + 12], [199, 199, -w^3 + 3*w^2 + 3*w - 6], [199, 199, w^3 - 6*w - 1], [211, 211, w^3 - 7*w - 4], [211, 211, -w^3 + 3*w^2 + 4*w - 10], [229, 229, -w^3 - w^2 + 5*w + 9], [229, 229, -w^3 + 4*w^2 - 12], [239, 239, 4*w^2 - 5*w - 17], [239, 239, 4*w^2 - 3*w - 18], [241, 241, -w^3 + 3*w^2 + w - 2], [241, 241, -w^3 + 3*w^2 + 4*w - 9], [241, 241, w^3 - 7*w - 3], [241, 241, -w^3 + 4*w - 1], [271, 271, -w - 4], [271, 271, w^3 - 3*w^2 - 2*w + 2], [271, 271, -2*w^3 + 6*w^2 + 2*w - 7], [271, 271, w - 5], [281, 281, w^3 - 2*w^2 - 3*w - 1], [281, 281, -w^3 + w^2 + 4*w - 5], [289, 17, -2*w^3 + w^2 + 9*w + 1], [289, 17, -2*w^3 + 5*w^2 + 5*w - 9], [311, 311, w^3 - w^2 - 6*w + 1], [311, 311, -w^3 + 2*w^2 + 5*w - 5], [331, 331, -3*w^3 + 5*w^2 + 10*w - 5], [331, 331, 3*w^3 - 2*w^2 - 12*w - 6], [349, 349, -2*w^3 + 2*w^2 + 10*w + 3], [349, 349, -2*w^3 - w^2 + 12*w + 10], [349, 349, 2*w^3 + w^2 - 10*w - 12], [349, 349, -2*w^3 + 4*w^2 + 8*w - 13], [361, 19, -4*w^2 + 4*w + 13], [379, 379, w^3 + w^2 - 5*w - 10], [379, 379, -3*w^3 + 4*w^2 + 12*w - 7], [379, 379, w^3 + 4*w^2 - 8*w - 21], [379, 379, w^3 - 3*w - 6], [389, 389, 2*w^3 - 6*w^2 - 4*w + 13], [389, 389, -5*w^2 + 7*w + 13], [389, 389, 2*w^3 - 7*w^2 - 5*w + 20], [389, 389, 2*w^3 - 10*w - 5], [419, 419, -w^3 + 5*w^2 + w - 13], [419, 419, 4*w^2 - 7*w - 14], [419, 419, 2*w^3 - 3*w^2 - 5*w - 1], [419, 419, -w^3 - 2*w^2 + 8*w + 8], [421, 421, -2*w^2 + 5*w + 7], [421, 421, w^3 - 6*w^2 + 5*w + 13], [439, 439, 2*w^3 - 2*w^2 - 9*w + 3], [439, 439, w^3 + w^2 - 7*w - 4], [449, 449, 3*w^3 - 6*w^2 - 9*w + 8], [449, 449, 5*w^2 - 8*w - 17], [449, 449, 2*w^3 - w^2 - 8*w - 7], [449, 449, -3*w^3 + 3*w^2 + 12*w - 4], [479, 479, -2*w^3 + 3*w^2 + 5*w + 3], [479, 479, 3*w^3 - 7*w^2 - 9*w + 15], [499, 499, -w^3 + 4*w^2 + 4*w - 9], [499, 499, w^3 + w^2 - 9*w - 2], [509, 509, 2*w^3 + 2*w^2 - 11*w - 16], [509, 509, -2*w^3 + 8*w^2 + w - 23], [521, 521, -3*w^3 + w^2 + 13*w + 6], [521, 521, w^3 + 4*w^2 - 10*w - 16], [541, 541, 3*w^3 - 2*w^2 - 13*w - 3], [541, 541, -w^3 + 7*w^2 - w - 25], [541, 541, w^3 + 4*w^2 - 10*w - 20], [541, 541, -3*w^3 + 7*w^2 + 8*w - 15], [571, 571, w^3 + 4*w^2 - 9*w - 15], [571, 571, w^3 - 7*w^2 + 2*w + 19], [601, 601, -3*w^3 + 2*w^2 + 13*w + 5], [601, 601, 3*w^3 - 7*w^2 - 8*w + 17], [619, 619, w^3 - 3*w - 7], [619, 619, w^3 - 5*w^2 + 3*w + 13], [619, 619, 3*w^3 - 4*w^2 - 9*w - 2], [619, 619, -w^3 + 3*w^2 - 9], [641, 641, 6*w^2 - 4*w - 23], [641, 641, -3*w^3 + w^2 + 12*w + 5], [659, 659, -2*w^3 + 6*w^2 + 3*w - 17], [659, 659, -2*w^3 + 9*w + 10], [661, 661, 3*w^3 - 6*w^2 - 9*w + 14], [661, 661, 5*w^2 - 6*w - 18], [661, 661, -5*w^2 + 4*w + 19], [661, 661, 3*w^3 - 3*w^2 - 12*w - 2], [691, 691, -3*w^3 + 5*w^2 + 10*w - 6], [691, 691, -3*w^3 + 4*w^2 + 11*w - 6], [701, 701, -w^3 - 4*w^2 + 9*w + 20], [701, 701, -w^3 + 4*w^2 + 3*w - 19], [701, 701, -w^3 + 4*w^2 + 4*w - 15], [701, 701, w^3 - 7*w^2 + 2*w + 24], [709, 709, 3*w^2 - 5*w - 13], [709, 709, 3*w^2 - w - 15], [719, 719, -w^3 + 3*w^2 + 4*w - 4], [719, 719, -w^3 + 7*w - 2], [739, 739, -w^3 + 4*w^2 + 3*w - 9], [739, 739, -2*w^3 - w^2 + 11*w + 8], [739, 739, 2*w^3 - 7*w^2 - 3*w + 16], [739, 739, -w^3 - w^2 + 8*w + 3], [751, 751, 3*w^3 - 5*w^2 - 10*w + 10], [751, 751, 2*w^2 - 5*w - 5], [761, 761, 3*w^3 - 3*w^2 - 11*w + 3], [761, 761, w^3 - 2*w^2 - 3*w - 2], [761, 761, -w^3 + w^2 + 4*w - 6], [761, 761, -3*w^3 + 6*w^2 + 8*w - 8], [769, 769, -w^3 - w^2 + 7*w + 1], [769, 769, -2*w^3 + 6*w^2 + 6*w - 15], [769, 769, -2*w^3 + 5*w^2 + 5*w - 7], [769, 769, 2*w^3 + w^2 - 12*w - 9], [809, 809, -2*w^3 + 8*w^2 + 4*w - 23], [809, 809, -3*w^3 + 11*w^2 + 2*w - 28], [829, 829, -3*w^3 + 7*w^2 + 7*w - 9], [829, 829, w^3 + 2*w^2 - 6*w - 15], [829, 829, -w^3 + 5*w^2 - w - 18], [829, 829, -3*w^3 + 2*w^2 + 12*w - 2], [839, 839, 2*w^3 - 9*w^2 + 20], [839, 839, -3*w^3 + 10*w^2 + 5*w - 30], [841, 29, 5*w^2 - 5*w - 16], [881, 881, -w^3 - 4*w^2 + 8*w + 18], [881, 881, 2*w^3 - 7*w^2 - w + 9], [881, 881, 2*w^3 - 6*w^2 - 3*w + 6], [881, 881, -w^3 + 7*w^2 - 3*w - 21], [911, 911, -w^3 - 4*w^2 + 8*w + 16], [911, 911, -w^3 - w^2 + 9*w + 5], [911, 911, -w^3 + 4*w^2 + 4*w - 12], [911, 911, w^3 - 7*w^2 + 3*w + 19], [919, 919, -4*w^3 + 7*w^2 + 14*w - 9], [919, 919, 4*w^3 - 5*w^2 - 16*w + 8], [929, 929, 3*w^2 - w - 16], [929, 929, 3*w^2 - 5*w - 14], [941, 941, -w^3 - w^2 + 9*w + 7], [941, 941, -3*w^3 + 7*w^2 + 7*w - 15], [941, 941, 3*w^3 - 2*w^2 - 12*w - 4], [941, 941, w^3 + 4*w^2 - 13*w - 16], [961, 31, -2*w^2 + 2*w + 13], [961, 31, 5*w^2 - 5*w - 18], [971, 971, w^3 + 4*w^2 - 9*w - 19], [971, 971, w^3 - 7*w^2 + 2*w + 23], [991, 991, 3*w^3 - 7*w^2 - 7*w + 14], [991, 991, -3*w^3 + 2*w^2 + 12*w + 3]]; primes := [ideal : I in primesArray]; heckePol := x^3 - 8*x^2 + 15*x + 2; K := NumberField(heckePol); heckeEigenvaluesArray := [1, 1, e, e^2 - 6*e + 4, -e^2 + 5*e - 2, e^2 - 3*e - 5, e^2 - 5*e + 2, 2*e^2 - 9*e + 6, -e^2 + 3*e + 4, -2*e^2 + 6*e + 10, e^2 - 6*e + 2, -3*e^2 + 12*e + 6, 3*e^2 - 12*e - 2, e^2 - 2*e - 8, -4*e^2 + 19*e - 6, e^2 - 5*e - 2, -e^2 + 9*e - 6, -5*e^2 + 20*e + 6, 3*e^2 - 12*e + 6, -4*e^2 + 18*e + 2, 4*e^2 - 21*e + 8, 6*e - 14, -3*e^2 + 12*e + 2, -4*e^2 + 17*e, -3*e^2 + 16*e - 16, e^2 - 7*e + 6, 2*e - 16, 4*e - 4, e^2 - 8*e + 2, -5*e^2 + 19*e + 12, e^2 - 4*e - 4, -6*e^2 + 23*e + 10, 4*e^2 - 20*e + 2, 4*e^2 - 18*e + 14, -6*e^2 + 28*e - 12, -3*e^2 + 13*e - 2, 3*e^2 - 17*e + 20, 7*e^2 - 29*e - 4, 4*e^2 - 13*e - 14, -7*e^2 + 28*e + 4, 2*e^2 - e - 22, -2*e^2 + 16*e - 16, -4*e^2 + 12*e + 12, -8*e^2 + 34*e, -2*e^2 + 14*e + 2, -3*e^2 + 16*e - 14, e^2 + 4*e - 28, 2*e^2 - 13*e + 10, 7*e^2 - 26*e - 6, 2*e^2 - 3*e - 24, -14, -e^2 - 3*e + 20, -2*e^2 + 15*e + 2, 3*e^2 - 19*e + 2, 2*e^2 - 12*e, -e^2 + 7*e - 18, -4*e^2 + 26*e - 26, e^2 - 13*e + 24, -2*e + 22, -3*e^2 + 22*e - 14, -e^2 - e + 6, -e^2 + 12*e - 28, 6*e^2 - 24*e + 4, 3*e^2 - 15*e - 10, 6*e^2 - 24*e - 10, 2*e^2 - 8*e + 6, 2*e^2 - 12*e + 14, 8*e^2 - 41*e + 24, -6*e^2 + 26*e - 2, -11*e^2 + 46*e - 4, 2*e^2 - 19*e + 18, -9*e^2 + 38*e + 4, -4, 4*e^2 - 26*e + 26, -2*e^2 + 10*e - 22, -2*e^2 + 12*e - 10, -4*e^2 + 24*e - 26, -8*e^2 + 40*e - 12, 2*e^2 - 18*e + 16, -5*e^2 + 27*e - 22, -e^2 - 2*e + 28, -2*e^2 + 12*e - 10, -e^2 + 10*e - 26, 6*e^2 - 24*e + 16, -3*e^2 + 11*e + 22, -5*e + 20, 3*e^2 - 22*e + 18, -10*e^2 + 42*e + 6, 2*e^2 - 12*e + 18, -e^2 + 11*e - 10, 9*e^2 - 39*e + 2, 7*e^2 - 22*e - 44, e + 10, 2*e^2 - 12*e + 14, -4*e^2 + 14*e + 2, 8*e^2 - 34*e - 2, 2*e^2 - 3*e, -6*e^2 + 40*e - 26, -e^2 - 5*e + 20, -6*e + 26, -3*e^2 + 14*e - 2, -7*e^2 + 23*e + 18, -e^2 + 14*e - 12, -4*e^2 + 23*e - 28, -4*e + 2, 6*e^2 - 28*e - 20, 13*e^2 - 54*e - 12, 9*e^2 - 41*e + 34, -2*e^2 + 22*e - 40, 4*e^2 - 28*e + 10, -e^2 - 3*e + 36, -6*e^2 + 29*e - 22, 12*e^2 - 56*e + 20, 4*e^2 - 26*e + 10, 4*e^2 - 18*e - 6, e^2 - 7*e + 24, 3*e^2 - 24*e + 26, e^2 - 4*e - 8, -13*e^2 + 45*e + 38, 4*e^2 - 11*e - 4, -8*e^2 + 35*e - 32, 6*e^2 - 23*e - 20, 5*e - 20, 4*e^2 - 21*e + 8, -3*e^2 + 9*e - 8, 7*e - 22, -5*e^2 + 39*e - 34, -e^2 - 3*e + 6, -4*e^2 + 18*e, -7*e + 10, 10*e^2 - 40*e + 12, 3*e^2 - 8*e - 12, 2*e^2 - 12*e, -14*e^2 + 54*e + 22, -13*e^2 + 59*e - 32, -8*e^2 + 36*e - 14, 16*e^2 - 62*e - 26, -14*e^2 + 54*e + 30, -2*e^2 + 9*e + 16, -3*e^2 + 25*e - 12, 8*e^2 - 36*e - 22, -8*e^2 + 50*e - 42, 8*e^2 - 42*e + 14, 16*e^2 - 70*e + 26, -4*e^2 + 20*e - 26, -11*e^2 + 59*e - 36, 2*e^2 - 22*e + 18, -7*e^2 + 16*e + 36, 7*e^2 - 27*e - 6, -11*e^2 + 36*e + 46, 3*e^2 - 11*e + 20, 22*e^2 - 104*e + 42, 13*e^2 - 39*e - 60, -7*e^2 + 19*e + 16, -3*e^2 + 27*e - 50, -10*e^2 + 34*e + 36, 8*e^2 - 30*e - 36, 14*e^2 - 54*e - 12, e^2 - 13*e + 22, 2*e^2 + 6*e - 44, -e^2 - 17*e + 48, 8*e^2 - 50*e + 54, 10*e + 10, -6*e^2 + 13*e + 36, 15*e^2 - 67*e + 16, 4*e^2 - 23*e + 36, -4*e^2 + 20*e + 10, 2*e^2 - 7*e - 32, -4*e^2 + 31*e - 58, -3*e^2 + 2*e + 36, -7*e^2 + 39*e - 42, 2*e^2 - 4*e + 32]; 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;