/* 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![4, 0, -9, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, w], [4, 2, -1/2*w^3 + 9/2*w], [9, 3, 1/4*w^3 - 11/4*w - 1/2], [9, 3, 1/4*w^3 - 11/4*w + 1/2], [25, 5, 1/2*w^3 - 7/2*w], [29, 29, -1/4*w^3 + 1/2*w^2 + 9/4*w - 1/2], [29, 29, -1/2*w^2 - 1/2*w + 4], [29, 29, -1/2*w^2 + 1/2*w + 4], [29, 29, -1/4*w^3 - 1/2*w^2 + 9/4*w + 1/2], [49, 7, 3/4*w^3 + 1/2*w^2 - 23/4*w - 3/2], [49, 7, 1/2*w^3 + 1/2*w^2 - 3*w - 3], [61, 61, 1/2*w^3 + 1/2*w^2 - 5*w - 1], [61, 61, -1/4*w^3 - 1/2*w^2 + 13/4*w + 7/2], [61, 61, -1/4*w^3 + 1/2*w^2 + 13/4*w - 7/2], [61, 61, -1/2*w^3 + 1/2*w^2 + 5*w - 1], [79, 79, 3/4*w^3 - 25/4*w - 9/2], [79, 79, -1/4*w^3 + 1/2*w^2 - 3/4*w - 3/2], [79, 79, 1/4*w^3 - 3/4*w - 9/2], [79, 79, 3/2*w^3 + 1/2*w^2 - 13*w - 3], [101, 101, 1/4*w^3 + w^2 - 7/4*w - 5/2], [101, 101, 5/4*w^3 - 1/2*w^2 - 45/4*w + 9/2], [101, 101, 1/4*w^3 + w^2 - 7/4*w - 13/2], [101, 101, 1/4*w^3 - w^2 - 7/4*w + 5/2], [121, 11, 3/4*w^3 - 21/4*w - 1/2], [121, 11, 1/4*w^3 - 7/4*w - 7/2], [131, 131, -3/4*w^3 + 29/4*w - 1/2], [131, 131, 1/4*w^3 - 15/4*w - 1/2], [131, 131, 1/4*w^3 - 15/4*w + 1/2], [131, 131, 3/4*w^3 - 29/4*w - 1/2], [139, 139, w^2 + w + 1], [139, 139, 1/2*w^3 + w^2 - 9/2*w - 10], [139, 139, 1/2*w^3 - w^2 - 9/2*w + 10], [139, 139, w^2 - w + 1], [169, 13, 1/2*w^3 - 11/2*w], [179, 179, -3/4*w^3 + w^2 + 21/4*w - 13/2], [179, 179, 1/2*w^3 + 1/2*w^2 - 6*w - 5], [179, 179, -3/4*w^3 - w^2 + 25/4*w + 7/2], [179, 179, -3/2*w^2 + 1/2*w + 2], [181, 181, -1/2*w^2 + 1/2*w - 2], [181, 181, 1/4*w^3 - 1/2*w^2 - 9/4*w + 13/2], [181, 181, 5/4*w^3 - 39/4*w + 3/2], [181, 181, 1/2*w^2 + 1/2*w + 2], [191, 191, -w^3 + 1/2*w^2 + 19/2*w - 4], [191, 191, 1/4*w^3 + 1/2*w^2 - 17/4*w - 1/2], [191, 191, 1/2*w^3 + 1/2*w^2 - 6*w - 3], [191, 191, -3/4*w^3 + 1/2*w^2 + 31/4*w - 3/2], [199, 199, 1/4*w^3 + 1/2*w^2 - 5/4*w - 15/2], [199, 199, -1/4*w^3 + w^2 + 11/4*w - 17/2], [199, 199, 1/2*w^3 + 1/2*w^2 - 4*w + 3], [199, 199, -1/4*w^3 - w^2 + 11/4*w + 1/2], [211, 211, -3/4*w^3 + 1/2*w^2 + 19/4*w - 9/2], [211, 211, -w^3 - 1/2*w^2 + 15/2*w], [211, 211, -1/4*w^3 + 1/2*w^2 + 13/4*w - 11/2], [211, 211, 3/4*w^3 + 1/2*w^2 - 19/4*w - 9/2], [251, 251, 3/4*w^3 - 1/2*w^2 - 27/4*w + 1/2], [251, 251, 1/2*w^2 - 3/2*w - 4], [251, 251, 1/2*w^2 + 3/2*w - 4], [251, 251, -3/4*w^3 - 1/2*w^2 + 27/4*w + 1/2], [269, 269, -3/4*w^3 + 17/4*w - 1/2], [269, 269, 1/2*w^3 + 1/2*w^2 - 4*w - 7], [269, 269, -5/4*w^3 + 39/4*w + 1/2], [269, 269, 3/4*w^3 - 17/4*w - 1/2], [289, 17, -1/4*w^3 + 11/4*w - 9/2], [289, 17, 1/4*w^3 - 11/4*w - 9/2], [311, 311, 3/4*w^3 + w^2 - 29/4*w - 19/2], [311, 311, 3/4*w^3 + w^2 - 25/4*w - 21/2], [311, 311, 3/4*w^3 - w^2 - 13/4*w + 7/2], [311, 311, -3/4*w^3 + w^2 + 29/4*w - 19/2], [361, 19, -1/4*w^3 + 7/4*w - 9/2], [361, 19, -w^3 + 7*w - 1], [389, 389, 5/4*w^3 - 3/2*w^2 - 41/4*w + 13/2], [389, 389, 5/4*w^3 - 47/4*w + 9/2], [389, 389, 1/2*w^3 + 3/2*w^2 - 2*w - 7], [389, 389, 5/4*w^3 + 3/2*w^2 - 41/4*w - 13/2], [419, 419, 5/4*w^3 - 1/2*w^2 - 37/4*w + 5/2], [419, 419, w^3 - 1/2*w^2 - 13/2*w + 2], [419, 419, w^3 + 1/2*w^2 - 13/2*w - 2], [419, 419, 5/4*w^3 + 1/2*w^2 - 37/4*w - 5/2], [439, 439, -1/4*w^3 - 1/2*w^2 - 7/4*w + 5/2], [439, 439, 2*w^3 + 1/2*w^2 - 35/2*w - 2], [439, 439, 2*w^3 - 1/2*w^2 - 35/2*w + 2], [439, 439, -1/4*w^3 + 1/2*w^2 - 7/4*w - 5/2], [491, 491, 1/4*w^3 + 3/2*w^2 - 9/4*w - 7/2], [491, 491, -3/2*w^2 + 1/2*w + 10], [491, 491, -1/4*w^3 - 5/4*w + 5/2], [491, 491, 1/4*w^3 - 3/2*w^2 - 9/4*w + 7/2], [521, 521, 1/2*w^2 - 3/2*w - 6], [521, 521, -3/4*w^3 - 1/2*w^2 + 27/4*w - 3/2], [521, 521, 3/4*w^3 - 1/2*w^2 - 27/4*w - 3/2], [521, 521, 1/2*w^2 + 3/2*w - 6], [529, 23, 1/2*w^3 - 11/2*w - 6], [529, 23, -1/2*w^3 + 11/2*w - 6], [569, 569, 3/4*w^3 + w^2 - 33/4*w - 3/2], [569, 569, -3/4*w^3 + w^2 + 33/4*w - 15/2], [569, 569, 3/4*w^3 + w^2 - 33/4*w - 15/2], [569, 569, -3/4*w^3 + w^2 + 33/4*w - 3/2], [571, 571, -1/2*w^3 - 3/2*w^2 + 5*w + 9], [571, 571, 1/4*w^3 - 19/4*w + 1/2], [571, 571, 1/4*w^3 - 19/4*w - 1/2], [571, 571, 3/4*w^3 + 3/2*w^2 - 27/4*w - 19/2], [599, 599, -3/4*w^3 - w^2 + 21/4*w + 1/2], [599, 599, 1/2*w^3 - 3/2*w^2 - 6*w + 9], [599, 599, -1/2*w^3 - 3/2*w^2 + 6*w + 9], [599, 599, 3/4*w^3 - w^2 - 21/4*w + 1/2], [601, 601, 1/2*w^3 - w^2 - 9/2*w], [601, 601, -w^2 - w + 9], [601, 601, -7/4*w^3 + 57/4*w - 7/2], [601, 601, 1/2*w^3 + w^2 - 9/2*w], [641, 641, w^3 + 1/2*w^2 - 11/2*w - 2], [641, 641, -7/4*w^3 + 1/2*w^2 + 55/4*w - 5/2], [641, 641, 7/4*w^3 + 1/2*w^2 - 55/4*w - 5/2], [641, 641, -w^3 + 1/2*w^2 + 11/2*w - 2], [659, 659, 7/4*w^3 - 1/2*w^2 - 59/4*w + 3/2], [659, 659, 5/2*w^3 - w^2 - 41/2*w + 8], [659, 659, 5/2*w^3 + w^2 - 41/2*w - 8], [659, 659, w^3 + 3/2*w^2 - 19/2*w - 12], [701, 701, 1/2*w^3 - 3/2*w^2 - 3*w + 5], [701, 701, 3/4*w^3 + 3/2*w^2 - 23/4*w - 17/2], [701, 701, 3/4*w^3 - 3/2*w^2 - 23/4*w + 17/2], [701, 701, 1/2*w^3 + 3/2*w^2 - 3*w - 5], [719, 719, 3/4*w^3 - 3/2*w^2 - 23/4*w + 13/2], [719, 719, -1/2*w^3 + 3/2*w^2 + 3*w - 7], [719, 719, 1/2*w^3 + 3/2*w^2 - 3*w - 7], [719, 719, 3/4*w^3 + 3/2*w^2 - 23/4*w - 13/2], [751, 751, 1/2*w^3 - 3/2*w - 4], [751, 751, -3/2*w^3 + 25/2*w + 4], [751, 751, 3/2*w^3 - 25/2*w + 4], [751, 751, -1/2*w^3 + 3/2*w - 4], [809, 809, 3/2*w^2 - 1/2*w - 4], [809, 809, 1/4*w^3 + 3/2*w^2 - 9/4*w - 19/2], [809, 809, 1/4*w^3 - 3/2*w^2 - 9/4*w + 19/2], [809, 809, 3/2*w^2 + 1/2*w - 4], [829, 829, -3/2*w^3 - 1/2*w^2 + 11*w + 1], [829, 829, 5/4*w^3 - 1/2*w^2 - 33/4*w + 7/2], [829, 829, 5/4*w^3 + 1/2*w^2 - 33/4*w - 7/2], [829, 829, -3/2*w^3 + 1/2*w^2 + 11*w - 1], [859, 859, -1/2*w^3 - 1/2*w^2 + 7*w + 3], [859, 859, 5/4*w^3 + 1/2*w^2 - 49/4*w - 3/2], [859, 859, -5/4*w^3 + 1/2*w^2 + 49/4*w - 3/2], [859, 859, 1/2*w^3 - 1/2*w^2 - 7*w + 3], [881, 881, 5/4*w^3 + 2*w^2 - 43/4*w - 29/2], [881, 881, -1/4*w^3 + 2*w^2 - 1/4*w - 7/2], [881, 881, -w^3 + 3/2*w^2 + 15/2*w - 12], [881, 881, 5/4*w^3 - 2*w^2 - 43/4*w + 29/2], [911, 911, 1/4*w^3 - w^2 - 7/4*w - 5/2], [911, 911, -1/4*w^3 + w^2 + 7/4*w - 23/2], [911, 911, -9/4*w^3 + 1/2*w^2 + 73/4*w - 9/2], [911, 911, 9/4*w^3 + w^2 - 75/4*w - 11/2], [919, 919, 5/4*w^3 - 1/2*w^2 - 41/4*w - 1/2], [919, 919, -3/4*w^3 - w^2 + 29/4*w + 3/2], [919, 919, -3/4*w^3 + w^2 + 29/4*w - 3/2], [919, 919, -5/4*w^3 - 1/2*w^2 + 41/4*w - 1/2], [961, 31, 1/2*w^3 - 7/2*w - 6], [961, 31, 5/4*w^3 - 35/4*w - 1/2], [971, 971, -7/4*w^3 + 61/4*w - 7/2], [971, 971, -1/4*w^3 - 5/4*w - 7/2], [971, 971, 11/4*w^3 + w^2 - 97/4*w - 17/2], [971, 971, 1/4*w^3 - 2*w^2 - 7/4*w + 7/2], [991, 991, -5/4*w^3 - w^2 + 43/4*w + 7/2], [991, 991, w^3 - 1/2*w^2 - 17/2*w - 2], [991, 991, -w^3 - 1/2*w^2 + 17/2*w - 2], [991, 991, -5/4*w^3 + w^2 + 43/4*w - 7/2]]; primes := [ideal : I in primesArray]; heckePol := x^2 - 2*x - 5; K := NumberField(heckePol); heckeEigenvaluesArray := [-1, e, 0, -1, -e + 1, 2*e, 2*e, -3*e + 5, e - 5, -2*e + 10, e - 5, e + 7, -4*e + 2, 2, 2*e + 2, -3*e + 5, -3*e + 5, 2*e - 10, 10, 3*e - 13, e + 7, -6*e + 2, 2, 2*e + 12, 4*e - 8, 8*e - 8, -5*e + 7, -4*e - 8, -6*e + 2, 2*e - 20, 5*e - 5, 4*e, 10, 2*e - 10, -10, 2*e - 10, -2*e + 10, 10, -4*e + 2, -4*e + 2, 2, e + 7, -5*e - 3, -8, -6*e + 12, 2*e - 8, -2*e + 20, -2*e + 10, -e + 25, -4*e, 2, 2*e + 2, 2*e + 12, 3*e + 7, -6*e + 12, 3*e - 3, e + 7, -6*e + 2, -8*e + 10, e + 5, -10, 6*e, 9*e - 15, e + 5, -7*e + 7, -5*e - 3, -6*e + 12, -e + 17, 2*e + 2, -5*e - 3, -5*e + 5, 2*e - 20, -8*e, -2*e - 30, -10*e + 10, -4*e + 10, 3*e + 15, -8*e + 20, -10*e + 10, 0, -3*e - 15, -30, -e - 23, 10*e + 2, -10*e + 22, -10*e - 8, 8*e - 8, 3*e + 17, 12*e - 18, 2*e - 18, -4*e - 20, 3*e - 5, 3*e + 15, -e - 5, -10, 2*e, 8*e - 8, 2*e + 22, 4*e - 8, -6*e + 32, -2*e - 30, -4*e + 20, -12*e, 10*e - 10, 14*e - 8, -6*e + 22, 4*e - 28, -8*e - 18, -10*e - 8, 7*e + 17, 10*e + 2, -4*e + 22, -14*e + 20, 8*e - 10, -8*e + 20, 2*e + 20, -10*e + 2, -4*e + 2, 4*e + 12, 5*e - 13, 12*e - 10, -10*e, 6*e - 30, -2*e + 20, -19*e + 17, -2*e + 32, 4*e + 12, -2*e - 28, 10, -8*e + 10, 2*e + 20, -13*e + 15, -12*e + 10, 12*e + 10, -12*e + 10, 3*e + 25, -5*e - 5, -4*e + 40, 8*e, -12*e + 30, -4*e - 28, 8*e + 2, 4*e - 18, 10*e + 12, 13*e - 13, -3*e + 27, 9*e + 27, -8*e + 32, -4*e - 40, -4*e + 20, 5*e - 25, 8*e - 40, 2, -14*e - 8, 12*e - 18, 9*e + 7, 12, 2*e + 32, 16*e - 18, 2*e + 32, -8, -e - 13]; heckeEigenvalues := AssociativeArray(); for i := 1 to #heckeEigenvaluesArray do heckeEigenvalues[primes[i]] := heckeEigenvaluesArray[i]; end for; ALEigenvalues := AssociativeArray(); ALEigenvalues[ideal] := 1; 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;