/* 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![29, 8, -12, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [5, 5, -w + 2], [5, 5, -3/5*w^3 - w^2 + 26/5*w + 42/5], [9, 3, 2/5*w^3 - 19/5*w - 3/5], [9, 3, -1/5*w^3 + 2/5*w + 4/5], [11, 11, -2/5*w^3 - w^2 + 14/5*w + 28/5], [11, 11, 1/5*w^3 - w^2 - 7/5*w + 36/5], [16, 2, 2], [29, 29, -w], [29, 29, 1/5*w^3 - 12/5*w + 1/5], [41, 41, -2/5*w^3 - w^2 + 14/5*w + 38/5], [41, 41, -w^2 + 10], [41, 41, 11/5*w^3 + 3*w^2 - 102/5*w - 149/5], [41, 41, -1/5*w^3 + w^2 + 7/5*w - 26/5], [49, 7, 1/5*w^3 + w^2 - 12/5*w - 19/5], [49, 7, 1/5*w^3 + w^2 - 12/5*w - 44/5], [59, 59, -4/5*w^3 - w^2 + 33/5*w + 36/5], [59, 59, -2*w^3 - 3*w^2 + 17*w + 26], [61, 61, -1/5*w^3 + w^2 + 12/5*w - 51/5], [61, 61, 4/5*w^3 + w^2 - 28/5*w - 41/5], [71, 71, 1/5*w^3 + w^2 - 7/5*w - 49/5], [71, 71, -2*w^3 - 3*w^2 + 18*w + 28], [89, 89, -3/5*w^3 + 16/5*w + 7/5], [89, 89, 3/5*w^3 + w^2 - 26/5*w - 57/5], [121, 11, -3/5*w^3 + 21/5*w + 2/5], [131, 131, w^2 - w - 8], [131, 131, 2/5*w^3 + w^2 - 19/5*w - 23/5], [149, 149, 2/5*w^3 - w^2 - 14/5*w + 22/5], [149, 149, 3/5*w^3 + w^2 - 21/5*w - 42/5], [179, 179, -6/5*w^3 - w^2 + 57/5*w + 69/5], [179, 179, -2/5*w^3 - 2*w^2 + 14/5*w + 73/5], [179, 179, 2*w^2 - 11], [179, 179, -3/5*w^3 + 2*w^2 + 16/5*w - 48/5], [181, 181, -7/5*w^3 - 2*w^2 + 59/5*w + 78/5], [181, 181, -2/5*w^3 + 24/5*w - 27/5], [191, 191, -3/5*w^3 + 2*w^2 + 21/5*w - 78/5], [191, 191, 2/5*w^3 - 2*w^2 - 9/5*w + 57/5], [199, 199, -1/5*w^3 + 17/5*w - 16/5], [199, 199, 1/5*w^3 - 17/5*w - 14/5], [211, 211, 2/5*w^3 - w^2 + 1/5*w + 7/5], [211, 211, -1/5*w^3 + w^2 - 3/5*w - 26/5], [211, 211, 4/5*w^3 + w^2 - 38/5*w - 36/5], [211, 211, -1/5*w^3 - 2*w^2 + 7/5*w + 44/5], [239, 239, 3/5*w^3 + w^2 - 16/5*w - 37/5], [239, 239, 2/5*w^3 + w^2 - 14/5*w - 53/5], [251, 251, 2/5*w^3 - 24/5*w - 13/5], [251, 251, 2*w - 3], [251, 251, w^2 + w - 10], [251, 251, -4/5*w^3 - w^2 + 28/5*w + 46/5], [269, 269, 1/5*w^3 - 12/5*w - 24/5], [269, 269, w - 5], [271, 271, -3/5*w^3 + 31/5*w - 33/5], [271, 271, -8/5*w^3 - 2*w^2 + 66/5*w + 77/5], [281, 281, 4/5*w^3 - w^2 - 38/5*w + 39/5], [281, 281, -14/5*w^3 - 3*w^2 + 128/5*w + 161/5], [311, 311, 1/5*w^3 - 2*w^2 - 2/5*w + 51/5], [311, 311, 1/5*w^3 - w^2 - 17/5*w + 21/5], [331, 331, 1/5*w^3 + 3/5*w - 4/5], [331, 331, 3/5*w^3 - 31/5*w - 2/5], [359, 359, -w^3 + 6*w - 1], [359, 359, -6/5*w^3 + 47/5*w - 6/5], [359, 359, 3/5*w^3 + w^2 - 31/5*w - 27/5], [359, 359, 3/5*w^3 + w^2 - 26/5*w - 22/5], [361, 19, 4/5*w^3 - 28/5*w - 11/5], [361, 19, 1/5*w^3 - 7/5*w - 24/5], [379, 379, 9/5*w^3 + 3*w^2 - 78/5*w - 121/5], [379, 379, -4/5*w^3 + 3*w^2 + 28/5*w - 99/5], [389, 389, -3/5*w^3 - 2*w^2 + 26/5*w + 42/5], [389, 389, -2*w^2 + w + 17], [401, 401, 4/5*w^3 - w^2 - 23/5*w + 24/5], [401, 401, 3/5*w^3 + w^2 - 26/5*w - 7/5], [401, 401, -4/5*w^3 - w^2 + 38/5*w + 66/5], [401, 401, 6/5*w^3 + w^2 - 52/5*w - 39/5], [409, 409, -6/5*w^3 + 52/5*w + 19/5], [409, 409, 1/5*w^3 + 2*w^2 - 7/5*w - 39/5], [421, 421, -1/5*w^3 - w^2 + 17/5*w + 44/5], [421, 421, 2/5*w^3 + w^2 - 24/5*w - 18/5], [431, 431, -3/5*w^3 - w^2 + 36/5*w + 47/5], [431, 431, -13/5*w^3 - 4*w^2 + 116/5*w + 182/5], [431, 431, -2/5*w^3 + w^2 + 24/5*w - 47/5], [431, 431, 2/5*w^3 - w^2 + 6/5*w - 8/5], [439, 439, 6/5*w^3 + w^2 - 47/5*w - 49/5], [439, 439, -2/5*w^3 + 2*w^2 + 9/5*w - 42/5], [439, 439, 4/5*w^3 - w^2 - 23/5*w + 14/5], [439, 439, -w^3 - 2*w^2 + 8*w + 17], [461, 461, w^3 + w^2 - 10*w - 9], [461, 461, -2*w^3 - 3*w^2 + 17*w + 27], [461, 461, -1/5*w^3 + w^2 - 8/5*w - 16/5], [461, 461, -3*w^3 - 4*w^2 + 26*w + 35], [479, 479, 2*w - 1], [479, 479, 2/5*w^3 - 24/5*w - 3/5], [491, 491, w^3 - 2*w^2 - 6*w + 11], [491, 491, w^3 + w^2 - 10*w - 15], [499, 499, -1/5*w^3 + 2*w^2 + 2/5*w - 36/5], [499, 499, 4/5*w^3 + 2*w^2 - 33/5*w - 91/5], [509, 509, 8/5*w^3 + w^2 - 66/5*w - 42/5], [509, 509, 1/5*w^3 - 2*w^2 + 8/5*w + 16/5], [521, 521, w^3 - 9*w - 4], [521, 521, 3/5*w^3 + w^2 - 16/5*w - 42/5], [521, 521, 3/5*w^3 - w^2 - 26/5*w + 23/5], [521, 521, -3/5*w^3 + 11/5*w + 22/5], [529, 23, 3/5*w^3 + w^2 - 36/5*w - 62/5], [529, 23, -4/5*w^3 + 2*w^2 + 23/5*w - 64/5], [541, 541, -w^3 - w^2 + 9*w + 7], [541, 541, 1/5*w^3 + 2*w^2 - 7/5*w - 64/5], [541, 541, 3/5*w^3 + w^2 - 26/5*w - 12/5], [571, 571, -w^3 - w^2 + 6*w + 9], [571, 571, -w^3 + w^2 + 8*w - 4], [619, 619, -w^3 - 2*w^2 + 8*w + 11], [619, 619, -2/5*w^3 + 2*w^2 + 9/5*w - 72/5], [619, 619, 2/5*w^3 - 2*w^2 - 4/5*w + 57/5], [619, 619, -6/5*w^3 - 2*w^2 + 52/5*w + 69/5], [631, 631, 1/5*w^3 + w^2 + 3/5*w - 24/5], [631, 631, 2/5*w^3 - w^2 - 24/5*w + 42/5], [659, 659, -13/5*w^3 - 4*w^2 + 111/5*w + 177/5], [659, 659, -11/5*w^3 - 3*w^2 + 92/5*w + 119/5], [659, 659, -8/5*w^3 - w^2 + 61/5*w + 27/5], [659, 659, -8/5*w^3 + 71/5*w + 2/5], [661, 661, -w^3 - w^2 + 7*w + 11], [661, 661, 4/5*w^3 - w^2 - 28/5*w + 9/5], [691, 691, 1/5*w^3 - w^2 - 17/5*w + 41/5], [691, 691, 3/5*w^3 + 2*w^2 - 26/5*w - 67/5], [701, 701, 12/5*w^3 + 4*w^2 - 99/5*w - 158/5], [701, 701, -17/5*w^3 - 4*w^2 + 149/5*w + 193/5], [709, 709, -1/5*w^3 + w^2 + 12/5*w - 6/5], [709, 709, 1/5*w^3 + w^2 - 2/5*w - 59/5], [719, 719, 2/5*w^3 + w^2 - 29/5*w - 8/5], [719, 719, -w^3 + w^2 + 7*w - 4], [719, 719, 6/5*w^3 + w^2 - 42/5*w - 44/5], [719, 719, -2/5*w^3 - w^2 + 29/5*w + 53/5], [739, 739, 14/5*w^3 + 4*w^2 - 123/5*w - 171/5], [739, 739, -1/5*w^3 + 2*w^2 + 12/5*w - 56/5], [739, 739, -6/5*w^3 + 3*w^2 + 37/5*w - 96/5], [739, 739, 2/5*w^3 + 2*w^2 - 9/5*w - 73/5], [751, 751, -9/5*w^3 - 2*w^2 + 73/5*w + 86/5], [751, 751, -w^3 + 2*w^2 + 5*w - 8], [761, 761, 1/5*w^3 + w^2 - 22/5*w + 16/5], [761, 761, -16/5*w^3 - 4*w^2 + 147/5*w + 214/5], [769, 769, 13/5*w^3 + 3*w^2 - 121/5*w - 172/5], [769, 769, 3/5*w^3 - w^2 - 41/5*w + 78/5], [769, 769, -12/5*w^3 - 4*w^2 + 99/5*w + 153/5], [769, 769, -6/5*w^3 + 3*w^2 + 27/5*w - 61/5], [809, 809, 1/5*w^3 + 3*w^2 - 22/5*w - 104/5], [809, 809, w^3 + 3*w^2 - 10*w - 17], [811, 811, -5*w + 11], [811, 811, -16/5*w^3 - 5*w^2 + 137/5*w + 214/5], [821, 821, -1/5*w^3 + w^2 + 17/5*w - 36/5], [821, 821, w^2 + 2*w - 6], [829, 829, 3*w^2 + w - 17], [829, 829, 2/5*w^3 + 3*w^2 - 9/5*w - 108/5], [841, 29, w^3 - 7*w - 3], [859, 859, 6/5*w^3 + w^2 - 37/5*w - 34/5], [859, 859, 2/5*w^3 + w^2 - 14/5*w - 68/5], [881, 881, 1/5*w^3 + 2*w^2 - 17/5*w - 79/5], [881, 881, 3/5*w^3 + 2*w^2 - 31/5*w - 47/5], [911, 911, 4/5*w^3 - 3*w^2 - 28/5*w + 89/5], [911, 911, 1/5*w^3 - w^2 - 7/5*w + 61/5], [911, 911, w^3 - 6*w - 3], [911, 911, -11/5*w^3 - 3*w^2 + 92/5*w + 139/5], [919, 919, 7/5*w^3 + 2*w^2 - 54/5*w - 88/5], [919, 919, 4/5*w^3 - 2*w^2 - 23/5*w + 39/5], [929, 929, -7/5*w^3 + w^2 + 54/5*w - 17/5], [929, 929, -1/5*w^3 + w^2 + 22/5*w - 71/5], [941, 941, 9/5*w^3 + w^2 - 73/5*w - 31/5], [941, 941, 1/5*w^3 - w^2 - 2/5*w + 66/5], [941, 941, 2/5*w^3 + 2*w^2 - 19/5*w - 103/5], [941, 941, -w^3 + w^2 + 5*w - 3], [961, 31, w^3 - 7*w - 2], [961, 31, 2/5*w^3 - 14/5*w - 33/5], [971, 971, -2/5*w^3 - 2*w^2 + 24/5*w + 93/5], [971, 971, 2/5*w^3 + 2*w^2 - 24/5*w - 33/5], [991, 991, -w^3 + 2*w^2 + 7*w - 10], [991, 991, -7/5*w^3 - 2*w^2 + 49/5*w + 78/5]]; primes := [ideal : I in primesArray]; heckePol := x^3 - 4*x^2 - 5*x + 22; K := NumberField(heckePol); heckeEigenvaluesArray := [e, 0, -e^2 + 11, e, -1, -e^2 + 10, e^2 - e - 7, 6, e^2 - 2*e - 5, e + 4, e^2 - 4*e - 5, e^2 - e - 5, -e^2 - e + 15, -2*e^2 + 4*e + 16, e - 6, -3*e^2 + 2*e + 21, 2*e^2 - 2*e - 12, 2*e - 6, 3*e^2 - 4*e - 17, -2*e^2 + 6*e + 9, e^2 - 4*e - 2, -1, 2*e^2 - 4*e - 12, -2*e^2 + 2*e + 2, 2*e^2 - 4*e - 12, 2*e^2 - 2*e - 23, 4*e^2 - 6*e - 26, 4*e^2 - 2*e - 26, -e^2 + 6*e - 5, -e^2 + 6*e - 5, -2*e^2 + 4*e + 17, 2*e^2 - 16, -5*e^2 + 10*e + 32, e^2 + 2*e - 1, 7*e^2 - 8*e - 45, 2*e^2 - 9*e - 12, 4*e^2 - 4*e - 23, -3*e^2 + 4*e + 32, -e^2 + 4*e + 7, -6*e^2 + 3*e + 50, 3*e^2 - 6*e - 5, 4*e^2 - 2*e - 37, 6*e^2 - 7*e - 32, 5*e^2 - 43, 6*e^2 - 11*e - 36, -2*e^2 + 8, -4*e^2 + 6*e + 10, -4*e - 12, -2*e^2 + 6*e + 12, -e^2 - e + 1, -6*e^2 + 10*e + 40, -e^2 - 2*e + 7, -e^2 - 4*e + 23, -9*e + 12, -4*e^2 + 33, 8*e, -e^2 + 6*e - 8, -6*e^2 + 12*e + 36, -e^2 - 5, 2*e^2 + e - 16, -3*e^2 + 2*e + 18, -2*e^2 + 6*e + 7, 3*e^2 - 10*e - 10, 4*e^2 - 8*e - 20, -9*e^2 + 12*e + 59, 5*e^2 - 2*e - 51, 6*e^2 - 14*e - 32, -6*e^2 + 14*e + 34, e^2 - 6*e + 15, -9*e^2 + 12*e + 46, 3*e^2 - 4*e + 4, 4*e^2 - 6*e - 42, 6*e^2 - 11*e - 30, 3*e^2 - 7*e + 3, 3*e^2 + 2*e - 19, -3*e^2 + 3*e + 3, 2*e^2 + 2*e + 4, -3*e^2 + 4*e + 32, 8*e^2 - 9*e - 62, -7*e^2 + 10*e + 43, e^2 + 4*e - 17, -4*e^2 + 6*e + 27, -e^2 - 4*e + 27, -5*e^2 + 2*e + 27, 4*e^2 - 4*e - 44, 3*e^2 - 6*e - 18, -2*e^2 - 4*e + 22, -4*e^2 - 4*e + 48, -e^2 + 9*e - 15, 6*e^2 - 8*e - 48, -6*e^2 + 13*e + 38, -4*e^2 + 60, 4*e^2 - 6*e - 12, -2*e^2 + 10, 3*e^2 - 4*e + 6, -6*e^2 + 12*e + 28, 5*e^2 + 2*e - 41, 2*e + 14, -e^2 + 10*e - 8, -3*e^2 + 6*e - 8, 3*e^2 + e - 35, -4*e^2 + 6*e + 42, -e^2 + 6*e - 13, -6*e^2 + 2*e + 53, 4*e^2 + 2*e - 46, 2*e^2 - 12*e - 6, -2*e^2 + 2*e + 5, 3*e^2 - 6*e + 1, -3*e^2 + 4*e + 12, -6*e^2 + 10*e + 56, 5*e - 10, -2*e^2 + 8*e + 14, 8*e^2 - 8*e - 52, -8*e^2 + 8*e + 68, -8*e^2 + 12*e + 46, -13*e^2 + 16*e + 85, 11*e^2 - 14*e - 80, e^2 - 10*e - 15, 4*e^2 + 2*e - 26, -7*e^2 + 14*e + 38, -11*e^2 + 14*e + 60, 2*e^2 - e - 12, -6*e^2 + 2*e + 76, 6*e^2 - 10*e - 44, -6*e^2 + 12*e + 11, 5*e^2 - 20, -2*e^2 - 4*e + 32, 7*e^2 - 10*e - 45, 8*e^2 - 6*e - 64, 13*e^2 - 14*e - 85, 3*e^2 - 6*e - 21, -6*e^2 + 8*e + 36, 13*e^2 - 18*e - 87, 3*e^2 - 6*e - 40, 12*e^2 - 14*e - 95, e^2 - 4*e - 32, 5*e^2 + 4*e - 65, 10*e^2 - 12*e - 64, -5*e^2 - 4*e + 55, -5*e^2 + 6*e + 33, -e^2 + 2*e - 9, 7*e^2 - 16*e - 37, -3*e^2 + 4*e - 26, -6*e^2 + 14*e + 44, 9*e^2 - 12*e - 33, 3*e^2 - 12*e - 25, -8*e^2 - 4*e + 74, -10*e^2 + 19*e + 50, -8*e^2 + 8*e + 50, -12*e^2 + 8*e + 90, 2*e^2 + 4*e - 28, 8*e^2 - 15*e - 28, e^2 - 8*e - 17, -10*e^2 + 4*e + 82, 10*e^2 - 6*e - 97, 14*e^2 - 16*e - 88, -e^2 + 2*e - 11, 3*e^2 - 18*e - 9, 3*e^2 - 2*e - 35, -3*e^2 - 2*e + 9, -8*e^2 + 11*e + 60, 4*e^2 - 3*e - 72, -4*e^2 + 6, e^2 - 6*e + 9, -8*e^2 + 4*e + 94, 9*e^2 - 12*e - 68, 11*e^2 - 117, 6*e^2 - 2*e - 68, -2*e^2 + 5*e + 16, 14*e^2 - 12*e - 116, -6*e^2 + 10*e, 3*e^2 - 8*e - 22]; 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;