/* 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![3, 2, -5, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [3, 3, w], [4, 2, -w^3 + 3*w^2 + w - 2], [11, 11, -w^3 + 3*w^2 + 2*w - 5], [13, 13, w^3 - 2*w^2 - 4*w + 2], [13, 13, -w + 2], [17, 17, w^3 - 3*w^2 - 2*w + 2], [19, 19, -w^2 + w + 4], [19, 19, w^3 - 2*w^2 - 3*w + 2], [23, 23, w^2 - 2*w - 1], [27, 3, w^3 - 2*w^2 - 5*w - 1], [29, 29, -w^3 + 2*w^2 + 5*w - 1], [37, 37, -w^3 + 2*w^2 + 5*w - 4], [41, 41, 2*w^3 - 5*w^2 - 6*w + 4], [53, 53, w^3 - 2*w^2 - 3*w - 2], [59, 59, w - 4], [67, 67, 2*w^2 - 3*w - 8], [73, 73, 2*w^3 - 5*w^2 - 6*w + 5], [89, 89, -2*w^3 + 6*w^2 + 5*w - 7], [97, 97, -2*w^3 + 6*w^2 + 3*w - 7], [97, 97, -w^3 + 3*w^2 + 3*w - 1], [103, 103, w^2 - 4*w - 4], [113, 113, 2*w^3 - 5*w^2 - 4*w + 1], [113, 113, -w^3 + 3*w^2 + w - 5], [139, 139, 2*w^2 - 3*w - 4], [139, 139, w^3 - w^2 - 6*w - 1], [149, 149, 2*w^3 - 5*w^2 - 5*w + 2], [149, 149, w^3 - 4*w^2 + 10], [151, 151, -3*w - 1], [157, 157, w^2 - w - 8], [157, 157, w^3 - 7*w - 8], [163, 163, -3*w^3 + 8*w^2 + 8*w - 10], [163, 163, w^3 - 3*w^2 - 4*w + 7], [163, 163, -w^3 + 4*w^2 + w - 8], [163, 163, -2*w^3 + 5*w^2 + 7*w - 4], [167, 167, -2*w^3 + 5*w^2 + 8*w - 4], [169, 13, -2*w^3 + 4*w^2 + 7*w - 5], [173, 173, 2*w^3 - 4*w^2 - 9*w + 4], [173, 173, -w^3 + 5*w^2 - 2*w - 5], [181, 181, 3*w^3 - 7*w^2 - 12*w + 7], [191, 191, w^3 - 3*w^2 - 3*w - 1], [199, 199, 2*w^3 - 3*w^2 - 10*w - 1], [199, 199, 2*w^3 - 6*w^2 - 6*w + 13], [223, 223, -2*w^3 + 6*w^2 + 4*w - 11], [223, 223, 3*w^3 - 7*w^2 - 12*w + 8], [223, 223, -2*w^3 + 5*w^2 + 6*w - 1], [229, 229, -w^3 + 3*w^2 + 2*w + 1], [229, 229, 3*w^3 - 4*w^2 - 15*w - 5], [233, 233, -3*w^3 + 7*w^2 + 11*w - 5], [233, 233, 2*w^3 - 5*w^2 - 4*w + 5], [241, 241, w^3 - 3*w^2 - 5*w + 7], [257, 257, w^3 - 3*w^2 - 4*w + 8], [263, 263, w^2 - 4*w - 5], [271, 271, -2*w^3 + 6*w^2 + 5*w - 13], [277, 277, -2*w^3 + 6*w^2 + 3*w - 8], [277, 277, w^3 - 2*w^2 - 2*w - 2], [281, 281, 2*w^3 - 5*w^2 - 4*w + 2], [283, 283, -3*w^2 + 7*w + 10], [283, 283, -w^3 + 4*w^2 - w - 7], [293, 293, 2*w^3 - 5*w^2 - 3*w + 4], [293, 293, w^3 - 8*w - 4], [307, 307, -w^3 + 2*w^2 + 6*w - 2], [311, 311, w^2 - 5], [317, 317, -w^3 + 5*w^2 - 2*w - 11], [331, 331, -w^3 + 3*w^2 - 5], [349, 349, -2*w^2 + 5*w + 2], [353, 353, -2*w^3 + 5*w^2 + 4*w - 4], [353, 353, 3*w^3 - 7*w^2 - 10*w + 2], [353, 353, -2*w^3 + 7*w^2 + 2*w - 10], [353, 353, w^3 + w^2 - 9*w - 13], [361, 19, -w^3 + w^2 + 5*w - 1], [373, 373, -w^3 + 3*w^2 + 4*w - 11], [373, 373, 2*w^3 - 5*w^2 - 5*w - 2], [383, 383, w^3 - 5*w^2 + w + 13], [389, 389, 3*w^3 - 10*w^2 - 4*w + 16], [397, 397, -w^3 + 2*w^2 + 3*w + 5], [397, 397, -3*w^3 + 7*w^2 + 10*w - 7], [419, 419, -w^3 + 2*w^2 + 4*w + 4], [419, 419, 3*w^3 - 7*w^2 - 12*w + 5], [421, 421, -w^2 + 5*w - 2], [421, 421, 3*w^3 - 7*w^2 - 10*w + 5], [431, 431, w^2 - 10], [439, 439, w^3 - w^2 - 7*w - 7], [461, 461, -2*w^3 + 7*w^2 + 5*w - 10], [467, 467, -3*w^3 + 6*w^2 + 14*w - 4], [479, 479, 3*w^2 - 6*w - 5], [479, 479, -4*w^3 + 11*w^2 + 10*w - 10], [491, 491, -w^3 + w^2 + 6*w - 1], [499, 499, -4*w^3 + 9*w^2 + 15*w - 10], [499, 499, 2*w^3 - 5*w^2 - 7*w + 2], [503, 503, -2*w^3 + 7*w^2 - 8], [521, 521, 2*w^2 - w - 7], [521, 521, -3*w^3 + 7*w^2 + 11*w - 11], [569, 569, 2*w^2 - 5*w - 1], [569, 569, -4*w - 1], [571, 571, -w^3 + 3*w^2 - 7], [577, 577, -w^3 + w^2 + 8*w - 4], [587, 587, -3*w^3 + 8*w^2 + 7*w - 8], [593, 593, 3*w^2 - 4*w - 11], [593, 593, -3*w^3 + 9*w^2 + 6*w - 14], [601, 601, -3*w^3 + 9*w^2 + 4*w - 10], [601, 601, 5*w^3 - 9*w^2 - 24*w - 2], [607, 607, 2*w^2 - 7*w - 5], [613, 613, w^3 - 6*w - 2], [613, 613, -w^2 + 3*w + 8], [617, 617, -w^2 + 4*w - 5], [619, 619, 3*w^3 - 6*w^2 - 13*w + 5], [625, 5, -5], [631, 631, -2*w^3 + 4*w^2 + 8*w - 7], [647, 647, -2*w^3 + 4*w^2 + 5*w - 1], [647, 647, w^3 - 3*w^2 - 2*w - 2], [653, 653, w^3 - 4*w^2 - w + 13], [653, 653, w^3 - 2*w^2 - 7*w + 5], [659, 659, -4*w^3 + 10*w^2 + 15*w - 14], [659, 659, 5*w^3 - 12*w^2 - 17*w + 14], [661, 661, w^2 - 5*w - 2], [661, 661, -w^3 + 5*w^2 - 2*w - 7], [673, 673, -w^3 + w^2 + 6*w - 2], [683, 683, 2*w^3 - 8*w^2 + w + 8], [683, 683, 5*w^3 - 12*w^2 - 19*w + 14], [701, 701, -2*w^3 + 6*w^2 + 5*w - 4], [709, 709, -w^2 + 3*w - 4], [709, 709, -2*w^3 + 5*w^2 + 9*w - 8], [719, 719, w^2 - 7], [719, 719, -2*w^3 + 3*w^2 + 8*w + 5], [733, 733, -2*w^3 + 7*w^2 + 3*w - 10], [739, 739, 4*w^3 - 11*w^2 - 13*w + 14], [739, 739, -5*w^3 + 10*w^2 + 21*w - 4], [739, 739, 3*w^3 - 8*w^2 - 6*w + 8], [739, 739, -w^3 + w^2 + 8*w - 5], [743, 743, -w - 5], [743, 743, w^3 - w^2 - 8*w - 8], [751, 751, -2*w^3 + 5*w^2 + 8*w - 2], [751, 751, -2*w^3 + 6*w^2 - 1], [757, 757, -2*w^3 + 6*w^2 + 3*w - 10], [757, 757, 5*w^2 - 9*w - 22], [761, 761, -2*w^3 + 4*w^2 + 9*w - 7], [761, 761, 2*w^3 - 3*w^2 - 12*w - 1], [769, 769, 5*w^3 - 13*w^2 - 14*w + 10], [773, 773, -3*w^3 + 5*w^2 + 16*w + 1], [773, 773, w^3 - 11*w + 2], [787, 787, -w^3 + 4*w^2 - w - 11], [797, 797, -5*w^3 + 12*w^2 + 17*w - 11], [809, 809, -2*w^3 + 7*w^2 + 4*w - 11], [809, 809, 4*w^3 - 9*w^2 - 14*w + 4], [821, 821, -w^3 + 5*w^2 - 2*w - 17], [827, 827, -3*w^3 + 8*w^2 + 9*w - 7], [829, 829, 2*w^3 - 6*w^2 - 5*w + 2], [829, 829, -w^3 + 4*w^2 - w - 10], [839, 839, w^2 - 8], [853, 853, -5*w^3 + 12*w^2 + 18*w - 16], [853, 853, w^3 - 6*w - 8], [863, 863, 5*w^3 - 11*w^2 - 19*w + 7], [881, 881, -3*w^3 + 9*w^2 + 9*w - 11], [907, 907, -w^3 + 2*w^2 + 7*w - 4], [907, 907, -2*w^3 + 3*w^2 + 7*w + 4], [929, 929, -w^3 + 5*w^2 - 3*w - 11], [937, 937, 2*w^3 - 5*w^2 - 6*w + 11], [937, 937, -2*w^3 + 6*w^2 + 3*w - 11], [941, 941, -3*w^3 + 8*w^2 + 11*w - 8], [953, 953, -4*w^3 + 10*w^2 + 10*w - 13], [953, 953, w^3 - 5*w^2 - w + 13], [967, 967, 3*w^3 - 7*w^2 - 9*w + 7], [967, 967, -2*w^3 + 5*w^2 + 8*w + 1], [967, 967, 4*w^3 - 13*w^2 - 6*w + 20], [967, 967, -2*w^2 + 3*w + 13], [971, 971, -6*w^3 + 13*w^2 + 25*w - 8], [977, 977, w^3 - w^2 - 4*w - 10], [977, 977, 2*w^3 - 6*w^2 - 7*w + 13], [983, 983, -4*w^3 + 10*w^2 + 11*w - 13], [983, 983, -w^3 + 5*w^2 - w - 7], [983, 983, 3*w^3 - 9*w^2 - 7*w + 19], [983, 983, -2*w^3 + 3*w^2 + 10*w - 1], [997, 997, 5*w^3 - 12*w^2 - 17*w + 13], [997, 997, -2*w^3 + 3*w^2 + 13*w - 4], [997, 997, w^3 - 7*w - 2], [997, 997, w^3 - 9*w - 2]]; primes := [ideal : I in primesArray]; heckePol := x^3 - 8*x - 4; K := NumberField(heckePol); heckeEigenvaluesArray := [e, -2, e^2 - 4, e^2 - 2*e - 8, -e^2 + 2*e + 8, -e^2 + e + 2, -2*e, 2*e^2 - e - 8, -2*e + 4, -e + 4, -e^2 + 4, -e^2 + 2*e + 4, -e^2 - e + 6, -e^2 - 2*e + 8, 2*e - 4, -e^2, e^2 + e - 2, -e^2 + 3*e + 10, e^2 - 2, -e^2 + 5*e + 10, 2*e^2 - 12, -e^2 + e + 14, -e^2 - 4*e + 6, e^2 - 4*e, -2*e^2 - e + 8, -e^2 - 2*e + 20, -3*e^2 + 2*e + 8, 2*e^2 + 6*e - 16, e^2 - 2*e - 4, e^2 + 6*e - 8, 4*e^2 - 5*e - 20, -2*e^2 - 2*e + 8, 2*e^2 - 6*e - 12, -2*e^2 + 5*e + 8, 2*e^2 - 6*e - 8, -3*e^2 + 3*e + 10, e^2 - 4*e - 8, -e^2 - 6*e + 4, 3*e^2 - 20, -6*e^2 + 8*e + 32, -2*e^2 - 2*e + 16, -2*e^2 - 4*e + 24, 2*e^2 - 4*e - 16, -2*e^2 - 4*e + 20, -4*e^2 + 2*e + 28, -3*e^2 + 2*e + 4, -3*e^2 + 6*e + 16, e^2 - e - 2, e^2 - e - 2, 3*e^2 - 4*e - 14, 6, 2*e^2 - 20, 6*e^2 - 4*e - 32, -3*e^2 - 2*e + 12, -e^2 + 2*e + 20, -3*e^2 - 3*e + 6, 2*e^2 - 10*e - 16, -2*e + 12, 3*e^2 + 2*e - 28, -3*e^2 - 4*e + 8, -2*e^2 + 7*e + 4, 6*e^2 - 8*e - 32, e^2 - 10*e - 8, -e^2 + 12, -3*e^2 + 4*e + 32, -3*e^2 + 7*e + 10, 3*e^2 - 3*e - 18, -e^2 + 4*e - 10, -4*e^2 + 12*e + 34, -5*e^2 + 9*e + 42, -3*e^2 - 2*e + 24, -7*e^2 + 10*e + 40, 4*e + 4, -5*e^2 + 2*e + 28, -e^2 + 6*e + 12, 5*e^2 - 2*e - 24, 3*e^2 + 4*e - 8, -2*e^2 + 3*e + 20, e^2 - 10*e - 16, -e^2 + 4*e - 12, 4*e^2 - 4*e - 8, -2*e^2 - 4*e + 12, 3*e^2 + 10*e - 32, 7*e - 8, 2*e^2 - 6*e - 32, 2*e^2 - 6*e - 32, 6*e^2 - 13*e - 28, 2*e^2 + e - 12, 2*e^2 - e - 32, -2*e^2 + 32, e^2 - 8*e + 6, 5*e^2 - e - 30, -5*e^2 + 7*e + 6, -3*e^2 - 3*e + 42, e^2 - 32, 7*e^2 - e - 34, 5*e + 8, 9*e^2 - 8*e - 50, -4*e^2 + 4*e + 26, -8*e + 18, 7*e^2 - 3*e - 30, -4*e^2 - 2*e + 36, 3*e^2 - 2*e - 28, -7*e^2 - 6*e + 36, -4*e - 10, 2*e^2 - 9*e + 8, 5*e^2 - 8*e - 38, -2*e^2 + 4*e + 4, 2*e^2 - 4*e - 12, 12*e + 12, -5*e^2 + 2*e + 40, 7*e^2 - 4*e - 44, 7*e + 16, 7*e + 16, -5*e^2 + 2*e + 20, -e^2 - 6*e - 12, e^2 - 7*e + 14, 5*e^2 + 4*e - 28, 5*e + 20, 5*e^2 - 8, -5*e^2 + 2*e + 12, 9*e^2 - 4*e - 48, 8*e^2 - 4*e - 36, -4*e^2 + 16*e + 20, 5*e^2 - 2*e + 4, -2*e^2 + 7*e + 16, 6*e^2 - 19*e - 36, -8*e^2 + 9*e + 48, -8*e^2 - e + 32, -12, -4*e^2 + 8*e + 48, -4*e^2 + 2*e + 52, -2*e^2 + 16*e + 20, -7*e^2 - 2*e + 52, 9*e^2 - 2*e - 36, -5*e^2 - 9*e + 38, -5*e^2 + 7*e + 30, -e^2 - 5*e - 6, 5*e^2 - 12*e - 56, 3*e^2 - 4*e - 28, 10*e^2 - 10*e - 60, e^2 + 10*e, 5*e^2 - 16*e - 18, e^2 + 9*e + 2, -e^2 + 14*e + 12, 2*e^2 - 5*e - 52, 5*e^2 - 4*e - 32, 5*e^2 + 2*e - 28, -6*e^2 + 20*e + 44, 5*e^2 - 8*e - 48, e^2 + 6*e + 16, -8*e^2 + 6*e + 44, -9*e^2 + 7*e + 46, 4*e^2 + e - 56, 7*e^2 - 44, 3*e^2 + 4*e - 2, -e^2 - 12*e - 6, 9*e^2 - 8*e - 42, -e^2 - 8*e - 4, 5*e^2 - 19*e - 30, 7*e^2 - 4*e - 38, 2*e^2 - 4*e + 28, 6*e^2 - 2*e - 16, 4*e, -4*e^2 - 8*e + 28, -8*e^2 + e + 60, 8*e^2 + 4*e - 34, -3*e^2 + 18, -4*e^2 - 4*e, -2*e^2 + 8, 6*e^2 - 4*e + 8, -6*e^2 + 4*e + 28, -11*e^2 - 4*e + 56, -e^2 + 6*e - 4, -9*e^2 + 4*e + 20, -3*e^2 - 2*e + 32]; heckeEigenvalues := AssociativeArray(); for i := 1 to #heckeEigenvaluesArray do heckeEigenvalues[primes[i]] := heckeEigenvaluesArray[i]; end for; ALEigenvalues := AssociativeArray(); // 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;