/* 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 - 66*x^2 + 900; K := NumberField(heckePol); heckeEigenvaluesArray := [3, 2, -1, 0, 1/45*e^3 - 17/15*e, 1/90*e^3 - 1/15*e, 1/30*e^3 - 11/5*e, e, -1/45*e^3 + 17/15*e, -1/90*e^3 + 1/15*e, -1/45*e^3 + 17/15*e, -1/90*e^3 + 1/15*e, 1/3*e^2 - 9, -1/3*e^2 + 13, -1/3*e^2 + 13, 1/3*e^2 - 9, 2/3*e^2 - 23, -1/3*e^2 + 17, 1/3*e^2 - 5, -2/3*e^2 + 21, 1/90*e^3 - 31/15*e, -13/90*e^3 + 88/15*e, -2/45*e^3 + 49/15*e, -11/90*e^3 + 56/15*e, -5, 1/5*e^3 - 36/5*e, -2/15*e^3 + 19/5*e, 1/5*e^3 - 36/5*e, -1/6*e^3 + 7*e, 11/90*e^3 - 41/15*e, 8/45*e^3 - 121/15*e, 1/30*e^3 - 6/5*e, 1/30*e^3 - 6/5*e, 2/15*e^3 - 29/5*e, 1/10*e^3 - 13/5*e, -11/45*e^3 + 142/15*e, -2/9*e^3 + 22/3*e, -2/3*e^2 + 21, -e^2 + 39, e^2 - 27, 2/3*e^2 - 23, -1/3*e^2 + 5, 1/3*e^2 - 17, -1/3*e^2 + 33, 1/3*e^2 + 11, 13/45*e^3 - 146/15*e, -4/45*e^3 + 83/15*e, -1/90*e^3 - 29/15*e, 14/45*e^3 - 178/15*e, -4/3*e^2 + 35, 1/3*e^2 + 1, -1/3*e^2 + 23, 4/3*e^2 - 53, 2/3*e^2 - 16, 5/3*e^2 - 56, -5/3*e^2 + 54, -2/3*e^2 + 28, 2/3*e^2 - 5, -2/3*e^2 + 39, -2/3*e^2 + 39, 2/3*e^2 - 5, 1/30*e^3 - 6/5*e, -7/90*e^3 + 37/15*e, -4/45*e^3 + 53/15*e, 1/30*e^3 - 6/5*e, 7/18*e^3 - 40/3*e, -4*e, 37/90*e^3 - 232/15*e, -2/15*e^3 + 44/5*e, -4/3*e^2 + 28, 7/3*e^2 - 72, -7/3*e^2 + 82, 4/3*e^2 - 60, 2/15*e^3 - 4/5*e, 4/15*e^3 - 68/5*e, 4/45*e^3 - 53/15*e, 7/90*e^3 - 37/15*e, -5/3*e^2 + 62, 2*e^2 - 66, 5/3*e^2 - 48, -2*e^2 + 66, -1/15*e^3 + 7/5*e, -5*e, -1/10*e^3 + 23/5*e, -1/6*e^3 + 11*e, -29/90*e^3 + 134/15*e, -37/90*e^3 + 262/15*e, -16/45*e^3 + 182/15*e, -17/45*e^3 + 214/15*e, -e^2 + 33, -2*e^2 + 73, e^2 - 33, 2*e^2 - 59, -2/45*e^3 - 56/15*e, -2/9*e^3 + 40/3*e, -1/30*e^3 - 24/5*e, -7/30*e^3 + 72/5*e, -1/3*e^2 - 13, 5/3*e^2 - 51, 1/3*e^2 - 35, -5/3*e^2 + 59, -e^2 + 25, -8/3*e^2 + 87, 8/3*e^2 - 89, e^2 - 41, -7/30*e^3 + 32/5*e, -3/10*e^3 + 64/5*e, 29/90*e^3 - 179/15*e, 14/45*e^3 - 163/15*e, -2*e^2 + 59, 4/3*e^2 - 37, 2*e^2 - 73, -4/3*e^2 + 51, -8/3*e^2 + 95, -5/3*e^2 + 41, 8/3*e^2 - 81, 5/3*e^2 - 69, -7/90*e^3 + 37/15*e, 4/45*e^3 - 98/15*e, -1/45*e^3 + 62/15*e, -4/45*e^3 + 53/15*e, -29, -29, 4/3*e^2 - 73, -4/3*e^2 + 15, -1/6*e^3 + 10*e, -1/30*e^3 - 14/5*e, -1/15*e^3 + 2/5*e, -2/15*e^3 + 34/5*e, -2/45*e^3 + 109/15*e, 14/45*e^3 - 193/15*e, 23/90*e^3 - 113/15*e, 13/90*e^3 - 163/15*e, -e^2 + 21, e^2 - 45, 5/3*e^2 - 67, -5/3*e^2 + 43, 1/3*e^2 - 32, -1/3*e^2 - 10, e^2 - 40, -e^2 + 26, -1/3*e^3 + 10*e, 1/30*e^3 - 21/5*e, -2/5*e^3 + 82/5*e, -1/15*e^3 + 27/5*e, 21, 21, -4/3*e^2 + 65, 4/3*e^2 - 23, -8/3*e^2 + 100, 2*e^2 - 68, -2*e^2 + 64, 8/3*e^2 - 76]; 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;