/* 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![41, 0, -13, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, -w^3 + 2*w^2 + 6*w - 11], [5, 5, -w - 2], [5, 5, -w + 2], [11, 11, -2*w^2 - w + 12], [11, 11, 2*w^2 - w - 12], [19, 19, -w^2 - w + 4], [19, 19, w^2 - w - 4], [29, 29, -w - 1], [29, 29, w - 1], [31, 31, -2*w^2 - w + 14], [31, 31, w^3 - 3*w^2 - 6*w + 19], [31, 31, -w^3 - 3*w^2 + 6*w + 19], [31, 31, -2*w^2 + w + 14], [41, 41, -w], [71, 71, w^3 + 3*w^2 - 7*w - 19], [71, 71, w^3 - 3*w^2 - 7*w + 19], [79, 79, w^3 + 3*w^2 - 9*w - 25], [79, 79, w^3 - 3*w^2 - 9*w + 25], [81, 3, -3], [89, 89, -w^3 - 4*w^2 + 6*w + 24], [89, 89, w^3 - 4*w^2 - 6*w + 24], [101, 101, w^3 - 4*w^2 - 7*w + 26], [101, 101, -w^3 - 4*w^2 + 7*w + 26], [109, 109, -4*w^2 + w + 27], [109, 109, -4*w^2 - w + 27], [121, 11, -3*w^2 + 19], [149, 149, -4*w^2 - w + 25], [149, 149, 4*w^2 - w - 25], [151, 151, -2*w^2 - w + 17], [151, 151, -2*w^2 + w + 17], [179, 179, -w^3 + w^2 + 9*w - 13], [179, 179, -w^3 - w^2 + 9*w + 13], [181, 181, 4*w^2 + w - 26], [181, 181, 4*w^2 - w - 26], [191, 191, -w^2 - 2*w + 11], [191, 191, w^2 - 2*w - 11], [199, 199, -w^3 - 2*w^2 + 5*w + 13], [199, 199, w^3 - 2*w^2 - 5*w + 13], [211, 211, -w^3 + 2*w^2 + 7*w - 11], [211, 211, w^3 + 2*w^2 - 7*w - 11], [229, 229, 2*w^3 + 4*w^2 - 11*w - 18], [229, 229, -2*w^3 - 5*w^2 + 10*w + 23], [239, 239, -w^3 - 5*w^2 + 4*w + 27], [239, 239, -w^3 + 5*w^2 + 4*w - 27], [241, 241, w^3 - 7*w - 5], [241, 241, w^2 - 2*w - 9], [241, 241, w^2 + 2*w - 9], [241, 241, -w^3 + 7*w - 5], [251, 251, w^2 + 2*w - 12], [251, 251, -w^3 - w^2 + 6*w + 11], [251, 251, w^3 - w^2 - 6*w + 11], [251, 251, w^2 - 2*w - 12], [269, 269, -3*w^3 - 10*w^2 + 14*w + 52], [269, 269, 2*w - 3], [269, 269, 2*w + 3], [269, 269, -2*w^2 - 2*w + 11], [281, 281, -4*w^3 - 12*w^2 + 20*w + 63], [281, 281, -w^3 - 4*w^2 + 4*w + 22], [311, 311, -4*w^2 + w + 20], [311, 311, -w^3 - 4*w^2 + 7*w + 24], [331, 331, w^3 - 2*w^2 - 8*w + 12], [331, 331, -w^3 - 2*w^2 + 8*w + 12], [361, 19, 4*w^2 - 27], [379, 379, 3*w^2 + 2*w - 22], [379, 379, -3*w^3 - 5*w^2 + 17*w + 23], [379, 379, 4*w^3 + 11*w^2 - 23*w - 64], [379, 379, 3*w^2 - 2*w - 22], [409, 409, w^3 - 5*w^2 - 6*w + 32], [409, 409, -5*w^2 + w + 34], [409, 409, 5*w^2 + w - 34], [409, 409, -w^3 - 5*w^2 + 6*w + 32], [419, 419, -5*w^2 + 2*w + 30], [419, 419, w^3 - w^2 - 8*w + 4], [419, 419, w^3 + w^2 - 8*w - 4], [419, 419, -5*w^2 - 2*w + 30], [421, 421, 2*w^2 + 2*w - 13], [421, 421, 2*w^2 - 2*w - 13], [431, 431, 3*w^3 + 7*w^2 - 19*w - 45], [431, 431, 3*w^3 + 5*w^2 - 19*w - 27], [431, 431, -3*w^2 - 3*w + 14], [431, 431, w^3 - 3*w^2 - 10*w + 28], [439, 439, 2*w^3 - 4*w^2 - 13*w + 23], [439, 439, -2*w^3 - 4*w^2 + 13*w + 23], [479, 479, -2*w^3 - 4*w^2 + 13*w + 28], [479, 479, 2*w^3 - 4*w^2 - 13*w + 28], [491, 491, 4*w^2 - 2*w - 23], [491, 491, w^3 - 2*w^2 - 6*w + 16], [491, 491, -w^3 - 2*w^2 + 6*w + 16], [491, 491, 4*w^2 + 2*w - 23], [499, 499, -w^3 - w^2 + 4*w + 1], [499, 499, -w^3 + w^2 + 4*w - 1], [509, 509, -2*w^3 + 7*w^2 + 14*w - 49], [509, 509, 2*w^3 + 7*w^2 - 14*w - 49], [521, 521, w^3 + 3*w^2 - 9*w - 21], [521, 521, -w^3 + 3*w^2 + 9*w - 21], [529, 23, -w^3 + 5*w^2 + 7*w - 33], [529, 23, w^3 + 5*w^2 - 7*w - 33], [541, 541, w^3 + w^2 - 9*w - 5], [541, 541, 2*w^3 + 7*w^2 - 12*w - 43], [541, 541, -7*w^3 - 18*w^2 + 38*w + 94], [541, 541, -w^3 + w^2 + 9*w - 5], [569, 569, -3*w^3 + 9*w^2 + 20*w - 58], [569, 569, w^2 + 2*w - 7], [569, 569, w^2 - 2*w - 7], [569, 569, -3*w^3 - 9*w^2 + 20*w + 58], [571, 571, -w^3 + 5*w - 6], [571, 571, w^3 - 5*w - 6], [601, 601, -w^3 + 4*w - 2], [601, 601, w^3 - 4*w - 2], [619, 619, -w^3 + 4*w^2 + 5*w - 26], [619, 619, w^3 + 3*w^2 - 6*w - 22], [619, 619, -w^3 + 3*w^2 + 6*w - 22], [619, 619, w^3 + 4*w^2 - 5*w - 26], [631, 631, w^3 + 4*w^2 - 7*w - 23], [631, 631, -2*w^3 + 3*w^2 + 14*w - 18], [631, 631, 2*w^3 + 3*w^2 - 14*w - 18], [631, 631, -w^3 + 4*w^2 + 7*w - 23], [641, 641, 2*w^3 + 6*w^2 - 8*w - 27], [641, 641, 2*w^3 + 7*w^2 - 13*w - 44], [659, 659, w^3 + 5*w^2 - 6*w - 35], [659, 659, -w^3 + 5*w^2 + 6*w - 35], [661, 661, 2*w^3 - 7*w^2 - 13*w + 46], [661, 661, -3*w^3 + 4*w^2 + 21*w - 26], [661, 661, 3*w^3 + 4*w^2 - 21*w - 26], [661, 661, -2*w^3 - 7*w^2 + 13*w + 46], [691, 691, 2*w^3 + 6*w^2 - 17*w - 48], [691, 691, 2*w^3 - 6*w^2 - 17*w + 48], [701, 701, -2*w^3 - 7*w^2 + 8*w + 34], [701, 701, w^3 - 9*w + 2], [701, 701, -w^3 + 9*w + 2], [701, 701, -w^3 - 6*w^2 + 3*w + 34], [709, 709, 5*w^2 + 3*w - 32], [709, 709, -5*w^2 + 3*w + 32], [719, 719, -2*w^2 - 4*w + 3], [719, 719, 2*w^2 - 4*w - 3], [739, 739, -w^3 + 9*w + 7], [739, 739, -w^3 + 9*w + 6], [739, 739, w^3 - 9*w + 6], [739, 739, -w^3 + 9*w - 7], [751, 751, w^3 + 3*w^2 - 8*w - 18], [751, 751, -w^3 + 3*w^2 + 8*w - 18], [761, 761, -2*w^3 + 5*w^2 + 17*w - 40], [761, 761, 2*w^3 + w^2 - 13*w - 8], [761, 761, -2*w^3 + w^2 + 13*w - 8], [761, 761, -2*w^3 - 5*w^2 + 17*w + 40], [809, 809, 2*w^3 + 5*w^2 - 9*w - 24], [809, 809, 2*w^3 - 5*w^2 - 9*w + 24], [811, 811, 2*w^3 - w^2 - 16*w + 11], [811, 811, -2*w^3 - 3*w^2 + 10*w + 9], [811, 811, -2*w^3 - 8*w^2 + 11*w + 50], [811, 811, 2*w^3 + w^2 - 16*w - 11], [839, 839, -3*w^3 - 9*w^2 + 18*w + 56], [839, 839, -3*w^3 - 4*w^2 + 17*w + 15], [841, 29, -5*w^2 + 31], [881, 881, w^3 + 7*w^2 - 6*w - 48], [881, 881, -5*w^3 - 12*w^2 + 30*w + 70], [881, 881, -4*w^3 - 6*w^2 + 24*w + 29], [881, 881, -w^3 + 7*w^2 + 6*w - 48], [919, 919, 2*w^3 - 12*w - 5], [919, 919, 2*w^3 - 12*w + 5], [929, 929, w^2 + 4*w + 2], [929, 929, -w^2 + 4*w - 2], [941, 941, 2*w^3 + w^2 - 13*w - 6], [941, 941, -w^3 - 2*w^2 + 4*w + 4], [941, 941, 4*w^3 + 8*w^2 - 22*w - 37], [941, 941, -2*w^3 + w^2 + 13*w - 6], [971, 971, 4*w^2 - 2*w - 29], [971, 971, 4*w^2 + 2*w - 29], [991, 991, 2*w^3 - w^2 - 15*w + 12], [991, 991, -w^3 + 4*w^2 + 7*w - 19]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 52*x^2 + 578; K := NumberField(heckePol); heckeEigenvaluesArray := [-1/7*e^2 + 33/7, -1/7*e^2 + 40/7, -1, -1/119*e^3 - 16/119*e, e, -13/119*e^3 + 387/119*e, 10/119*e^3 - 197/119*e, -4/7*e^2 + 104/7, 3/7*e^2 - 36/7, 9/119*e^3 - 213/119*e, 8/119*e^3 - 348/119*e, -2/17*e^3 + 53/17*e, 8/119*e^3 - 348/119*e, 4, -18/119*e^3 + 545/119*e, 4/119*e^3 - 174/119*e, 2/17*e^3 - 70/17*e, 2/17*e^3 - 70/17*e, 8/7*e^2 - 250/7, -2/7*e^2 + 94/7, 6/7*e^2 - 128/7, 2/7*e^2 - 52/7, 9/7*e^2 - 192/7, -2/7*e^2 + 66/7, 6/7*e^2 - 156/7, -2/7*e^2 - 18/7, -12/7*e^2 + 312/7, 11/7*e^2 - 272/7, 6/17*e^3 - 176/17*e, -24/119*e^3 + 925/119*e, 29/119*e^3 - 964/119*e, 31/119*e^3 - 694/119*e, -6/7*e^2 + 128/7, 2/7*e^2 - 94/7, -40/119*e^3 + 907/119*e, 4/17*e^3 - 140/17*e, 1/7*e^3 - 19/7*e, -6/119*e^3 + 261/119*e, -5/119*e^3 + 396/119*e, 1/7*e^3 - 19/7*e, -5/7*e^2 + 116/7, 8/7*e^2 - 82/7, -11/119*e^3 + 181/119*e, 33/119*e^3 - 1257/119*e, -2/7*e^2 + 38/7, 4/7*e^2 - 20/7, 4/7*e^2 - 20/7, 12/7*e^2 - 242/7, -47/119*e^3 + 1390/119*e, -10/119*e^3 + 435/119*e, 31/119*e^3 - 1408/119*e, 44/119*e^3 - 1081/119*e, 2/7*e^2 - 94/7, 2/7*e^2 + 60/7, -3/7*e^2 + 36/7, -1/7*e^2 + 152/7, 6/7*e^2 - 268/7, 2/7*e^2 + 60/7, 38/119*e^3 - 1296/119*e, 2/17*e^3 - 121/17*e, -3/17*e^3 + 20/17*e, -39/119*e^3 + 1399/119*e, 9/7*e^2 - 206/7, -32/119*e^3 + 1511/119*e, -1/7*e^3 + 68/7*e, -67/119*e^3 + 1784/119*e, 54/119*e^3 - 1635/119*e, -8/7*e^2 + 166/7, -2/7*e^2 - 18/7, 20/7*e^2 - 520/7, -8, -1/7*e^3 + 19/7*e, 1/17*e^3 - 1/17*e, 5/119*e^3 - 277/119*e, -15/119*e^3 + 593/119*e, 2/7*e^2 + 172/7, -3/7*e^2 + 148/7, -29/119*e^3 + 369/119*e, -62/119*e^3 + 1745/119*e, -38/119*e^3 + 1296/119*e, 64/119*e^3 - 1832/119*e, 61/119*e^3 - 1761/119*e, 36/119*e^3 - 1447/119*e, 8/119*e^3 - 824/119*e, -80/119*e^3 + 2052/119*e, 11/119*e^3 - 181/119*e, -78/119*e^3 + 2441/119*e, -79/119*e^3 + 2306/119*e, -1/17*e^3 + 154/17*e, 58/119*e^3 - 1571/119*e, -13/119*e^3 - 89/119*e, 3/7*e^2 - 176/7, -2/7*e^2 + 234/7, 12/7*e^2 - 340/7, -6/7*e^2 + 268/7, 6/7*e^2 - 240/7, 19/7*e^2 - 438/7, 8/7*e^2 - 306/7, 2, -22/7*e^2 + 516/7, 3/7*e^2 + 104/7, 2/7*e^2 - 178/7, 13/7*e^2 - 338/7, 6/7*e^2 - 198/7, -9/7*e^2 + 290/7, -10/119*e^3 + 1149/119*e, -61/119*e^3 + 1642/119*e, -3*e^2 + 74, 11/7*e^2 - 370/7, -57/119*e^3 + 1230/119*e, 1/7*e^3 - 75/7*e, -3/17*e^3 + 139/17*e, -13/119*e^3 - 208/119*e, 20/119*e^3 - 870/119*e, 46/119*e^3 - 930/119*e, -66/119*e^3 + 2395/119*e, -4/119*e^3 - 421/119*e, 26/7*e^2 - 718/7, -6/7*e^2 + 170/7, 52/119*e^3 - 1191/119*e, 27/119*e^3 - 877/119*e, -4/7*e^2 + 202/7, 2/7*e^2 - 192/7, 2/7*e^2 - 192/7, 9/7*e^2 + 4/7, -9/119*e^3 + 213/119*e, -33/119*e^3 + 662/119*e, -6/7*e^2 + 380/7, 23/7*e^2 - 612/7, 9/7*e^2 - 332/7, -2*e^2 + 24, -23/7*e^2 + 612/7, 10/7*e^2 - 358/7, -40/119*e^3 + 1740/119*e, -86/119*e^3 + 2908/119*e, -3/7*e^3 + 57/7*e, -27/119*e^3 + 1829/119*e, -8/17*e^3 + 229/17*e, 43/119*e^3 - 1097/119*e, 48/119*e^3 - 1017/119*e, -22/119*e^3 + 600/119*e, 6/7*e^2 + 68/7, -2*e^2 + 48, 4/7*e^2 - 272/7, -3/7*e^2 - 62/7, -2*e^2 + 64, -1/7*e^2 + 250/7, 30/119*e^3 - 829/119*e, 33/119*e^3 - 1852/119*e, 36/119*e^3 - 1447/119*e, -19/119*e^3 - 66/119*e, -2/17*e^3 + 155/17*e, -66/119*e^3 + 1443/119*e, -6/7*e^2 + 44/7, 15/7*e^2 - 278/7, -22/7*e^2 + 726/7, 12/7*e^2 - 326/7, -10/7*e^2 + 36/7, 44/119*e^3 - 724/119*e, -50/119*e^3 + 1342/119*e, -4*e^2 + 110, -8/7*e^2 + 432/7, 29/7*e^2 - 852/7, -18/7*e^2 + 496/7, -12/7*e^2 + 438/7, -26/7*e^2 + 620/7, 25/119*e^3 - 314/119*e, -45/119*e^3 + 1303/119*e, -19/119*e^3 + 1243/119*e, -26/119*e^3 + 298/119*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;