/* 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![3, -3, -6, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [3, 3, w], [5, 5, w - 1], [7, 7, w^3 - w^2 - 4*w + 1], [11, 11, -w^2 + w + 2], [13, 13, -w^3 + w^2 + 3*w - 1], [16, 2, 2], [17, 17, -w^3 + 5*w + 2], [29, 29, -w^2 + w + 1], [37, 37, -w^3 + 2*w^2 + 4*w - 4], [41, 41, -w^3 + w^2 + 5*w + 1], [41, 41, w^2 - 5], [47, 47, w^3 - w^2 - 5*w - 2], [47, 47, -w^3 + 2*w^2 + 4*w - 1], [53, 53, w^3 - 4*w - 4], [53, 53, 2*w^3 - 2*w^2 - 9*w + 1], [61, 61, -w^3 + w^2 + 6*w - 2], [71, 71, w^3 - w^2 - 6*w - 2], [103, 103, 2*w^3 - 2*w^2 - 8*w + 1], [103, 103, -3*w^3 + 3*w^2 + 13*w - 5], [109, 109, 2*w^3 - w^2 - 8*w - 4], [109, 109, 2*w^3 - w^2 - 9*w - 1], [113, 113, -2*w^3 + w^2 + 11*w - 1], [113, 113, 2*w^3 - w^2 - 10*w - 4], [125, 5, 2*w^3 - 3*w^2 - 10*w + 4], [131, 131, -2*w^3 + w^2 + 9*w - 1], [139, 139, 2*w^3 - 4*w^2 - 7*w + 5], [139, 139, 3*w^3 - w^2 - 16*w - 5], [149, 149, w^2 + w - 4], [149, 149, 3*w^3 - 3*w^2 - 13*w + 1], [151, 151, w^2 - 2*w - 8], [157, 157, w^3 - w^2 - 7*w - 2], [157, 157, -2*w^2 + w + 7], [167, 167, 2*w^3 - 2*w^2 - 7*w + 5], [173, 173, -w^3 + 6*w - 2], [173, 173, -w^3 + 2*w^2 + 5*w - 7], [181, 181, -3*w^3 + 2*w^2 + 14*w + 1], [191, 191, -w^3 + 2*w^2 + 2*w - 5], [191, 191, -w^3 + 2*w^2 + 6*w - 5], [193, 193, -w^3 + 3*w^2 + 4*w - 4], [193, 193, 2*w^3 + 3*w^2 - 13*w - 20], [197, 197, w^3 - 2*w - 2], [199, 199, 2*w^3 - w^2 - 11*w - 2], [211, 211, -2*w^3 + 9*w + 5], [223, 223, -w^3 + w^2 + 4*w - 5], [223, 223, w^2 - 3*w - 2], [229, 229, 2*w^3 - 2*w^2 - 7*w + 1], [241, 241, 3*w^2 - 2*w - 13], [241, 241, -w^3 + w^2 + 5*w + 4], [257, 257, -3*w^3 + w^2 + 15*w + 8], [263, 263, -3*w^3 + 5*w^2 + 9*w - 7], [263, 263, 2*w^3 - w^2 - 9*w + 2], [263, 263, -w^3 + 4*w^2 + 2*w - 16], [263, 263, w^3 - w^2 - 2*w - 2], [271, 271, -3*w - 1], [281, 281, 2*w^3 - 3*w^2 - 8*w + 2], [281, 281, 3*w^3 - 4*w^2 - 12*w + 4], [283, 283, w^3 - 5*w - 7], [293, 293, -2*w^3 + w^2 + 10*w - 1], [307, 307, w^3 - 3*w^2 - 3*w + 8], [307, 307, 3*w^3 - 15*w - 10], [311, 311, 2*w^3 - 3*w^2 - 7*w + 7], [313, 313, -w^3 + 7*w + 2], [337, 337, 3*w^3 - 17*w - 10], [337, 337, 2*w^3 - 2*w^2 - 9*w - 5], [343, 7, -2*w^3 + w^2 + 8*w + 2], [347, 347, -3*w^3 + 17*w + 14], [347, 347, -3*w^3 - w^2 + 17*w + 13], [349, 349, 2*w^3 - w^2 - 8*w - 1], [349, 349, -w^3 + 3*w^2 + 4*w - 8], [353, 353, -w^3 - w^2 + 7*w + 4], [359, 359, -2*w^3 + 9*w + 10], [367, 367, 3*w^3 - 4*w^2 - 9*w + 4], [367, 367, -w^3 + w^2 + 4*w + 4], [367, 367, -w^3 + 3*w^2 + 3*w - 7], [373, 373, -w^2 + w - 2], [373, 373, -2*w^3 + 2*w^2 + 11*w - 2], [379, 379, -2*w^3 + 4*w^2 + 7*w - 8], [379, 379, -w^2 - 2], [389, 389, -w^3 - 2*w^2 + 5*w + 11], [397, 397, -2*w^3 + 4*w^2 + 7*w - 7], [401, 401, w^3 - 3*w^2 - 2*w + 10], [401, 401, -2*w^3 + 11*w + 4], [401, 401, 3*w^3 - 2*w^2 - 14*w - 4], [401, 401, -3*w^3 + 4*w^2 + 15*w - 5], [421, 421, -w^3 + w^2 + 7*w - 1], [421, 421, -2*w^3 + 2*w^2 + 9*w - 7], [433, 433, w^2 - w - 8], [439, 439, -w^3 + 3*w^2 + 4*w - 7], [443, 443, -2*w^3 + w^2 + 10*w - 2], [449, 449, w^2 + 2*w - 4], [449, 449, 2*w^3 - 2*w^2 - 10*w - 1], [461, 461, 2*w^3 - 2*w^2 - 6*w + 5], [461, 461, -2*w^3 + 4*w^2 + 7*w - 13], [463, 463, -3*w^3 + 3*w^2 + 12*w - 4], [463, 463, w - 5], [467, 467, -3*w^3 + w^2 + 16*w + 8], [467, 467, 2*w^2 - 3*w - 10], [479, 479, 2*w^2 - 4*w - 1], [479, 479, -w^3 + 2*w^2 + 2*w - 7], [487, 487, -3*w^3 + 5*w^2 + 12*w - 10], [503, 503, w^3 + 2*w^2 - 8*w - 8], [509, 509, -3*w^3 + 5*w^2 + 11*w - 5], [521, 521, 2*w^2 - 3*w - 11], [523, 523, -2*w^3 - w^2 + 13*w + 11], [523, 523, -2*w^3 + 4*w^2 + 8*w - 7], [541, 541, 3*w^3 - 2*w^2 - 13*w + 1], [563, 563, w^3 - 3*w - 5], [563, 563, -w^3 + 3*w^2 + 2*w - 11], [569, 569, -2*w^3 + 4*w^2 + 9*w - 4], [569, 569, 3*w^2 - w - 14], [571, 571, -w^3 + 8*w - 1], [577, 577, 3*w^3 - 2*w^2 - 16*w + 1], [587, 587, -4*w^3 + 5*w^2 + 18*w - 7], [587, 587, 2*w^3 + w^2 - 10*w - 7], [599, 599, 2*w^3 + w^2 - 11*w - 8], [607, 607, w^3 - 3*w + 4], [613, 613, 3*w^3 - w^2 - 14*w - 5], [613, 613, 3*w^2 - w - 11], [619, 619, 2*w^2 - 5*w - 8], [631, 631, -2*w^3 - 2*w^2 + 12*w + 19], [647, 647, 2*w^3 - 2*w^2 - 11*w - 2], [653, 653, 3*w^3 - 5*w^2 - 8*w + 7], [677, 677, -2*w^3 + 4*w^2 + 5*w - 8], [683, 683, 2*w^3 + w^2 - 12*w - 8], [683, 683, -w^3 + 3*w^2 - 8], [683, 683, -2*w^3 + 3*w^2 + 11*w - 8], [683, 683, -2*w^3 + 3*w^2 + 10*w - 2], [691, 691, w^2 - 4*w - 1], [709, 709, 3*w^3 - 2*w^2 - 13*w - 2], [709, 709, w^3 - 2*w^2 - 3*w - 2], [727, 727, -w^3 + 4*w^2 + 2*w - 7], [727, 727, -w^3 + 8*w + 5], [733, 733, 3*w^2 - 2*w - 10], [733, 733, -w^3 + 5*w + 8], [757, 757, 3*w^3 - 14*w - 8], [761, 761, -w^3 + 3*w^2 + 5*w - 10], [773, 773, -2*w^3 + 3*w^2 + 9*w - 1], [787, 787, -w^3 + 4*w - 4], [797, 797, w^2 + 2*w - 5], [797, 797, w^3 + w^2 - 5*w - 1], [809, 809, w^3 + 3*w^2 - 9*w - 17], [811, 811, -4*w^2 + 3*w + 17], [811, 811, w^3 - 2*w^2 - 8*w + 2], [823, 823, -4*w^3 + 4*w^2 + 17*w - 4], [857, 857, 3*w^2 - w - 16], [881, 881, -2*w^3 + 9*w + 1], [883, 883, w^3 - w^2 - 4*w - 5], [887, 887, 3*w^2 + w - 10], [911, 911, w^3 - 3*w - 7], [919, 919, -w^3 + w^2 + 3*w - 7], [919, 919, 3*w^3 - 2*w^2 - 12*w + 2], [929, 929, 3*w^3 - w^2 - 16*w - 2], [929, 929, w^3 + w^2 - 6*w - 2], [941, 941, -3*w^3 + 5*w^2 + 14*w - 14], [941, 941, -w^3 + 2*w^2 + 6*w - 8], [947, 947, 3*w^3 - 3*w^2 - 13*w - 5], [947, 947, 3*w^3 - 4*w^2 - 12*w + 2], [953, 953, -3*w^3 + 5*w^2 + 10*w - 10], [961, 31, -w^3 + 4*w^2 + 3*w - 13], [961, 31, -4*w^3 + 3*w^2 + 17*w - 4], [967, 967, -w^3 - 4*w^2 + 9*w + 19], [967, 967, w^3 + 5*w^2 - 9*w - 26], [971, 971, -3*w^3 + 6*w^2 + 13*w - 7], [971, 971, w^3 + 2*w^2 - 7*w - 7], [977, 977, 2*w^3 - 3*w^2 - 4*w - 2], [983, 983, 3*w^3 - 5*w^2 - 7*w + 7], [991, 991, 2*w^2 - w - 13], [991, 991, w^3 - 8*w - 4]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 3*x^3 - 12*x^2 + 30*x + 21; K := NumberField(heckePol); heckeEigenvaluesArray := [e, 0, 7*e^3 + 2*e^2 - 75*e - 38, 0, 5*e^3 + 2*e^2 - 54*e - 35, -4*e^3 - 2*e^2 + 42*e + 32, 0, 0, -11*e^3 - 5*e^2 + 117*e + 80, 0, 0, 0, 0, 0, 0, -15*e^3 - 3*e^2 + 159*e + 76, 0, 21*e^3 + 8*e^2 - 225*e - 140, -26*e^3 - 8*e^2 + 276*e + 155, -e^3 + 2*e^2 + 9*e - 11, -18*e^3 - 6*e^2 + 195*e + 100, 0, 0, 0, 0, -9*e^3 - 4*e^2 + 93*e + 61, -27*e^3 - 12*e^2 + 291*e + 191, 0, 0, -27*e^3 - 12*e^2 + 291*e + 193, 8*e^3 + 4*e^2 - 87*e - 46, -28*e^3 - 14*e^2 + 306*e + 203, 0, 0, 0, -10*e^3 - 4*e^2 + 114*e + 61, 0, 0, -24*e^3 - 7*e^2 + 258*e + 124, -12*e^3 - 5*e^2 + 126*e + 74, 0, 37*e^3 + 14*e^2 - 402*e - 221, 25*e^3 + 8*e^2 - 267*e - 149, -24*e^3 - 13*e^2 + 264*e + 184, 21*e^3 + 6*e^2 - 225*e - 100, e^3 - 2*e^2 - 15*e + 8, 8*e^3 + 8*e^2 - 87*e - 80, 3*e^3 + 4*e^2 - 30*e - 31, 0, 0, 0, 0, 0, -5*e^3 - e^2 + 45*e + 28, 0, 0, 33*e^3 + 10*e^2 - 354*e - 193, 0, 13*e^3 + 4*e^2 - 141*e - 49, 21*e^3 + 10*e^2 - 234*e - 145, 0, 34*e^3 + 14*e^2 - 369*e - 218, 14*e^3 + 2*e^2 - 144*e - 47, 27*e^3 + 11*e^2 - 291*e - 194, -36*e^3 - 11*e^2 + 390*e + 194, 0, 0, -32*e^3 - 17*e^2 + 348*e + 236, 8*e^3 + e^2 - 90*e - 40, 0, 0, -3*e^3 + 4*e^2 + 33*e - 7, -e^3 + 5*e^2 + 3*e - 38, -8*e^3 - 7*e^2 + 96*e + 94, 21*e^3 + 4*e^2 - 231*e - 94, 9*e + 4, -4*e^2 + 12*e + 40, 48*e^3 + 21*e^2 - 522*e - 316, 0, -27*e^3 - 13*e^2 + 285*e + 202, 0, 0, 0, 0, -39*e^3 - 8*e^2 + 414*e + 197, -24*e^3 - 9*e^2 + 258*e + 148, -9*e^3 - 6*e^2 + 90*e + 89, 5*e^3 + 7*e^2 - 63*e - 70, 0, 0, 0, 0, 0, -3*e^3 + 39*e + 16, -33*e^3 - 12*e^2 + 351*e + 205, 0, 0, 0, 0, 27*e^3 + 16*e^2 - 291*e - 214, 0, 0, 0, 3*e^3 + 9*e^2 - 33*e - 64, 14*e^3 + 2*e^2 - 159*e - 50, -6*e^3 + 6*e^2 + 63*e - 10, 0, 0, 0, 0, -56*e^3 - 17*e^2 + 600*e + 320, 13*e^3 - 2*e^2 - 138*e - 49, 0, 0, 0, 8*e^3 + 5*e^2 - 78*e - 92, 43*e^3 + 20*e^2 - 462*e - 317, 9*e^3 + 3*e^2 - 99*e - 74, -7*e^3 - 8*e^2 + 87*e + 101, -15*e^3 - 12*e^2 + 165*e + 127, 0, 0, 0, 0, 0, 0, 0, 39*e^3 + 21*e^2 - 429*e - 302, -2*e^3 - 2*e^2 + 24*e + 29, -48*e^3 - 15*e^2 + 516*e + 256, 56*e^3 + 20*e^2 - 612*e - 320, 9*e^3 - 81*e - 26, 39*e^3 + 21*e^2 - 429*e - 286, 51*e^3 + 19*e^2 - 555*e - 286, 7*e^3 + 7*e^2 - 75*e - 100, 0, 0, -56*e^3 - 20*e^2 + 603*e + 326, 0, 0, 0, 57*e^3 + 23*e^2 - 615*e - 380, 72*e^3 + 22*e^2 - 768*e - 415, -66*e^3 - 22*e^2 + 711*e + 376, 0, 0, -74*e^3 - 22*e^2 + 786*e + 433, 0, 0, -27*e^3 - 12*e^2 + 279*e + 209, 7*e^3 + 8*e^2 - 78*e - 83, 0, 0, 0, 0, 0, 0, 0, 34*e^3 + 14*e^2 - 351*e - 242, 29*e^3 + 14*e^2 - 321*e - 227, 36*e^3 + 12*e^2 - 378*e - 239, -7*e^3 - 7*e^2 + 87*e + 106, 0, 0, 0, 0, -2*e^3 + 8*e^2 + 24*e - 47, -5*e^3 - 4*e^2 + 63*e + 19]; 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;