/* 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 - 20*x^2 + 20; K := NumberField(heckePol); heckeEigenvaluesArray := [1/8*e^2 - 7/4, 0, -3/8*e^2 + 9/4, e, 1/8*e^2 - 15/4, 1/4*e^2 - 3/2, -e, 1/2*e^3 - 10*e, 1/8*e^2 - 11/4, -1/4*e^3 + 11/2*e, -3/8*e^3 + 17/4*e, 1/2*e^3 - 8*e, -3/8*e^3 + 33/4*e, 1/8*e^3 + 1/4*e, 1/8*e^3 - 19/4*e, -3/8*e^2 - 7/4, -3/4*e^3 + 27/2*e, 7/8*e^2 - 45/4, -1/4*e^2 - 1/2, -3/8*e^2 + 13/4, 1/8*e^2 - 7/4, -1/8*e^3 + 3/4*e, -3/4*e^3 + 25/2*e, 3/4*e^3 - 35/2*e, 1/2*e^3 - 6*e, 13/8*e^2 - 59/4, -1/8*e^2 - 49/4, -3/8*e^3 + 25/4*e, -1/8*e^3 + 23/4*e, -1/8*e^2 - 81/4, 5/8*e^2 + 45/4, -1/2*e^2 + 15, -9/8*e^3 + 79/4*e, 1/8*e^3 - 3/4*e, -1/8*e^3 + 27/4*e, -3/4*e^2 + 21/2, -5/8*e^3 + 51/4*e, 3/4*e^3 - 25/2*e, -9/8*e^2 - 5/4, 3/8*e^2 - 25/4, -3/8*e^3 + 29/4*e, -1/8*e^2 + 63/4, -23/8*e^2 + 121/4, 7/8*e^2 - 53/4, 13/8*e^2 - 47/4, -1/8*e^2 - 13/4, 19/8*e^2 - 117/4, 3/8*e^2 + 11/4, 5/8*e^3 - 59/4*e, 3/4*e^3 - 41/2*e, -11/8*e^3 + 85/4*e, 1/4*e^3 - 1/2*e, 3/8*e^3 - 53/4*e, -13/8*e^2 + 31/4, -e^3 + 16*e, 3/2*e^3 - 25*e, -3/8*e^2 - 43/4, -9/8*e^3 + 59/4*e, 15/8*e^2 - 49/4, -11/8*e^2 + 45/4, 7/8*e^3 - 57/4*e, 7/8*e^2 - 17/4, -3/4*e^2 - 35/2, -7/8*e^2 + 101/4, -11/8*e^2 + 113/4, 6*e, 1/4*e^3 - 23/2*e, -1/8*e^2 - 13/4, 1/8*e^2 - 3/4, 9/8*e^3 - 59/4*e, 2*e^3 - 34*e, -1/8*e^2 + 39/4, 7/8*e^2 - 85/4, 3/8*e^2 - 49/4, -21/8*e^2 + 87/4, 3/8*e^2 - 77/4, e^2 - 32, -9/8*e^2 - 13/4, -1/2*e^3 + 11*e, 1/8*e^2 - 19/4, -3/8*e^3 + 1/4*e, 13/8*e^3 - 115/4*e, -9/8*e^3 + 71/4*e, e^3 - 14*e, 3/8*e^2 - 21/4, -5/8*e^2 - 81/4, -3/8*e^2 - 123/4, 13/8*e^2 - 47/4, 1/8*e^3 + 21/4*e, -1/4*e^3 - 1/2*e, -1/8*e^3 + 15/4*e, 3/8*e^3 - 17/4*e, 1/8*e^3 + 1/4*e, 17/8*e^2 - 115/4, -3/8*e^2 + 5/4, -1/8*e^3 - 9/4*e, -11/8*e^3 + 109/4*e, 5/8*e^3 - 55/4*e, 5/4*e^3 - 61/2*e, -7/8*e^2 - 19/4, -3/2*e^3 + 30*e, -11/8*e^3 + 73/4*e, 1/2*e^3 - 10*e, -13/8*e^2 + 15/4, 17/8*e^2 - 127/4, -7/8*e^2 - 47/4, -3/4*e^3 + 23/2*e, 11/4*e^3 - 91/2*e, -13/8*e^3 + 99/4*e, -11/8*e^3 + 141/4*e, -13/8*e^2 + 31/4, -13/8*e^2 - 21/4, -19/8*e^3 + 161/4*e, -3/4*e^3 + 19/2*e, 13/4*e^3 - 101/2*e, 21/8*e^2 - 111/4, 3/8*e^2 - 53/4, -31/8*e^2 + 173/4, -15/8*e^2 + 113/4, -7/8*e^2 + 1/4, -e^3 + 14*e, e^3 - 9*e, -21/8*e^3 + 175/4*e, 17/8*e^3 - 171/4*e, 5/4*e^3 - 43/2*e, 5/8*e^3 - 39/4*e, -11/4*e^3 + 89/2*e, -7/8*e^2 - 91/4, -11/4*e^2 + 101/2, -17/8*e^2 + 91/4, 19/4*e^2 - 77/2, 19/8*e^2 - 89/4, -25/8*e^2 + 203/4, -17/8*e^2 - 13/4, 1/8*e^2 + 101/4, 9/8*e^3 - 87/4*e, -7/8*e^3 + 89/4*e, -21/8*e^2 + 171/4, 1/2*e^3 - 11*e, -1/8*e^3 + 51/4*e, e^3 - 27*e, -13/8*e^2 + 87/4, 1/4*e^2 + 1/2, -25/8*e^2 + 23/4, 23/8*e^3 - 225/4*e, -7/4*e^3 + 61/2*e, -3*e^2, 15/8*e^3 - 109/4*e, 1/8*e^3 + 9/4*e, -3/8*e^2 + 117/4, -19/8*e^2 + 61/4, -7/8*e^3 + 97/4*e, -23/8*e^3 + 221/4*e, 11/4*e^3 - 83/2*e, 7/8*e^3 - 29/4*e, -3/4*e^3 + 19/2*e, 1/4*e^3 + 1/2*e, -1/8*e^3 - 1/4*e, 5/8*e^2 + 21/4, 13/8*e^2 - 59/4, 9/4*e^2 - 23/2, -29/8*e^2 + 119/4, 3/8*e^3 - 29/4*e, -9/4*e^3 + 67/2*e, 2*e^3 - 34*e, -21/8*e^3 + 163/4*e, -3/4*e^2 + 49/2, 7/8*e^2 + 31/4]; 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;