/* 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![-1, 3, 4, -5, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [3, 3, w^4 - w^3 - 5*w^2 + 3*w + 3], [9, 3, -w^4 + 5*w^2 - 3], [9, 3, -w^4 + w^3 + 5*w^2 - 3*w - 2], [13, 13, -w^4 + w^3 + 4*w^2 - 3*w - 1], [17, 17, w^4 - w^3 - 5*w^2 + 3*w + 1], [19, 19, -w^3 + w^2 + 4*w - 2], [23, 23, -w^2 + 3], [31, 31, w^3 - 4*w + 2], [32, 2, 2], [37, 37, w^3 - 3*w - 1], [53, 53, -2*w^4 + w^3 + 9*w^2 - 3*w - 2], [59, 59, -w^4 + 5*w^2 + w - 4], [61, 61, -w^4 + w^3 + 5*w^2 - 4*w], [67, 67, -w^4 + 6*w^2 + 2*w - 4], [71, 71, 2*w^4 - w^3 - 9*w^2 + 4*w + 5], [79, 79, 2*w^4 - w^3 - 10*w^2 + 2*w + 7], [83, 83, -w^4 + 2*w^3 + 5*w^2 - 7*w - 2], [83, 83, -w^4 + w^3 + 4*w^2 - 3*w + 3], [83, 83, w^4 - w^3 - 5*w^2 + 4*w - 1], [83, 83, -w^4 + w^3 + 4*w^2 - 4*w - 2], [83, 83, -2*w^4 + w^3 + 9*w^2 - 3*w - 5], [97, 97, -w^4 - w^3 + 6*w^2 + 4*w - 4], [101, 101, -w^4 + 4*w^2 + 2*w - 2], [107, 107, -2*w^4 + w^3 + 11*w^2 - 3*w - 7], [127, 127, w^3 - w^2 - 4*w], [131, 131, w^4 - w^3 - 4*w^2 + 2*w - 1], [137, 137, w^4 - w^3 - 6*w^2 + 3*w + 3], [139, 139, -2*w^4 + w^3 + 9*w^2 - 3*w + 1], [157, 157, 2*w^4 - w^3 - 9*w^2 + 4*w + 2], [163, 163, -w^2 - 2*w + 3], [167, 167, w^4 - 5*w^2 + 2*w + 1], [169, 13, -2*w^4 + 2*w^3 + 9*w^2 - 7*w - 5], [169, 13, w^4 - 2*w^3 - 5*w^2 + 8*w + 2], [191, 191, 2*w^4 - w^3 - 9*w^2 + 3*w + 4], [193, 193, 2*w^4 - 2*w^3 - 8*w^2 + 7*w], [199, 199, -w^4 + 2*w^3 + 5*w^2 - 9*w - 3], [211, 211, -3*w^4 + w^3 + 13*w^2 - 2*w - 1], [227, 227, 2*w^3 - w^2 - 9*w + 1], [233, 233, -w^3 + w^2 + 4*w + 1], [251, 251, -3*w^4 + 14*w^2 + w - 2], [257, 257, -2*w^4 + 2*w^3 + 10*w^2 - 6*w - 5], [257, 257, -w^4 + w^3 + 5*w^2 - 6*w - 1], [257, 257, 2*w^4 - 2*w^3 - 11*w^2 + 9*w + 9], [257, 257, -2*w^4 + 2*w^3 + 9*w^2 - 6*w - 3], [257, 257, 2*w^4 - w^3 - 10*w^2 + 5*w + 5], [269, 269, -w^4 + 2*w^3 + 4*w^2 - 6*w - 2], [271, 271, -w^4 + 4*w^2 + w - 3], [277, 277, -2*w^4 + 9*w^2 + w - 4], [281, 281, w^4 - w^3 - 3*w^2 + 3*w - 4], [283, 283, 2*w^4 - 3*w^3 - 8*w^2 + 13*w], [289, 17, -w^4 + w^3 + 7*w^2 - 5*w - 5], [289, 17, 4*w^4 - 3*w^3 - 19*w^2 + 11*w + 6], [293, 293, -2*w^4 + 11*w^2 - 7], [317, 317, w^3 - 6*w], [337, 337, -w^4 + 2*w^3 + 5*w^2 - 9*w - 1], [337, 337, w^4 - 2*w^3 - 5*w^2 + 6*w + 3], [337, 337, -w^4 + w^3 + 5*w^2 - 4*w - 6], [337, 337, -2*w^3 + 8*w + 1], [337, 337, w^2 + w - 5], [347, 347, -2*w^4 + w^3 + 9*w^2 - 5*w - 3], [349, 349, 3*w^4 - 2*w^3 - 13*w^2 + 8*w + 2], [353, 353, w^4 - 3*w^3 - 4*w^2 + 12*w + 2], [359, 359, 2*w^3 - w^2 - 7*w + 3], [361, 19, w^4 - 2*w^3 - 4*w^2 + 7*w + 3], [361, 19, w^4 - w^3 - 3*w^2 + 3*w - 3], [367, 367, -2*w^4 + w^3 + 9*w^2 - w - 2], [379, 379, -2*w^3 + w^2 + 7*w + 2], [379, 379, -2*w^4 + w^3 + 10*w^2 - 4*w], [379, 379, 2*w^3 - w^2 - 6*w - 2], [379, 379, -2*w^3 + 2*w^2 + 6*w - 3], [379, 379, -3*w^4 + 2*w^3 + 14*w^2 - 7*w - 6], [383, 383, 2*w^4 + w^3 - 10*w^2 - 7*w + 4], [383, 383, -2*w^3 + w^2 + 10*w], [383, 383, w^3 + w^2 - 5*w - 1], [383, 383, 3*w^4 + 3*w^3 - 15*w^2 - 15*w + 4], [383, 383, -2*w^4 + 3*w^3 + 10*w^2 - 10*w - 2], [389, 389, 3*w^4 - w^3 - 14*w^2 + 3*w + 3], [397, 397, w^4 - 6*w^2 - 2*w + 5], [397, 397, w^4 - 2*w^3 - 2*w^2 + 6*w - 5], [397, 397, 2*w^4 - 2*w^3 - 11*w^2 + 10*w + 6], [397, 397, w^4 - w^3 - 3*w^2 + 4*w - 6], [397, 397, w^3 + w^2 - 3*w - 4], [401, 401, w^3 - w^2 - 6*w + 3], [401, 401, -w^4 + 4*w^2 + 2*w - 3], [401, 401, -w^4 + 6*w^2 - w - 7], [421, 421, -w^4 - w^3 + 5*w^2 + 5*w - 4], [421, 421, -w^4 + w^3 + 6*w^2 - 3*w - 2], [421, 421, -w^4 - w^3 + 6*w^2 + 6*w - 5], [421, 421, 3*w^4 - w^3 - 15*w^2 + w + 10], [421, 421, 2*w^4 - 9*w^2 + 2*w + 4], [431, 431, 2*w^4 - 11*w^2 - 2*w + 11], [439, 439, 2*w^4 - 3*w^3 - 9*w^2 + 10*w + 6], [443, 443, -3*w^4 + 2*w^3 + 14*w^2 - 7*w - 2], [449, 449, -w^4 + 2*w^3 + 5*w^2 - 6*w - 4], [461, 461, 3*w^4 - 4*w^3 - 14*w^2 + 14*w + 5], [463, 463, w^3 - 6*w - 1], [467, 467, 3*w^4 - 3*w^3 - 13*w^2 + 10*w], [487, 487, 3*w^4 - w^3 - 14*w^2 + w + 3], [487, 487, 2*w^2 - w - 4], [487, 487, -2*w^4 + 2*w^3 + 9*w^2 - 8*w - 5], [487, 487, 2*w^4 - 10*w^2 - 3*w + 4], [487, 487, -2*w^4 + w^3 + 8*w^2 - 3*w - 1], [499, 499, -w^4 + 2*w^3 + 4*w^2 - 8*w - 2], [499, 499, -2*w^4 + w^3 + 10*w^2 - w - 9], [499, 499, -w^3 - 2*w^2 + 2*w + 5], [499, 499, -w^4 + 4*w^2 + 4*w], [499, 499, -2*w^4 + w^3 + 12*w^2 - 4*w - 9], [509, 509, 3*w^4 - 2*w^3 - 16*w^2 + 6*w + 9], [521, 521, -2*w^4 + w^3 + 10*w^2 - 5*w - 4], [523, 523, w - 4], [529, 23, -w^3 + 2*w^2 + 4*w - 4], [529, 23, w^4 + 2*w^3 - 6*w^2 - 11*w + 4], [569, 569, -2*w^4 + 11*w^2 - 10], [571, 571, -2*w^4 + w^3 + 10*w^2 - 3*w - 2], [593, 593, -2*w^4 + 3*w^3 + 10*w^2 - 11*w - 8], [613, 613, -2*w^3 + 2*w^2 + 9*w - 5], [617, 617, -2*w^4 + 10*w^2 - w - 7], [631, 631, -2*w^4 + 2*w^3 + 7*w^2 - 8*w + 3], [641, 641, -2*w^4 + 2*w^3 + 8*w^2 - 9*w + 3], [643, 643, -3*w^4 + w^3 + 13*w^2 - w + 1], [643, 643, w^4 + w^3 - 3*w^2 - 6*w - 2], [643, 643, -w^4 - w^3 + 6*w^2 + 3*w - 4], [643, 643, 2*w^4 - w^3 - 10*w^2 + 4*w + 1], [643, 643, 2*w^4 - 2*w^3 - 8*w^2 + 6*w + 5], [647, 647, -2*w^3 + w^2 + 6*w - 4], [659, 659, 4*w^4 - 3*w^3 - 19*w^2 + 11*w + 10], [661, 661, 2*w^4 + 3*w^3 - 11*w^2 - 14*w + 6], [673, 673, w^4 - 3*w^3 - 3*w^2 + 10*w - 1], [683, 683, w^4 - 2*w^3 - 4*w^2 + 6*w - 4], [701, 701, w^3 - w^2 - 2*w + 4], [727, 727, -w^4 + 6*w^2 + 2*w - 7], [743, 743, w^4 - w^3 - 7*w^2 + 5*w + 9], [769, 769, w^4 + 2*w^3 - 5*w^2 - 9*w + 4], [787, 787, w^4 + w^3 - 7*w^2 - 3*w + 5], [797, 797, -2*w^4 - w^3 + 10*w^2 + 4*w - 4], [797, 797, w^4 - 3*w^3 - 5*w^2 + 12*w + 5], [797, 797, -3*w^4 + 2*w^3 + 13*w^2 - 8*w], [797, 797, -w^4 + w^3 + 3*w^2 - 5*w - 1], [797, 797, 2*w^4 - 11*w^2 + 2*w + 7], [809, 809, -4*w^4 + 2*w^3 + 18*w^2 - 6*w + 1], [809, 809, 3*w^4 - 3*w^3 - 14*w^2 + 11*w + 8], [809, 809, w^4 - 2*w^3 - 2*w^2 + 8*w - 4], [809, 809, 2*w^4 - 8*w^2 - 2*w + 3], [809, 809, 2*w^4 - 3*w^3 - 9*w^2 + 13*w + 4], [821, 821, -2*w^4 + 2*w^3 + 8*w^2 - 6*w + 3], [823, 823, -2*w^4 + 3*w^3 + 8*w^2 - 12*w - 1], [829, 829, 2*w^4 - 3*w^3 - 10*w^2 + 13*w + 4], [839, 839, -2*w^4 + 12*w^2 - w - 10], [863, 863, 2*w^4 - w^3 - 9*w^2 + 5], [877, 877, -w^4 + w^3 + 5*w^2 - 5*w - 7], [881, 881, 2*w^4 - w^3 - 9*w^2 + w - 1], [887, 887, 3*w^4 - 3*w^3 - 15*w^2 + 11*w + 6], [907, 907, -3*w^4 + w^3 + 13*w^2 - w - 5], [919, 919, w^4 + w^3 - 3*w^2 - 5*w - 3], [929, 929, 2*w^4 - 3*w^3 - 10*w^2 + 9*w + 4], [937, 937, -2*w^4 + 10*w^2 + 3*w - 7], [941, 941, -w^4 + 2*w^3 + 3*w^2 - 6*w - 2], [961, 31, 2*w^4 + 2*w^3 - 10*w^2 - 12*w + 5], [961, 31, -w^4 + 5*w^2 - w - 7], [967, 967, -2*w^4 + w^3 + 9*w^2 - 3*w + 2], [991, 991, -3*w^4 + w^3 + 15*w^2 - 4*w - 5], [997, 997, -3*w^4 + 15*w^2 - 5], [997, 997, 2*w^4 - w^3 - 9*w^2 + 6*w + 2], [997, 997, 2*w^4 - w^3 - 11*w^2 + w + 7], [997, 997, 2*w^3 - 5*w - 1], [997, 997, 2*w^4 - 3*w^3 - 6*w^2 + 5*w + 1]]; primes := [ideal : I in primesArray]; heckePol := x^2 + 3*x - 1; K := NumberField(heckePol); heckeEigenvaluesArray := [0, e, e + 3, -e, -3*e - 3, 2, 6, 2*e + 6, -3, 5*e + 6, 3*e + 9, -6*e - 12, -e + 3, 2, -6, 8*e + 12, -6, 0, 6*e + 12, 6*e + 12, 0, -3*e - 4, 3*e + 18, -6*e - 18, 8, 6, -3*e - 6, -4*e - 6, -e - 9, -6*e - 4, 12, -e - 15, -3*e + 11, 18, -e - 3, 12*e + 14, 8*e + 18, -12*e - 24, -3*e - 9, 6*e + 12, 3*e - 15, -12*e - 18, -9*e - 18, 3*e + 15, -3*e + 12, 3*e + 15, -4*e, -3*e + 2, -9*e - 9, -10*e - 18, -e - 18, -7*e - 6, 9*e + 24, -3*e + 24, -3*e - 1, -9*e + 5, -3*e - 10, 5*e - 12, -4*e - 6, -6*e - 6, -3*e - 13, -12*e - 18, -6*e - 6, -13*e - 12, -7*e - 33, 8*e + 24, -10*e - 30, -10*e - 30, 14*e + 24, 12*e + 32, -4*e + 6, -12*e - 18, 18, 12*e + 24, 12*e + 12, -6*e, -6, -7*e + 3, -4*e - 18, -15*e - 34, -9*e - 13, 15*e + 20, -9*e - 21, 9*e + 33, -3*e + 15, -3*e - 34, 17*e + 30, -e - 6, 3*e + 2, 9*e + 8, 12, 8*e - 6, -12, -15*e - 33, 15*e + 30, -4*e - 24, 12, 2*e + 18, 2, -12*e - 28, 8*e + 24, -6*e - 34, -6*e - 10, -10*e - 30, 8*e + 24, 2*e, -4*e + 12, 12*e + 18, -3*e - 30, -10*e - 6, -9*e + 8, 3*e - 19, -18, 12*e + 2, -3*e - 3, 11*e + 27, -15*e - 15, -12*e + 8, -9*e - 27, 8*e + 42, 20, 6*e + 26, -12*e + 2, 20*e + 36, -6*e - 18, 12*e + 24, 3*e + 35, 3*e - 4, 12*e + 12, -15*e, 12*e + 38, 18*e + 36, -13*e - 24, -4*e + 30, 9*e - 6, 3*e - 30, 6, 9*e + 51, 15*e + 33, -3*e - 48, -9*e + 12, 6, -15*e - 27, -15*e - 15, -3*e + 3, 8*e + 6, 9*e + 2, -6*e, -6*e - 30, -12*e - 10, -15*e - 27, 36, -10*e - 6, -12*e - 4, 3*e - 27, 8*e + 18, 15*e + 27, 12*e + 26, -16*e + 6, -12*e - 46, -16*e - 12, 9*e + 8, -e - 6, 24*e + 26, -13*e - 39, 9*e + 17]; 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;