/* 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![44, 0, -14, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, -1/2*w^3 + w^2 + 4*w - 8], [11, 11, 1/2*w^3 - 3/2*w^2 - 4*w + 11], [11, 11, -1/2*w^2 - w + 2], [11, 11, -1/2*w^2 + w + 2], [19, 19, 1/2*w^3 - 1/2*w^2 - 4*w + 5], [19, 19, 1/2*w^3 + w^2 - 4*w - 9], [19, 19, 1/2*w^3 - w^2 - 4*w + 9], [19, 19, 1/2*w^3 + 1/2*w^2 - 4*w - 5], [25, 5, 1/2*w^2 - 1], [29, 29, 1/2*w^3 - 4*w - 1], [29, 29, -1/2*w^3 + 4*w - 1], [31, 31, -w - 1], [31, 31, w - 1], [41, 41, 1/2*w^3 + 1/2*w^2 - 4*w - 2], [41, 41, -1/2*w^3 + 1/2*w^2 + 4*w - 2], [49, 7, -1/2*w^3 + 1/2*w^2 + 5*w - 7], [49, 7, 3/2*w^3 - 7/2*w^2 - 13*w + 29], [59, 59, -1/2*w^3 - 3/2*w^2 + 3*w + 10], [59, 59, 1/2*w^3 - 3/2*w^2 - 3*w + 10], [61, 61, 1/2*w^2 + w - 6], [61, 61, 1/2*w^2 - w - 6], [71, 71, w^3 - 5/2*w^2 - 8*w + 20], [71, 71, -w^3 + 5/2*w^2 + 10*w - 24], [81, 3, -3], [101, 101, -1/2*w^3 + 1/2*w^2 + 4*w - 1], [101, 101, 1/2*w^3 + 1/2*w^2 - 4*w - 1], [109, 109, 3/2*w^2 + w - 12], [109, 109, 3/2*w^2 - w - 12], [149, 149, 1/2*w^3 + 2*w^2 - 4*w - 15], [149, 149, -1/2*w^3 + 2*w^2 + 4*w - 15], [151, 151, 1/2*w^3 - 1/2*w^2 - 4*w + 8], [151, 151, -w^3 + 5/2*w^2 + 8*w - 18], [151, 151, -w^3 + 3/2*w^2 + 10*w - 18], [151, 151, -1/2*w^3 - 1/2*w^2 + 4*w + 8], [179, 179, 1/2*w^3 + w^2 - 4*w - 5], [179, 179, -1/2*w^3 + w^2 + 4*w - 5], [181, 181, 1/2*w^3 - 5*w - 3], [181, 181, w^3 - 1/2*w^2 - 7*w - 1], [181, 181, -1/2*w^3 - 5/2*w^2 + 4*w + 15], [181, 181, 1/2*w^3 - 5*w + 3], [191, 191, w^3 - 2*w^2 - 7*w + 13], [191, 191, -w^3 - 2*w^2 + 7*w + 13], [199, 199, -5/2*w^2 - 2*w + 18], [199, 199, -5/2*w^2 + 2*w + 18], [241, 241, -3/2*w^3 + 7/2*w^2 + 14*w - 30], [241, 241, -3/2*w^3 + 5/2*w^2 + 16*w - 30], [251, 251, 3/2*w^2 - w - 13], [251, 251, 3/2*w^2 + w - 13], [269, 269, 1/2*w^3 + 1/2*w^2 - 3*w - 10], [269, 269, -w^3 + 1/2*w^2 + 7*w - 8], [269, 269, w^3 + 1/2*w^2 - 7*w - 8], [269, 269, -1/2*w^3 + 1/2*w^2 + 3*w - 10], [271, 271, -w^3 + 8*w + 5], [271, 271, -2*w^2 + 2*w + 15], [271, 271, 2*w^2 + 2*w - 15], [271, 271, w^3 - 8*w + 5], [281, 281, -2*w + 3], [281, 281, w^3 - 2*w^2 - 12*w + 25], [311, 311, 1/2*w^3 + 5/2*w^2 - 3*w - 17], [311, 311, -1/2*w^3 + 5/2*w^2 + 3*w - 17], [331, 331, -1/2*w^3 + 3/2*w^2 + 5*w - 10], [331, 331, 1/2*w^3 + 3/2*w^2 - 5*w - 10], [349, 349, -1/2*w^2 + 3*w - 3], [349, 349, -w^3 + 5/2*w^2 + 11*w - 25], [379, 379, 5/2*w^2 - w - 21], [379, 379, 5/2*w^2 + w - 21], [389, 389, 3/2*w^2 - w - 14], [389, 389, 1/2*w^3 - 5/2*w^2 - 3*w + 16], [389, 389, -1/2*w^3 - 5/2*w^2 + 3*w + 16], [389, 389, 3/2*w^2 + w - 14], [409, 409, w^3 + w^2 - 8*w - 7], [409, 409, -w^3 + w^2 + 8*w - 7], [419, 419, 3/2*w^3 - 5/2*w^2 - 15*w + 28], [419, 419, 3/2*w^3 - 7/2*w^2 - 13*w + 28], [439, 439, 1/2*w^2 + 2*w - 9], [439, 439, -3/2*w^2 + 2*w + 6], [439, 439, -3/2*w^2 - 2*w + 6], [439, 439, 1/2*w^2 - 2*w - 9], [449, 449, -w^3 + 1/2*w^2 + 6*w - 1], [449, 449, 1/2*w^2 + 2*w - 5], [449, 449, 1/2*w^2 - 2*w - 5], [449, 449, w^3 + 1/2*w^2 - 6*w - 1], [461, 461, w^3 + 3/2*w^2 - 7*w - 9], [461, 461, -w^3 + 3/2*w^2 + 7*w - 9], [491, 491, -1/2*w^3 - 1/2*w^2 + 6*w + 7], [491, 491, -5/2*w^2 + w + 16], [491, 491, 5/2*w^2 + w - 16], [491, 491, 1/2*w^3 - 1/2*w^2 - 6*w + 7], [499, 499, -1/2*w^3 + 5/2*w^2 + 4*w - 19], [499, 499, 1/2*w^3 + 5/2*w^2 - 4*w - 19], [541, 541, -1/2*w^3 + 3/2*w^2 + 4*w - 7], [541, 541, 1/2*w^3 + 3/2*w^2 - 4*w - 7], [569, 569, 1/2*w^2 + 2*w - 2], [569, 569, 1/2*w^2 - 2*w - 2], [571, 571, -2*w^3 + 9/2*w^2 + 17*w - 39], [571, 571, 1/2*w^3 - 1/2*w^2 - 5*w - 2], [571, 571, -1/2*w^3 - 1/2*w^2 + 5*w - 2], [571, 571, w^3 - 5/2*w^2 - 11*w + 27], [599, 599, -w^3 + 2*w^2 + 8*w - 13], [599, 599, w^3 + 2*w^2 - 8*w - 13], [601, 601, 1/2*w^2 + 2*w - 4], [601, 601, 1/2*w^2 - 2*w - 4], [619, 619, -1/2*w^3 + 2*w^2 + 6*w - 13], [619, 619, 1/2*w^3 + 2*w^2 - 6*w - 13], [631, 631, -w^3 - 1/2*w^2 + 6*w - 2], [631, 631, w^3 - 1/2*w^2 - 6*w - 2], [641, 641, w^3 - 8*w - 1], [641, 641, -1/2*w^3 - 1/2*w^2 + 5*w - 1], [641, 641, 1/2*w^3 - 1/2*w^2 - 5*w - 1], [641, 641, w^3 - 8*w + 1], [661, 661, -1/2*w^3 + 7/2*w^2 + 2*w - 25], [661, 661, 3/2*w^3 - 9/2*w^2 - 11*w + 32], [661, 661, -5/2*w^3 + 13/2*w^2 + 23*w - 56], [661, 661, 1/2*w^3 + 7/2*w^2 - 2*w - 25], [691, 691, 1/2*w^3 + 7/2*w^2 - 3*w - 28], [691, 691, -1/2*w^3 + 7/2*w^2 + 3*w - 28], [701, 701, -1/2*w^3 + 1/2*w^2 + 5*w - 10], [701, 701, 3/2*w^3 - 5/2*w^2 - 17*w + 34], [709, 709, 1/2*w^3 - 5/2*w^2 - 6*w + 17], [709, 709, w^3 + 5/2*w^2 - 7*w - 14], [709, 709, -w^3 + 5/2*w^2 + 7*w - 14], [709, 709, -1/2*w^3 - 5/2*w^2 + 6*w + 17], [719, 719, -w^3 + 7/2*w^2 + 8*w - 23], [719, 719, w^3 + 7/2*w^2 - 8*w - 23], [751, 751, 7/2*w^2 + 2*w - 27], [751, 751, 7/2*w^2 - 2*w - 27], [761, 761, -1/2*w^3 + 3/2*w^2 + 3*w - 13], [761, 761, 1/2*w^3 + 3/2*w^2 - 3*w - 13], [769, 769, -w^3 + 7/2*w^2 + 8*w - 25], [769, 769, w^3 + 7/2*w^2 - 8*w - 25], [809, 809, 2*w^3 - 7/2*w^2 - 20*w + 40], [809, 809, -1/2*w^2 + 2*w - 4], [811, 811, -1/2*w^2 - 3*w + 8], [811, 811, 1/2*w^3 + 3/2*w^2 - 3*w - 18], [811, 811, -1/2*w^3 + 3/2*w^2 + 3*w - 18], [811, 811, 1/2*w^2 - 3*w - 8], [821, 821, 3/2*w^3 - 7/2*w^2 - 16*w + 37], [821, 821, -3/2*w^3 + 7/2*w^2 + 12*w - 29], [839, 839, 3*w^2 - 2*w - 23], [839, 839, 3*w^2 + 2*w - 23], [841, 29, -5/2*w^2 + 16], [859, 859, 5/2*w^2 + 3*w - 16], [859, 859, 5/2*w^2 - 3*w - 16], [911, 911, 3*w^2 - 2*w - 17], [911, 911, 3*w^2 + 2*w - 17], [919, 919, 3*w^2 - w - 23], [919, 919, -2*w^2 + 3*w + 15], [919, 919, -2*w^2 - 3*w + 15], [919, 919, 3*w^2 + w - 23], [941, 941, 3/2*w^2 - 3*w - 2], [941, 941, 2*w^3 - 11/2*w^2 - 17*w + 42], [961, 31, -w^2 + 13], [971, 971, 1/2*w^3 + 1/2*w^2 - 6*w - 5], [971, 971, -1/2*w^3 + 1/2*w^2 + 6*w - 5], [991, 991, w^3 + 3/2*w^2 - 8*w - 8], [991, 991, -w^3 + 3/2*w^2 + 8*w - 8]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 40*x^2 + 80; K := NumberField(heckePol); heckeEigenvaluesArray := [0, -2, e, -e, -1/8*e^3 + 9/2*e, -1/4*e^2 + 5, -1/4*e^2 + 5, 1/8*e^3 - 9/2*e, 1/4*e^2 - 9, -1/8*e^3 + 7/2*e, 1/8*e^3 - 7/2*e, -1/8*e^3 + 11/2*e, 1/8*e^3 - 11/2*e, 3/16*e^3 - 29/4*e, -3/16*e^3 + 29/4*e, -1/16*e^3 + 15/4*e, 1/16*e^3 - 15/4*e, -1/4*e^2 + 5, -1/4*e^2 + 5, 1/8*e^2 - 19/2, 1/8*e^2 - 19/2, 3/4*e^2 - 17, 3/4*e^2 - 17, -1/4*e^2 + 13, -3/8*e^3 + 25/2*e, 3/8*e^3 - 25/2*e, 3/8*e^2 - 25/2, 3/8*e^2 - 25/2, 3/8*e^2 - 25/2, 3/8*e^2 - 25/2, 1/2*e^2 - 22, 1/4*e^3 - 7*e, -1/4*e^3 + 7*e, 1/2*e^2 - 22, 1/4*e^3 - 6*e, -1/4*e^3 + 6*e, 1/8*e^3 - 15/2*e, 1/8*e^3 - 11/2*e, -1/8*e^3 + 11/2*e, -1/8*e^3 + 15/2*e, -1/4*e^3 + 7*e, 1/4*e^3 - 7*e, -3/4*e^2 + 25, -3/4*e^2 + 25, 5/16*e^3 - 51/4*e, -5/16*e^3 + 51/4*e, -1/2*e^2 + 12, -1/2*e^2 + 12, 1/8*e^2 - 35/2, 3/8*e^2 - 25/2, 3/8*e^2 - 25/2, 1/8*e^2 - 35/2, -3/8*e^3 + 33/2*e, -1/4*e^2 - 13, -1/4*e^2 - 13, 3/8*e^3 - 33/2*e, -7/16*e^3 + 49/4*e, 7/16*e^3 - 49/4*e, -8, -8, -3/8*e^3 + 23/2*e, 3/8*e^3 - 23/2*e, -3/8*e^3 + 25/2*e, 3/8*e^3 - 25/2*e, -e^2 + 30, -e^2 + 30, -7/8*e^2 + 5/2, 5/8*e^2 - 15/2, 5/8*e^2 - 15/2, -7/8*e^2 + 5/2, -7/16*e^3 + 73/4*e, 7/16*e^3 - 73/4*e, 1/2*e^3 - 23*e, -1/2*e^3 + 23*e, 0, -4*e, 4*e, 0, 7/16*e^3 - 81/4*e, 3/16*e^3 - 37/4*e, -3/16*e^3 + 37/4*e, -7/16*e^3 + 81/4*e, -5/8*e^3 + 51/2*e, 5/8*e^3 - 51/2*e, -5/8*e^3 + 41/2*e, 1/4*e^2 - 17, 1/4*e^2 - 17, 5/8*e^3 - 41/2*e, -30, -30, 5/8*e^3 - 39/2*e, -5/8*e^3 + 39/2*e, -13/16*e^3 + 115/4*e, 13/16*e^3 - 115/4*e, -e^2 + 22, -1/2*e^3 + 19*e, 1/2*e^3 - 19*e, -e^2 + 22, -1/8*e^3 + 19/2*e, 1/8*e^3 - 19/2*e, 7/16*e^3 - 81/4*e, -7/16*e^3 + 81/4*e, -1/8*e^3 + 9/2*e, 1/8*e^3 - 9/2*e, -1/2*e^2 - 2, -1/2*e^2 - 2, -11/16*e^3 + 93/4*e, 7/16*e^3 - 81/4*e, -7/16*e^3 + 81/4*e, 11/16*e^3 - 93/4*e, -7/8*e^2 + 101/2, -1/8*e^2 + 19/2, -1/8*e^2 + 19/2, -7/8*e^2 + 101/2, -3/4*e^2 - 17, -3/4*e^2 - 17, -5/8*e^2 - 1/2, -5/8*e^2 - 1/2, 1/8*e^3 - 15/2*e, -7/8*e^3 + 61/2*e, 7/8*e^3 - 61/2*e, -1/8*e^3 + 15/2*e, -1/8*e^3 + 3/2*e, 1/8*e^3 - 3/2*e, e^2 + 12, e^2 + 12, -3/4*e^2 + 23, -3/4*e^2 + 23, -10, -10, -1/2*e^2 + 20, -1/2*e^2 + 20, 1/4*e^3 - 4*e, 1/2*e^2 - 52, 1/2*e^2 - 52, -1/4*e^3 + 4*e, -3/8*e^2 + 89/2, -3/8*e^2 + 89/2, -3/2*e^2 + 10, -3/2*e^2 + 10, e^2 - 2, 9/8*e^3 - 77/2*e, -9/8*e^3 + 77/2*e, -3/8*e^3 + 9/2*e, 3/8*e^3 - 9/2*e, 5/4*e^2 - 55, 5/8*e^3 - 39/2*e, -5/8*e^3 + 39/2*e, 5/4*e^2 - 55, 1/8*e^3 + 5/2*e, -1/8*e^3 - 5/2*e, e^2 - 58, -9/8*e^3 + 77/2*e, 9/8*e^3 - 77/2*e, 1/2*e^3 - 18*e, -1/2*e^3 + 18*e]; 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;