/* 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![7, 0, -6, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [2, 2, w + 1], [7, 7, w], [9, 3, w^2 + w - 1], [9, 3, w^2 - w - 1], [17, 17, -w^3 + 3*w - 1], [17, 17, w^3 - 3*w - 1], [23, 23, -w^3 - w^2 + 3*w + 4], [23, 23, w^3 - w^2 - 3*w + 4], [41, 41, w^3 - w^2 - 2*w + 3], [41, 41, -w^3 - w^2 + 2*w + 3], [49, 7, w^2 - 6], [71, 71, w^3 + 3*w^2 - 3*w - 6], [71, 71, -2*w^2 - 2*w + 1], [73, 73, w^2 - 2*w - 2], [73, 73, w^2 + 2*w - 2], [79, 79, w^3 - w^2 - 5*w + 2], [79, 79, -w^3 - w^2 + 5*w + 2], [89, 89, 2*w - 1], [89, 89, -2*w - 1], [97, 97, -w^3 + w^2 + 4*w - 1], [97, 97, w^3 + w^2 - 4*w - 1], [103, 103, -2*w^3 + w^2 + 8*w - 2], [103, 103, w^3 - w^2 - 3*w + 6], [103, 103, -w^3 - w^2 + 3*w + 6], [103, 103, 2*w^3 + w^2 - 8*w - 2], [127, 127, w^3 + 3*w^2 - 4*w - 11], [127, 127, -w^3 + 3*w^2 + 4*w - 11], [137, 137, -w^3 - 3*w^2 + 2*w + 9], [137, 137, -2*w^2 + w + 10], [137, 137, -2*w^2 - w + 10], [137, 137, w^3 - 3*w^2 - 2*w + 9], [151, 151, 3*w^2 - 2*w - 10], [151, 151, w^3 + 3*w^2 - 4*w - 9], [167, 167, w^3 + 4*w^2 - 2*w - 8], [167, 167, 2*w^3 - 8*w - 3], [167, 167, 2*w^3 - 8*w + 3], [167, 167, 2*w^3 + 5*w^2 - 7*w - 13], [191, 191, -w^3 + 6*w - 2], [191, 191, w^3 - 6*w - 2], [193, 193, -2*w^3 + 2*w^2 + 6*w - 5], [193, 193, w^3 + 2*w^2 - 4*w - 4], [193, 193, -w^3 + 2*w^2 + 4*w - 4], [193, 193, -2*w^3 - 2*w^2 + 6*w + 5], [199, 199, 2*w^2 - 3*w - 6], [199, 199, w^3 + w^2 + w + 2], [199, 199, 2*w^3 + 2*w^2 - 4*w - 5], [199, 199, 2*w^2 + 3*w - 6], [223, 223, 2*w^3 + w^2 - 6*w - 6], [223, 223, w^3 - w^2 - 5*w - 2], [223, 223, 2*w^3 + 4*w^2 - 6*w - 9], [223, 223, -2*w^3 + w^2 + 6*w - 6], [239, 239, -2*w^3 - 5*w^2 + 5*w + 11], [239, 239, w^3 + 4*w^2 - 4*w - 10], [241, 241, -3*w^3 - 4*w^2 + 9*w + 11], [241, 241, -2*w^3 - w^2 + 6*w + 4], [257, 257, 2*w^3 + 5*w^2 - 6*w - 12], [257, 257, -w^3 - 4*w^2 + 3*w + 9], [263, 263, -w^3 - w^2 + 6*w + 3], [263, 263, w^3 - w^2 - 6*w + 3], [271, 271, -2*w^3 - w^2 + 7*w + 3], [271, 271, -w^3 + 2*w^2 + 3*w - 9], [271, 271, w^3 + 2*w^2 - 3*w - 9], [271, 271, 2*w^3 - w^2 - 7*w + 3], [289, 17, 3*w^2 - 8], [313, 313, -w^3 + 2*w^2 - 6], [313, 313, w^3 + 2*w^2 - 6], [353, 353, -w^3 + 3*w - 5], [353, 353, w^3 - 3*w - 5], [359, 359, w^3 - w + 3], [359, 359, 4*w^3 + 5*w^2 - 14*w - 18], [361, 19, -w^3 + 2*w^2 + 4*w - 2], [361, 19, w^3 + 2*w^2 - 4*w - 2], [367, 367, -2*w^3 - 3*w^2 + 6*w + 10], [367, 367, -3*w - 2], [367, 367, 3*w - 2], [367, 367, w^3 + 2*w^2 - 7*w - 11], [401, 401, -2*w^3 + 6*w - 1], [401, 401, -3*w^3 + 3*w^2 + 11*w - 10], [401, 401, 3*w^3 + 3*w^2 - 11*w - 10], [401, 401, 2*w^3 - 6*w - 1], [409, 409, w^3 - 3*w^2 - 6*w + 13], [409, 409, -w^3 - 3*w^2 + 6*w + 13], [431, 431, w^3 - 4*w^2 - 2*w + 10], [431, 431, -w^3 - 4*w^2 + 2*w + 10], [433, 433, w^3 - w^2 - 6*w - 3], [433, 433, 2*w^3 + 4*w^2 - 7*w - 10], [463, 463, w^2 + 3*w - 3], [463, 463, w^2 - 3*w - 3], [487, 487, 2*w^2 + 2*w - 9], [487, 487, 2*w^2 - 2*w - 9], [521, 521, -w^3 - 4*w^2 + 5*w + 13], [521, 521, w^3 - 4*w^2 - 5*w + 13], [529, 23, -w^2 - 2], [577, 577, w^3 + 2*w^2 - 2*w - 8], [577, 577, -w^3 + 2*w^2 + 2*w - 8], [593, 593, -2*w^3 - 3*w^2 + 5*w + 9], [593, 593, w^3 + 2*w^2 - 8*w - 12], [599, 599, w^3 + 2*w^2 - 5*w - 3], [599, 599, -w^3 + 2*w^2 + 5*w - 3], [601, 601, -w^3 + 4*w^2 + 4*w - 8], [601, 601, w^3 + 4*w^2 - 4*w - 8], [607, 607, -w^3 + 8*w + 6], [607, 607, -3*w^3 - 5*w^2 + 7*w + 12], [607, 607, 2*w^2 - 4*w - 9], [607, 607, -2*w^3 - 3*w^2 + 11*w + 13], [617, 617, 3*w^3 + 2*w^2 - 11*w - 9], [617, 617, -2*w^3 + w^2 + 9*w - 1], [617, 617, 2*w^3 + w^2 - 9*w - 1], [617, 617, 3*w^3 - 12*w - 4], [625, 5, -5], [631, 631, w^3 - w^2 - 7*w - 4], [631, 631, 2*w^3 + 4*w^2 - 8*w - 11], [641, 641, -2*w^3 + 3*w^2 + 9*w - 9], [641, 641, w^3 - 2*w^2 - 7*w + 5], [641, 641, w^3 + 2*w^2 - 7*w - 5], [641, 641, 2*w^3 + 3*w^2 - 9*w - 9], [647, 647, -w^3 + 3*w^2 - 1], [647, 647, 2*w^3 - 3*w^2 - 8*w + 8], [647, 647, -2*w^3 - 3*w^2 + 8*w + 8], [647, 647, w^3 + 3*w^2 - 1], [727, 727, -3*w^3 - 2*w^2 + 11*w + 3], [727, 727, -2*w^3 + 5*w^2 + 9*w - 17], [727, 727, 2*w^3 + 5*w^2 - 9*w - 17], [727, 727, 3*w^3 - 2*w^2 - 11*w + 3], [743, 743, 3*w^2 - 2*w - 12], [743, 743, 3*w^2 + 2*w - 12], [751, 751, 2*w^3 - 2*w^2 - 6*w + 9], [751, 751, -2*w^3 - 2*w^2 + 6*w + 9], [761, 761, -3*w^3 + 5*w^2 + 6*w - 11], [761, 761, 3*w^3 + 5*w^2 - 6*w - 11], [769, 769, w^3 - 7*w - 3], [769, 769, -w^3 + 7*w - 3], [823, 823, w^3 + 2*w^2 - 5*w - 1], [823, 823, w^3 - 2*w^2 - 5*w + 1], [839, 839, 4*w^2 + w - 12], [839, 839, -3*w^3 + w^2 + 13*w - 8], [839, 839, 3*w^3 + w^2 - 13*w - 8], [839, 839, 4*w^2 - w - 12], [841, 29, 2*w^3 + 4*w^2 - 7*w - 16], [841, 29, -2*w^3 + 4*w^2 + 7*w - 16], [857, 857, 3*w^2 - 3*w - 11], [857, 857, 3*w^2 + 3*w - 11], [863, 863, w^3 + 3*w^2 - 5*w - 6], [863, 863, -w^3 + 3*w^2 + 5*w - 6], [881, 881, w^3 - w^2 - 5*w - 4], [881, 881, 2*w^2 + 4*w + 3], [887, 887, w^2 - w - 9], [887, 887, 3*w^3 + 4*w^2 - 11*w - 11], [887, 887, -3*w^3 + 4*w^2 + 11*w - 11], [887, 887, w^2 + w - 9], [911, 911, w^2 - 4*w - 8], [911, 911, -3*w^3 - 4*w^2 + 9*w + 13], [919, 919, 2*w^3 - w^2 - 8*w - 2], [919, 919, -2*w^3 - w^2 + 8*w - 2], [929, 929, 4*w^3 + w^2 - 16*w - 2], [929, 929, 2*w^3 - 11*w - 6], [937, 937, 3*w^3 - 3*w^2 - 10*w + 5], [937, 937, -3*w^3 - 3*w^2 + 10*w + 5], [953, 953, w^3 - 9*w - 11], [953, 953, 5*w^2 + 3*w - 17], [953, 953, 5*w^2 - 3*w - 17], [953, 953, -2*w^3 - w^2 + 8*w + 10], [961, 31, 4*w^2 - 11], [961, 31, 4*w^2 - 13], [967, 967, w^3 - w^2 - 6*w - 5], [967, 967, 2*w^2 + 3*w + 2], [983, 983, -w^2 + w - 3], [983, 983, 2*w^3 - 2*w^2 - 11*w + 10], [983, 983, 2*w^3 + 2*w^2 - 11*w - 10], [983, 983, -w^2 - w - 3], [991, 991, w^3 + 3*w^2 - 10*w - 15], [991, 991, -2*w^3 - 4*w^2 + w + 6]]; primes := [ideal : I in primesArray]; heckePol := x^3 - x^2 - 11*x + 14; K := NumberField(heckePol); heckeEigenvaluesArray := [1, e, -e^2 + 6, 1, e^2 + 2*e - 11, -2*e, -e^2 - e + 11, e^2 - 6, e, e^2 + 2*e - 4, -e^2 - 2*e + 11, -e^2 - 2*e + 16, -e^2 + e + 9, -e^2 + 2, 3*e^2 + 3*e - 23, -2*e - 6, e^2 - 1, e^2 - e - 17, -e^2 - e + 9, -2*e^2 + 22, 2*e^2 - 2*e - 14, -4*e, e - 6, -e^2 - 2*e + 14, e^2 + 3*e - 1, 4*e^2 - 26, 5*e + 3, -e^2 + 5*e + 9, 3*e^2 + 3*e - 27, -e^2 - e + 23, -3*e^2 - e + 15, -3*e^2 - 5*e + 27, e^2 + e - 5, -2*e^2 - 3*e + 14, 5*e^2 + 2*e - 32, 3*e^2 + 7*e - 29, -e^2 + 5*e + 5, -2*e^2 - 7*e + 19, -2*e^2 - e + 22, -2*e^2 - 7*e + 21, -4*e - 12, 2*e^2 + 2*e - 18, -e^2 - e + 11, -4, e^2 - 5*e - 11, 2*e^2 + 2*e - 12, -4*e^2 - 3*e + 38, -e^2 + 3*e + 9, -2*e^2 - 2*e + 28, -5*e^2 - 4*e + 32, 2*e^2 + 2*e - 22, 2*e^2 + 5*e - 30, 3*e - 5, 2*e^2 + 2*e - 4, 2*e^2 - 2*e - 6, -e^2 - 6*e + 13, -2*e + 2, -e^2 + e - 3, 3*e^2 - 2*e - 14, 4*e^2 + 3*e - 25, -5*e^2 - 5*e + 37, 2*e^2 + 2*e - 8, -2*e^2 - 8*e + 22, 4*e^2 + 6*e - 48, 4*e + 10, 4*e^2 + 3*e - 34, -2*e^2 - 5*e + 29, 2*e^2 + 10*e - 24, -2*e^2 + 2*e + 30, 4*e^2 - 32, -2*e^2 - e + 22, 2*e^2 - 2*e - 22, -5*e^2 - 2*e + 41, -7*e - 1, 4*e^2 - 4*e - 26, -4*e^2 - 6*e + 26, -3*e - 16, -4*e^2 + 12, -4*e^2 - e + 20, -2*e^2 + 20, e^2 - 7*e - 23, -3*e^2 + 24, 2*e^2 - 5*e - 30, -e^2 - 6*e, e^2 - 6*e - 7, 2*e^2 - 3*e - 27, 3*e^2 + 7*e - 39, 2*e^2 + 2*e - 20, -6*e^2 + e + 48, -e + 20, 7*e^2 + e - 53, 2*e^2 - 14, -2*e + 2, 3*e^2 - 8*e - 26, 5*e - 23, -5*e^2 - 5*e + 19, -4*e + 14, 4*e^2 - 5*e - 24, -e^2 - 7*e + 23, -2*e^2 - e - 10, 5*e^2 + e - 49, 3*e^2 + 4*e - 24, -5*e^2 + 2*e + 45, -10*e + 8, 8*e^2 + 6*e - 54, -4*e^2 - 4*e + 22, 5*e^2 + 6*e - 56, 2*e^2 + 3*e - 44, 5*e^2 + 13*e - 61, 4*e + 16, -e^2 - 7*e + 21, e^2 - 7*e - 5, -2*e^2 + 10*e + 10, 4*e^2 + e - 47, -4*e^2 - 2*e + 30, -e^2 + 10*e + 14, 6*e^2 + 11*e - 62, 3*e^2 + e - 11, 2*e^2 + 9*e - 28, -3*e^2 - 7*e + 29, 3*e^2 - 9*e - 21, 10*e^2 + 13*e - 84, -5*e^2 + 2*e + 46, -2*e^2 + 4*e + 8, 4*e + 32, -2*e^2 + 3*e + 32, -4*e + 2, -e^2 + 4*e + 36, -8*e^2 - e + 58, -2*e^2 + 5*e, e - 20, 5*e^2 + 8*e - 39, -e^2 + 8*e + 42, 6*e^2 + 6*e - 50, 8*e^2 + 16*e - 72, -4*e^2 - 10*e + 20, -8*e^2 - 5*e + 66, 7*e^2 - 5*e - 61, -7*e^2 - 3*e + 73, e^2 + 4*e - 36, 12*e + 14, -e^2 - 8*e, -e^2 - 41, -6*e^2 - 3*e + 65, -36, -10*e^2 - 9*e + 81, -e^2 - 10*e + 12, 3*e^2 + 5*e - 41, 10*e^2 + 2*e - 74, -2*e^2 + 8*e, -4*e^2 - 3*e + 19, -3*e^2 - 4*e - 3, -9*e^2 + 68, 2*e^2 + 6*e - 38, 4*e^2 + 12*e - 34, -3*e^2 - 2*e + 50, -14, 3*e^2 + 11*e - 5, -5*e^2 + 50, 4*e^2 + 7*e - 38, 6*e^2 + 6*e - 56, -5*e^2 - 8*e + 46, 6*e^2 - 2*e - 52, 2*e^2 + 14*e - 26, -4*e^2 + 6*e + 20, 8*e^2 + 16*e - 80, -e^2 + 5*e + 5, 3*e^2 + 10, -3*e^2 - 7*e + 59, 8*e^2 - 5*e - 66, -2*e^2 - 10*e + 44, -5*e^2 + 37]; 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;