/* 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, 0, -6, 0, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [2, 2, w + 1], [7, 7, w], [9, 3, w^2 + w - 1], [9, 3, w^2 - w - 1], [17, 17, -w^3 + 3*w - 1], [17, 17, w^3 - 3*w - 1], [23, 23, -w^3 - w^2 + 3*w + 4], [23, 23, w^3 - w^2 - 3*w + 4], [41, 41, w^3 - w^2 - 2*w + 3], [41, 41, -w^3 - w^2 + 2*w + 3], [49, 7, w^2 - 6], [71, 71, w^3 + 3*w^2 - 3*w - 6], [71, 71, -2*w^2 - 2*w + 1], [73, 73, w^2 - 2*w - 2], [73, 73, w^2 + 2*w - 2], [79, 79, w^3 - w^2 - 5*w + 2], [79, 79, -w^3 - w^2 + 5*w + 2], [89, 89, 2*w - 1], [89, 89, -2*w - 1], [97, 97, -w^3 + w^2 + 4*w - 1], [97, 97, w^3 + w^2 - 4*w - 1], [103, 103, -2*w^3 + w^2 + 8*w - 2], [103, 103, w^3 - w^2 - 3*w + 6], [103, 103, -w^3 - w^2 + 3*w + 6], [103, 103, 2*w^3 + w^2 - 8*w - 2], [127, 127, w^3 + 3*w^2 - 4*w - 11], [127, 127, -w^3 + 3*w^2 + 4*w - 11], [137, 137, -w^3 - 3*w^2 + 2*w + 9], [137, 137, -2*w^2 + w + 10], [137, 137, -2*w^2 - w + 10], [137, 137, w^3 - 3*w^2 - 2*w + 9], [151, 151, 3*w^2 - 2*w - 10], [151, 151, w^3 + 3*w^2 - 4*w - 9], [167, 167, w^3 + 4*w^2 - 2*w - 8], [167, 167, 2*w^3 - 8*w - 3], [167, 167, 2*w^3 - 8*w + 3], [167, 167, 2*w^3 + 5*w^2 - 7*w - 13], [191, 191, -w^3 + 6*w - 2], [191, 191, w^3 - 6*w - 2], [193, 193, -2*w^3 + 2*w^2 + 6*w - 5], [193, 193, w^3 + 2*w^2 - 4*w - 4], [193, 193, -w^3 + 2*w^2 + 4*w - 4], [193, 193, -2*w^3 - 2*w^2 + 6*w + 5], [199, 199, 2*w^2 - 3*w - 6], [199, 199, w^3 + w^2 + w + 2], [199, 199, 2*w^3 + 2*w^2 - 4*w - 5], [199, 199, 2*w^2 + 3*w - 6], [223, 223, 2*w^3 + w^2 - 6*w - 6], [223, 223, w^3 - w^2 - 5*w - 2], [223, 223, 2*w^3 + 4*w^2 - 6*w - 9], [223, 223, -2*w^3 + w^2 + 6*w - 6], [239, 239, -2*w^3 - 5*w^2 + 5*w + 11], [239, 239, w^3 + 4*w^2 - 4*w - 10], [241, 241, -3*w^3 - 4*w^2 + 9*w + 11], [241, 241, -2*w^3 - w^2 + 6*w + 4], [257, 257, 2*w^3 + 5*w^2 - 6*w - 12], [257, 257, -w^3 - 4*w^2 + 3*w + 9], [263, 263, -w^3 - w^2 + 6*w + 3], [263, 263, w^3 - w^2 - 6*w + 3], [271, 271, -2*w^3 - w^2 + 7*w + 3], [271, 271, -w^3 + 2*w^2 + 3*w - 9], [271, 271, w^3 + 2*w^2 - 3*w - 9], [271, 271, 2*w^3 - w^2 - 7*w + 3], [289, 17, 3*w^2 - 8], [313, 313, -w^3 + 2*w^2 - 6], [313, 313, w^3 + 2*w^2 - 6], [353, 353, -w^3 + 3*w - 5], [353, 353, w^3 - 3*w - 5], [359, 359, w^3 - w + 3], [359, 359, 4*w^3 + 5*w^2 - 14*w - 18], [361, 19, -w^3 + 2*w^2 + 4*w - 2], [361, 19, w^3 + 2*w^2 - 4*w - 2], [367, 367, -2*w^3 - 3*w^2 + 6*w + 10], [367, 367, -3*w - 2], [367, 367, 3*w - 2], [367, 367, w^3 + 2*w^2 - 7*w - 11], [401, 401, -2*w^3 + 6*w - 1], [401, 401, -3*w^3 + 3*w^2 + 11*w - 10], [401, 401, 3*w^3 + 3*w^2 - 11*w - 10], [401, 401, 2*w^3 - 6*w - 1], [409, 409, w^3 - 3*w^2 - 6*w + 13], [409, 409, -w^3 - 3*w^2 + 6*w + 13], [431, 431, w^3 - 4*w^2 - 2*w + 10], [431, 431, -w^3 - 4*w^2 + 2*w + 10], [433, 433, w^3 - w^2 - 6*w - 3], [433, 433, 2*w^3 + 4*w^2 - 7*w - 10], [463, 463, w^2 + 3*w - 3], [463, 463, w^2 - 3*w - 3], [487, 487, 2*w^2 + 2*w - 9], [487, 487, 2*w^2 - 2*w - 9], [521, 521, -w^3 - 4*w^2 + 5*w + 13], [521, 521, w^3 - 4*w^2 - 5*w + 13], [529, 23, -w^2 - 2], [577, 577, w^3 + 2*w^2 - 2*w - 8], [577, 577, -w^3 + 2*w^2 + 2*w - 8], [593, 593, -2*w^3 - 3*w^2 + 5*w + 9], [593, 593, w^3 + 2*w^2 - 8*w - 12], [599, 599, w^3 + 2*w^2 - 5*w - 3], [599, 599, -w^3 + 2*w^2 + 5*w - 3], [601, 601, -w^3 + 4*w^2 + 4*w - 8], [601, 601, w^3 + 4*w^2 - 4*w - 8], [607, 607, -w^3 + 8*w + 6], [607, 607, -3*w^3 - 5*w^2 + 7*w + 12], [607, 607, 2*w^2 - 4*w - 9], [607, 607, -2*w^3 - 3*w^2 + 11*w + 13], [617, 617, 3*w^3 + 2*w^2 - 11*w - 9], [617, 617, -2*w^3 + w^2 + 9*w - 1], [617, 617, 2*w^3 + w^2 - 9*w - 1], [617, 617, 3*w^3 - 12*w - 4], [625, 5, -5], [631, 631, w^3 - w^2 - 7*w - 4], [631, 631, 2*w^3 + 4*w^2 - 8*w - 11], [641, 641, -2*w^3 + 3*w^2 + 9*w - 9], [641, 641, w^3 - 2*w^2 - 7*w + 5], [641, 641, w^3 + 2*w^2 - 7*w - 5], [641, 641, 2*w^3 + 3*w^2 - 9*w - 9], [647, 647, -w^3 + 3*w^2 - 1], [647, 647, 2*w^3 - 3*w^2 - 8*w + 8], [647, 647, -2*w^3 - 3*w^2 + 8*w + 8], [647, 647, w^3 + 3*w^2 - 1], [727, 727, -3*w^3 - 2*w^2 + 11*w + 3], [727, 727, -2*w^3 + 5*w^2 + 9*w - 17], [727, 727, 2*w^3 + 5*w^2 - 9*w - 17], [727, 727, 3*w^3 - 2*w^2 - 11*w + 3], [743, 743, 3*w^2 - 2*w - 12], [743, 743, 3*w^2 + 2*w - 12], [751, 751, 2*w^3 - 2*w^2 - 6*w + 9], [751, 751, -2*w^3 - 2*w^2 + 6*w + 9], [761, 761, -3*w^3 + 5*w^2 + 6*w - 11], [761, 761, 3*w^3 + 5*w^2 - 6*w - 11], [769, 769, w^3 - 7*w - 3], [769, 769, -w^3 + 7*w - 3], [823, 823, w^3 + 2*w^2 - 5*w - 1], [823, 823, w^3 - 2*w^2 - 5*w + 1], [839, 839, 4*w^2 + w - 12], [839, 839, -3*w^3 + w^2 + 13*w - 8], [839, 839, 3*w^3 + w^2 - 13*w - 8], [839, 839, 4*w^2 - w - 12], [841, 29, 2*w^3 + 4*w^2 - 7*w - 16], [841, 29, -2*w^3 + 4*w^2 + 7*w - 16], [857, 857, 3*w^2 - 3*w - 11], [857, 857, 3*w^2 + 3*w - 11], [863, 863, w^3 + 3*w^2 - 5*w - 6], [863, 863, -w^3 + 3*w^2 + 5*w - 6], [881, 881, w^3 - w^2 - 5*w - 4], [881, 881, 2*w^2 + 4*w + 3], [887, 887, w^2 - w - 9], [887, 887, 3*w^3 + 4*w^2 - 11*w - 11], [887, 887, -3*w^3 + 4*w^2 + 11*w - 11], [887, 887, w^2 + w - 9], [911, 911, w^2 - 4*w - 8], [911, 911, -3*w^3 - 4*w^2 + 9*w + 13], [919, 919, 2*w^3 - w^2 - 8*w - 2], [919, 919, -2*w^3 - w^2 + 8*w - 2], [929, 929, 4*w^3 + w^2 - 16*w - 2], [929, 929, 2*w^3 - 11*w - 6], [937, 937, 3*w^3 - 3*w^2 - 10*w + 5], [937, 937, -3*w^3 - 3*w^2 + 10*w + 5], [953, 953, w^3 - 9*w - 11], [953, 953, 5*w^2 + 3*w - 17], [953, 953, 5*w^2 - 3*w - 17], [953, 953, -2*w^3 - w^2 + 8*w + 10], [961, 31, 4*w^2 - 11], [961, 31, 4*w^2 - 13], [967, 967, w^3 - w^2 - 6*w - 5], [967, 967, 2*w^2 + 3*w + 2], [983, 983, -w^2 + w - 3], [983, 983, 2*w^3 - 2*w^2 - 11*w + 10], [983, 983, 2*w^3 + 2*w^2 - 11*w - 10], [983, 983, -w^2 - w - 3], [991, 991, w^3 + 3*w^2 - 10*w - 15], [991, 991, -2*w^3 - 4*w^2 + w + 6]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 32*x^2 + 128; K := NumberField(heckePol); heckeEigenvaluesArray := [0, e, 1/16*e^3 - e, 1/16*e^3 - e, 1/16*e^3 - 2*e, 1/16*e^3 - 2*e, -1/2*e^2 + 8, -1/2*e^2 + 8, -1/2*e^2 + 6, -1/2*e^2 + 6, -1/2*e^2 + 14, 1/4*e^3 - 7*e, 1/4*e^3 - 7*e, -3/16*e^3 + 7*e, -3/16*e^3 + 7*e, 1/4*e^3 - 6*e, 1/4*e^3 - 6*e, -3/16*e^3 + 5*e, -3/16*e^3 + 5*e, -3/16*e^3 + 4*e, -3/16*e^3 + 4*e, -1/2*e^3 + 11*e, 1/2*e^2, 1/2*e^2, -1/2*e^3 + 11*e, 8, 8, 2, 3/2*e^2 - 26, 3/2*e^2 - 26, 2, -1/2*e^2 + 16, -1/2*e^2 + 16, -1/2*e^2, -1/4*e^3 + 3*e, -1/4*e^3 + 3*e, -1/2*e^2, -1/4*e^3 + 6*e, -1/4*e^3 + 6*e, 5/16*e^3 - 6*e, -7/16*e^3 + 8*e, -7/16*e^3 + 8*e, 5/16*e^3 - 6*e, -1/4*e^3 + 7*e, 3/2*e^2 - 24, 3/2*e^2 - 24, -1/4*e^3 + 7*e, e^2 - 16, -1/4*e^3 + 10*e, -1/4*e^3 + 10*e, e^2 - 16, e^2 - 32, e^2 - 32, 5/16*e^3 - 12*e, 5/16*e^3 - 12*e, -3/2*e^2 + 14, -3/2*e^2 + 14, -e, -e, 0, 0, 0, 0, 18, -2*e^2 + 34, -2*e^2 + 34, 1/2*e^2 - 18, 1/2*e^2 - 18, -3/2*e^2 + 8, -3/2*e^2 + 8, -3/16*e^3 + 5*e, -3/16*e^3 + 5*e, -2*e^2 + 32, 1/4*e^3 - 4*e, 1/4*e^3 - 4*e, -2*e^2 + 32, -7/16*e^3 + 16*e, -3/16*e^3, -3/16*e^3, -7/16*e^3 + 16*e, 2, 2, -24, -24, 9/16*e^3 - 18*e, 9/16*e^3 - 18*e, -1/4*e^3 + 6*e, -1/4*e^3 + 6*e, 3/2*e^2 - 40, 3/2*e^2 - 40, 2*e^2 - 14, 2*e^2 - 14, -e^2 + 50, -1/2*e^2 - 2, -1/2*e^2 - 2, -1/2*e^2 + 14, -1/2*e^2 + 14, 7*e, 7*e, 1/16*e^3 - 7*e, 1/16*e^3 - 7*e, 1/4*e^3 - 8*e, e^2 + 8, e^2 + 8, 1/4*e^3 - 8*e, -3/16*e^3 + 7*e, 9/16*e^3 - 7*e, 9/16*e^3 - 7*e, -3/16*e^3 + 7*e, e^2 + 18, -1/2*e^3 + 9*e, -1/2*e^3 + 9*e, 13/16*e^3 - 26*e, -3/16*e^3 + 4*e, -3/16*e^3 + 4*e, 13/16*e^3 - 26*e, 1/2*e^2, 1/4*e^3 - 3*e, 1/4*e^3 - 3*e, 1/2*e^2, 1/2*e^3 - 9*e, -3/2*e^2 + 48, -3/2*e^2 + 48, 1/2*e^3 - 9*e, 3/2*e^2 - 24, 3/2*e^2 - 24, -2*e^2 + 56, -2*e^2 + 56, 2*e^2 - 46, 2*e^2 - 46, 17/16*e^3 - 24*e, 17/16*e^3 - 24*e, -1/4*e^3 + 17*e, -1/4*e^3 + 17*e, 3/2*e^2 + 16, 1/4*e^3 - 13*e, 1/4*e^3 - 13*e, 3/2*e^2 + 16, -1/2*e^2 - 10, -1/2*e^2 - 10, -1/2*e^2 + 6, -1/2*e^2 + 6, 6*e, 6*e, e^2 + 2, e^2 + 2, -3/2*e^2 + 24, -1/2*e^3 + 7*e, -1/2*e^3 + 7*e, -3/2*e^2 + 24, e^2 - 24, e^2 - 24, 1/2*e^3 - 19*e, 1/2*e^3 - 19*e, -7/16*e^3 + 18*e, -7/16*e^3 + 18*e, -15/16*e^3 + 15*e, -15/16*e^3 + 15*e, 2, 3/2*e^2 - 26, 3/2*e^2 - 26, 2, -3*e^2 + 66, 1/2*e^2 + 46, -1/2*e^2 + 16, -1/2*e^2 + 16, -3/2*e^2 + 64, -5/4*e^3 + 33*e, -5/4*e^3 + 33*e, -3/2*e^2 + 64, 5/4*e^3 - 24*e, 5/4*e^3 - 24*e]; 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;