/* 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^3 + x^2 - 6*x - 3; K := NumberField(heckePol); heckeEigenvaluesArray := [e, 3, e - 1, 3, -e^2 + e + 5, -e^2 - 2*e + 5, -1, -3*e, e - 4, 3, -e^2 + 3*e + 9, e^2 - 3, 3*e^2 + 3*e - 12, 2*e^2 + 3*e - 9, -3*e^2 + 15, -1, 3, 2*e^2 - 2*e - 16, -5*e + 5, -3*e^2 - 2*e + 14, 2*e^2 - 3*e - 22, -e^2 - 6, -4*e^2 - 3*e + 18, -e^2 - 3*e + 12, -2*e^2 + 3, -2*e^2 - 8*e + 8, e^2 + 6*e + 2, e^2 + 3*e, 2*e^2 + 3*e + 3, 5*e^2 - 16, e^2 - 5*e - 13, -e^2 - 2*e + 11, -5*e^2 + 18, e^2 + 3*e - 9, e^2, -e^2 - 5*e + 2, e^2 - 9*e - 9, -7*e^2 - 3*e + 24, -3*e^2 + 4*e + 17, e - 1, e^2 + 3, 3*e^2 + 4*e - 25, -3*e^2 - 2*e + 14, e^2 + 4*e + 5, 3*e^2 - 1, -6*e^2 - 8*e + 20, -e^2 - 2*e + 2, 4*e^2 + 7*e - 10, 4*e^2 - 3*e - 15, -2*e^2 - 3*e - 6, 4*e^2 - 3*e - 24, 2*e^2 + 3, 3*e^2 - 6*e - 18, -e^2 - 5*e + 5, -4*e^2 - 3*e + 12, 3*e^2 - 9*e - 21, -2*e + 23, -e^2 + 9*e + 9, -e^2 + 7*e + 5, 2*e^2 - 5*e - 7, -2*e^2 - 9*e + 6, 4*e^2 - 11*e - 28, 6*e^2 + 4*e - 16, -4*e^2 - 8*e + 23, 5*e^2 + e - 10, -3*e^2 + 24, -e^2 + 3*e - 9, -5*e^2 - 2*e + 17, -8*e^2 - 5*e + 29, -2*e^2 + 3*e + 21, 4*e^2 + 3*e + 9, -2*e^2 + e + 8, -e^2 - 8*e + 11, -5*e^2 - 5*e + 17, -3*e^2 + 4*e + 29, 5*e^2 + 3*e - 10, 6*e^2 + 13*e - 25, 5*e^2 + 3*e - 4, -3*e^2 + 6*e + 6, 5*e^2 - 2*e - 16, 3*e^2 + 6*e, -e^2 + 33, e^2 - 9*e + 3, -7*e^2 - 12*e + 30, e - 13, 2*e^2 + 6*e - 16, 2*e^2 + 3*e - 13, 10*e^2 + 10*e - 37, e^2 - 36, -5*e^2 + 3*e + 21, -6*e - 3, 4*e^2 - 3*e - 12, 3*e^2 + 9*e - 27, 5*e^2 + 3*e - 19, -3*e^2 - 9*e + 32, 11*e^2 + 9*e - 36, -e^2 - 3*e + 21, 10*e^2 + 6*e - 33, 5*e^2 - 9, e - 13, 3*e^2 - 3*e - 6, -2*e^2 + 12*e + 18, -6*e^2 - 3*e + 24, 10*e^2 + 9*e - 28, -e^2 + e + 8, -2*e^2 - 3*e - 10, 3*e^2 + 6*e - 21, 9*e^2 + 6*e - 30, e^2 + 6*e + 3, -8*e^2 + 6*e + 42, -7*e^2 + e + 38, -8*e + 11, -4*e^2 - 3*e + 30, 5*e^2 + 3*e + 12, -6*e^2 - 3*e + 30, 4*e^2 + 13*e - 22, -4*e^2 + 4*e + 11, 9*e^2 - 3*e - 43, e^2 + 7*e + 5, 2*e^2 + 12*e - 13, -8*e^2 + 45, 2*e^2 - 15*e - 18, -10*e^2 - 6*e + 30, -4*e^2 - 6*e - 9, 3*e^2 - 9*e - 21, -9*e^2 - 9*e + 30, 3*e + 30, 6*e^2 + 3*e - 37, 2*e^2 - 2*e - 1, -e^2 - 9*e - 25, -9*e^2 + 4*e + 29, 8*e^2 - 6*e - 43, 4*e^2 + 15*e - 25, -2*e^2 + 10*e + 29, 6*e^2 + e - 19, -3*e^2 + 3*e + 3, -e^2 - 18, -3*e^2 + 4*e + 14, 9*e^2 + 6*e - 21, e^2 - 6*e, -11*e^2 - 3*e + 33, e^2 - 2*e - 46, 3*e^2 - 11*e - 16, e^2 + e - 19, 2*e^2 + 12*e - 9, 6*e^2 - 24, 4*e^2 + 10*e - 4, -13*e^2 - 3*e + 51, 12*e^2 + 12*e - 39, 4*e^2 + 12*e - 19, -8*e^2 + e + 29, e^2 + 3*e - 42, -5*e^2, -2*e^2 - 3*e + 30, -3*e^2 - 3, 3*e^2 - 15*e - 27, 6*e^2 + 3*e - 6, 14*e^2 - 3*e - 66, -7*e^2 - 8*e + 29, 3*e^2 - 17*e - 31, -7*e^2 - 18*e + 35, -10*e^2 + e + 44, -e^2 - 6*e + 42, 13*e^2 + 15*e - 48, 4*e^2 - 6*e - 30, 3*e^2 - 15*e - 9, e^2 + 7*e + 26, -8*e^2 - 11*e + 5]; 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;