/* 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![36, 6, -13, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, 1/3*w^3 - 4/3*w^2 - 4/3*w + 6], [4, 2, -1/3*w^3 - 2/3*w^2 + 10/3*w + 7], [9, 3, -1/2*w^3 + 3/2*w^2 + 7/2*w - 9], [9, 3, 1/3*w^3 + 2/3*w^2 - 7/3*w - 5], [11, 11, -1/6*w^3 + 1/6*w^2 + 1/6*w], [19, 19, w + 1], [19, 19, 1/6*w^3 - 1/6*w^2 - 13/6*w + 2], [25, 5, -1/3*w^3 + 1/3*w^2 + 7/3*w - 1], [29, 29, -1/6*w^3 + 1/6*w^2 + 13/6*w], [29, 29, w - 1], [31, 31, 1/3*w^3 - 1/3*w^2 - 10/3*w + 3], [31, 31, 1/6*w^3 - 1/6*w^2 - 1/6*w + 2], [41, 41, -1/2*w^3 - 1/2*w^2 + 9/2*w + 5], [41, 41, -1/2*w^3 + 3/2*w^2 + 5/2*w - 8], [59, 59, 1/3*w^3 - 1/3*w^2 - 10/3*w - 1], [59, 59, -1/3*w^3 + 4/3*w^2 + 7/3*w - 7], [59, 59, 1/2*w^3 - 1/2*w^2 - 5/2*w + 2], [79, 79, w^2 - 11], [79, 79, 1/6*w^3 - 7/6*w^2 - 7/6*w + 3], [89, 89, -1/6*w^3 + 1/6*w^2 + 19/6*w - 5], [89, 89, 1/6*w^3 - 1/6*w^2 - 19/6*w - 3], [109, 109, -1/6*w^3 + 7/6*w^2 + 1/6*w - 9], [109, 109, -7/6*w^3 + 19/6*w^2 + 49/6*w - 20], [109, 109, -5/6*w^3 + 17/6*w^2 + 23/6*w - 12], [109, 109, 1/6*w^3 + 5/6*w^2 - 13/6*w - 4], [121, 11, 1/6*w^3 - 1/6*w^2 - 7/6*w - 3], [139, 139, 1/3*w^3 - 4/3*w^2 + 5/3*w - 1], [139, 139, -5/3*w^3 - 7/3*w^2 + 50/3*w + 29], [169, 13, w^3 + w^2 - 10*w - 13], [169, 13, -5/6*w^3 + 17/6*w^2 + 17/6*w - 12], [179, 179, -1/3*w^3 + 4/3*w^2 + 1/3*w - 7], [179, 179, -2/3*w^3 + 2/3*w^2 + 17/3*w - 5], [181, 181, -w^3 + 3*w^2 + 4*w - 13], [181, 181, -1/6*w^3 + 7/6*w^2 + 1/6*w - 11], [181, 181, 7/6*w^3 + 11/6*w^2 - 79/6*w - 25], [181, 181, 1/6*w^3 + 5/6*w^2 - 13/6*w - 2], [191, 191, -5/6*w^3 - 1/6*w^2 + 53/6*w + 7], [191, 191, 1/6*w^3 + 11/6*w^2 - 19/6*w - 16], [211, 211, -1/6*w^3 + 1/6*w^2 - 5/6*w - 2], [211, 211, -1/2*w^3 + 1/2*w^2 + 9/2*w + 2], [211, 211, 1/3*w^3 - 1/3*w^2 - 4/3*w - 3], [211, 211, -1/2*w^3 + 1/2*w^2 + 11/2*w - 4], [229, 229, 5/6*w^3 + 1/6*w^2 - 53/6*w - 9], [229, 229, 1/2*w^3 - 3/2*w^2 - 1/2*w + 2], [239, 239, 5/6*w^3 + 7/6*w^2 - 59/6*w - 19], [239, 239, 1/2*w^3 - 5/2*w^2 + 1/2*w + 5], [241, 241, 1/6*w^3 - 1/6*w^2 - 13/6*w - 4], [241, 241, w - 5], [269, 269, -1/6*w^3 + 7/6*w^2 + 1/6*w - 2], [269, 269, 1/3*w^3 - 7/3*w^2 - 1/3*w + 7], [271, 271, 5/3*w^3 + 7/3*w^2 - 47/3*w - 25], [271, 271, -5/3*w^3 + 17/3*w^2 + 23/3*w - 27], [281, 281, 1/6*w^3 + 5/6*w^2 - 1/6*w - 7], [281, 281, -1/2*w^3 + 3/2*w^2 + 9/2*w - 8], [311, 311, 11/6*w^3 + 7/6*w^2 - 113/6*w - 23], [311, 311, -4/3*w^3 + 13/3*w^2 + 10/3*w - 13], [311, 311, -2/3*w^3 + 5/3*w^2 + 20/3*w - 17], [311, 311, 1/6*w^3 + 5/6*w^2 + 5/6*w + 1], [349, 349, -1/2*w^3 + 1/2*w^2 + 11/2*w - 1], [349, 349, -5/6*w^3 + 17/6*w^2 + 29/6*w - 14], [349, 349, 1/6*w^3 - 1/6*w^2 + 5/6*w - 1], [349, 349, -2/3*w^3 - 4/3*w^2 + 17/3*w + 13], [359, 359, -1/6*w^3 + 13/6*w^2 + 7/6*w - 18], [359, 359, -1/6*w^3 - 11/6*w^2 + 13/6*w + 18], [361, 19, 2/3*w^3 - 2/3*w^2 - 14/3*w + 1], [379, 379, 1/2*w^3 + 1/2*w^2 - 7/2*w - 7], [379, 379, -5/6*w^3 + 11/6*w^2 + 23/6*w - 7], [379, 379, w^3 - 9*w - 5], [379, 379, -2/3*w^3 + 5/3*w^2 + 14/3*w - 7], [401, 401, -1/3*w^3 + 7/3*w^2 + 4/3*w - 17], [401, 401, -4/3*w^3 - 8/3*w^2 + 43/3*w + 31], [419, 419, 1/6*w^3 - 1/6*w^2 + 5/6*w], [419, 419, 1/2*w^3 - 1/2*w^2 - 11/2*w + 2], [421, 421, -5/6*w^3 - 7/6*w^2 + 47/6*w + 11], [421, 421, 1/3*w^3 - 1/3*w^2 - 19/3*w - 7], [431, 431, 5/6*w^3 + 1/6*w^2 - 41/6*w - 6], [431, 431, 2/3*w^3 - 8/3*w^2 - 8/3*w + 15], [431, 431, 5/6*w^3 - 11/6*w^2 - 29/6*w + 7], [431, 431, 1/2*w^3 - 5/2*w^2 + 5/2*w + 2], [439, 439, 5/6*w^3 + 1/6*w^2 - 41/6*w - 4], [439, 439, 1/2*w^3 - 1/2*w^2 - 9/2*w + 8], [449, 449, 5/6*w^3 - 17/6*w^2 - 29/6*w + 18], [449, 449, 11/6*w^3 - 41/6*w^2 - 41/6*w + 29], [449, 449, -7/6*w^3 + 31/6*w^2 + 7/6*w - 16], [449, 449, 5/3*w^3 + 7/3*w^2 - 56/3*w - 33], [461, 461, -1/6*w^3 + 1/6*w^2 + 19/6*w - 3], [461, 461, 1/6*w^3 - 1/6*w^2 - 19/6*w - 1], [479, 479, -2*w - 1], [479, 479, 1/3*w^3 - 1/3*w^2 - 13/3*w + 3], [491, 491, 2/3*w^3 + 1/3*w^2 - 14/3*w - 7], [491, 491, 5/6*w^3 - 11/6*w^2 - 35/6*w + 7], [509, 509, 5/6*w^3 - 11/6*w^2 - 29/6*w + 8], [509, 509, 5/6*w^3 + 1/6*w^2 - 41/6*w - 5], [521, 521, -1/6*w^3 + 7/6*w^2 - 17/6*w + 1], [521, 521, -1/6*w^3 + 7/6*w^2 - 11/6*w - 3], [521, 521, -1/6*w^3 + 7/6*w^2 + 19/6*w - 5], [521, 521, 2/3*w^3 + 1/3*w^2 - 26/3*w - 11], [541, 541, 1/6*w^3 + 5/6*w^2 - 31/6*w - 17], [541, 541, 5/6*w^3 - 17/6*w^2 - 47/6*w + 23], [541, 541, 3*w^3 + 3*w^2 - 32*w - 47], [541, 541, 2/3*w^3 + 4/3*w^2 - 14/3*w - 11], [571, 571, -1/3*w^3 + 1/3*w^2 + 13/3*w - 1], [571, 571, 2*w - 1], [571, 571, -1/3*w^3 + 4/3*w^2 + 7/3*w - 1], [571, 571, 1/6*w^3 + 5/6*w^2 - 7/6*w - 13], [599, 599, 1/2*w^3 + 1/2*w^2 - 9/2*w - 2], [599, 599, -1/6*w^3 + 1/6*w^2 + 19/6*w - 2], [599, 599, 1/6*w^3 - 1/6*w^2 - 19/6*w], [599, 599, 1/2*w^3 - 3/2*w^2 - 5/2*w + 11], [601, 601, 1/6*w^3 + 11/6*w^2 - 7/6*w - 15], [601, 601, -1/3*w^3 + 7/3*w^2 - 5/3*w - 5], [601, 601, 2/3*w^3 + 4/3*w^2 - 26/3*w - 19], [601, 601, 1/2*w^3 - 5/2*w^2 - 7/2*w + 13], [659, 659, w^2 - 13], [659, 659, -5/6*w^3 + 11/6*w^2 + 29/6*w - 12], [659, 659, -1/6*w^3 + 7/6*w^2 + 7/6*w - 1], [659, 659, 5/6*w^3 + 1/6*w^2 - 41/6*w - 1], [691, 691, 1/2*w^3 - 1/2*w^2 - 11/2*w + 10], [691, 691, -1/6*w^3 + 1/6*w^2 - 5/6*w - 8], [701, 701, -2*w^2 + w + 11], [701, 701, -1/6*w^3 + 13/6*w^2 + 7/6*w - 9], [701, 701, -1/6*w^3 + 13/6*w^2 + 1/6*w - 16], [701, 701, -w^3 + w^2 + 9*w - 1], [709, 709, -2/3*w^3 + 11/3*w^2 + 14/3*w - 21], [709, 709, 1/3*w^3 + 5/3*w^2 + 2/3*w - 5], [709, 709, 7/6*w^3 - 25/6*w^2 - 43/6*w + 25], [709, 709, 2/3*w^3 - 2/3*w^2 - 23/3*w - 1], [719, 719, 2*w^2 - 2*w - 19], [719, 719, -2*w^2 + 2*w + 7], [739, 739, 5/6*w^3 - 5/6*w^2 - 29/6*w + 4], [739, 739, -5/6*w^3 + 11/6*w^2 + 53/6*w - 17], [739, 739, -1/6*w^3 - 5/6*w^2 - 11/6*w], [739, 739, -w^3 + w^2 + 8*w - 5], [751, 751, -1/6*w^3 + 1/6*w^2 + 25/6*w + 8], [751, 751, -1/3*w^3 + 1/3*w^2 + 16/3*w - 11], [761, 761, -2/3*w^3 + 5/3*w^2 + 8/3*w - 9], [761, 761, 5/6*w^3 + 1/6*w^2 - 47/6*w - 3], [769, 769, 1/3*w^3 - 7/3*w^2 - 7/3*w + 11], [769, 769, -4/3*w^3 - 8/3*w^2 + 46/3*w + 33], [769, 769, -1/2*w^3 + 5/2*w^2 + 5/2*w - 20], [769, 769, 2*w^2 - 17], [809, 809, 1/6*w^3 + 11/6*w^2 - 31/6*w - 15], [809, 809, -5/6*w^3 - 1/6*w^2 + 35/6*w + 3], [809, 809, 1/6*w^3 + 11/6*w^2 - 31/6*w - 9], [809, 809, w^3 - 2*w^2 - 7*w + 11], [811, 811, -1/6*w^3 - 5/6*w^2 + 25/6*w + 7], [811, 811, 1/6*w^3 + 5/6*w^2 - 25/6*w - 15], [811, 811, -1/6*w^3 - 5/6*w^2 + 25/6*w - 4], [811, 811, 1/6*w^3 + 5/6*w^2 - 25/6*w - 4], [821, 821, -1/2*w^3 - 5/2*w^2 + 13/2*w + 16], [821, 821, 1/6*w^3 - 13/6*w^2 - 7/6*w + 21], [821, 821, 3/2*w^3 + 1/2*w^2 - 35/2*w - 20], [821, 821, -1/6*w^3 + 13/6*w^2 + 7/6*w - 7], [829, 829, -1/6*w^3 + 19/6*w^2 - 11/6*w - 23], [829, 829, 5/6*w^3 - 17/6*w^2 - 5/6*w + 8], [829, 829, -4/3*w^3 - 2/3*w^2 + 43/3*w + 15], [829, 829, -1/6*w^3 - 17/6*w^2 + 25/6*w + 16], [839, 839, 1/3*w^3 - 7/3*w^2 + 2/3*w + 5], [839, 839, 1/2*w^3 + 3/2*w^2 - 13/2*w - 20], [841, 29, -5/6*w^3 + 5/6*w^2 + 35/6*w - 4], [859, 859, 1/6*w^3 + 5/6*w^2 - 37/6*w + 7], [859, 859, 13/6*w^3 + 17/6*w^2 - 127/6*w - 33], [881, 881, -2/3*w^3 + 2/3*w^2 + 20/3*w + 5], [881, 881, 17/6*w^3 + 19/6*w^2 - 167/6*w - 42], [911, 911, -1/6*w^3 + 13/6*w^2 - 11/6*w - 6], [911, 911, 3/2*w^3 + 1/2*w^2 - 33/2*w - 17], [911, 911, 5/6*w^3 - 17/6*w^2 + 1/6*w + 5], [911, 911, 7/6*w^3 - 1/6*w^2 - 61/6*w - 1], [929, 929, -7/6*w^3 - 11/6*w^2 + 67/6*w + 22], [929, 929, -1/6*w^3 + 1/6*w^2 - 11/6*w + 6], [941, 941, 11/6*w^3 + 19/6*w^2 - 107/6*w - 34], [941, 941, 4/3*w^3 - 10/3*w^2 - 25/3*w + 19], [941, 941, -11/6*w^3 + 41/6*w^2 + 47/6*w - 31], [941, 941, 1/2*w^3 + 1/2*w^2 - 13/2*w - 13], [961, 31, -1/3*w^3 + 1/3*w^2 + 7/3*w + 5], [991, 991, -1/6*w^3 - 5/6*w^2 + 25/6*w + 6], [991, 991, 1/6*w^3 + 5/6*w^2 - 25/6*w - 5]]; primes := [ideal : I in primesArray]; heckePol := x^3 + 3*x^2 - 7*x - 17; K := NumberField(heckePol); heckeEigenvaluesArray := [-1, e, 1/2*e^2 + e - 5/2, -1/2*e^2 - e + 9/2, 1, e^2 - 11, -e^2 + 7, -e^2 + 7, 1/2*e^2 - e - 17/2, -1/2*e^2 - e - 7/2, 2, -e^2 - 2*e + 1, -1/2*e^2 - e + 9/2, 1/2*e^2 - e - 17/2, -e^2 - 2*e - 1, 8, 2*e + 6, e^2 + 2*e - 7, e^2 - 2*e - 3, 3/2*e^2 + e - 11/2, -1/2*e^2 - e - 3/2, 3/2*e^2 + e - 11/2, 1/2*e^2 - 3*e - 17/2, -1/2*e^2 + 3*e + 29/2, -1/2*e^2 + 3*e + 5/2, 5/2*e^2 + e - 45/2, -2*e^2 + 10, -2*e^2 - 8*e + 10, 3/2*e^2 - 3*e - 27/2, 1/2*e^2 - 3*e - 17/2, 2*e^2 + 4*e - 14, e^2 - 2*e - 11, 9/2*e^2 + 3*e - 57/2, -4*e - 6, 5/2*e^2 + e - 33/2, -e^2 - 4*e + 3, e^2 + 4*e - 19, 3*e^2 + 8*e - 17, -3*e^2 - 2*e + 15, 5*e^2 + 6*e - 25, 2*e^2 + 4*e - 16, -2*e^2 + 16, 9/2*e^2 + e - 69/2, 5/2*e^2 + e - 17/2, e^2 - 7, 5*e^2 + 8*e - 27, -3/2*e^2 - e + 19/2, 1/2*e^2 - 5*e - 9/2, -1/2*e^2 + 5*e - 7/2, -5/2*e^2 - 3*e + 61/2, -e^2 - 6*e - 3, -e^2 + 6*e + 17, 3/2*e^2 - 5*e - 43/2, -3/2*e^2 + e + 7/2, e^2 + 2*e - 9, -2*e^2 - 4*e + 12, -10*e - 2, -6*e - 14, -2*e^2 - 4*e - 4, -7/2*e^2 - 3*e + 51/2, 4*e^2 + 6*e - 24, 1/2*e^2 + 5*e + 27/2, -3*e^2 + 2*e + 35, -3*e^2 + 2*e + 27, 3/2*e^2 - 3*e - 43/2, 6*e^2 + 10*e - 32, -2*e^2 + 4*e + 24, -e^2 - 2*e - 7, -2*e^2 + 6*e + 12, -2*e - 4, -4*e^2 - 4*e + 38, 5*e^2 + 10*e - 31, -20, 15/2*e^2 + 9*e - 87/2, 9/2*e^2 + e - 73/2, -3*e^2 + 17, -3*e^2 + 4*e + 29, -5*e^2 - 4*e + 31, 5*e^2 + 4*e - 19, 5*e^2 + 2*e - 53, e^2 - 6*e - 17, -9/2*e^2 - e + 41/2, -11/2*e^2 + 3*e + 91/2, 10*e + 4, -4*e^2 - 12*e + 26, -5/2*e^2 - 9*e + 29/2, -7/2*e^2 - e + 55/2, -5*e^2 - 2*e + 39, 6*e^2 + 8*e - 34, -6*e^2 + 40, -6*e^2 - 12*e + 28, -1/2*e^2 + 3*e + 17/2, 3/2*e^2 + 7*e - 27/2, -1/2*e^2 + 9*e + 41/2, -2*e^2 + 8*e + 32, 6*e + 4, 3/2*e^2 - e + 9/2, -7/2*e^2 + 3*e + 71/2, 3/2*e^2 + 7*e - 35/2, 1/2*e^2 - 3*e - 53/2, -9/2*e^2 - 5*e + 17/2, -2*e^2 - 4*e + 8, -3*e^2 - 14*e + 7, -4*e^2 - 4*e + 28, 4*e^2 - 32, 3*e^2 - 2*e - 51, -5*e^2 - 2*e + 61, e^2 - 10*e - 25, -6*e^2 - 12*e + 44, 1/2*e^2 + 7*e + 39/2, 8*e^2 + 8*e - 54, 6*e + 24, -3/2*e^2 - e - 21/2, 7*e^2 + 6*e - 43, 4*e^2 + 8*e - 12, 6*e^2 + 12*e - 36, 5*e^2 - 2*e - 63, -3*e^2 + 6*e + 15, -e^2 + 2*e + 17, -9/2*e^2 - 11*e + 57/2, -2*e^2 - 4, 7/2*e^2 + 7*e - 43/2, 6*e^2 + 8*e - 52, 13/2*e^2 - 7*e - 121/2, -15/2*e^2 - 11*e + 75/2, 1/2*e^2 + 3*e - 17/2, -11/2*e^2 - 5*e + 43/2, 3*e^2 - 4*e - 41, -7*e^2 - 4*e + 57, -4*e - 36, -4*e^2 - 12*e + 40, 10*e^2 + 4*e - 70, 2*e^2 + 12*e - 6, -5*e^2 - 10*e + 21, -8*e^2 - 8*e + 42, 6*e^2 + 4*e - 36, -2*e^2 + 2*e + 10, 7/2*e^2 + e - 119/2, -1/2*e^2 + 3*e - 11/2, 3/2*e^2 + 5*e - 35/2, -1/2*e^2 - 3*e + 57/2, -e^2 + 4*e - 5, -5/2*e^2 - 7*e + 53/2, -2*e^2 + 32, 3/2*e^2 - 11*e - 43/2, -3*e^2 - 6*e + 7, e^2 - 8*e - 39, -7*e^2 - 8*e + 17, -4*e^2 + 38, -6*e^2 + 56, 6*e^2 + 2*e - 74, 6*e + 16, -e^2 + 11, -e^2 + 4*e + 43, 3/2*e^2 - 3*e - 99/2, -5/2*e^2 - 9*e + 17/2, 12*e^2 + 16*e - 62, -3*e^2 - 4*e + 17, -7*e^2 - 12*e + 45, -6*e^2 - 4*e + 12, -9*e^2 - 10*e + 43, -6*e^2 - 8*e + 18, 11/2*e^2 + 11*e - 51/2, -11/2*e^2 - 11*e + 55/2, -10*e^2 - 14*e + 56, -e^2 + 2*e + 11, -2*e^2 + 12*e + 14, 6*e^2 + 6*e - 20, -6*e^2 + 4*e + 56, 4*e^2 - 54, 9/2*e^2 + 7*e - 41/2, -11/2*e^2 + 3*e + 155/2, 15/2*e^2 - e - 151/2, 17/2*e^2 + 11*e - 113/2, 3*e^2 + 8*e - 17, -2*e^2 - 12*e + 34, 3*e^2 + 6*e - 41]; 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;