/* 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, 2, -5, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [3, 3, w], [4, 2, -w^3 + 3*w^2 + w - 2], [11, 11, -w^3 + 3*w^2 + 2*w - 5], [13, 13, w^3 - 2*w^2 - 4*w + 2], [13, 13, -w + 2], [17, 17, w^3 - 3*w^2 - 2*w + 2], [19, 19, -w^2 + w + 4], [19, 19, w^3 - 2*w^2 - 3*w + 2], [23, 23, w^2 - 2*w - 1], [27, 3, w^3 - 2*w^2 - 5*w - 1], [29, 29, -w^3 + 2*w^2 + 5*w - 1], [37, 37, -w^3 + 2*w^2 + 5*w - 4], [41, 41, 2*w^3 - 5*w^2 - 6*w + 4], [53, 53, w^3 - 2*w^2 - 3*w - 2], [59, 59, w - 4], [67, 67, 2*w^2 - 3*w - 8], [73, 73, 2*w^3 - 5*w^2 - 6*w + 5], [89, 89, -2*w^3 + 6*w^2 + 5*w - 7], [97, 97, -2*w^3 + 6*w^2 + 3*w - 7], [97, 97, -w^3 + 3*w^2 + 3*w - 1], [103, 103, w^2 - 4*w - 4], [113, 113, 2*w^3 - 5*w^2 - 4*w + 1], [113, 113, -w^3 + 3*w^2 + w - 5], [139, 139, 2*w^2 - 3*w - 4], [139, 139, w^3 - w^2 - 6*w - 1], [149, 149, 2*w^3 - 5*w^2 - 5*w + 2], [149, 149, w^3 - 4*w^2 + 10], [151, 151, -3*w - 1], [157, 157, w^2 - w - 8], [157, 157, w^3 - 7*w - 8], [163, 163, -3*w^3 + 8*w^2 + 8*w - 10], [163, 163, w^3 - 3*w^2 - 4*w + 7], [163, 163, -w^3 + 4*w^2 + w - 8], [163, 163, -2*w^3 + 5*w^2 + 7*w - 4], [167, 167, -2*w^3 + 5*w^2 + 8*w - 4], [169, 13, -2*w^3 + 4*w^2 + 7*w - 5], [173, 173, 2*w^3 - 4*w^2 - 9*w + 4], [173, 173, -w^3 + 5*w^2 - 2*w - 5], [181, 181, 3*w^3 - 7*w^2 - 12*w + 7], [191, 191, w^3 - 3*w^2 - 3*w - 1], [199, 199, 2*w^3 - 3*w^2 - 10*w - 1], [199, 199, 2*w^3 - 6*w^2 - 6*w + 13], [223, 223, -2*w^3 + 6*w^2 + 4*w - 11], [223, 223, 3*w^3 - 7*w^2 - 12*w + 8], [223, 223, -2*w^3 + 5*w^2 + 6*w - 1], [229, 229, -w^3 + 3*w^2 + 2*w + 1], [229, 229, 3*w^3 - 4*w^2 - 15*w - 5], [233, 233, -3*w^3 + 7*w^2 + 11*w - 5], [233, 233, 2*w^3 - 5*w^2 - 4*w + 5], [241, 241, w^3 - 3*w^2 - 5*w + 7], [257, 257, w^3 - 3*w^2 - 4*w + 8], [263, 263, w^2 - 4*w - 5], [271, 271, -2*w^3 + 6*w^2 + 5*w - 13], [277, 277, -2*w^3 + 6*w^2 + 3*w - 8], [277, 277, w^3 - 2*w^2 - 2*w - 2], [281, 281, 2*w^3 - 5*w^2 - 4*w + 2], [283, 283, -3*w^2 + 7*w + 10], [283, 283, -w^3 + 4*w^2 - w - 7], [293, 293, 2*w^3 - 5*w^2 - 3*w + 4], [293, 293, w^3 - 8*w - 4], [307, 307, -w^3 + 2*w^2 + 6*w - 2], [311, 311, w^2 - 5], [317, 317, -w^3 + 5*w^2 - 2*w - 11], [331, 331, -w^3 + 3*w^2 - 5], [349, 349, -2*w^2 + 5*w + 2], [353, 353, -2*w^3 + 5*w^2 + 4*w - 4], [353, 353, 3*w^3 - 7*w^2 - 10*w + 2], [353, 353, -2*w^3 + 7*w^2 + 2*w - 10], [353, 353, w^3 + w^2 - 9*w - 13], [361, 19, -w^3 + w^2 + 5*w - 1], [373, 373, -w^3 + 3*w^2 + 4*w - 11], [373, 373, 2*w^3 - 5*w^2 - 5*w - 2], [383, 383, w^3 - 5*w^2 + w + 13], [389, 389, 3*w^3 - 10*w^2 - 4*w + 16], [397, 397, -w^3 + 2*w^2 + 3*w + 5], [397, 397, -3*w^3 + 7*w^2 + 10*w - 7], [419, 419, -w^3 + 2*w^2 + 4*w + 4], [419, 419, 3*w^3 - 7*w^2 - 12*w + 5], [421, 421, -w^2 + 5*w - 2], [421, 421, 3*w^3 - 7*w^2 - 10*w + 5], [431, 431, w^2 - 10], [439, 439, w^3 - w^2 - 7*w - 7], [461, 461, -2*w^3 + 7*w^2 + 5*w - 10], [467, 467, -3*w^3 + 6*w^2 + 14*w - 4], [479, 479, 3*w^2 - 6*w - 5], [479, 479, -4*w^3 + 11*w^2 + 10*w - 10], [491, 491, -w^3 + w^2 + 6*w - 1], [499, 499, -4*w^3 + 9*w^2 + 15*w - 10], [499, 499, 2*w^3 - 5*w^2 - 7*w + 2], [503, 503, -2*w^3 + 7*w^2 - 8], [521, 521, 2*w^2 - w - 7], [521, 521, -3*w^3 + 7*w^2 + 11*w - 11], [569, 569, 2*w^2 - 5*w - 1], [569, 569, -4*w - 1], [571, 571, -w^3 + 3*w^2 - 7], [577, 577, -w^3 + w^2 + 8*w - 4], [587, 587, -3*w^3 + 8*w^2 + 7*w - 8], [593, 593, 3*w^2 - 4*w - 11], [593, 593, -3*w^3 + 9*w^2 + 6*w - 14], [601, 601, -3*w^3 + 9*w^2 + 4*w - 10], [601, 601, 5*w^3 - 9*w^2 - 24*w - 2], [607, 607, 2*w^2 - 7*w - 5], [613, 613, w^3 - 6*w - 2], [613, 613, -w^2 + 3*w + 8], [617, 617, -w^2 + 4*w - 5], [619, 619, 3*w^3 - 6*w^2 - 13*w + 5], [625, 5, -5], [631, 631, -2*w^3 + 4*w^2 + 8*w - 7], [647, 647, -2*w^3 + 4*w^2 + 5*w - 1], [647, 647, w^3 - 3*w^2 - 2*w - 2], [653, 653, w^3 - 4*w^2 - w + 13], [653, 653, w^3 - 2*w^2 - 7*w + 5], [659, 659, -4*w^3 + 10*w^2 + 15*w - 14], [659, 659, 5*w^3 - 12*w^2 - 17*w + 14], [661, 661, w^2 - 5*w - 2], [661, 661, -w^3 + 5*w^2 - 2*w - 7], [673, 673, -w^3 + w^2 + 6*w - 2], [683, 683, 2*w^3 - 8*w^2 + w + 8], [683, 683, 5*w^3 - 12*w^2 - 19*w + 14], [701, 701, -2*w^3 + 6*w^2 + 5*w - 4], [709, 709, -w^2 + 3*w - 4], [709, 709, -2*w^3 + 5*w^2 + 9*w - 8], [719, 719, w^2 - 7], [719, 719, -2*w^3 + 3*w^2 + 8*w + 5], [733, 733, -2*w^3 + 7*w^2 + 3*w - 10], [739, 739, 4*w^3 - 11*w^2 - 13*w + 14], [739, 739, -5*w^3 + 10*w^2 + 21*w - 4], [739, 739, 3*w^3 - 8*w^2 - 6*w + 8], [739, 739, -w^3 + w^2 + 8*w - 5], [743, 743, -w - 5], [743, 743, w^3 - w^2 - 8*w - 8], [751, 751, -2*w^3 + 5*w^2 + 8*w - 2], [751, 751, -2*w^3 + 6*w^2 - 1], [757, 757, -2*w^3 + 6*w^2 + 3*w - 10], [757, 757, 5*w^2 - 9*w - 22], [761, 761, -2*w^3 + 4*w^2 + 9*w - 7], [761, 761, 2*w^3 - 3*w^2 - 12*w - 1], [769, 769, 5*w^3 - 13*w^2 - 14*w + 10], [773, 773, -3*w^3 + 5*w^2 + 16*w + 1], [773, 773, w^3 - 11*w + 2], [787, 787, -w^3 + 4*w^2 - w - 11], [797, 797, -5*w^3 + 12*w^2 + 17*w - 11], [809, 809, -2*w^3 + 7*w^2 + 4*w - 11], [809, 809, 4*w^3 - 9*w^2 - 14*w + 4], [821, 821, -w^3 + 5*w^2 - 2*w - 17], [827, 827, -3*w^3 + 8*w^2 + 9*w - 7], [829, 829, 2*w^3 - 6*w^2 - 5*w + 2], [829, 829, -w^3 + 4*w^2 - w - 10], [839, 839, w^2 - 8], [853, 853, -5*w^3 + 12*w^2 + 18*w - 16], [853, 853, w^3 - 6*w - 8], [863, 863, 5*w^3 - 11*w^2 - 19*w + 7], [881, 881, -3*w^3 + 9*w^2 + 9*w - 11], [907, 907, -w^3 + 2*w^2 + 7*w - 4], [907, 907, -2*w^3 + 3*w^2 + 7*w + 4], [929, 929, -w^3 + 5*w^2 - 3*w - 11], [937, 937, 2*w^3 - 5*w^2 - 6*w + 11], [937, 937, -2*w^3 + 6*w^2 + 3*w - 11], [941, 941, -3*w^3 + 8*w^2 + 11*w - 8], [953, 953, -4*w^3 + 10*w^2 + 10*w - 13], [953, 953, w^3 - 5*w^2 - w + 13], [967, 967, 3*w^3 - 7*w^2 - 9*w + 7], [967, 967, -2*w^3 + 5*w^2 + 8*w + 1], [967, 967, 4*w^3 - 13*w^2 - 6*w + 20], [967, 967, -2*w^2 + 3*w + 13], [971, 971, -6*w^3 + 13*w^2 + 25*w - 8], [977, 977, w^3 - w^2 - 4*w - 10], [977, 977, 2*w^3 - 6*w^2 - 7*w + 13], [983, 983, -4*w^3 + 10*w^2 + 11*w - 13], [983, 983, -w^3 + 5*w^2 - w - 7], [983, 983, 3*w^3 - 9*w^2 - 7*w + 19], [983, 983, -2*w^3 + 3*w^2 + 10*w - 1], [997, 997, 5*w^3 - 12*w^2 - 17*w + 13], [997, 997, -2*w^3 + 3*w^2 + 13*w - 4], [997, 997, w^3 - 7*w - 2], [997, 997, w^3 - 9*w - 2]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 17*x^2 + 36; K := NumberField(heckePol); heckeEigenvaluesArray := [0, e, -1, 1/3*e^3 - 14/3*e, -4, 1/3*e^3 - 11/3*e, 4, 2*e, 1/3*e^3 - 14/3*e, -1/3*e^3 + 14/3*e, 2/3*e^3 - 22/3*e, -2*e, -e, -2*e^2 + 16, -2*e^2 + 16, -e^2 + 4, -1/3*e^3 + 23/3*e, -e^3 + 13*e, -e^2 + 18, 1/3*e^3 - 5/3*e, -e^2 + 8, 1/3*e^3 + 1/3*e, -e^2 + 2, e^2 - 4, -1/3*e^3 + 26/3*e, 0, 2*e^2 - 16, -2/3*e^3 + 22/3*e, 0, e^2 - 8, 0, -4, -e^2 + 20, -1/3*e^3 + 8/3*e, -2/3*e^3 + 16/3*e, 2/3*e^3 - 25/3*e, -2/3*e^3 + 22/3*e, e^2, 2*e, -3*e^2 + 24, e^3 - 14*e, e^2 + 8, -20, -e^3 + 14*e, -2/3*e^3 + 40/3*e, e^2 - 4, 2/3*e^3 - 16/3*e, -2/3*e^3 + 13/3*e, -1/3*e^3 + 35/3*e, -e^2 - 10, e^2 - 6, e^2 - 8, -2*e^2 + 16, -4, 2*e^2 - 28, 5/3*e^3 - 73/3*e, -2*e^2 + 28, e^2 - 20, 1/3*e^3 - 38/3*e, 5/3*e^3 - 52/3*e, -4/3*e^3 + 44/3*e, e^2 + 16, e^2 + 12, 3*e^2 - 32, -2*e^3 + 22*e, 5/3*e^3 - 67/3*e, 1/3*e^3 - 5/3*e, 30, 2*e^2 - 22, -2/3*e^3 + 43/3*e, e^2 - 16, -2*e^2 + 36, 16, -4*e^2 + 40, -2*e^2 + 24, -4*e, -3*e^2 + 28, -1/3*e^3 + 38/3*e, 2/3*e^3 - 52/3*e, -e^3 + 8*e, -4*e^2 + 44, -e^2, 2*e^2 - 36, 5/3*e^3 - 76/3*e, 2*e^3 - 24*e, e^3 - 6*e, -4/3*e^3 + 68/3*e, -2*e^3 + 18*e, 0, -3*e^2, -2*e^2 + 6, -2*e^3 + 21*e, -3*e, -5/3*e^3 + 55/3*e, -4*e^2 + 48, -2/3*e^3 + 25/3*e, 4/3*e^3 - 62/3*e, -4*e^2 + 22, 4*e^2 - 30, e^2 - 10, 1/3*e^3 - 35/3*e, e^3 - 10*e, -e^3 + 14*e, e^2 - 48, 2*e^2 + 6, 1/3*e^3 - 38/3*e, -3*e^2 + 14, -4*e, 2*e^3 - 18*e, 4*e^2 - 40, 7*e^2 - 68, -4/3*e^3 + 38/3*e, 4/3*e^3 - 56/3*e, 4/3*e^3 - 26/3*e, 2*e^3 - 24*e, -6*e^2 + 52, 1/3*e^3 - 5/3*e, 3*e^2, 2/3*e^3 - 46/3*e, -2*e^3 + 32*e, -8*e^2 + 68, 6*e, 3*e^2 - 32, -6*e^2 + 48, 2*e^2 - 20, -2*e^3 + 26*e, 5/3*e^3 - 46/3*e, -2*e^3 + 34*e, 2*e^3 - 16*e, -3*e^2 + 48, -16, -8*e, -2*e^2 + 32, -5*e^2 + 44, -4*e^2 + 20, -1/3*e^3 + 41/3*e, -5/3*e^3 + 31/3*e, -8/3*e^3 + 91/3*e, -2*e^3 + 38*e, 1/3*e^3 - 20/3*e, -2*e^2 + 32, 5/3*e^3 - 70/3*e, -4*e^2 + 30, -2*e^3 + 27*e, e^2 + 4, -2*e^3 + 36*e, 2*e^3 - 30*e, 20, 4*e^2 - 36, -7/3*e^3 + 80/3*e, 5*e^2 - 44, 2/3*e^3 - 40/3*e, 5/3*e^3 - 109/3*e, -1/3*e^3 - 10/3*e, -2*e^2 + 44, -4*e^2 + 14, -4*e^2 + 34, 8*e^2 - 74, -2*e^3 + 20*e, 2*e^3 - 31*e, 6*e^2 - 54, -4*e, -2*e^3 + 18*e, -3*e^2 + 64, 8, 2*e^3 - 32*e, -2*e^2 + 54, -46, 2*e^3 - 42*e, 2*e^2 - 40, 4*e^2 - 48, -2/3*e^3 + 52/3*e, -6*e, -4/3*e^3 + 68/3*e, -2/3*e^3 + 52/3*e, -12*e]; 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;