/* 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![11, 7, -6, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [5, 5, -w^2 + 2*w + 3], [9, 3, w^3 - 3*w^2 - 2*w + 9], [9, 3, -w^3 + 5*w + 5], [11, 11, w], [11, 11, w - 1], [16, 2, 2], [19, 19, -w^3 + 2*w^2 + 3*w - 2], [19, 19, w^3 - w^2 - 4*w + 2], [29, 29, w^3 - 4*w^2 - w + 10], [29, 29, -w^3 + 3*w^2 + w - 7], [41, 41, 3*w^2 - 2*w - 10], [49, 7, -2*w^2 + 3*w + 8], [49, 7, w^3 - 2*w^2 - 2*w + 5], [71, 71, -w - 3], [71, 71, w - 4], [79, 79, -w^3 + w^2 + 3*w + 3], [79, 79, -w^3 + 2*w^2 + 2*w - 6], [89, 89, w^3 - 3*w^2 - 3*w + 7], [89, 89, w^3 - 6*w - 2], [101, 101, 2*w^3 - 5*w^2 - 3*w + 9], [101, 101, -w^3 + 3*w^2 + 3*w - 12], [109, 109, -w^3 + 4*w^2 + w - 9], [109, 109, -w^3 + 2*w^2 + 4*w - 2], [121, 11, -3*w^2 + 3*w + 10], [131, 131, -2*w^3 + 5*w^2 + 4*w - 9], [131, 131, -w^3 + w^2 + 3*w + 5], [131, 131, -w^3 + 2*w^2 + 2*w - 8], [131, 131, -w^3 + 6*w^2 - 18], [149, 149, -w^3 - 2*w^2 + 7*w + 8], [149, 149, -2*w^3 + 6*w^2 + 5*w - 16], [151, 151, w^2 + w - 5], [151, 151, w^2 - 3*w - 3], [169, 13, w^3 - 4*w^2 - w + 6], [169, 13, 2*w^3 - 5*w^2 - 4*w + 6], [179, 179, w^3 - 4*w - 6], [179, 179, -w^3 + 3*w^2 + w - 9], [181, 181, w^3 + 3*w^2 - 7*w - 15], [181, 181, w^3 - 6*w^2 + 2*w + 18], [191, 191, 5*w^2 - 7*w - 15], [191, 191, -4*w^2 + 5*w + 12], [199, 199, -w^3 + 3*w^2 + 3*w - 6], [199, 199, w^3 - 6*w - 1], [211, 211, w^3 - 7*w - 4], [211, 211, -w^3 + 3*w^2 + 4*w - 10], [229, 229, -w^3 - w^2 + 5*w + 9], [229, 229, -w^3 + 4*w^2 - 12], [239, 239, 4*w^2 - 5*w - 17], [239, 239, 4*w^2 - 3*w - 18], [241, 241, -w^3 + 3*w^2 + w - 2], [241, 241, -w^3 + 3*w^2 + 4*w - 9], [241, 241, w^3 - 7*w - 3], [241, 241, -w^3 + 4*w - 1], [271, 271, -w - 4], [271, 271, w^3 - 3*w^2 - 2*w + 2], [271, 271, -2*w^3 + 6*w^2 + 2*w - 7], [271, 271, w - 5], [281, 281, w^3 - 2*w^2 - 3*w - 1], [281, 281, -w^3 + w^2 + 4*w - 5], [289, 17, -2*w^3 + w^2 + 9*w + 1], [289, 17, -2*w^3 + 5*w^2 + 5*w - 9], [311, 311, w^3 - w^2 - 6*w + 1], [311, 311, -w^3 + 2*w^2 + 5*w - 5], [331, 331, -3*w^3 + 5*w^2 + 10*w - 5], [331, 331, 3*w^3 - 2*w^2 - 12*w - 6], [349, 349, -2*w^3 + 2*w^2 + 10*w + 3], [349, 349, -2*w^3 - w^2 + 12*w + 10], [349, 349, 2*w^3 + w^2 - 10*w - 12], [349, 349, -2*w^3 + 4*w^2 + 8*w - 13], [361, 19, -4*w^2 + 4*w + 13], [379, 379, w^3 + w^2 - 5*w - 10], [379, 379, -3*w^3 + 4*w^2 + 12*w - 7], [379, 379, w^3 + 4*w^2 - 8*w - 21], [379, 379, w^3 - 3*w - 6], [389, 389, 2*w^3 - 6*w^2 - 4*w + 13], [389, 389, -5*w^2 + 7*w + 13], [389, 389, 2*w^3 - 7*w^2 - 5*w + 20], [389, 389, 2*w^3 - 10*w - 5], [419, 419, -w^3 + 5*w^2 + w - 13], [419, 419, 4*w^2 - 7*w - 14], [419, 419, 2*w^3 - 3*w^2 - 5*w - 1], [419, 419, -w^3 - 2*w^2 + 8*w + 8], [421, 421, -2*w^2 + 5*w + 7], [421, 421, w^3 - 6*w^2 + 5*w + 13], [439, 439, 2*w^3 - 2*w^2 - 9*w + 3], [439, 439, w^3 + w^2 - 7*w - 4], [449, 449, 3*w^3 - 6*w^2 - 9*w + 8], [449, 449, 5*w^2 - 8*w - 17], [449, 449, 2*w^3 - w^2 - 8*w - 7], [449, 449, -3*w^3 + 3*w^2 + 12*w - 4], [479, 479, -2*w^3 + 3*w^2 + 5*w + 3], [479, 479, 3*w^3 - 7*w^2 - 9*w + 15], [499, 499, -w^3 + 4*w^2 + 4*w - 9], [499, 499, w^3 + w^2 - 9*w - 2], [509, 509, 2*w^3 + 2*w^2 - 11*w - 16], [509, 509, -2*w^3 + 8*w^2 + w - 23], [521, 521, -3*w^3 + w^2 + 13*w + 6], [521, 521, w^3 + 4*w^2 - 10*w - 16], [541, 541, 3*w^3 - 2*w^2 - 13*w - 3], [541, 541, -w^3 + 7*w^2 - w - 25], [541, 541, w^3 + 4*w^2 - 10*w - 20], [541, 541, -3*w^3 + 7*w^2 + 8*w - 15], [571, 571, w^3 + 4*w^2 - 9*w - 15], [571, 571, w^3 - 7*w^2 + 2*w + 19], [601, 601, -3*w^3 + 2*w^2 + 13*w + 5], [601, 601, 3*w^3 - 7*w^2 - 8*w + 17], [619, 619, w^3 - 3*w - 7], [619, 619, w^3 - 5*w^2 + 3*w + 13], [619, 619, 3*w^3 - 4*w^2 - 9*w - 2], [619, 619, -w^3 + 3*w^2 - 9], [641, 641, 6*w^2 - 4*w - 23], [641, 641, -3*w^3 + w^2 + 12*w + 5], [659, 659, -2*w^3 + 6*w^2 + 3*w - 17], [659, 659, -2*w^3 + 9*w + 10], [661, 661, 3*w^3 - 6*w^2 - 9*w + 14], [661, 661, 5*w^2 - 6*w - 18], [661, 661, -5*w^2 + 4*w + 19], [661, 661, 3*w^3 - 3*w^2 - 12*w - 2], [691, 691, -3*w^3 + 5*w^2 + 10*w - 6], [691, 691, -3*w^3 + 4*w^2 + 11*w - 6], [701, 701, -w^3 - 4*w^2 + 9*w + 20], [701, 701, -w^3 + 4*w^2 + 3*w - 19], [701, 701, -w^3 + 4*w^2 + 4*w - 15], [701, 701, w^3 - 7*w^2 + 2*w + 24], [709, 709, 3*w^2 - 5*w - 13], [709, 709, 3*w^2 - w - 15], [719, 719, -w^3 + 3*w^2 + 4*w - 4], [719, 719, -w^3 + 7*w - 2], [739, 739, -w^3 + 4*w^2 + 3*w - 9], [739, 739, -2*w^3 - w^2 + 11*w + 8], [739, 739, 2*w^3 - 7*w^2 - 3*w + 16], [739, 739, -w^3 - w^2 + 8*w + 3], [751, 751, 3*w^3 - 5*w^2 - 10*w + 10], [751, 751, 2*w^2 - 5*w - 5], [761, 761, 3*w^3 - 3*w^2 - 11*w + 3], [761, 761, w^3 - 2*w^2 - 3*w - 2], [761, 761, -w^3 + w^2 + 4*w - 6], [761, 761, -3*w^3 + 6*w^2 + 8*w - 8], [769, 769, -w^3 - w^2 + 7*w + 1], [769, 769, -2*w^3 + 6*w^2 + 6*w - 15], [769, 769, -2*w^3 + 5*w^2 + 5*w - 7], [769, 769, 2*w^3 + w^2 - 12*w - 9], [809, 809, -2*w^3 + 8*w^2 + 4*w - 23], [809, 809, -3*w^3 + 11*w^2 + 2*w - 28], [829, 829, -3*w^3 + 7*w^2 + 7*w - 9], [829, 829, w^3 + 2*w^2 - 6*w - 15], [829, 829, -w^3 + 5*w^2 - w - 18], [829, 829, -3*w^3 + 2*w^2 + 12*w - 2], [839, 839, 2*w^3 - 9*w^2 + 20], [839, 839, -3*w^3 + 10*w^2 + 5*w - 30], [841, 29, 5*w^2 - 5*w - 16], [881, 881, -w^3 - 4*w^2 + 8*w + 18], [881, 881, 2*w^3 - 7*w^2 - w + 9], [881, 881, 2*w^3 - 6*w^2 - 3*w + 6], [881, 881, -w^3 + 7*w^2 - 3*w - 21], [911, 911, -w^3 - 4*w^2 + 8*w + 16], [911, 911, -w^3 - w^2 + 9*w + 5], [911, 911, -w^3 + 4*w^2 + 4*w - 12], [911, 911, w^3 - 7*w^2 + 3*w + 19], [919, 919, -4*w^3 + 7*w^2 + 14*w - 9], [919, 919, 4*w^3 - 5*w^2 - 16*w + 8], [929, 929, 3*w^2 - w - 16], [929, 929, 3*w^2 - 5*w - 14], [941, 941, -w^3 - w^2 + 9*w + 7], [941, 941, -3*w^3 + 7*w^2 + 7*w - 15], [941, 941, 3*w^3 - 2*w^2 - 12*w - 4], [941, 941, w^3 + 4*w^2 - 13*w - 16], [961, 31, -2*w^2 + 2*w + 13], [961, 31, 5*w^2 - 5*w - 18], [971, 971, w^3 + 4*w^2 - 9*w - 19], [971, 971, w^3 - 7*w^2 + 2*w + 23], [991, 991, 3*w^3 - 7*w^2 - 7*w + 14], [991, 991, -3*w^3 + 2*w^2 + 12*w + 3]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 76*x^2 + 1280; K := NumberField(heckePol); heckeEigenvaluesArray := [-1/4*e^2 + 10, 0, 0, -1/4*e^2 + 8, -1/4*e^2 + 8, 1/4*e^2 - 7, e, -e, -e, e, -1, 1/8*e^3 - 9/2*e, -1/8*e^3 + 9/2*e, -1/4*e^2 + 12, -1/4*e^2 + 12, 1/8*e^3 - 11/2*e, -1/8*e^3 + 11/2*e, -1/8*e^3 + 11/2*e, 1/8*e^3 - 11/2*e, 3/4*e^2 - 22, 3/4*e^2 - 22, 1/8*e^3 - 11/2*e, -1/8*e^3 + 11/2*e, -18, e^2 - 32, -3/4*e^2 + 32, -3/4*e^2 + 32, e^2 - 32, 1/8*e^3 - 13/2*e, -1/8*e^3 + 13/2*e, 8, 8, 2*e, -2*e, -1/8*e^3 + 11/2*e, 1/8*e^3 - 11/2*e, -1/4*e^2 + 2, -1/4*e^2 + 2, 1/4*e^2 + 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3/4*e^2 + 18, -3/4*e^2 + 18, 4*e, -4*e, 7/4*e^2 - 82, 3/4*e^2 - 22, 3/4*e^2 - 22, 7/4*e^2 - 82, 11/4*e^2 - 108, 11/4*e^2 - 108, -2, 5/4*e^2 - 18, 5/4*e^2 - 18, -2, 1/4*e^3 - 9*e, -1/4*e^3 + 9*e, -e, e, 3/8*e^3 - 33/2*e, 4*e, -4*e, -3/8*e^3 + 33/2*e, 2*e^2 - 72, 2*e^2 - 72, -1/4*e^2 - 22, -3/4*e^2 + 38, -3/4*e^2 + 38, -1/4*e^2 - 22, -1/4*e^3 + 11*e, 1/2*e^3 - 22*e, -1/2*e^3 + 22*e, 1/4*e^3 - 11*e, 1/8*e^3 - 13/2*e, -1/8*e^3 + 13/2*e, -1/4*e^3 + 6*e, -1/4*e^3 + 14*e, 1/4*e^3 - 14*e, 1/4*e^3 - 6*e, 1/2*e^3 - 20*e, -1/2*e^3 + 20*e, -1/4*e^2 + 58, -2, -3/4*e^2 + 78, -3/4*e^2 + 78, -2, -1/4*e^2 - 8, 7/4*e^2 - 68, 7/4*e^2 - 68, -1/4*e^2 - 8, 1/8*e^3 - 5/2*e, -1/8*e^3 + 5/2*e, 3/8*e^3 - 27/2*e, -3/8*e^3 + 27/2*e, -e^2 + 18, 7/4*e^2 - 98, 7/4*e^2 - 98, -e^2 + 18, -3*e^2 + 102, -58, 7/4*e^2 - 68, 7/4*e^2 - 68, 8, 8]; 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;