/* 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, 11, -10, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [11, 11, -w - 1], [11, 11, w^2 - 5], [11, 11, -w^2 + 2*w + 4], [11, 11, w - 2], [16, 2, 2], [19, 19, w^2 - 2*w - 5], [19, 19, -w^2 + 6], [25, 5, -2*w^2 + 2*w + 11], [29, 29, w], [29, 29, 2*w^2 - w - 10], [29, 29, -2*w^2 + 3*w + 9], [29, 29, w - 1], [31, 31, w^3 - 6*w - 6], [31, 31, -w^3 + 3*w^2 + 3*w - 11], [41, 41, w^3 - 4*w^2 - 2*w + 16], [41, 41, w^3 - 5*w^2 - 2*w + 24], [59, 59, w^3 - w^2 - 5*w - 2], [59, 59, 2*w^2 - w - 13], [61, 61, w^3 - w^2 - 6*w + 3], [61, 61, -w^3 + 2*w^2 + 5*w - 3], [71, 71, 2*w^2 - w - 16], [71, 71, -w^3 + 3*w^2 + 4*w - 10], [71, 71, -w^3 + 7*w + 4], [71, 71, w^3 - 5*w^2 - 2*w + 23], [79, 79, -w^3 + 4*w^2 + 3*w - 16], [79, 79, w^3 + w^2 - 8*w - 10], [81, 3, -3], [131, 131, 4*w^2 - 5*w - 24], [131, 131, 4*w^2 - 3*w - 25], [139, 139, w^2 + w - 9], [139, 139, -w^3 + w^2 + 6*w - 5], [149, 149, w^3 - w^2 - 4*w + 2], [149, 149, w^3 - 2*w^2 - 3*w + 2], [151, 151, -w^3 + 7*w + 3], [151, 151, -w^3 + 3*w^2 + 4*w - 9], [179, 179, -w^3 - 2*w^2 + 10*w + 16], [179, 179, -w^3 + 3*w^2 + 3*w - 6], [179, 179, w^3 - 6*w - 1], [179, 179, w^3 - 5*w^2 - 3*w + 23], [191, 191, w^3 - 6*w^2 - w + 27], [191, 191, w^3 + 3*w^2 - 10*w - 21], [199, 199, -w^3 + 2*w^2 + 6*w - 4], [199, 199, -4*w^2 + 3*w + 22], [199, 199, 4*w^2 - 5*w - 21], [199, 199, 3*w^2 - 4*w - 12], [239, 239, -w^3 + w^2 + 4*w - 6], [239, 239, 2*w^3 - 5*w^2 - 9*w + 17], [239, 239, 2*w^3 - w^2 - 13*w - 5], [239, 239, w^3 - 8*w^2 + 2*w + 41], [241, 241, -w^3 + 5*w^2 + 4*w - 25], [241, 241, w^3 - 6*w - 8], [241, 241, -w^3 + 3*w^2 + 3*w - 13], [241, 241, w^3 - 5*w^2 + w + 19], [269, 269, w^2 - 2*w - 10], [269, 269, w^2 - 11], [271, 271, w^3 + 2*w^2 - 8*w - 18], [271, 271, 2*w^3 - 13*w - 10], [271, 271, 2*w^3 + w^2 - 15*w - 16], [271, 271, w^3 - 5*w^2 - w + 23], [289, 17, 2*w^2 - 11], [289, 17, -2*w^2 + 4*w + 9], [311, 311, w^3 - 4*w^2 - 3*w + 10], [311, 311, w^3 - 7*w^2 - w + 34], [331, 331, w^3 - w^2 - 7*w + 4], [331, 331, w^3 - 2*w^2 - 6*w + 3], [349, 349, w^3 + w^2 - 6*w - 12], [349, 349, -w^3 + 4*w^2 + w - 16], [361, 19, 4*w^2 - 4*w - 21], [379, 379, w^3 - 3*w^2 - 3*w + 15], [379, 379, 2*w^3 - 2*w^2 - 12*w + 1], [379, 379, -2*w^3 + 4*w^2 + 10*w - 11], [379, 379, w^3 - 6*w - 10], [401, 401, -2*w^3 + 7*w^2 + 8*w - 30], [401, 401, -w^3 + 2*w^2 + 6*w - 2], [419, 419, 5*w^2 - 4*w - 26], [419, 419, 5*w^2 - 6*w - 25], [421, 421, 3*w^2 - w - 20], [421, 421, -2*w^3 + 2*w^2 + 10*w + 3], [431, 431, w^2 - 3*w - 5], [431, 431, w^2 + w - 7], [449, 449, 2*w^3 - 13*w - 7], [449, 449, -2*w^3 + 6*w^2 + 7*w - 18], [461, 461, w^3 - w^2 - 8*w + 3], [461, 461, -w^3 + 2*w^2 + 7*w - 5], [491, 491, w^3 - 3*w^2 - 6*w + 15], [491, 491, w^3 - 9*w - 7], [499, 499, 4*w^2 - 6*w - 23], [499, 499, -4*w^2 + 2*w + 25], [509, 509, 2*w^3 - 3*w^2 - 11*w + 6], [521, 521, -w^3 + 3*w^2 + 2*w - 12], [521, 521, -w^3 + 4*w^2 + 2*w - 19], [529, 23, w^3 - 7*w^2 - w + 35], [529, 23, -w^3 + 3*w^2 + 4*w - 5], [541, 541, 2*w^3 - w^2 - 12*w - 5], [541, 541, w^3 - 2*w^2 - 7*w + 9], [569, 569, w^3 - 8*w - 2], [569, 569, -w^3 + 3*w^2 + 5*w - 9], [599, 599, -w^3 - 4*w^2 + 10*w + 25], [599, 599, -w^3 + 7*w^2 - 36], [601, 601, 5*w^2 - 6*w - 26], [601, 601, -2*w^3 + 8*w^2 + 6*w - 33], [601, 601, -2*w^3 - 2*w^2 + 16*w + 21], [601, 601, 5*w^2 - 4*w - 27], [619, 619, w^3 + 4*w^2 - 11*w - 26], [619, 619, w^3 - 3*w^2 - 5*w + 18], [641, 641, -w^3 + 3*w^2 + 6*w - 14], [641, 641, -w^3 + 9*w + 6], [659, 659, -w^3 - 4*w^2 + 10*w + 28], [659, 659, -w^3 + 6*w^2 - w - 27], [659, 659, -w^3 - 3*w^2 + 8*w + 23], [659, 659, -w^3 + 7*w^2 - w - 33], [691, 691, w^3 - w^2 - 8*w + 2], [691, 691, 2*w^3 - 2*w^2 - 11*w + 1], [701, 701, -w^3 - w^2 + 7*w + 15], [701, 701, -w^3 + 4*w^2 + 2*w - 20], [709, 709, -2*w^3 - w^2 + 15*w + 15], [709, 709, 2*w^3 - 7*w^2 - 7*w + 27], [719, 719, -w^3 - 4*w^2 + 13*w + 26], [719, 719, w^3 - 7*w^2 - 2*w + 34], [739, 739, 2*w^3 + 2*w^2 - 15*w - 24], [739, 739, -2*w^3 + 8*w^2 + 5*w - 35], [751, 751, -w^3 - 3*w^2 + 9*w + 25], [751, 751, -w^3 + 6*w^2 - 30], [761, 761, 3*w^3 - 2*w^2 - 16*w - 8], [761, 761, -3*w^3 + 7*w^2 + 11*w - 23], [769, 769, -2*w^3 + 4*w^2 + 11*w - 10], [769, 769, w^3 + 2*w^2 - 9*w - 12], [809, 809, -3*w^3 + 3*w^2 + 16*w + 4], [809, 809, w^3 + 5*w^2 - 12*w - 30], [811, 811, -w^3 - 4*w^2 + 10*w + 27], [811, 811, -2*w^3 + 5*w^2 + 9*w - 14], [811, 811, -2*w^3 + w^2 + 13*w + 2], [811, 811, -w^3 + 7*w^2 - w - 32], [821, 821, 2*w^3 - 8*w^2 - 7*w + 35], [821, 821, -2*w^3 - 2*w^2 + 17*w + 22], [829, 829, -3*w^3 + 20*w + 13], [829, 829, -w^3 + 7*w^2 - w - 36], [829, 829, w^3 + 4*w^2 - 10*w - 31], [829, 829, 2*w^3 - 3*w^2 - 11*w + 14], [859, 859, -w^3 + 7*w^2 - 3*w - 31], [859, 859, 7*w^2 - 9*w - 39], [859, 859, 7*w^2 - 5*w - 41], [859, 859, 3*w^3 - 4*w^2 - 17*w + 2], [929, 929, w^3 + 5*w^2 - 14*w - 31], [929, 929, -2*w^3 + 4*w^2 + 10*w - 5], [929, 929, w^3 - 9*w^2 + 4*w + 44], [929, 929, -w^3 + 8*w^2 + w - 39], [941, 941, -w^3 + 7*w^2 - 34], [941, 941, w^3 + 4*w^2 - 11*w - 28], [961, 31, -5*w^2 + 5*w + 28], [971, 971, -3*w^3 + w^2 + 19*w + 14], [971, 971, -3*w^3 + 8*w^2 + 12*w - 31], [991, 991, -w^3 - 5*w^2 + 11*w + 35], [991, 991, w^3 - 8*w^2 + 2*w + 40]]; primes := [ideal : I in primesArray]; heckePol := x^3 - 2*x^2 - 22*x + 58; K := NumberField(heckePol); heckeEigenvaluesArray := [e, e^2 + e - 14, -2, 2*e^2 + 2*e - 32, e^2 + 2*e - 19, -1, -2*e^2 - 3*e + 38, e^2 - 18, -e + 1, -2*e^2 - 3*e + 39, -2*e^2 - 2*e + 35, e^2 + e - 13, 2*e^2 + 4*e - 36, -6, e^2 - 17, -2*e^2 - 2*e + 39, -3*e^2 - 3*e + 46, -e^2 - e + 16, 3*e^2 + 5*e - 51, e^2 + 2*e - 25, 3*e^2 + 3*e - 52, 2*e^2 + 4*e - 40, -5*e^2 - 9*e + 92, e^2 + 3*e - 12, 3*e^2 + 3*e - 50, 2*e^2 + 2*e - 22, -6*e^2 - 10*e + 106, 4*e^2 + 4*e - 64, 4*e^2 + 6*e - 62, 6*e^2 + 10*e - 98, 2*e + 2, -4*e^2 - 3*e + 67, 3*e^2 + 4*e - 49, 4*e + 6, -e^2 - 3*e + 20, e^2 + 3*e - 22, -2*e^2 - 2*e + 44, -8*e^2 - 13*e + 138, 2*e^2 - 22, -8*e^2 - 13*e + 144, 7*e^2 + 11*e - 118, -4*e^2 - 4*e + 64, 2*e - 6, -11*e^2 - 19*e + 196, -2*e^2 - 5*e + 36, -5*e^2 - 3*e + 82, 2*e^2 + 8*e - 32, 18, 6*e^2 + 7*e - 110, -6*e^2 - 12*e + 107, 3*e^2 + 3*e - 49, -4*e^2 - 5*e + 81, 4*e^2 + 5*e - 77, -3*e^2 - 7*e + 39, -3*e^2 + 49, -e + 20, 2*e^2 + 5*e - 40, -8*e^2 - 9*e + 122, 4*e^2 + 4*e - 48, -2*e^2 - 3*e + 27, 3*e^2 + 9*e - 55, 2*e^2 + 3*e - 58, -4*e^2 + 74, 6*e^2 + 6*e - 110, e^2 + e - 40, -2*e^2 - 5*e + 39, -5*e^2 - 7*e + 73, 10*e^2 + 15*e - 167, -2*e^2 - e + 52, -8*e^2 - 9*e + 132, -e + 2, -7*e^2 - 11*e + 104, -5*e^2 - 13*e + 91, -3*e^2 - 2*e + 65, 11*e^2 + 15*e - 190, 6*e^2 + 8*e - 102, -10*e^2 - 11*e + 173, -3*e^2 - 5*e + 23, 2*e^2 + 6*e - 26, 7*e^2 + 9*e - 116, -2*e^2 + 29, 4*e^2 + 6*e - 71, -7*e^2 - 12*e + 141, -e^2 + 4*e + 13, 7*e^2 + 13*e - 120, -2*e^2 - 2*e + 66, -8*e^2 - 8*e + 142, 4*e^2 + 11*e - 58, 3*e^2 - 38, 9*e^2 + 5*e - 147, -13*e^2 - 21*e + 221, -10*e^2 - 11*e + 169, 6*e^2 + 9*e - 79, -7*e^2 - 10*e + 101, 4*e^2 + 7*e - 91, -7*e^2 - 12*e + 134, 8*e^2 + 8*e - 122, -9*e^2 - 11*e + 142, 7*e^2 + 11*e - 140, 4*e^2 - 2*e - 63, -3*e^2 - 2*e + 45, -5*e^2 - 5*e + 51, -27, -10*e^2 - 14*e + 170, 9*e^2 + 7*e - 138, -9*e^2 - 14*e + 174, 5*e^2 + 6*e - 116, -10*e^2 - 10*e + 172, 4*e^2 + 4*e - 48, -10*e^2 - 18*e + 178, 3*e^2 + 5*e - 48, -2*e^2 - 2*e + 32, -2*e^2 + 2*e + 40, -10*e^2 - 18*e + 170, 12*e^2 + 16*e - 206, -9*e^2 - 10*e + 154, 11*e^2 + 12*e - 166, 8*e^2 + 16*e - 150, 16*e^2 + 20*e - 276, 2*e^2 + 10*e - 38, -6*e^2 - 6*e + 106, -10*e^2 - 16*e + 176, 4*e^2 + 8*e - 70, 6*e^2 + 14*e - 94, -15*e^2 - 18*e + 262, -5, 2*e^2 + 3*e - 37, 6*e^2 + 13*e - 87, e^2 - 3*e - 5, 7*e^2 + 13*e - 132, 9*e - 10, -16*e^2 - 24*e + 270, 14*e^2 + 17*e - 216, -19*e^2 - 26*e + 317, -7*e^2 - 12*e + 141, -4*e^2 - 9*e + 73, 15*e^2 + 18*e - 238, -13*e^2 - 14*e + 190, -12*e^2 - 18*e + 229, -6*e^2 - 16*e + 96, 4*e^2 + 3*e - 60, 2*e^2 + 6*e - 22, 15*e^2 + 17*e - 230, -6*e^2 - 11*e + 115, 13*e^2 + 18*e - 188, 8*e^2 + 16*e - 130, 13*e^2 + 21*e - 199, e^2 + 2*e - 49, -5*e^2 - 8*e + 91, 8*e^2 + 11*e - 135, -6*e^2 - 12*e + 114, 10*e^2 + 15*e - 200, 18*e^2 + 27*e - 292, -12*e^2 - 15*e + 200]; 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;