/* 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, -2, -6, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [2, 2, w + 1], [3, 3, -w^3 + w^2 + 5*w - 2], [11, 11, -w^3 + 5*w + 1], [11, 11, -w + 2], [13, 13, -w^3 + w^2 + 4*w + 1], [17, 17, -w^3 + w^2 + 6*w - 1], [17, 17, -w^2 - w + 3], [23, 23, w^3 - 6*w], [27, 3, w^3 + w^2 - 5*w - 4], [41, 41, -w^3 + w^2 + 5*w], [41, 41, 2*w^3 - 11*w - 4], [53, 53, 2*w^3 - 2*w^2 - 11*w + 6], [59, 59, 2*w^3 - 11*w - 2], [67, 67, w^3 - 7*w - 1], [71, 71, 3*w^3 - 2*w^2 - 15*w + 1], [79, 79, -3*w^3 + w^2 + 16*w + 3], [89, 89, -4*w^3 + 2*w^2 + 22*w - 3], [101, 101, -2*w^3 + 13*w + 6], [101, 101, w^3 + w^2 - 6*w - 3], [101, 101, -3*w^3 + 2*w^2 + 17*w - 3], [101, 101, w^3 - w^2 - 8*w - 3], [107, 107, 2*w^3 - 3*w^2 - 6*w], [109, 109, -w^3 + w^2 + 4*w - 3], [113, 113, w^3 - 8*w - 4], [113, 113, 7*w^3 - 4*w^2 - 39*w + 7], [121, 11, w^3 - w^2 - 6*w - 1], [127, 127, -2*w^3 + w^2 + 9*w + 3], [127, 127, 2*w^3 - 13*w], [131, 131, 6*w^3 - 3*w^2 - 34*w + 6], [139, 139, w^2 - 2*w - 4], [149, 149, 3*w^3 - w^2 - 18*w - 3], [151, 151, -2*w^3 + 2*w^2 + 9*w - 4], [163, 163, 3*w^3 - 2*w^2 - 16*w + 2], [163, 163, 2*w^3 - 10*w + 1], [167, 167, 3*w^3 - 18*w - 4], [173, 173, -3*w^3 + w^2 + 18*w - 3], [193, 193, 4*w^3 - 3*w^2 - 23*w + 9], [197, 197, 3*w^3 - w^2 - 17*w + 2], [197, 197, -3*w^3 - 2*w^2 + 15*w + 9], [199, 199, 2*w^3 - w^2 - 8*w - 6], [223, 223, -6*w^3 + 3*w^2 + 35*w - 7], [227, 227, 2*w^3 - 12*w - 1], [227, 227, -w^3 + w^2 + 7*w - 8], [227, 227, 3*w^3 - w^2 - 18*w - 1], [227, 227, -4*w^3 - 2*w^2 + 21*w + 14], [229, 229, -w^3 + 2*w^2 + 3*w - 5], [233, 233, w^3 - 3*w - 3], [233, 233, -3*w^3 + 3*w^2 + 15*w - 8], [241, 241, 4*w^2 - 7*w - 8], [241, 241, w^3 + w^2 - 4*w - 5], [251, 251, 2*w^3 - w^2 - 13*w - 1], [251, 251, 2*w^3 - 9*w - 6], [257, 257, w^3 - 8*w], [263, 263, -w^3 + 2*w^2 + 5*w - 7], [269, 269, 3*w^3 - 3*w^2 - 12*w - 1], [271, 271, 2*w^3 - w^2 - 12*w - 2], [271, 271, 9*w^3 - 5*w^2 - 50*w + 9], [277, 277, w^3 - 2*w^2 - 6*w + 6], [277, 277, w^3 + w^2 - 7*w - 2], [281, 281, 4*w^3 - 2*w^2 - 24*w + 5], [281, 281, -7*w^3 + 4*w^2 + 40*w - 12], [289, 17, -5*w^3 + 5*w^2 + 26*w - 15], [293, 293, -w^3 + 2*w^2 + 4*w - 4], [293, 293, -9*w^3 + 5*w^2 + 51*w - 12], [307, 307, -2*w^3 + 2*w^2 + 12*w - 7], [311, 311, -4*w^3 + 24*w + 11], [313, 313, 2*w^3 - 9*w - 4], [317, 317, 2*w^3 - 4*w^2 - 2*w - 3], [317, 317, 2*w^3 - 14*w - 7], [331, 331, -3*w^3 + 19*w + 3], [349, 349, -w^3 - 2*w^2 + 8*w + 8], [349, 349, w^3 + w^2 - 5*w - 8], [361, 19, -w^3 + w^2 + 7*w - 6], [361, 19, w^3 + w^2 - 3*w - 4], [373, 373, 2*w^3 - w^2 - 11*w - 3], [379, 379, -4*w^3 + 25*w + 14], [383, 383, -3*w^3 + w^2 + 15*w - 2], [383, 383, 3*w^3 - 4*w^2 - 10*w], [401, 401, 4*w^3 - w^2 - 24*w - 4], [409, 409, w^2 + 5*w + 5], [419, 419, w^2 - 2*w - 6], [419, 419, -6*w^3 + 3*w^2 + 34*w - 8], [433, 433, 3*w^3 - 16*w - 6], [433, 433, 3*w^3 - w^2 - 16*w - 5], [443, 443, -w^3 + 2*w^2 + w + 3], [449, 449, 2*w^2 - 2*w - 5], [457, 457, -4*w^3 + 4*w^2 + 20*w - 9], [457, 457, w^2 + w - 7], [463, 463, w^3 - 7*w - 7], [463, 463, w^3 + 2*w^2 - 5*w - 9], [487, 487, w^3 + 2*w^2 - 5*w - 5], [487, 487, -w^3 + w^2 + 6*w - 7], [509, 509, -2*w^3 - 2*w^2 + 13*w + 10], [509, 509, 3*w^3 - 17*w - 3], [509, 509, -5*w^3 + 3*w^2 + 30*w - 11], [509, 509, -w^3 - 2*w^2 + 4*w + 6], [521, 521, -2*w^3 - w^2 + 9*w + 7], [541, 541, -2*w^3 - 2*w^2 + 12*w + 9], [541, 541, -2*w^3 + 12*w + 9], [547, 547, 2*w^3 + w^2 - 7*w - 3], [547, 547, 5*w^3 - 3*w^2 - 30*w + 3], [557, 557, w^3 + 2*w^2 - 5*w - 11], [557, 557, -w^3 + w^2 + 3*w - 4], [563, 563, 3*w^3 - w^2 - 15*w - 4], [569, 569, 2*w^2 - w - 8], [577, 577, 4*w^3 - 22*w - 7], [593, 593, -3*w^3 + w^2 + 17*w + 4], [607, 607, -w^3 - 3*w^2 + w + 4], [613, 613, 3*w^3 - 2*w^2 - 14*w], [613, 613, w^2 - 3*w - 5], [619, 619, -w^3 + 2*w^2 + 4*w - 10], [625, 5, -5], [641, 641, -3*w^3 - 3*w^2 + 12*w + 7], [643, 643, 2*w^3 + 2*w^2 - 14*w - 13], [643, 643, 3*w^3 - 19*w - 7], [647, 647, w^3 - 5*w - 7], [653, 653, -3*w^3 + 2*w^2 + 14*w - 2], [659, 659, -6*w^3 + 2*w^2 + 34*w - 1], [659, 659, -2*w^3 + w^2 + 17*w + 9], [683, 683, w^3 + 2*w^2 - 7*w - 7], [691, 691, 3*w^3 - 15*w - 7], [701, 701, w^3 + 2*w^2 - 6*w - 10], [701, 701, -w^3 + 3*w^2 + 6*w - 13], [701, 701, 5*w^3 - 2*w^2 - 30*w + 4], [701, 701, 4*w^3 - 2*w^2 - 21*w + 2], [727, 727, -2*w^3 - 3*w^2 + 9*w + 7], [743, 743, 3*w - 4], [751, 751, w^3 - 9*w - 3], [757, 757, w^3 - 5*w^2 + 4*w + 7], [757, 757, 4*w^3 - 5*w^2 - 11*w - 5], [761, 761, 4*w^3 - 5*w^2 - 20*w + 16], [769, 769, -3*w^3 + 16*w + 12], [773, 773, 2*w^3 + 2*w^2 - 11*w - 10], [773, 773, w^3 - 3*w - 5], [773, 773, -w^3 + 2*w^2 + 9*w + 3], [773, 773, 5*w^3 - w^2 - 27*w], [787, 787, -4*w^3 + 3*w^2 + 22*w - 4], [787, 787, -2*w^3 + w^2 + 14*w - 6], [797, 797, 2*w^3 - w^2 - 14*w + 2], [797, 797, -3*w^3 + 2*w^2 + 19*w - 7], [811, 811, 2*w^3 + w^2 - 14*w - 12], [811, 811, 2*w^3 + 2*w^2 - 8*w - 3], [829, 829, -2*w^3 + 14*w + 11], [857, 857, -3*w^3 + 3*w^2 + 14*w - 7], [859, 859, 3*w^3 - w^2 - 15*w], [859, 859, -11*w^3 + 7*w^2 + 60*w - 15], [863, 863, 2*w^2 - 2*w - 13], [863, 863, 2*w^3 + w^2 - 12*w - 4], [877, 877, -6*w^3 - 2*w^2 + 32*w + 19], [887, 887, 3*w^3 + w^2 - 14*w - 7], [887, 887, 2*w^3 - w^2 - 15*w - 5], [911, 911, 3*w^3 - 18*w - 2], [919, 919, w^3 - w^2 - 6*w - 5], [919, 919, -4*w^3 + w^2 + 24*w - 2], [941, 941, 3*w^3 - 3*w^2 - 13*w], [947, 947, 2*w^3 - 2*w^2 - 10*w - 1], [947, 947, -3*w^3 + 2*w^2 + 14*w + 6], [953, 953, -4*w^3 + 3*w^2 + 21*w - 3], [953, 953, 4*w^3 - w^2 - 23*w + 1], [961, 31, -2*w^3 + 3*w^2 + 12*w - 8], [961, 31, 3*w^2 - 4*w - 6], [967, 967, -5*w^3 - 3*w^2 + 23*w + 14], [971, 971, 5*w^3 - w^2 - 27*w - 8], [971, 971, -9*w^3 + 6*w^2 + 50*w - 12], [983, 983, -w^3 + w^2 + 10*w + 3], [997, 997, 2*w^3 + w^2 - 11*w - 3], [997, 997, w^3 + 2*w^2 - 6*w - 8], [997, 997, -5*w^3 + 4*w^2 + 29*w - 15]]; primes := [ideal : I in primesArray]; heckePol := x^3 - 5*x^2 - 15*x + 36; K := NumberField(heckePol); heckeEigenvaluesArray := [-1, -1, e, -1/3*e^2 + 2/3*e + 6, e - 2, -e + 1, e - 1, 1/3*e^2 - 2/3*e - 1, 1/3*e^2 - 5/3*e - 3, e + 1, -2/3*e^2 + 4/3*e + 8, -2/3*e^2 + 7/3*e + 8, -1/3*e^2 - 1/3*e + 11, -e - 6, 1/3*e^2 - 2/3*e - 4, 2/3*e^2 - 13/3*e - 11, 1/3*e^2 - 5/3*e - 3, -2/3*e^2 + 1/3*e + 16, 1/3*e^2 - 5/3*e + 3, -1/3*e^2 + 2/3*e + 16, -2/3*e^2 + 4/3*e + 10, -2/3*e^2 + 7/3*e + 16, 2/3*e^2 - 13/3*e - 10, 4/3*e^2 - 14/3*e - 10, -4/3*e^2 + 14/3*e + 10, 2, -4, -4/3*e^2 + 17/3*e + 16, 2/3*e^2 + 2/3*e - 18, -2/3*e^2 + 13/3*e + 8, -e^2 + 2*e + 18, e^2 - 4*e - 3, -1/3*e^2 - 7/3*e + 11, 1/3*e^2 + 7/3*e - 11, -1/3*e^2 + 2/3*e + 7, -e^2 + 3*e + 13, -2/3*e^2 + 22/3*e + 6, 4/3*e^2 - 8/3*e - 26, 1/3*e^2 - 8/3*e - 6, e - 5, -2/3*e^2 + 7/3*e + 7, -e^2 + 2*e + 24, e - 8, e^2 - 2*e - 2, 2*e + 4, 18, -e^2 + 4*e + 23, 4/3*e^2 - 8/3*e - 24, 2/3*e^2 + 2/3*e - 20, 4/3*e^2 - 14/3*e - 6, 4, -2/3*e^2 + 10/3*e + 16, 4/3*e^2 - 8/3*e - 28, 2/3*e^2 - 10/3*e - 28, -1/3*e^2 + 5/3*e + 15, 5/3*e^2 - 10/3*e - 25, 4/3*e^2 - 17/3*e - 5, 1/3*e^2 - 14/3*e - 10, 2*e^2 - 6*e - 20, 2/3*e^2 + 8/3*e - 30, 2/3*e^2 - 25/3*e - 7, 2/3*e^2 + 2/3*e - 6, -1/3*e^2 + 5/3*e - 9, e^2 - 8*e - 8, -5/3*e^2 + 13/3*e + 11, e^2 - e - 3, -4*e + 10, 4/3*e^2 - 17/3*e - 4, 4*e - 6, 4/3*e^2 - 23/3*e - 14, 2/3*e^2 + 2/3*e - 4, e^2 - 2*e - 4, 2/3*e^2 - 7/3*e - 10, -e^2 + 2*e + 34, -1/3*e^2 + 11/3*e - 3, -1/3*e^2 - 1/3*e + 5, e^2 - 5*e + 1, 4/3*e^2 - 2/3*e - 26, 4/3*e^2 - 17/3*e - 13, -2*e^2 + 6*e + 12, -e^2 + 34, -e^2 - e + 25, 1/3*e^2 - 8/3*e + 13, e^2 - 4*e - 6, -7/3*e^2 + 23/3*e + 35, 2/3*e^2 - 10/3*e - 28, 2/3*e^2 - 4/3*e - 12, -e^2 + 13, -7/3*e^2 + 32/3*e + 29, -1/3*e^2 + 14/3*e + 12, -2/3*e^2 - 11/3*e + 29, -4/3*e^2 + 20/3*e + 16, -e^2 + 6*e + 16, 7/3*e^2 - 23/3*e - 11, 5/3*e^2 - 19/3*e - 23, e - 2, -e^2 + 2*e + 39, -1/3*e^2 + 23/3*e + 1, e^2 - 8*e - 8, -1/3*e^2 + 2/3*e + 4, -1/3*e^2 - 13/3*e + 17, 1/3*e^2 - 17/3*e - 23, -e^2 + 3*e + 25, -1/3*e^2 + 17/3*e + 17, 4/3*e^2 - 11/3*e - 31, -2/3*e^2 + 4/3*e + 30, -5/3*e^2 + 13/3*e + 39, -2*e - 12, 8/3*e^2 - 10/3*e - 46, 1/3*e^2 - 2/3*e + 12, 10/3*e^2 - 29/3*e - 38, -1/3*e^2 - 16/3*e + 21, -4/3*e^2 + 8/3*e - 2, -1/3*e^2 + 14/3*e + 18, -1/3*e^2 - 10/3*e + 32, 2/3*e^2 - 10/3*e + 16, 2/3*e^2 - 4/3*e - 22, e^2 - 42, 1/3*e^2 + 19/3*e - 25, 4/3*e^2 - 8/3*e - 40, -2/3*e^2 + 1/3*e + 28, -5/3*e^2 + 19/3*e + 17, -3*e - 16, 2/3*e^2 + 11/3*e - 32, e^2 - 7*e - 31, 2*e^2 - 10*e - 20, 2*e^2 - 8*e - 12, -4/3*e^2 + 26/3*e - 6, -e^2 - 5*e + 39, 1/3*e^2 + 16/3*e - 32, 1/3*e^2 - 20/3*e + 9, e^2 - 9*e - 9, -e^2 - 3*e + 47, 2/3*e^2 - 10/3*e + 18, -11/3*e^2 + 31/3*e + 33, -1/3*e^2 - 1/3*e - 19, -11/3*e^2 + 37/3*e + 43, 4/3*e^2 - 32/3*e - 28, -2/3*e^2 + 25/3*e + 2, -2*e^2 + 4*e + 18, 7/3*e^2 - 17/3*e - 7, -4/3*e^2 + 11/3*e - 6, 1/3*e^2 - 17/3*e + 1, 10/3*e^2 - 44/3*e - 26, -5/3*e^2 - 11/3*e + 49, e^2 - 8*e + 16, -2/3*e^2 + 22/3*e + 2, -8/3*e^2 + 22/3*e + 34, -2*e^2 + 6*e + 40, 4/3*e^2 - 5/3*e - 15, e^2, 8/3*e^2 - 28/3*e - 18, -7/3*e^2 + 44/3*e + 37, 1/3*e^2 - 14/3*e - 21, 4/3*e^2 - 29/3*e - 10, e^2 + 3*e - 33, 2/3*e^2 + 8/3*e - 20, 2/3*e^2 - 4/3*e - 12, -7*e + 2, 2/3*e^2 + 14/3*e - 10, 5*e - 34, 4/3*e^2 - 20/3*e, 4/3*e^2 - 26/3*e - 28, -4/3*e^2 + 5/3*e + 46, -5/3*e^2 + 16/3*e + 48, -8/3*e^2 + 10/3*e + 58, -4/3*e^2 + 20/3*e + 18, -8/3*e^2 + 7/3*e + 46]; 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;