/* 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 - 3*x^2 - 13*x + 31; K := NumberField(heckePol); heckeEigenvaluesArray := [-1, e, 1/4*e^2 + e - 17/4, -1/4*e^2 - 1/2*e + 19/4, 1/4*e^2 + e - 17/4, -1/4*e^2 - 1/2*e + 19/4, 1/4*e^2 - 21/4, -1/2*e^2 + e + 3/2, -1/2*e^2 + 2*e + 15/2, -e^2 + 11, 1/4*e^2 - 3/2*e + 5/4, 1/4*e^2 - 3/2*e + 5/4, 3/4*e^2 - 3/2*e - 29/4, -5/4*e^2 - 1/2*e + 63/4, -3/4*e^2 + e + 27/4, -3/2*e^2 + e + 25/2, 1/4*e^2 - 1/2*e - 23/4, -5/4*e^2 - 1/2*e + 63/4, 1/2*e^2 - 2*e - 5/2, e + 11, -5/4*e^2 + 2*e + 33/4, 5/4*e^2 - 7/2*e - 39/4, 1/2*e^2 + e - 19/2, 1/4*e^2 + 3/2*e - 47/4, 3/4*e^2 - 1/2*e - 65/4, -1/2*e^2 + 9/2*e + 5, -e^2 + 1/2*e + 23/2, -1/2*e^2 + 2*e + 5/2, 3/4*e^2 + 1/2*e - 61/4, 3/4*e^2 + 1/2*e - 61/4, -2*e^2 + 27, 3/2*e^2 - 3*e - 19/2, 11/4*e^2 - 7/2*e - 125/4, -5*e + 5, 1/4*e^2 - 1/2*e - 23/4, -3/4*e^2 - 3/2*e + 97/4, -11/4*e^2 + 3/2*e + 77/4, -e^2 + 3*e + 19, -9/4*e^2 + 7/2*e + 51/4, e^2 - 2*e, 2*e^2 - 24, 1/4*e^2 + 1/2*e + 49/4, 1/4*e^2 - 5/2*e - 31/4, -1/2*e^2 + 3*e - 3/2, 1/2*e^2 + 23/2, 1/2*e^2 + 23/2, 7/4*e^2 + 9/2*e - 137/4, 3/2*e^2 + 3/2, -3*e^2 - e + 42, 9/4*e^2 - 11/2*e - 51/4, -7/4*e^2 + 1/2*e + 61/4, 11/4*e^2 + 3/2*e - 133/4, -9/4*e^2 - 11/2*e + 155/4, 13/4*e^2 - 5/2*e - 135/4, -1/2*e^2 + 57/2, -1/2*e^2 + 57/2, -1/2*e^2 - 5*e + 7/2, 3/2*e^2 + 4*e - 29/2, 1/2*e^2 - 1/2, -1/4*e^2 + 5/2*e - 49/4, -3/2*e^2 + 3/2*e + 13, -1/4*e^2 - 1/2*e + 39/4, 17/4*e^2 - 2*e - 165/4, -4*e^2 + 7/2*e + 55/2, -1/2*e^2 - 2*e - 23/2, -1/2*e^2 + 4*e + 49/2, 1/2*e^2 - 4*e + 11/2, 9/4*e^2 - 11/2*e - 51/4, 7/4*e^2 - 13/2*e - 93/4, -11/4*e^2 - 1/2*e + 101/4, 13/4*e^2 - 153/4, 3/4*e^2 - 3/2*e + 3/4, 3/2*e^2 + 5/2*e - 19, 11/4*e^2 - 1/2*e - 113/4, -5/4*e^2 - 7/2*e + 11/4, -3*e^2 + 33, -3/4*e^2 - 13/2*e + 37/4, -5/4*e^2 + 5/2*e - 45/4, -1/2*e^2 + 3*e + 7/2, -1/2*e^2 + 4*e + 49/2, -5/4*e^2 - 6*e + 121/4, 5/4*e^2 - 11/2*e - 127/4, e^2 - 4*e + 15, -5/4*e^2 + 9/2*e + 43/4, -3/4*e^2 - 5/2*e + 53/4, 3/4*e^2 + 4*e - 47/4, -5/2*e^2 - 3*e + 39/2, 1/4*e^2 + 5/2*e - 11/4, 7/2*e^2 - 107/2, -1/4*e^2 + 3/2*e + 147/4, 7/4*e^2 - 15/2*e - 97/4, -15/4*e^2 + 5*e + 135/4, -9/2*e + 31/2, -1/2*e^2 - 8*e + 25/2, -9/4*e^2 - 11/2*e + 167/4, 3/2*e^2 - 2*e - 37/2, 1/2*e^2 + 1/2*e - 10, 13/4*e^2 - 11/2*e - 167/4, 1/2*e^2 - 7*e - 11/2, 7/4*e^2 - 5/2*e - 77/4, -2*e^2 - 2*e + 20, -1/4*e^2 - 1/2*e + 79/4, 5*e + 5, -5/2*e^2 - 3*e + 75/2, 5/2*e^2 - 5*e - 75/2, -4*e^2 - e + 55, 13/4*e^2 + 3/2*e - 119/4, -7/2*e^2 - 4*e + 79/2, -3/4*e^2 - 1/2*e + 61/4, 3*e^2 - 3*e - 31, -3/2*e - 43/2, -13/4*e^2 + 15/2*e + 155/4, 7/2*e^2 - 9*e - 69/2, -11/4*e^2 + 21/2*e + 113/4, 1/2*e^2 + 2*e + 43/2, -11/2*e^2 + 6*e + 123/2, -2*e^2 + 3*e + 25, -2*e^2 - 9/2*e + 35/2, -3/4*e^2 - 15/2*e + 33/4, 5/4*e^2 - 3/2*e - 71/4, 23/4*e^2 - 3/2*e - 289/4, -4*e^2 + 5*e + 31, -3/4*e^2 - 11/2*e + 49/4, -2*e^2 - 5*e + 32, e^2 + e - 40, -15/4*e^2 - 9/2*e + 297/4, -6*e^2 + 5*e + 61, 3*e^2 + 3*e - 60, e^2 - e - 22, e^2 - 6*e - 7, 1/2*e^2 + 6*e - 9/2, 11/4*e^2 + 8*e - 159/4, -5/4*e^2 + 11/2*e + 7/4, -9/4*e^2 - 5/2*e + 111/4, -e^2 + 9*e - 2, 4*e + 26, 3/4*e^2 - 7/2*e + 31/4, 7/4*e^2 - 8*e + 21/4, 7/4*e^2 - 5/2*e - 157/4, 7/2*e^2 - 2*e - 91/2, -9/2*e^2 + 5*e + 79/2, 17/4*e^2 - 19/2*e - 195/4, -5/4*e^2 + 5*e + 85/4, -4*e^2 - 5*e + 57, -e^2 + 6*e + 15, 1/4*e^2 + 13/2*e - 75/4, 27/4*e^2 - e - 331/4, 11/4*e^2 - 7/2*e - 5/4, 5/4*e^2 - 1/2*e - 147/4, 1/2*e^2 - 2*e - 5/2, 5/4*e^2 + 19/2*e - 147/4, 5/2*e^2 - 10*e - 75/2, -9/4*e^2 - 3/2*e + 63/4, 7/2*e^2 - 5/2*e - 36, 3*e^2 + 5*e - 26, -7/2*e^2 - e + 111/2, -e^2 - 4*e + 55, 15/4*e^2 - 5/2*e - 177/4, -5/4*e^2 + 9/2*e + 83/4, 3/4*e^2 + 9/2*e - 205/4, 27/4*e^2 - 19/2*e - 245/4, -5*e^2 + 1/2*e + 91/2, -e^2 - 4*e + 34, e^2 + 2*e - 41, 7/4*e^2 - 5/2*e - 9/4, 9/4*e^2 - 25/2*e - 47/4, 17/4*e^2 - 19/2*e - 187/4, -1/2*e^2 + 3*e - 49/2, 9/4*e^2 - 5/2*e + 81/4, 19/4*e^2 + e - 195/4, -5*e^2 - 19/2*e + 151/2, -2*e + 48]; 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;