/* 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![31, 14, -14, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [5, 5, 4*w^3 + 7*w^2 - 37*w - 45], [11, 11, 2*w^3 + 3*w^2 - 18*w - 16], [11, 11, -w + 2], [16, 2, 2], [19, 19, 4*w^3 + 7*w^2 - 36*w - 45], [19, 19, -w^3 - w^2 + 9*w + 3], [19, 19, -2*w^3 - 4*w^2 + 17*w + 23], [19, 19, w^3 + 2*w^2 - 10*w - 10], [29, 29, -w - 2], [29, 29, -w^3 - 2*w^2 + 8*w + 15], [29, 29, 2*w^3 + 3*w^2 - 18*w - 20], [29, 29, -3*w^3 - 5*w^2 + 27*w + 28], [31, 31, 3*w^3 + 5*w^2 - 27*w - 31], [31, 31, -3*w^3 - 5*w^2 + 27*w + 30], [31, 31, -2*w^3 - 3*w^2 + 18*w + 17], [31, 31, 2*w^3 + 3*w^2 - 18*w - 18], [71, 71, -w^3 - 2*w^2 + 10*w + 8], [71, 71, 4*w^3 + 8*w^2 - 35*w - 50], [71, 71, -4*w^3 - 7*w^2 + 36*w + 47], [71, 71, -w^3 - 2*w^2 + 8*w + 17], [79, 79, w^3 + 2*w^2 - 10*w - 14], [79, 79, -w^3 - w^2 + 9*w + 7], [79, 79, -2*w^3 - 4*w^2 + 17*w + 27], [79, 79, -4*w^3 - 7*w^2 + 36*w + 41], [81, 3, -3], [109, 109, -2*w^3 - 3*w^2 + 19*w + 13], [109, 109, 3*w^3 + 5*w^2 - 26*w - 26], [109, 109, 2*w^3 + 3*w^2 - 19*w - 22], [109, 109, 3*w^3 + 5*w^2 - 26*w - 35], [139, 139, 4*w^3 + 7*w^2 - 36*w - 40], [139, 139, -w^3 - w^2 + 9*w + 8], [139, 139, -w^3 - 2*w^2 + 10*w + 15], [139, 139, 2*w^3 + 4*w^2 - 17*w - 28], [149, 149, 4*w^3 + 8*w^2 - 35*w - 52], [149, 149, -3*w^3 - 5*w^2 + 26*w + 34], [149, 149, -2*w^3 - 3*w^2 + 19*w + 14], [149, 149, -6*w^3 - 11*w^2 + 54*w + 66], [181, 181, w^3 + 2*w^2 - 11*w - 13], [181, 181, -3*w^3 - 4*w^2 + 27*w + 24], [181, 181, -7*w^3 - 12*w^2 + 63*w + 72], [181, 181, 3*w^3 + 6*w^2 - 25*w - 39], [191, 191, -7*w^3 - 12*w^2 + 66*w + 80], [191, 191, 5*w^3 + 9*w^2 - 47*w - 57], [191, 191, -2*w^3 - 2*w^2 + 18*w + 9], [191, 191, 2*w^3 + 2*w^2 - 17*w - 13], [239, 239, 7*w^3 + 13*w^2 - 62*w - 81], [239, 239, -2*w^3 - 5*w^2 + 17*w + 32], [239, 239, 6*w^3 + 11*w^2 - 55*w - 67], [239, 239, -w^3 - 3*w^2 + 10*w + 20], [251, 251, 7*w^3 + 13*w^2 - 63*w - 82], [251, 251, -5*w^3 - 10*w^2 + 44*w + 61], [251, 251, 4*w^3 + 8*w^2 - 37*w - 48], [251, 251, -2*w^3 - 5*w^2 + 18*w + 34], [311, 311, 5*w^3 + 9*w^2 - 44*w - 50], [311, 311, -4*w^3 - 7*w^2 + 37*w + 48], [311, 311, 2*w^3 + 4*w^2 - 19*w - 19], [311, 311, w^3 + w^2 - 8*w - 11], [331, 331, 4*w^3 + 6*w^2 - 36*w - 37], [331, 331, -6*w^3 - 10*w^2 + 54*w + 59], [331, 331, -2*w - 1], [331, 331, -2*w^3 - 4*w^2 + 16*w + 27], [349, 349, -3*w^3 - 5*w^2 + 28*w + 27], [349, 349, 4*w^3 + 8*w^2 - 35*w - 53], [349, 349, -3*w^3 - 6*w^2 + 28*w + 40], [349, 349, 6*w^3 + 11*w^2 - 54*w - 65], [359, 359, -w^3 - 3*w^2 + 8*w + 19], [359, 359, -6*w^3 - 11*w^2 + 53*w + 69], [359, 359, 5*w^3 + 9*w^2 - 46*w - 54], [359, 359, w^2 - w - 8], [401, 401, 5*w^3 + 8*w^2 - 45*w - 50], [401, 401, w^3 + 2*w^2 - 7*w - 15], [401, 401, w^3 + 2*w^2 - 7*w - 11], [401, 401, 5*w^3 + 8*w^2 - 45*w - 46], [409, 409, -9*w^3 - 16*w^2 + 81*w + 97], [409, 409, w^3 + w^2 - 11*w - 10], [409, 409, 6*w^3 + 10*w^2 - 53*w - 66], [409, 409, -3*w^3 - 6*w^2 + 29*w + 38], [421, 421, -3*w^3 - 4*w^2 + 26*w + 23], [421, 421, -4*w^3 - 6*w^2 + 35*w + 39], [421, 421, 8*w^3 + 14*w^2 - 71*w - 86], [421, 421, -7*w^3 - 12*w^2 + 62*w + 70], [439, 439, w^3 + w^2 - 10*w - 9], [439, 439, -4*w^3 - 7*w^2 + 35*w + 47], [439, 439, 3*w^3 + 5*w^2 - 28*w - 26], [439, 439, 2*w^3 + 3*w^2 - 17*w - 14], [479, 479, 3*w^3 + 6*w^2 - 29*w - 33], [479, 479, 5*w^3 + 10*w^2 - 43*w - 59], [479, 479, w^3 - 9*w + 6], [479, 479, 9*w^3 + 16*w^2 - 81*w - 102], [521, 521, 4*w^3 + 7*w^2 - 38*w - 44], [521, 521, 3*w^3 + 4*w^2 - 26*w - 25], [521, 521, 5*w^3 + 8*w^2 - 44*w - 46], [521, 521, -8*w^3 - 14*w^2 + 71*w + 84], [569, 569, 21*w^3 + 37*w^2 - 191*w - 236], [569, 569, -13*w^3 - 23*w^2 + 120*w + 149], [569, 569, 10*w^3 + 17*w^2 - 92*w - 111], [569, 569, -18*w^3 - 32*w^2 + 164*w + 201], [631, 631, -2*w^3 - 3*w^2 + 20*w + 25], [631, 631, 7*w^3 + 12*w^2 - 64*w - 80], [631, 631, -9*w^3 - 17*w^2 + 80*w + 106], [631, 631, 19*w^3 + 33*w^2 - 175*w - 215], [641, 641, 4*w^3 + 6*w^2 - 35*w - 35], [641, 641, 4*w^3 + 6*w^2 - 35*w - 38], [641, 641, 7*w^3 + 12*w^2 - 62*w - 71], [641, 641, 7*w^3 + 12*w^2 - 62*w - 74], [659, 659, 6*w^3 + 11*w^2 - 54*w - 63], [659, 659, 4*w^3 + 6*w^2 - 37*w - 38], [659, 659, 4*w^3 + 8*w^2 - 35*w - 55], [659, 659, 3*w^3 + 6*w^2 - 28*w - 42], [661, 661, -27*w^3 - 48*w^2 + 247*w + 306], [661, 661, 14*w^3 + 24*w^2 - 129*w - 158], [661, 661, 11*w^3 + 19*w^2 - 102*w - 126], [661, 661, 2*w^3 + 3*w^2 - 19*w - 24], [691, 691, 6*w^3 + 12*w^2 - 53*w - 73], [691, 691, 8*w^3 + 15*w^2 - 72*w - 95], [691, 691, -5*w^3 - 10*w^2 + 46*w + 60], [691, 691, -3*w^3 - 7*w^2 + 27*w + 47], [739, 739, -2*w^3 - 5*w^2 + 19*w + 34], [739, 739, 7*w^3 + 13*w^2 - 64*w - 78], [739, 739, -3*w^3 - 7*w^2 + 26*w + 43], [739, 739, 8*w^3 + 15*w^2 - 71*w - 95], [751, 751, -4*w^3 - 9*w^2 + 37*w + 59], [751, 751, -5*w^3 - 9*w^2 + 43*w + 48], [751, 751, -6*w^3 - 10*w^2 + 55*w + 68], [751, 751, -10*w^3 - 17*w^2 + 93*w + 114], [769, 769, 6*w^3 + 11*w^2 - 52*w - 69], [769, 769, w^3 + w^2 - 7*w - 5], [769, 769, 2*w^3 + 2*w^2 - 19*w - 11], [769, 769, 7*w^3 + 12*w^2 - 64*w - 72], [809, 809, -3*w^3 - 4*w^2 + 29*w + 17], [809, 809, -5*w^3 - 8*w^2 + 43*w + 54], [809, 809, w^3 - 9*w + 9], [809, 809, 10*w^3 + 18*w^2 - 90*w - 109], [881, 881, -10*w^3 - 17*w^2 + 92*w + 113], [881, 881, -6*w^3 - 10*w^2 + 56*w + 69], [881, 881, -31*w^3 - 55*w^2 + 283*w + 350], [881, 881, -11*w^3 - 19*w^2 + 101*w + 125], [911, 911, 5*w^3 + 8*w^2 - 44*w - 49], [911, 911, -6*w^3 - 10*w^2 + 53*w + 60], [911, 911, 5*w^3 + 8*w^2 - 44*w - 48], [911, 911, 6*w^3 + 10*w^2 - 53*w - 61], [919, 919, 4*w^3 + 7*w^2 - 37*w - 38], [919, 919, 5*w^3 + 9*w^2 - 44*w - 60], [919, 919, 8*w^3 + 14*w^2 - 73*w - 85], [919, 919, -7*w^3 - 13*w^2 + 61*w + 81], [971, 971, 28*w^3 + 49*w^2 - 255*w - 312], [971, 971, 16*w^3 + 28*w^2 - 145*w - 176], [971, 971, -25*w^3 - 44*w^2 + 227*w + 278], [971, 971, 15*w^3 + 26*w^2 - 136*w - 165], [991, 991, 5*w^3 + 10*w^2 - 42*w - 64], [991, 991, -4*w^3 - 5*w^2 + 36*w + 29], [991, 991, -11*w^3 - 19*w^2 + 99*w + 115], [991, 991, 10*w^3 + 17*w^2 - 90*w - 108]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 10*x^2 + 8; K := NumberField(heckePol); heckeEigenvaluesArray := [0, e, 1/2*e^3 - 3*e, -e^2 + 7, 1, e^2 - 8, -2*e, -1/2*e^3 + 4*e, e^2 - 8, -e^2, -1/2*e^3 + 4*e, 1/2*e^3 - 8*e, 1/2*e^3 - 5*e, -3/2*e^3 + 13*e, -1/2*e^3 + 7*e, e^3 - 9*e, e^2 - 4, e^2 - 4, -e^2 + 4, -8, e^2 - 16, 1/2*e^3 - 4*e, -2*e^2 + 4, 1/2*e^3 - 4*e, -2*e^2 + 10, -3/2*e^3 + 10*e, 3*e^2 - 20, -5/2*e^3 + 22*e, -e^2 + 12, 3*e^3 - 24*e, -e^3 + 8*e, 8, 2*e^2 - 16, 4*e^2 - 24, -e^2 + 4, 3/2*e^3 - 14*e, -2*e^3 + 20*e, -3*e^3 + 20*e, e^3 - 12*e, -1/2*e^3 + 6*e, 0, -3*e^3 + 25*e, -1/2*e^3 + 3*e, e^3 - 13*e, 5/2*e^3 - 23*e, -e^2 - 16, 2*e^3 - 10*e, 7/2*e^3 - 28*e, -2*e^2 + 12, -5*e^2 + 32, -28, 4*e^2 - 12, -12, -16, -16, -e^2 + 28, 0, -1/2*e^3 - 3*e, 2*e^3 - 9*e, 3*e^3 - 31*e, -e^3 + 17*e, -3*e^3 + 34*e, -e^2, 3*e^2 - 16, 3*e^3 - 22*e, -6*e, -4*e^2 + 12, -2*e^3 + 18*e, -2*e^2 - 12, 3/2*e^3 - 16*e, -9/2*e^3 + 44*e, -4*e^3 + 38*e, 3/2*e^3 - 16*e, 1/2*e^3 - 14*e, -1/2*e^3 + 14*e, 7*e^2 - 36, 2*e^2 - 8, e^3, 5/2*e^3 - 26*e, -4*e, -2*e^3 + 12*e, -1/2*e^3 + 2*e, -6*e^2 + 16, -4*e^3 + 44*e, 2*e^2 - 16, -2*e^3 + 18*e, -2*e^3 + 18*e, -3*e^2 + 16, e^2, -3/2*e^3, -3/2*e^3 + 12*e, 7*e^3 - 54*e, 5/2*e^3 - 36*e, -6*e^2 + 24, 6*e^2 - 24, 4*e^3 - 32*e, -7/2*e^3 + 18*e, 8*e^2 - 32, -e^2 - 4, -3*e^2 + 36, 4*e^2, -1/2*e^3 - 4*e, 4*e^3 - 30*e, -5/2*e^3 + 16*e, 15/2*e^3 - 52*e, 7/2*e^3 - 22*e, -3*e^3 + 40*e, -e^2 + 20, e^2 - 4, 9*e^2 - 50, -e^2 + 38, 10, 2*e^2 - 46, -4*e^2 + 12, -8*e^2 + 44, -4*e^2 - 4, 2*e^2 + 4, -3*e^2 - 20, 3/2*e^3 + 2*e, -2*e^3 + 12*e, -2*e^2 + 16, 4*e^2 - 32, -4*e^2 - 16, 8*e^2 - 32, -4*e^2 + 16, 3*e^2 - 8, 11*e^2 - 56, 13/2*e^3 - 52*e, -3*e^3 + 38*e, 6*e, 8*e^2 - 28, -e^2 - 32, 7*e^3 - 62*e, 2, 2*e^2 - 22, -30, -9*e^2 + 62, -5/2*e^3 + 41*e, 1/2*e^3 + 5*e, 3/2*e^3 - 17*e, -5*e^3 + 37*e, 8*e^3 - 68*e, -4*e^2 + 56, -17/2*e^3 + 66*e, -9*e^2 + 68, 2*e^3 - 7*e, -3*e^3 + 37*e, 17/2*e^3 - 67*e, 2*e^3 - 29*e, -4*e^3 + 47*e, -6*e^3 + 61*e, -4*e^3 + 21*e, -5/2*e^3 + 37*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;