/* 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![-2, 4, 3, -6, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [2, 2, w], [7, 7, -2*w^4 + w^3 + 12*w^2 + w - 5], [8, 2, w^4 - 7*w^2 - 3*w + 5], [19, 19, -2*w^4 + w^3 + 12*w^2 - 5], [19, 19, -w^3 + w^2 + 5*w - 1], [29, 29, 2*w^4 - 2*w^3 - 11*w^2 + 4*w + 3], [31, 31, -2*w^4 + w^3 + 12*w^2 + 2*w - 5], [37, 37, -2*w^4 + 13*w^2 + 5*w - 7], [53, 53, 3*w^4 - 2*w^3 - 18*w^2 + 3*w + 9], [59, 59, 2*w^4 - 13*w^2 - 6*w + 5], [61, 61, -3*w^4 + 2*w^3 + 18*w^2 - 2*w - 11], [61, 61, w^2 - w - 3], [61, 61, 6*w^4 - 2*w^3 - 38*w^2 - 6*w + 23], [67, 67, -w^4 + 7*w^2 + 4*w - 5], [67, 67, -w^4 + 6*w^2 + 2*w - 1], [71, 71, -w^2 + 3], [73, 73, 3*w^4 - w^3 - 19*w^2 - 3*w + 9], [79, 79, 3*w^4 - w^3 - 19*w^2 - 4*w + 11], [83, 83, -w^4 - w^3 + 7*w^2 + 8*w - 3], [97, 97, -2*w^4 + w^3 + 12*w^2 + 2*w - 3], [97, 97, w^4 - w^3 - 5*w^2 + 2*w + 3], [103, 103, -4*w^4 + w^3 + 25*w^2 + 7*w - 13], [103, 103, 7*w^4 - 3*w^3 - 43*w^2 - 4*w + 23], [107, 107, 4*w^4 - 2*w^3 - 24*w^2 - w + 9], [113, 113, 5*w^4 - 3*w^3 - 30*w^2 + w + 15], [137, 137, -3*w^4 + 2*w^3 + 17*w^2 - 7], [139, 139, w^2 - 5], [149, 149, 4*w^4 - w^3 - 26*w^2 - 5*w + 17], [151, 151, -4*w^4 + 2*w^3 + 24*w^2 + w - 13], [157, 157, -4*w^4 + w^3 + 26*w^2 + 5*w - 15], [157, 157, 5*w^4 - 2*w^3 - 31*w^2 - 4*w + 15], [157, 157, -3*w^4 + 2*w^3 + 19*w^2 - 2*w - 15], [169, 13, -w^4 + 2*w^3 + 5*w^2 - 8*w - 3], [173, 173, w^4 - w^3 - 5*w^2 + w - 1], [179, 179, -2*w^4 + 2*w^3 + 12*w^2 - 5*w - 7], [191, 191, -4*w^4 + 2*w^3 + 24*w^2 + 2*w - 11], [193, 193, 2*w^4 - 2*w^3 - 11*w^2 + 5*w + 5], [197, 197, w^4 - 6*w^2 - w + 1], [197, 197, -w^4 + 8*w^2 + 2*w - 11], [199, 199, -3*w^4 + w^3 + 20*w^2 + 3*w - 17], [211, 211, 4*w^4 - 2*w^3 - 25*w^2 + 13], [223, 223, w^4 - 6*w^2 - 3*w - 1], [223, 223, 2*w^4 - 13*w^2 - 4*w + 9], [223, 223, -2*w^4 + 2*w^3 + 11*w^2 - 3*w - 3], [227, 227, 2*w^4 - 12*w^2 - 7*w + 5], [227, 227, -w^4 + 8*w^2 + w - 7], [229, 229, -2*w^4 - w^3 + 14*w^2 + 11*w - 11], [229, 229, -3*w^4 + 19*w^2 + 8*w - 11], [233, 233, -w^4 + 8*w^2 + 2*w - 7], [233, 233, 3*w^4 - w^3 - 20*w^2 - w + 11], [239, 239, -w^4 + 6*w^2 + 5*w - 3], [243, 3, -3], [251, 251, -w^4 + w^3 + 5*w^2 - 3*w - 3], [263, 263, 3*w^4 - 2*w^3 - 18*w^2 + 2*w + 7], [269, 269, -3*w^4 + 20*w^2 + 8*w - 11], [271, 271, 4*w^4 - 2*w^3 - 25*w^2 - w + 13], [283, 283, -w^2 + 3*w + 1], [283, 283, 6*w^4 - 4*w^3 - 36*w^2 + 3*w + 19], [283, 283, -6*w^4 + 3*w^3 + 36*w^2 + 2*w - 17], [289, 17, -8*w^4 + 2*w^3 + 49*w^2 + 12*w - 21], [293, 293, -3*w^4 + 2*w^3 + 17*w^2 - 2*w - 7], [293, 293, 2*w^4 - 2*w^3 - 12*w^2 + 4*w + 7], [307, 307, -2*w^4 + 13*w^2 + 7*w - 9], [311, 311, -w^4 + 5*w^2 + 4*w + 3], [311, 311, 3*w^4 - w^3 - 18*w^2 - 2*w + 7], [317, 317, -w^4 + w^3 + 6*w^2 - 4*w - 3], [337, 337, 4*w^4 - w^3 - 25*w^2 - 7*w + 15], [347, 347, -2*w^4 + w^3 + 13*w^2 + w - 11], [347, 347, -3*w^4 + w^3 + 20*w^2 + 2*w - 17], [349, 349, -w^3 + w^2 + 3*w + 3], [359, 359, 3*w^4 - w^3 - 18*w^2 - 3*w + 11], [367, 367, -w^4 - w^3 + 8*w^2 + 6*w - 7], [367, 367, 4*w^4 - 3*w^3 - 24*w^2 + 3*w + 11], [373, 373, -w^3 + 6*w + 1], [379, 379, 2*w^4 - 14*w^2 - 5*w + 9], [397, 397, -2*w^4 - w^3 + 15*w^2 + 11*w - 13], [397, 397, w^4 - 6*w^2 - 2*w - 1], [397, 397, -w^4 - w^3 + 8*w^2 + 8*w - 5], [401, 401, -2*w^4 + 14*w^2 + 7*w - 13], [409, 409, -4*w^4 + 2*w^3 + 24*w^2 - 11], [421, 421, 3*w^4 - 2*w^3 - 18*w^2 + 9], [433, 433, -2*w^4 + 2*w^3 + 12*w^2 - 5*w - 5], [433, 433, 6*w^4 - w^3 - 38*w^2 - 12*w + 21], [439, 439, -5*w^4 + 2*w^3 + 30*w^2 + 3*w - 15], [443, 443, 4*w^4 - 2*w^3 - 26*w^2 - w + 15], [443, 443, -w^4 + w^3 + 5*w^2 - w - 5], [443, 443, -w^4 + w^3 + 6*w^2 - 4*w - 5], [443, 443, -w^4 + 6*w^2 + 5*w - 1], [443, 443, w^4 + w^3 - 7*w^2 - 7*w + 1], [461, 461, 2*w^4 - 14*w^2 - 6*w + 9], [461, 461, -w^4 + w^3 + 4*w^2 - 2*w + 5], [463, 463, w^4 - 7*w^2 - 2*w + 1], [479, 479, -6*w^4 + 3*w^3 + 37*w^2 + w - 19], [499, 499, -4*w^4 + 25*w^2 + 11*w - 13], [499, 499, 5*w^4 - 3*w^3 - 31*w^2 + 17], [503, 503, -4*w^4 + 3*w^3 + 23*w^2 - 3*w - 7], [503, 503, -3*w^4 + w^3 + 18*w^2 + w - 9], [503, 503, 2*w^4 - w^3 - 14*w^2 - w + 11], [509, 509, 8*w^4 - 2*w^3 - 52*w^2 - 11*w + 35], [521, 521, -2*w^4 + 2*w^3 + 13*w^2 - 5*w - 11], [521, 521, 10*w^4 - 4*w^3 - 63*w^2 - 6*w + 39], [529, 23, -w^4 - w^3 + 7*w^2 + 7*w - 3], [547, 547, 9*w^4 - 5*w^3 - 55*w^2 + w + 29], [547, 547, -w^4 + 2*w^3 + 6*w^2 - 9*w - 7], [557, 557, -5*w^4 + w^3 + 32*w^2 + 6*w - 17], [563, 563, 4*w^4 - w^3 - 26*w^2 - 4*w + 19], [587, 587, -2*w^3 + 3*w^2 + 10*w - 5], [587, 587, 7*w^4 - w^3 - 45*w^2 - 15*w + 25], [593, 593, -9*w^4 + 3*w^3 + 57*w^2 + 10*w - 33], [599, 599, w^4 + w^3 - 6*w^2 - 7*w + 3], [601, 601, w^4 - 2*w^3 - 4*w^2 + 9*w - 1], [601, 601, 3*w^4 - 3*w^3 - 16*w^2 + 5*w + 3], [607, 607, 6*w^4 - 2*w^3 - 38*w^2 - 5*w + 23], [607, 607, 4*w^4 - 2*w^3 - 24*w^2 - 3*w + 11], [613, 613, -w^4 + w^3 + 7*w^2 - 3*w - 5], [641, 641, 2*w^4 - 2*w^3 - 11*w^2 + 4*w + 7], [641, 641, -w^3 + 6*w - 1], [647, 647, 7*w^4 - 3*w^3 - 45*w^2 - 2*w + 31], [659, 659, -3*w^4 + w^3 + 19*w^2 + w - 9], [661, 661, -2*w^4 + 15*w^2 + 5*w - 13], [683, 683, -w^4 + 8*w^2 + 2*w - 9], [683, 683, -4*w^4 + 3*w^3 + 24*w^2 - 4*w - 17], [683, 683, 6*w^4 - 3*w^3 - 36*w^2 - w + 15], [691, 691, -3*w^4 + w^3 + 18*w^2 + 4*w - 11], [709, 709, w^4 - w^3 - 4*w^2 + 4*w - 3], [733, 733, -5*w^4 + 2*w^3 + 30*w^2 + 2*w - 15], [743, 743, -9*w^4 + 5*w^3 + 55*w^2 - 31], [751, 751, -4*w^4 + 2*w^3 + 23*w^2 + 2*w - 9], [751, 751, 5*w^4 - w^3 - 32*w^2 - 8*w + 19], [761, 761, w^4 + w^3 - 7*w^2 - 6*w + 3], [761, 761, -6*w^4 + w^3 + 38*w^2 + 11*w - 19], [787, 787, -w^3 + w^2 + 3*w - 5], [787, 787, -6*w^4 + 3*w^3 + 35*w^2 + 3*w - 13], [809, 809, -7*w^4 + 5*w^3 + 42*w^2 - 6*w - 23], [821, 821, 3*w^4 - 2*w^3 - 18*w^2 + 2*w + 5], [827, 827, 7*w^4 - 3*w^3 - 43*w^2 - 3*w + 23], [829, 829, 4*w^4 - w^3 - 26*w^2 - 7*w + 19], [829, 829, 5*w^4 - 2*w^3 - 30*w^2 - 4*w + 17], [841, 29, w^4 - w^3 - 5*w^2 - 1], [841, 29, 6*w^4 - 2*w^3 - 38*w^2 - 6*w + 19], [853, 853, 3*w^4 - 20*w^2 - 7*w + 13], [857, 857, 2*w^3 - 3*w^2 - 8*w + 3], [859, 859, -5*w^4 + 2*w^3 + 33*w^2 + 2*w - 27], [863, 863, -3*w^4 + 2*w^3 + 17*w^2 - 3], [881, 881, -5*w^4 + w^3 + 32*w^2 + 10*w - 21], [883, 883, w^2 - 2*w - 5], [887, 887, 3*w^4 + w^3 - 21*w^2 - 12*w + 13], [911, 911, -4*w^4 + w^3 + 26*w^2 + 7*w - 17], [911, 911, 6*w^4 - 2*w^3 - 37*w^2 - 5*w + 19], [919, 919, 14*w^4 - 3*w^3 - 86*w^2 - 26*w + 37], [919, 919, -7*w^4 + 4*w^3 + 42*w^2 - 21], [937, 937, 3*w^4 - 2*w^3 - 19*w^2 + 4*w + 13], [947, 947, 6*w^4 - 3*w^3 - 36*w^2 - 2*w + 19], [953, 953, w^4 - 2*w^3 - 3*w^2 + 6*w - 5], [953, 953, -9*w^4 + 3*w^3 + 56*w^2 + 10*w - 31], [977, 977, -5*w^4 + w^3 + 33*w^2 + 7*w - 23], [977, 977, -5*w^4 + 2*w^3 + 31*w^2 + 2*w - 13], [997, 997, 6*w^4 - w^3 - 38*w^2 - 13*w + 21], [997, 997, 4*w^4 - 2*w^3 - 24*w^2 - 4*w + 13]]; primes := [ideal : I in primesArray]; heckePol := x^2 + 4*x - 6; K := NumberField(heckePol); heckeEigenvaluesArray := [0, e, -e - 1, -2, 2, -3*e - 6, e - 4, 2*e, 0, -6, -e, 10, -10, e + 6, 2*e + 6, 4*e + 4, -2, -e - 2, 2*e - 4, -2*e - 10, 4*e + 14, 3*e - 2, 2*e - 2, -e - 10, -e - 4, 4*e + 10, -5*e - 10, 4*e - 2, -4*e - 12, -4*e - 8, -5*e - 18, -4*e - 18, -8, 12, -4*e - 22, 2*e - 10, -3*e - 16, 2*e + 2, -18, 20, -2*e - 24, -5*e - 4, -2*e - 12, -2*e - 12, 6*e + 18, -12, -6*e - 10, 4, 18, -4*e - 4, 4*e + 16, 4*e + 14, 2*e + 2, e + 4, -6*e - 6, 6*e + 22, 6*e + 10, -6*e - 10, -2*e - 24, e - 10, 2*e - 10, 5*e + 20, e - 28, -12, -8*e - 14, -6, 4*e, 3*e, 2*e - 4, 2*e + 28, -4*e - 4, -4*e - 14, e, 2*e - 12, 2*e + 4, 2*e + 22, -2*e + 14, -2*e + 14, -6*e - 30, 7*e + 2, 4*e + 14, 3*e + 14, -6*e - 8, e + 2, -6*e - 18, 9*e + 24, -8*e - 14, e - 2, -6*e - 18, 24, -e - 34, 14, -4*e + 20, e + 6, 4, -2*e - 2, -10*e - 28, 3*e + 12, -3*e, 6*e - 12, 8*e + 8, 28, 6*e + 16, 7*e + 26, -e + 8, -11*e - 26, 2*e - 28, 6*e, 2*e - 34, -3*e - 24, 10, 6*e + 14, 40, 2*e + 16, -e + 10, 12*e + 18, e + 16, 6*e + 6, 11*e + 14, -8*e - 22, 8*e + 8, -10*e - 28, -e + 26, -10*e - 18, 2*e + 12, 8*e + 12, 3*e + 42, 7*e - 6, 9*e + 14, -4*e - 34, -3*e + 18, 8*e + 40, -8*e - 40, -4*e + 14, 6*e + 18, 2*e - 16, 2*e + 54, 10*e + 26, -14, -11*e - 42, 2*e - 6, 9*e + 42, -5*e + 8, 12*e + 12, -6*e - 42, 2*e - 36, 12*e + 36, -6*e, -2*e - 26, 16, -2*e - 4, -9*e - 34, 5*e - 28, -12*e - 30, 18, -9*e - 42, e + 4, -8*e - 34, 8*e + 34]; 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;