/* 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 - 12*x + 2; K := NumberField(heckePol); heckeEigenvaluesArray := [e, e, e^2 - 5, -1/3*e^2 - 4/3*e + 8/3, -1/3*e^2 - 4/3*e + 8/3, 2*e + 2, -4/3*e^2 + 2/3*e + 32/3, 2/3*e^2 - 4/3*e - 22/3, 2/3*e^2 - 4/3*e - 22/3, -2/3*e^2 - 8/3*e + 22/3, -2/3*e^2 - 8/3*e + 22/3, -2/3*e^2 - 5/3*e + 10/3, -2/3*e^2 - 5/3*e + 10/3, 2/3*e^2 + 5/3*e - 40/3, 2/3*e^2 + 5/3*e - 40/3, -2*e^2 - e + 14, -2*e^2 - e + 14, 5/3*e^2 + 2/3*e - 10/3, 4/3*e^2 - 2/3*e - 38/3, 4/3*e^2 - 2/3*e - 38/3, -e^2 + 2, -e^2 + 2, -e, -2/3*e^2 + 10/3*e + 10/3, -2/3*e^2 + 10/3*e + 10/3, -e, -1, 2/3*e^2 - 10/3*e - 16/3, 2/3*e^2 - 10/3*e - 16/3, -2/3*e^2 + 16/3*e + 28/3, 2/3*e^2 - 10/3*e + 8/3, 2/3*e^2 - 10/3*e + 8/3, -2/3*e^2 + 16/3*e + 28/3, 4/3*e^2 + 13/3*e - 38/3, -4/3*e^2 + 2/3*e + 26/3, 4/3*e^2 + 13/3*e - 38/3, -4/3*e^2 + 2/3*e + 26/3, 2*e^2 + 2*e - 20, 2*e^2 + 2*e - 20, 2*e^2 + 3*e - 22, -8/3*e^2 + 4/3*e + 58/3, -8/3*e^2 + 4/3*e + 58/3, 2*e^2 + 3*e - 22, 5*e + 10, 5*e + 10, 8/3*e^2 + 2/3*e - 52/3, 8/3*e^2 + 2/3*e - 52/3, -1/3*e^2 - 10/3*e - 22/3, -1/3*e^2 - 10/3*e - 22/3, 8, 8, 2*e^2 - 18, 2*e^2 - 18, 4/3*e^2 - 14/3*e - 80/3, 4/3*e^2 - 14/3*e - 80/3, 4/3*e^2 + 13/3*e - 8/3, 4/3*e^2 + 13/3*e - 8/3, 2*e^2 - 6, 2*e^2 - 6, -1/3*e^2 + 8/3*e + 8/3, -1/3*e^2 + 8/3*e + 8/3, -4/3*e^2 - 16/3*e + 56/3, -4/3*e^2 - 16/3*e + 56/3, -2/3*e^2 + 10/3*e + 28/3, -2/3*e^2 + 10/3*e + 28/3, 4/3*e^2 - 2/3*e + 46/3, 2/3*e^2 - 10/3*e - 4/3, 2/3*e^2 - 10/3*e - 4/3, -4/3*e^2 + 2/3*e + 14/3, -4/3*e^2 + 2/3*e + 14/3, -10/3*e^2 - 19/3*e + 92/3, -10/3*e^2 - 19/3*e + 92/3, 2/3*e^2 + 5/3*e - 58/3, 2/3*e^2 + 5/3*e - 58/3, -5/3*e^2 - 2/3*e + 88/3, -5/3*e^2 - 2/3*e + 88/3, 4/3*e^2 - 11/3*e - 2/3, 4/3*e^2 - 11/3*e - 2/3, 4*e^2 + e - 16, 4*e^2 + e - 16, -2*e^2 + 10*e + 20, -2*e^2 + 10*e + 20, -2*e^2 + e + 24, -2*e^2 + e + 24, -2*e^2 + 2*e + 24, -2*e^2 + 2*e + 24, -2*e^2 + 2*e + 32, -2*e^2 + 2*e + 32, 2*e^2 - 32, 2*e^2 - 32, 4/3*e^2 - 14/3*e - 98/3, 4/3*e^2 - 14/3*e - 98/3, -5/3*e^2 + 22/3*e + 34/3, -5/3*e^2 + 22/3*e + 34/3, -4/3*e^2 + 8/3*e - 28/3, -4/3*e^2 - 4/3*e + 116/3, -4/3*e^2 + 8/3*e - 28/3, -4/3*e^2 - 4/3*e + 116/3, 8/3*e^2 + 26/3*e - 118/3, 8/3*e^2 + 26/3*e - 118/3, -4*e^2 + 20, -4*e^2 + 20, -14/3*e^2 + 16/3*e + 118/3, -14/3*e^2 + 16/3*e + 118/3, -3*e^2 + 2*e + 4, -3*e^2 + 2*e + 4, -3*e - 2, -3*e - 2, -2*e^2 - 9*e + 20, -2*e^2 - 9*e + 20, 4*e^2 + 5*e - 34, 4*e^2 + 5*e - 34, 2/3*e^2 - 7/3*e - 52/3, 2/3*e^2 - 7/3*e - 52/3, -4/3*e^2 + 2/3*e + 8/3, -4/3*e^2 + 2/3*e + 8/3, -1/3*e^2 + 26/3*e + 20/3, -1/3*e^2 + 26/3*e + 20/3, 2/3*e^2 + 5/3*e - 130/3, 2/3*e^2 + 5/3*e - 130/3, -10/3*e^2 - 16/3*e + 74/3, -10/3*e^2 - 16/3*e + 74/3, -12*e, 10/3*e^2 - 2/3*e - 140/3, -12*e, 10/3*e^2 - 2/3*e - 140/3, 10/3*e^2 - 2/3*e - 50/3, 10/3*e^2 - 2/3*e - 50/3, -2/3*e^2 - 14/3*e + 28/3, -2/3*e^2 - 14/3*e + 28/3, 4*e - 10, 4*e - 10, -1/3*e^2 + 8/3*e + 38/3, -1/3*e^2 + 8/3*e + 38/3, 4/3*e^2 + 4/3*e - 140/3, 10/3*e^2 + 13/3*e - 14/3, 10/3*e^2 + 13/3*e - 14/3, 4/3*e^2 + 4/3*e - 140/3, -4/3*e^2 - 7/3*e - 46/3, 4*e^2 + 4*e - 46, -4/3*e^2 - 7/3*e - 46/3, 4*e^2 + 4*e - 46, -4*e^2 - 9*e + 50, -4*e^2 - 9*e + 50, 4/3*e^2 - 8/3*e + 88/3, 4/3*e^2 - 8/3*e + 88/3, -20/3*e^2 - 32/3*e + 178/3, 2/3*e^2 - 13/3*e + 8/3, 2/3*e^2 - 13/3*e + 8/3, -4*e^2 - 2*e + 18, -4*e^2 - 2*e + 18, 8/3*e^2 - 34/3*e - 82/3, 8/3*e^2 - 34/3*e - 82/3, 4/3*e^2 + 22/3*e - 2/3, 8/3*e^2 - 4/3*e - 22/3, 8/3*e^2 - 4/3*e - 22/3, 4/3*e^2 + 22/3*e - 2/3, -4*e + 14, -4*e + 14, -14/3*e^2 - 8/3*e + 58/3, -14/3*e^2 - 8/3*e + 58/3, 4*e^2 - 6*e - 30, -2*e^2 + 40, -2*e^2 + 40]; 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;