/* 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, 6, -8, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [9, 3, 1/3*w^3 - 8/3*w - 2/3], [9, 3, -w + 1], [11, 11, w], [11, 11, -1/3*w^3 + 2/3*w + 5/3], [11, 11, 1/3*w^3 - 8/3*w + 1/3], [11, 11, -2/3*w^3 + 13/3*w + 4/3], [16, 2, 2], [25, 5, 2/3*w^3 - 10/3*w - 1/3], [29, 29, -w - 3], [29, 29, -1/3*w^3 + 8/3*w - 10/3], [31, 31, w^3 - 6*w + 1], [31, 31, w^3 - 6*w - 2], [41, 41, 2/3*w^3 + w^2 - 13/3*w - 10/3], [41, 41, 2/3*w^3 - 13/3*w + 5/3], [59, 59, 2/3*w^3 - 13/3*w + 8/3], [59, 59, w^3 + w^2 - 6*w - 4], [79, 79, 2/3*w^3 + w^2 - 10/3*w - 19/3], [79, 79, 1/3*w^3 + w^2 - 2/3*w - 17/3], [89, 89, 4/3*w^3 - 23/3*w - 5/3], [89, 89, 1/3*w^3 + 2*w^2 - 5/3*w - 32/3], [101, 101, 5/3*w^3 + w^2 - 31/3*w - 16/3], [101, 101, 2/3*w^3 - w^2 - 4/3*w + 8/3], [109, 109, -w^3 - 2*w^2 + 7*w + 7], [109, 109, -1/3*w^3 + 2*w^2 + 2/3*w - 16/3], [131, 131, w^3 - w^2 - 7*w + 5], [131, 131, -2/3*w^3 - w^2 + 4/3*w + 13/3], [139, 139, -2/3*w^3 - w^2 + 13/3*w + 4/3], [139, 139, w^2 - w - 7], [151, 151, -5/3*w^3 + 28/3*w - 5/3], [151, 151, -1/3*w^3 + w^2 + 2/3*w - 16/3], [151, 151, w^3 + w^2 - 6*w - 3], [151, 151, -w^3 + w^2 + 7*w - 6], [179, 179, 5/3*w^3 + w^2 - 28/3*w - 19/3], [179, 179, -1/3*w^3 + w^2 + 11/3*w - 4/3], [181, 181, -4/3*w^3 - 2*w^2 + 20/3*w + 29/3], [181, 181, 1/3*w^3 + w^2 - 2/3*w - 20/3], [181, 181, w^3 + w^2 - 5*w - 7], [181, 181, 5/3*w^3 + w^2 - 28/3*w - 16/3], [191, 191, 2*w - 1], [191, 191, 2/3*w^3 - 16/3*w - 1/3], [199, 199, 1/3*w^3 - 11/3*w + 4/3], [199, 199, 1/3*w^3 - 11/3*w - 2/3], [211, 211, -2/3*w^3 - w^2 + 19/3*w + 16/3], [211, 211, 2/3*w^3 + w^2 - 19/3*w - 7/3], [229, 229, 1/3*w^3 - 11/3*w + 1/3], [239, 239, -5/3*w^3 - w^2 + 25/3*w + 19/3], [239, 239, -4/3*w^3 + w^2 + 20/3*w - 7/3], [251, 251, -2/3*w^3 + w^2 + 16/3*w - 14/3], [251, 251, -1/3*w^3 - w^2 - 1/3*w + 14/3], [269, 269, 2/3*w^3 + w^2 - 7/3*w - 19/3], [269, 269, 1/3*w^3 + 2*w^2 - 2/3*w - 32/3], [281, 281, w^3 - w^2 - 5*w + 1], [281, 281, 4/3*w^3 + w^2 - 20/3*w - 23/3], [289, 17, 2/3*w^3 + w^2 - 16/3*w - 4/3], [289, 17, 1/3*w^3 + w^2 - 11/3*w - 20/3], [331, 331, 1/3*w^3 + 2*w^2 - 8/3*w - 23/3], [331, 331, 2/3*w^3 + 2*w^2 - 13/3*w - 28/3], [349, 349, 4/3*w^3 - 17/3*w + 1/3], [349, 349, -5/3*w^3 + 28/3*w - 2/3], [361, 19, -1/3*w^3 + 5/3*w + 14/3], [361, 19, 4/3*w^3 - 20/3*w - 5/3], [379, 379, 4/3*w^3 + 2*w^2 - 23/3*w - 41/3], [379, 379, -5/3*w^3 + 31/3*w - 5/3], [389, 389, 5/3*w^3 + w^2 - 25/3*w - 16/3], [389, 389, -4/3*w^3 + w^2 + 20/3*w - 10/3], [401, 401, -1/3*w^3 - 3*w^2 + 5/3*w + 26/3], [401, 401, 1/3*w^3 + w^2 - 11/3*w - 23/3], [401, 401, -2/3*w^3 - 3*w^2 + 10/3*w + 52/3], [401, 401, 2/3*w^3 + w^2 - 16/3*w - 1/3], [409, 409, -2*w^3 - w^2 + 11*w + 2], [409, 409, -5/3*w^3 - 2*w^2 + 28/3*w + 37/3], [409, 409, 1/3*w^3 - 11/3*w - 17/3], [409, 409, 5/3*w^3 + 3*w^2 - 25/3*w - 37/3], [419, 419, -1/3*w^3 + 3*w^2 - 1/3*w - 37/3], [419, 419, 2*w^3 + 3*w^2 - 12*w - 13], [421, 421, -1/3*w^3 + 3*w^2 + 2/3*w - 31/3], [421, 421, -5/3*w^3 - w^2 + 25/3*w + 13/3], [421, 421, -w^3 + 7*w - 4], [421, 421, -4/3*w^3 + w^2 + 20/3*w - 13/3], [439, 439, -4/3*w^3 + w^2 + 14/3*w - 7/3], [439, 439, 4/3*w^3 - 17/3*w - 5/3], [439, 439, -7/3*w^3 - w^2 + 41/3*w + 17/3], [439, 439, 5/3*w^3 - 28/3*w - 4/3], [449, 449, w^3 + 3*w^2 - 6*w - 17], [449, 449, 1/3*w^3 + 3*w^2 - 8/3*w - 26/3], [449, 449, -4/3*w^3 + 26/3*w + 17/3], [449, 449, 7/3*w^3 + w^2 - 38/3*w - 8/3], [461, 461, -5/3*w^3 + w^2 + 28/3*w - 14/3], [461, 461, -2/3*w^3 - 2*w^2 + 10/3*w + 43/3], [461, 461, -2*w^3 - w^2 + 12*w + 4], [461, 461, -w^3 + 8*w - 5], [479, 479, w^3 + w^2 - 7*w - 2], [479, 479, -4/3*w^3 - w^2 + 23/3*w + 5/3], [499, 499, -4/3*w^3 - 2*w^2 + 23/3*w + 17/3], [499, 499, -4/3*w^3 - w^2 + 29/3*w + 8/3], [521, 521, 2*w^3 - 11*w + 2], [521, 521, 4/3*w^3 - w^2 - 14/3*w + 1/3], [569, 569, w^3 + 3*w^2 - 6*w - 9], [569, 569, 4/3*w^3 + w^2 - 26/3*w - 32/3], [569, 569, -w^3 + 6*w - 6], [569, 569, -1/3*w^3 - 3*w^2 + 8/3*w + 50/3], [571, 571, 2/3*w^3 + 3*w^2 - 10/3*w - 46/3], [571, 571, 2*w^2 - 15], [599, 599, -w^3 + 2*w^2 + 4*w - 10], [599, 599, -w^2 - 3*w + 8], [601, 601, 5/3*w^3 + 3*w^2 - 28/3*w - 34/3], [601, 601, 1/3*w^3 - 3*w^2 - 2/3*w + 43/3], [619, 619, 2/3*w^3 - w^2 - 13/3*w + 2/3], [619, 619, 2/3*w^3 + w^2 - 7/3*w - 25/3], [619, 619, 2*w^3 + w^2 - 11*w - 6], [619, 619, -2/3*w^3 + 13/3*w - 17/3], [631, 631, 2/3*w^3 + 2*w^2 - 19/3*w - 31/3], [631, 631, w^3 + 2*w^2 - 8*w - 6], [631, 631, 2/3*w^3 + 2*w^2 - 4/3*w - 31/3], [631, 631, -2/3*w^3 + 2*w^2 + 16/3*w - 23/3], [659, 659, -2/3*w^3 + 1/3*w + 16/3], [659, 659, 5/3*w^3 - 34/3*w - 13/3], [661, 661, w^3 - 8*w + 2], [661, 661, 4/3*w^3 + w^2 - 23/3*w + 1/3], [661, 661, 5/3*w^3 + w^2 - 31/3*w - 10/3], [661, 661, -3*w - 1], [691, 691, -4/3*w^3 + 29/3*w + 2/3], [691, 691, 1/3*w^3 + 4/3*w - 5/3], [691, 691, -5/3*w^3 + w^2 + 25/3*w - 5/3], [691, 691, 2*w^3 + w^2 - 10*w - 7], [701, 701, -2/3*w^3 - 3*w^2 + 19/3*w + 46/3], [701, 701, w^3 - 2*w^2 - 6*w + 8], [701, 701, 4/3*w^3 + 2*w^2 - 17/3*w - 29/3], [701, 701, 5/3*w^3 + 3*w^2 - 28/3*w - 52/3], [709, 709, 1/3*w^3 - 14/3*w + 10/3], [709, 709, -2/3*w^3 + 19/3*w + 7/3], [719, 719, 3*w^2 - w - 10], [719, 719, -4/3*w^3 - 3*w^2 + 23/3*w + 47/3], [739, 739, 5/3*w^3 + w^2 - 34/3*w - 10/3], [739, 739, 4/3*w^3 + 2*w^2 - 23/3*w - 14/3], [761, 761, 7/3*w^3 + 2*w^2 - 41/3*w - 26/3], [761, 761, 2*w^3 + 3*w^2 - 12*w - 15], [769, 769, -2/3*w^3 + 19/3*w - 8/3], [769, 769, -4/3*w^3 + 2*w^2 + 17/3*w - 31/3], [769, 769, 1/3*w^3 - 14/3*w - 5/3], [769, 769, -1/3*w^3 + 3*w^2 + 2/3*w - 34/3], [809, 809, -4/3*w^3 + w^2 + 26/3*w - 7/3], [809, 809, w^3 + w^2 - 3*w - 7], [811, 811, 4/3*w^3 + w^2 - 17/3*w - 23/3], [811, 811, -1/3*w^3 - 2*w^2 + 2/3*w + 38/3], [821, 821, 8/3*w^3 + 3*w^2 - 43/3*w - 34/3], [821, 821, 2/3*w^3 + 2*w^2 - 7/3*w - 34/3], [821, 821, -w^3 - w^2 + 4*w + 8], [821, 821, 2/3*w^3 + 4*w^2 - 7/3*w - 58/3], [829, 829, 4/3*w^3 + 3*w^2 - 26/3*w - 50/3], [829, 829, 7/3*w^3 - 41/3*w - 5/3], [839, 839, 2*w^3 + w^2 - 10*w - 3], [839, 839, 5/3*w^3 - w^2 - 25/3*w + 17/3], [841, 29, 5/3*w^3 - 25/3*w - 7/3], [859, 859, -7/3*w^3 - w^2 + 32/3*w + 29/3], [859, 859, 2*w^3 + w^2 - 14*w - 6], [859, 859, 1/3*w^3 + 2*w^2 - 2/3*w - 47/3], [859, 859, -5/3*w^3 - 2*w^2 + 31/3*w + 49/3], [881, 881, w^3 + 4*w^2 - 4*w - 20], [881, 881, 8/3*w^3 + 2*w^2 - 43/3*w - 34/3], [919, 919, -w^3 + 3*w - 7], [919, 919, 1/3*w^3 + 3*w^2 - 5/3*w - 35/3], [919, 919, -5/3*w^3 + 31/3*w - 23/3], [919, 919, 2/3*w^3 + 3*w^2 - 10/3*w - 43/3], [929, 929, w^2 - 2*w - 9], [929, 929, w^3 + w^2 - 7*w + 1], [961, 31, 2/3*w^3 - 10/3*w - 19/3], [971, 971, -w^3 - 3*w^2 + 7*w + 16], [971, 971, -5/3*w^3 + w^2 + 25/3*w - 8/3], [971, 971, 2*w^3 + w^2 - 10*w - 6], [971, 971, 1/3*w^3 + 2*w^2 - 8/3*w - 47/3]]; primes := [ideal : I in primesArray]; heckePol := x^2 - 8*x + 13; K := NumberField(heckePol); heckeEigenvaluesArray := [-2*e + 10, e, e, 2*e - 11, -1, -2*e + 10, -e + 4, e - 6, 2*e - 12, -2*e + 9, 2*e - 12, 2*e - 12, -2, -4*e + 19, -2*e + 8, e - 2, 8, -2*e + 7, 6*e - 24, -4, 8*e - 34, 2*e - 14, -4*e + 16, 2*e - 4, 4*e - 4, -5*e + 26, -2*e + 2, -10*e + 44, -2*e + 15, 12*e - 46, -6, 16, -8*e + 34, -4*e + 13, -8, 2*e - 21, -2*e, -2*e + 14, 4, 6*e - 16, 6*e - 20, 11*e - 52, -8*e + 30, -2*e + 10, -8*e + 40, 2*e - 10, -11, -2*e + 22, 2*e - 22, -14*e + 58, -2*e - 5, 8*e - 42, 3*e - 10, -6*e + 16, -4*e + 40, 4*e - 35, -4*e + 30, -2*e + 4, 8*e - 37, 12*e - 58, -2*e - 8, 14*e - 70, 8*e - 27, 3*e + 18, -8*e + 24, 4*e - 8, -e + 4, 5*e + 4, -12*e + 56, e + 2, 6*e - 18, e + 14, 8*e - 29, -4*e + 2, -6*e + 24, -6*e + 25, -12*e + 42, 3*e - 28, -6*e + 22, 4*e - 32, e - 8, 19*e - 82, 6*e - 40, -10*e + 52, -14*e + 50, -8*e + 30, -6*e + 8, 6*e - 33, 9*e - 16, 6*e - 52, 2*e - 35, 11*e - 62, 2*e + 14, -22*e + 91, -8*e + 29, -12*e + 40, 17*e - 72, 2*e - 13, 3*e + 18, -14*e + 44, 3*e - 24, -10*e + 48, 6*e - 59, -18*e + 61, 10*e - 40, -22, -8*e + 20, e - 18, 16, 10*e - 46, 12*e - 68, -2*e + 28, -8*e + 25, 22*e - 88, 9*e - 14, 2*e - 24, -10*e + 16, 2*e + 2, 2*e + 26, 2, 24*e - 102, -10*e + 26, 8*e - 34, 6*e - 50, -4*e + 37, 20*e - 86, 16*e - 53, 4*e - 36, -6*e + 16, 3*e + 2, -12*e + 52, 30, -24*e + 87, -15*e + 44, -8*e + 13, 9*e - 60, -13*e + 44, 20*e - 94, -26, 11, -14*e + 59, -2*e + 2, -6*e, -8*e + 28, 5*e, 14, -4*e + 38, 21*e - 76, -32, -e - 6, -12*e + 23, -6*e + 10, 10*e - 28, 4*e - 51, 6*e + 4, -2*e, -45, 8*e - 18, 2*e - 8, 20*e - 68, 16*e - 71, -6*e + 29, -7*e + 44, 20*e - 73, -8*e + 16, -8*e + 62, -8*e + 60, -6*e + 38, -6*e, 2*e + 4, -30*e + 118]; 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;