/* 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![1, 1, -3, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [11, 11, -w^3 + 2*w^2 + w - 3], [11, 11, w^3 - 3*w], [16, 2, 2], [19, 19, -w^3 + 2*w + 2], [19, 19, 2*w^3 - 3*w^2 - 4*w + 2], [25, 5, 2*w^3 - 2*w^2 - 4*w + 1], [29, 29, w^3 - w^2 - 4*w + 1], [31, 31, w^3 - 4*w + 1], [31, 31, -w^2 + 2*w + 3], [41, 41, 2*w^2 - w - 3], [41, 41, -w^3 + 3*w^2 + w - 4], [49, 7, 2*w^3 - 3*w^2 - 5*w + 2], [49, 7, w^2 + w - 3], [61, 61, 2*w^3 - 3*w^2 - 4*w], [61, 61, -3*w^3 + 4*w^2 + 7*w - 3], [79, 79, 2*w^3 - 4*w^2 - 3*w + 2], [79, 79, w^3 + w^2 - 3*w - 5], [81, 3, -3], [89, 89, -3*w^3 + 4*w^2 + 5*w - 3], [89, 89, 3*w^3 - 2*w^2 - 7*w], [101, 101, -3*w^3 + 5*w^2 + 7*w - 5], [101, 101, -2*w^2 - w + 4], [109, 109, 3*w^3 - 5*w^2 - 5*w + 3], [109, 109, -2*w^3 + 7*w + 1], [109, 109, 4*w^3 - 5*w^2 - 9*w + 3], [109, 109, -2*w^3 + 5*w + 4], [121, 11, 3*w^3 - 3*w^2 - 6*w + 1], [131, 131, -3*w^3 + 2*w^2 + 8*w - 2], [131, 131, w^3 + w^2 - 5*w], [139, 139, -w^3 + 2*w^2 + 2*w - 6], [139, 139, 2*w^3 - 5*w^2 - 2*w + 6], [139, 139, 3*w^3 - 5*w^2 - 6*w + 4], [139, 139, -2*w^3 + 2*w^2 + 7*w - 2], [149, 149, -3*w^3 + 4*w^2 + 7*w - 2], [149, 149, w^3 - w^2 - 3*w - 3], [149, 149, 3*w^3 - 2*w^2 - 9*w + 2], [149, 149, w - 4], [169, 13, -4*w^3 + 5*w^2 + 8*w - 4], [169, 13, 3*w^3 - 2*w^2 - 6*w], [179, 179, -4*w^3 + 3*w^2 + 10*w - 3], [179, 179, -4*w^3 + 4*w^2 + 9*w - 3], [179, 179, -2*w^3 + w^2 + 8*w - 1], [179, 179, 4*w^3 - 3*w^2 - 8*w - 2], [191, 191, -w^3 + 4*w^2 - 6], [191, 191, -4*w^3 + 4*w^2 + 9*w - 2], [211, 211, 2*w^3 - w^2 - 8*w], [211, 211, -w^3 + 4*w^2 + w - 5], [229, 229, w^3 - 3*w^2 + w + 5], [229, 229, 2*w^3 - 7*w], [251, 251, 3*w^3 - 4*w^2 - 7*w + 1], [251, 251, w^3 - w - 4], [269, 269, 3*w^3 - 6*w^2 - 3*w + 7], [269, 269, 3*w^3 - 9*w - 2], [271, 271, -3*w^3 + w^2 + 10*w], [271, 271, 4*w^3 - 5*w^2 - 9*w + 2], [281, 281, -3*w^3 + w^2 + 11*w - 1], [281, 281, -2*w^2 + 5*w + 4], [281, 281, -3*w^3 + 3*w^2 + 10*w - 1], [281, 281, 3*w^3 - 4*w^2 - 7*w - 1], [311, 311, -w^3 + 7*w + 2], [311, 311, 3*w^2 - 7], [331, 331, w^3 + 2*w^2 - 3*w - 7], [331, 331, w^3 - w^2 - w + 5], [359, 359, -4*w^3 + 5*w^2 + 6*w - 4], [359, 359, -5*w^3 + 4*w^2 + 12*w - 2], [361, 19, -4*w^3 + 4*w^2 + 8*w - 3], [379, 379, -3*w^3 + 10*w + 2], [379, 379, 2*w^3 - 5*w^2 + 6], [389, 389, -5*w^3 + 6*w^2 + 10*w - 3], [389, 389, w^3 + 3*w^2 - 6*w - 7], [409, 409, -4*w^3 + 4*w^2 + 7*w], [409, 409, -4*w^2 + 4*w + 5], [421, 421, -2*w^3 + 2*w^2 + 8*w - 3], [421, 421, w^3 + 3*w^2 - 6*w - 6], [431, 431, 4*w^3 - 6*w^2 - 10*w + 5], [431, 431, 3*w^3 - 5*w^2 - 6*w + 2], [431, 431, -4*w^3 + 3*w^2 + 8*w - 2], [431, 431, -5*w^3 + 6*w^2 + 10*w - 6], [449, 449, 4*w^3 - 5*w^2 - 6*w + 2], [449, 449, -w^3 + 2*w^2 + w - 7], [461, 461, 5*w^3 - 4*w^2 - 12*w + 1], [461, 461, w^3 + 2*w^2 - 2*w - 6], [479, 479, w^3 + 3*w^2 - 5*w - 7], [479, 479, 2*w^3 - 6*w^2 - w + 6], [491, 491, 3*w^2 - 5*w - 6], [491, 491, -2*w^3 - w^2 + 9*w + 1], [499, 499, 4*w^3 - 3*w^2 - 12*w + 4], [499, 499, 4*w^3 - 5*w^2 - 10*w + 2], [499, 499, -5*w^3 + 5*w^2 + 11*w - 4], [499, 499, -4*w^3 + 4*w^2 + 7*w - 3], [509, 509, -5*w^3 + 6*w^2 + 10*w - 4], [509, 509, -4*w^2 + 3*w + 8], [509, 509, -3*w^3 + w^2 + 10*w - 1], [509, 509, 5*w^3 - 6*w^2 - 12*w + 3], [521, 521, -5*w^3 + 6*w^2 + 10*w - 5], [521, 521, 2*w^3 - 6*w^2 - w + 7], [521, 521, w^3 - 5*w^2 + 9], [521, 521, w^3 + 3*w^2 - 5*w - 6], [529, 23, 3*w^3 - 5*w^2 - 6*w + 1], [529, 23, -2*w^3 - w^2 + 8*w + 1], [541, 541, 3*w^3 - 5*w^2 - 8*w + 3], [541, 541, -w^3 + 3*w^2 + 4*w - 7], [569, 569, -w^3 + 7*w - 1], [569, 569, -3*w^3 + 2*w^2 + 11*w], [571, 571, w^3 - 4*w - 6], [571, 571, 4*w^3 - 5*w^2 - 11*w + 2], [571, 571, -5*w^3 + 5*w^2 + 11*w - 3], [571, 571, -2*w^3 + 6*w^2 + 2*w - 9], [599, 599, 3*w^3 - 6*w^2 - 6*w + 4], [599, 599, 3*w^2 - 8], [601, 601, -4*w^3 + 2*w^2 + 12*w - 1], [601, 601, -5*w^3 + 7*w^2 + 11*w - 5], [619, 619, -w^3 + 5*w^2 - w - 6], [619, 619, 4*w^2 - 3*w - 7], [631, 631, 2*w^3 - 3*w^2 - 5*w - 3], [631, 631, 5*w^3 - 3*w^2 - 13*w + 2], [631, 631, 2*w^3 + w^2 - 11*w - 2], [631, 631, 6*w^3 - 6*w^2 - 14*w + 3], [641, 641, 2*w^2 - w - 9], [641, 641, -w^3 + 3*w^2 + 2*w - 10], [659, 659, -4*w^3 + w^2 + 14*w + 1], [659, 659, 5*w^3 - 6*w^2 - 11*w + 1], [709, 709, 6*w^3 - 7*w^2 - 14*w + 3], [709, 709, 6*w^3 - 8*w^2 - 15*w + 7], [709, 709, 2*w^3 - 5*w^2 - 5*w + 2], [709, 709, -4*w^3 + 3*w^2 + 11*w - 5], [739, 739, 5*w^3 - 7*w^2 - 7*w + 5], [739, 739, -w^3 - 3*w^2 + 6*w + 1], [751, 751, 5*w^3 - 3*w^2 - 11*w + 1], [751, 751, 5*w^3 - 6*w^2 - 13*w + 3], [769, 769, -w^2 + 2*w + 7], [769, 769, -4*w^3 + 6*w^2 + 11*w - 4], [809, 809, -5*w^3 + 4*w^2 + 13*w - 5], [809, 809, 2*w^3 + w^2 - 8*w], [811, 811, -w^3 - 4*w^2 + 7*w + 6], [811, 811, 3*w^3 - 5*w^2 - 7*w], [811, 811, -2*w^3 - w^2 + 9*w], [811, 811, -5*w^3 + 5*w^2 + 9*w - 5], [821, 821, -w^3 + 3*w^2 + 4*w - 8], [821, 821, -3*w^3 + 7*w + 6], [821, 821, -3*w^3 + w^2 + 6*w + 5], [821, 821, 5*w^3 - 8*w^2 - 9*w + 5], [829, 829, -w^3 + w^2 + w - 6], [829, 829, 5*w^3 - 6*w^2 - 9*w + 3], [839, 839, -4*w^3 + 2*w^2 + 14*w - 3], [839, 839, 5*w^3 - 7*w^2 - 7*w + 4], [841, 29, -w^2 + 6*w + 1], [859, 859, -4*w^3 + 2*w^2 + 13*w - 2], [859, 859, 5*w^3 - 6*w^2 - 12*w + 2], [881, 881, -2*w^3 + 4*w^2 + w - 9], [881, 881, -6*w^3 + 9*w^2 + 12*w - 7], [911, 911, 5*w^3 - 6*w^2 - 11*w], [911, 911, -w^3 + 4*w^2 + 4*w - 8], [929, 929, 5*w^3 - 8*w^2 - 11*w + 7], [929, 929, -4*w^3 + 13*w + 3], [929, 929, 3*w^3 - 7*w^2 - w + 8], [929, 929, -6*w^3 + 5*w^2 + 16*w - 5], [941, 941, -4*w^3 + w^2 + 11*w], [941, 941, -2*w^3 - w^2 + 10*w - 1], [941, 941, -5*w^3 + 5*w^2 + 9*w], [941, 941, -5*w^2 + 5*w + 6], [961, 31, -5*w^3 + 5*w^2 + 10*w - 3], [971, 971, -2*w^3 - 3*w^2 + 8*w + 7], [971, 971, 3*w^3 - 8*w^2 - 2*w + 9]]; primes := [ideal : I in primesArray]; heckePol := x^3 + 2*x^2 - 20*x - 8; K := NumberField(heckePol); heckeEigenvaluesArray := [-1/2*e + 1, e, -1/4*e^2 - 3/2*e + 3, -1/8*e^2 - 1/2*e + 3/2, -1/4*e^2 + 5, 3/4*e^2 + e - 9, 1/4*e^2 + e - 1, 1/2*e^2 - 6, -1/8*e^2 + 1/2*e + 3/2, -7/8*e^2 - 1/2*e + 25/2, -1/4*e^2 - e + 5, 1/8*e^2 - 3/2*e - 19/2, 1/8*e^2 + 1/2*e + 1/2, -1/8*e^2 + 1/2*e - 5/2, 7/8*e^2 + 7/2*e - 25/2, 1/4*e^2 + 2*e + 3, 1/2*e^2 + 1/2*e - 15, 1/4*e^2 + 3/2*e - 6, -1/4*e^2 - 1/2*e - 4, -e^2 + e + 18, 3/4*e^2 - e - 11, 1/4*e^2 + 1/2*e - 8, 5/8*e^2 + 5/2*e - 3/2, 5/8*e^2 + 1/2*e - 23/2, -5/4*e^2 - 4*e + 15, -2*e - 2, -1/4*e^2 - 3*e + 7, 1/8*e^2 - 1/2*e - 15/2, -7/8*e^2 - 3/2*e + 25/2, -1/4*e^2 + 4*e + 9, 9/8*e^2 + 5/2*e - 19/2, 11/8*e^2 + 3/2*e - 33/2, -1/2*e^2 - 3/2*e + 9, -5/4*e^2 - 3*e + 9, 1/4*e^2 - e + 7, -5/8*e^2 - 9/2*e + 27/2, 5/8*e^2 + 3/2*e - 35/2, -1/2*e^2 - 5/2*e + 17, -1, 4*e - 4, -5/8*e^2 - 7/2*e - 5/2, -11/8*e^2 - 1/2*e + 37/2, -1/4*e^2 - 4*e + 9, -1/2*e^2 + 4*e + 12, 1/4*e^2 - 2*e - 7, 5/4*e^2 + 2*e - 9, -5/4*e^2 - 5/2*e + 14, 1/2*e^2 + 7/2*e - 3, -e^2 - e + 12, 1/4*e^2 - e - 27, -3/4*e^2 + 3, -7/8*e^2 + 3/2*e + 25/2, -1/8*e^2 - 9/2*e - 13/2, -1/4*e^2 + 4*e + 5, e^2 + 3*e - 10, -11/4*e^2 - 4*e + 29, -15/8*e^2 - 13/2*e + 53/2, -3/8*e^2 - 7/2*e + 25/2, -1/4*e^2 + 3*e - 7, -15/8*e^2 - 3/2*e + 61/2, 9/8*e^2 - 3/2*e - 55/2, e^2 + 3*e - 18, -1/8*e^2 - 1/2*e + 15/2, 1/4*e^2 - 2*e - 9, 5/8*e^2 - 3/2*e - 19/2, 7/4*e^2 + 5*e - 35, e^2 - 36, -1/4*e^2 + 5/2*e + 12, -3*e - 16, -e^2 - 5*e + 16, 1/4*e^2 + 2*e - 7, 3/8*e^2 + 5/2*e - 45/2, e^2 - e - 16, -11/8*e^2 - 17/2*e + 33/2, 3/2*e^2 + 3*e - 24, 5/8*e^2 + 5/2*e - 39/2, 3/4*e^2 + 11/2*e - 14, -7/4*e^2 - 8*e + 15, 1/2*e^2 + 3*e + 2, 13/8*e^2 + 15/2*e - 71/2, 5/4*e^2 - e - 29, -e^2 + 3/2*e + 27, -3/2*e^2 + e + 38, -2*e^2 - 17/2*e + 37, 7/8*e^2 + 9/2*e - 5/2, 17/8*e^2 + 15/2*e - 63/2, 15/8*e^2 + 13/2*e - 53/2, e^2 - e - 6, 5/2*e^2 + 4*e - 10, 5/4*e^2 + 3/2*e - 4, -e^2 + e + 30, -e^2 - 8*e + 2, 3/4*e^2 + 3*e + 9, -2*e^2 + e + 38, -3/4*e^2 - 5/2*e + 14, -7/4*e^2 - 3*e + 11, e^2 - 30, 3/4*e^2 + 5*e - 3, -5/4*e^2 - 2*e + 3, 5/4*e^2 + 6*e - 11, -7/4*e^2 - 3*e + 31, 11/4*e^2 + 8*e - 35, -7/4*e^2 + 2*e + 33, 2*e^2 + 5*e - 16, 3/2*e^2 + 5*e - 44, -9/4*e^2 - 9*e + 35, -9/4*e^2 - 7/2*e + 20, -5/4*e^2 + 7/2*e + 30, -3/4*e^2 - 11/2*e + 26, 7/4*e^2 + 7/2*e - 34, -3/4*e^2 - 9*e + 19, 1/2*e^2 + 20, -5/4*e^2 - 10*e + 19, 2*e^2 + 6*e - 12, -3*e^2 + 44, 1/2*e^2 - e - 6, 3/4*e^2 - 3*e - 1, -1/8*e^2 - 1/2*e - 65/2, 15/8*e^2 + 11/2*e - 85/2, 11/8*e^2 + 1/2*e - 25/2, 4*e, 1/2*e^2 + 3*e + 8, 5/2*e^2 + 5/2*e - 37, -3/4*e^2 + 15/2*e + 14, 1/2*e^2 - 3*e - 6, 3/2*e^2 + 8*e - 10, 1/2*e^2 + 11*e - 8, -15/8*e^2 - 9/2*e + 37/2, -1/8*e^2 + 13/2*e + 7/2, 7/8*e^2 + 17/2*e + 11/2, 5/4*e^2 + 7/2*e - 30, e^2 - 6*e - 16, -5/4*e^2 - 4*e + 1, 5/4*e^2 - 6*e - 29, 3/2*e^2 + 4*e - 30, e + 18, e^2 - 4*e - 32, 7/8*e^2 + 17/2*e - 5/2, -5/2*e^2 - 5*e + 18, 1/8*e^2 - 17/2*e - 7/2, 1/8*e^2 - 7/2*e + 9/2, -e^2 - 2*e - 30, -3/4*e^2 + 37, 1/4*e^2 - 2*e - 15, 3/2*e^2 + 2*e - 12, e^2 - 3/2*e - 17, -e^2 - 13/2*e + 27, 3/4*e^2 + e + 9, 1/4*e^2 - 11*e - 13, e^2 + 5*e - 36, 5/4*e^2 + 3*e + 3, -7/4*e^2 + 2*e + 35, 9/4*e^2 + 6*e - 45, -2*e^2 - 2*e + 18, -5/4*e^2 - 3*e + 41, 1/8*e^2 - 13/2*e - 43/2, 5/8*e^2 + 1/2*e - 83/2, e^2 + 16, 9/4*e^2 + 9/2*e - 48, 9/4*e^2 + 3*e - 13, -5/2*e^2 - 21/2*e + 17, -5/4*e^2 + 3*e + 1, 11/8*e^2 + 5/2*e - 93/2, 25/8*e^2 + 23/2*e - 99/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;