/* 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![7, 6, -5, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, -w^2 + w + 3], [7, 7, w], [7, 7, -w^2 + 2*w + 1], [7, 7, w^2 - 2], [7, 7, w - 1], [23, 23, -w^3 + w^2 + 3*w - 1], [23, 23, w^3 - 2*w^2 - 2*w + 2], [31, 31, w^2 - 5], [31, 31, -w^2 + 2*w + 4], [41, 41, -w^3 + 2*w^2 + 2*w - 6], [41, 41, w^3 - w^2 - 3*w - 3], [47, 47, w^2 - 2*w - 5], [47, 47, w^2 - 6], [71, 71, -w^3 + 2*w^2 + 3*w - 1], [71, 71, -w^3 + w^2 + 4*w - 3], [79, 79, -w - 3], [79, 79, w - 4], [81, 3, -3], [89, 89, w^2 - 3*w - 2], [89, 89, w^2 + w - 4], [97, 97, 2*w^3 - 5*w^2 - 4*w + 9], [97, 97, -2*w^3 + w^2 + 8*w + 2], [113, 113, w^3 - 2*w^2 - 4*w + 2], [113, 113, w^3 - w^2 - 5*w + 3], [121, 11, 2*w^2 - w - 9], [121, 11, -2*w^2 + 3*w + 8], [127, 127, w^3 - 3*w^2 - 2*w + 5], [127, 127, w^3 - 5*w - 1], [137, 137, 2*w - 1], [167, 167, 2*w^3 - 2*w^2 - 7*w - 2], [167, 167, w^3 - 7*w - 4], [167, 167, 2*w^3 - w^2 - 9*w - 2], [167, 167, 2*w^3 - 4*w^2 - 5*w + 9], [191, 191, 2*w^3 - 4*w^2 - 5*w + 5], [191, 191, -2*w^3 + 2*w^2 + 7*w - 2], [193, 193, -2*w^3 + 3*w^2 + 6*w - 6], [193, 193, -2*w^3 + 2*w^2 + 7*w - 4], [193, 193, -2*w^3 + 4*w^2 + 5*w - 3], [193, 193, 2*w^3 - 3*w^2 - 6*w + 1], [199, 199, -w^3 - 2*w^2 + 6*w + 10], [199, 199, -w^3 + 5*w^2 - w - 13], [223, 223, -w^3 + 2*w^2 + 3*w - 8], [223, 223, w^3 - w^2 - 4*w - 4], [233, 233, -w^2 - 1], [233, 233, w^2 - 2*w + 2], [239, 239, 3*w^2 - 2*w - 13], [239, 239, 3*w^2 - 4*w - 12], [241, 241, w^3 - w^2 - 6*w + 3], [241, 241, w^3 - 2*w^2 - 5*w + 3], [257, 257, -w^3 + 3*w^2 + 4*w - 9], [257, 257, -2*w^3 + 4*w^2 + 8*w - 11], [257, 257, -w^3 + 2*w^2 + 4], [257, 257, w^3 - 7*w - 3], [263, 263, -w^3 + w^2 + 3*w + 5], [263, 263, w^3 - 5*w^2 + 12], [263, 263, -w^3 - 2*w^2 + 7*w + 8], [263, 263, -w^3 + 7*w + 2], [271, 271, -w^3 + 3*w^2 + 2*w - 3], [271, 271, w^3 - 5*w + 1], [289, 17, 3*w^2 - 3*w - 8], [289, 17, 3*w^2 - 3*w - 10], [311, 311, -2*w^3 + 2*w^2 + 7*w - 1], [311, 311, -w^3 + 5*w^2 - w - 11], [311, 311, w^3 + 2*w^2 - 6*w - 8], [311, 311, -2*w^3 + 4*w^2 + 5*w - 6], [337, 337, w^3 - w^2 - 2*w - 4], [337, 337, 2*w^3 - 9*w - 4], [337, 337, 2*w^3 - 6*w^2 - 3*w + 11], [337, 337, -w^3 + 2*w^2 + w - 6], [353, 353, -w^3 + 4*w^2 - 12], [353, 353, w^3 + w^2 - 5*w - 9], [359, 359, 2*w^3 - 4*w^2 - 6*w + 5], [359, 359, 2*w^3 - 2*w^2 - 8*w + 3], [361, 19, -w^3 + 5*w^2 - 13], [361, 19, w^3 + 2*w^2 - 7*w - 9], [367, 367, 2*w^3 - 10*w - 5], [367, 367, w^3 - w^2 - 6*w + 2], [367, 367, -w^3 + 2*w^2 + 5*w - 4], [367, 367, 2*w^3 - 6*w^2 - 4*w + 13], [401, 401, -w^3 + 2*w^2 + 5*w - 5], [401, 401, -w^3 + w^2 + 6*w - 1], [409, 409, 2*w^3 - 3*w^2 - 6*w + 4], [409, 409, 3*w^3 - 3*w^2 - 12*w + 1], [409, 409, -3*w^3 + 6*w^2 + 9*w - 11], [409, 409, -2*w^3 + 3*w^2 + 6*w - 3], [431, 431, 3*w^2 - 5*w - 10], [431, 431, w^3 + w^2 - 8*w - 3], [457, 457, -2*w^3 + 4*w^2 + 4*w - 5], [457, 457, -2*w^3 + 2*w^2 + 6*w - 1], [463, 463, -2*w^3 + 7*w^2 + w - 16], [463, 463, 3*w^3 - 6*w^2 - 8*w + 8], [503, 503, -w^3 + 3*w^2 + 2*w - 12], [503, 503, -w^3 + 4*w^2 + 4*w - 10], [521, 521, w^3 + w^2 - 6*w - 2], [521, 521, -w^3 + 4*w^2 + w - 6], [529, 23, w^2 - w - 8], [569, 569, w^3 - 3*w - 6], [569, 569, -w^3 + 3*w^2 - 8], [577, 577, -w^3 + 4*w^2 - w - 10], [577, 577, w^3 + w^2 - 4*w - 8], [593, 593, -w^3 + 3*w^2 - 12], [593, 593, w^3 - 3*w - 10], [599, 599, w^3 + 3*w^2 - 7*w - 9], [599, 599, -w^3 + 3*w^2 + 3*w - 13], [601, 601, w^2 + 2*w - 4], [601, 601, w^2 - 4*w - 1], [607, 607, 2*w^2 - 13], [607, 607, w^3 + 2*w^2 - 7*w - 5], [607, 607, 2*w^3 - 3*w^2 - 8*w + 8], [607, 607, 2*w^2 - 4*w - 11], [617, 617, w^3 + w^2 - 9*w - 1], [617, 617, w^3 - w^2 - 4*w - 5], [617, 617, -w^3 + 2*w^2 + 3*w - 9], [617, 617, -w^3 + 4*w^2 + 4*w - 8], [625, 5, -5], [631, 631, -w^3 + 5*w^2 - 2*w - 13], [631, 631, w^3 + 2*w^2 - 5*w - 11], [641, 641, w^2 - 2*w + 3], [641, 641, -w^3 + 6*w - 2], [641, 641, -w^3 + 3*w^2 + 3*w - 3], [641, 641, -w^2 - 2], [647, 647, -2*w^3 + 5*w^2 + 4*w - 6], [647, 647, 2*w^3 - 4*w^2 - 5*w - 1], [647, 647, 3*w^3 - 7*w^2 - 7*w + 13], [647, 647, -2*w^3 + w^2 + 8*w - 1], [673, 673, -w^3 + 7*w - 2], [673, 673, -w^3 + 3*w^2 + 4*w - 4], [719, 719, -2*w^3 + 5*w^2 + 3*w - 12], [719, 719, 4*w^2 - 5*w - 10], [719, 719, -4*w^2 + 3*w + 11], [719, 719, 2*w^3 - w^2 - 7*w - 6], [727, 727, -w - 5], [727, 727, w - 6], [743, 743, w^2 + 2*w - 11], [743, 743, w^3 + 4*w^2 - 11*w - 11], [751, 751, -2*w^2 + w + 13], [751, 751, 2*w^2 - 3*w - 12], [769, 769, 2*w^3 - 6*w^2 - 3*w + 17], [769, 769, 3*w^3 - 2*w^2 - 11*w + 2], [809, 809, w^3 + 3*w^2 - 6*w - 11], [809, 809, -3*w^3 + 5*w^2 + 8*w - 11], [823, 823, -w^3 + w^2 + 2*w - 6], [823, 823, 4*w^2 - 5*w - 11], [823, 823, -4*w^2 + 3*w + 12], [823, 823, -w^3 + 4*w^2 + 4*w - 12], [839, 839, -2*w^3 + w^2 + 6*w + 5], [839, 839, -3*w^3 + 8*w^2 + 7*w - 17], [839, 839, 3*w^3 - w^2 - 14*w - 5], [839, 839, -2*w^3 + 5*w^2 + 2*w - 10], [857, 857, w^3 + w^2 - 8*w - 2], [857, 857, -w^3 + 4*w^2 + 3*w - 8], [863, 863, -w^3 + w^2 - w - 1], [863, 863, w^3 - 2*w^2 + 2*w - 2], [911, 911, -w^3 + 3*w^2 - 11], [911, 911, w^3 - 3*w - 9], [919, 919, -2*w^3 + w^2 + 8*w - 2], [919, 919, -2*w^3 + 5*w^2 + 4*w - 5], [929, 929, -2*w^3 + 2*w^2 + 9*w - 4], [929, 929, 2*w^3 - 9*w - 12], [929, 929, 2*w^3 - 6*w^2 - 3*w + 19], [929, 929, -2*w^3 + 4*w^2 + 7*w - 5], [937, 937, -w^3 + 2*w^2 - 6], [937, 937, -w^3 + 3*w^2 - 10], [937, 937, w^3 - 3*w - 8], [937, 937, w^3 - w^2 - w - 5], [953, 953, 2*w^3 - 6*w^2 - 3*w + 18], [953, 953, -3*w^3 + 3*w^2 + 11*w - 5], [961, 31, 4*w^2 - 4*w - 11], [967, 967, -w^3 + 7*w - 3], [967, 967, -2*w^3 + 2*w^2 + 11*w + 2], [967, 967, -w^3 - 4*w^2 + 9*w + 9], [967, 967, -w^3 + 3*w^2 + 4*w - 3], [977, 977, 2*w^2 - 5*w - 8], [977, 977, -w^3 + 2*w^2 - w + 6], [977, 977, -w^3 + w^2 - 6], [977, 977, 2*w^2 + w - 11], [983, 983, -w^3 + 6*w^2 - 2*w - 16], [983, 983, w^3 + 3*w^2 - 7*w - 13]]; primes := [ideal : I in primesArray]; heckePol := x; K := Rationals(); e := 1; heckeEigenvaluesArray := [1, -1, -4, -1, 1, 3, 9, 2, -7, -9, 6, -6, 6, -3, 6, 8, 8, 4, 6, 3, 14, -1, 18, 6, -22, 5, 11, -7, 18, 21, -3, -21, -18, 0, -15, 17, 2, -13, -10, 2, 20, 2, -22, 3, -6, 0, -9, 2, -4, -12, -27, 12, -6, 24, -3, 30, -21, 2, 8, -25, -16, 3, 6, -18, 30, 32, 8, 17, 11, 9, -24, 18, 12, -1, 32, 11, -4, 23, 14, 27, -6, -22, -22, -37, 5, -3, -3, 17, 26, -34, -19, 15, -24, 30, 18, 11, 18, -9, 14, 38, 36, -6, 33, 30, 26, 44, -4, -16, 29, 14, -36, -3, 18, -42, -22, -40, 20, 12, 30, 30, 18, 15, 3, 27, -30, -13, -43, -24, -24, -36, 0, -16, 2, 15, -15, 20, -16, 35, -31, 6, 36, -22, 26, -19, 23, 0, 21, 42, -42, -18, -24, -36, 9, -27, 0, 38, -43, -24, -21, -33, 54, 50, 11, 56, 32, 54, -6, -1, -4, -22, 2, 32, 48, -9, 51, -12, -36, 6]; heckeEigenvalues := AssociativeArray(); for i := 1 to #heckeEigenvaluesArray do heckeEigenvalues[primes[i]] := heckeEigenvaluesArray[i]; end for; ALEigenvalues := AssociativeArray(); ALEigenvalues[ideal] := -1; 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;