/* 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 + 4*x - 1; K := NumberField(heckePol); heckeEigenvaluesArray := [e, e, -1/2*e + 5/2, -1/2*e - 5/2, 2*e + 5, -3/2*e - 9/2, -1/2*e - 15/2, -1/2*e - 3/2, -1/2*e + 1/2, -2*e - 5, 1, -2*e - 7, -7/2*e - 19/2, 4*e + 8, -1/2*e - 27/2, -2*e - 4, -9/2*e - 31/2, 5*e + 11, 7/2*e + 17/2, -3/2*e + 7/2, 3*e + 2, -2*e + 7, -7/2*e + 1/2, -9/2*e - 13/2, -5/2*e + 23/2, 3/2*e - 21/2, 9*e + 21, -3*e - 8, e - 8, -1/2*e - 35/2, 3/2*e - 27/2, 4*e + 3, -5*e - 17, -1/2*e - 21/2, -3/2*e - 39/2, 5*e - 2, -5/2*e + 11/2, 6*e + 8, 2*e - 16, -2*e + 16, -24, -7*e - 8, -3*e - 14, 5*e + 12, 5*e + 24, -23/2*e - 49/2, 15/2*e + 57/2, 5*e + 17, 4*e + 20, 5/2*e - 33/2, 11/2*e + 19/2, 3*e + 20, 9/2*e + 21/2, 7*e + 24, 13/2*e + 51/2, -e + 2, 6*e + 31, -11/2*e - 57/2, -15/2*e - 25/2, 11/2*e + 47/2, 1, 1/2*e + 5/2, 2*e - 7, 19/2*e + 29/2, -e - 4, -21/2*e - 47/2, -4*e - 19, -13/2*e - 1/2, -5*e - 26, -7*e - 27, 2*e - 3, 15/2*e + 11/2, -23, 6*e - 14, 21/2*e + 65/2, -27/2*e - 53/2, 15*e + 36, 7*e + 2, -e - 21, 3*e + 28, -7*e + 6, 7/2*e - 7/2, 5*e - 5, -9*e - 14, -11/2*e - 29/2, 5*e + 4, -6*e - 13, -13/2*e - 45/2, e + 8, 10*e + 16, -31/2*e - 61/2, 8*e + 25, 9/2*e - 29/2, 5*e + 24, 10*e + 24, -11/2*e - 61/2, 31/2*e + 43/2, 3*e + 29, 15/2*e - 25/2, -15, -19/2*e - 17/2, e - 28, -7*e + 1, -10*e - 3, -5*e - 13, 5*e + 40, 2*e - 11, 17/2*e + 3/2, -11/2*e - 33/2, 3*e + 34, 6*e - 10, -7/2*e - 21/2, 31/2*e + 65/2, 23/2*e + 5/2, -15/2*e - 11/2, 3*e + 11, -9*e - 3, -6*e - 5, 5/2*e + 15/2, -4*e + 12, -3*e + 6, -13/2*e - 67/2, -8*e + 11, 9/2*e + 53/2, 17/2*e + 69/2, -23/2*e - 21/2, 5*e - 13, -11/2*e - 33/2, -6*e + 13, -3*e - 40, -13*e - 5, 43/2*e + 91/2, 17/2*e + 9/2, 5/2*e - 17/2, -5/2*e - 17/2, -1/2*e + 19/2, -25/2*e - 79/2, 27/2*e + 19/2, -5/2*e + 1/2, 5*e + 10, 7*e - 13, 13*e + 10, -12*e - 20, 6*e + 22, -29/2*e - 23/2, 4*e + 13, -9*e - 19, -7*e + 10, -4*e - 23, -10*e + 7, 7/2*e - 67/2, 27/2*e + 75/2, -15/2*e - 29/2, -3*e - 26, -3/2*e + 1/2, 21, -1/2*e - 85/2, -15*e - 44, 11*e + 29, -21/2*e - 3/2, e + 36, 19/2*e + 107/2, -13/2*e - 33/2, 18*e + 43, -35, 12*e + 19, -3*e - 2, -16*e - 17, 3/2*e + 87/2, 11*e + 50, -27/2*e - 59/2]; 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;