/* 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^3 + 7*x^2 + x - 46; K := NumberField(heckePol); heckeEigenvaluesArray := [-1, -2*e^2 - 5*e + 21, 2*e^2 + 5*e - 21, 1, e, -6*e^2 - 15*e + 58, 4*e^2 + 8*e - 44, 3*e^2 + 6*e - 36, 5*e^2 + 13*e - 49, 6*e^2 + 13*e - 64, -9*e^2 - 21*e + 93, -2*e^2 - 5*e + 12, 8*e^2 + 19*e - 82, -3*e^2 - 7*e + 31, e^2 + 5*e - 11, -4*e^2 - 9*e + 39, e^2 + 2*e - 16, -13*e^2 - 33*e + 125, -3*e^2 - 8*e + 32, 9*e^2 + 20*e - 99, 11*e^2 + 26*e - 111, -e^2 - 2*e + 20, -9*e^2 - 24*e + 82, -2*e^2 - 4*e + 30, 2*e^2 + 9*e - 17, -4*e^2 - 11*e + 30, -13*e^2 - 34*e + 115, 11*e^2 + 27*e - 107, 2*e + 8, 9*e^2 + 21*e - 93, 3*e^2 + 11*e - 29, -6*e^2 - 14*e + 52, -2*e^2 - 3*e + 6, -12*e^2 - 31*e + 122, -6*e^2 - 13*e + 59, -4*e^2 - 6*e + 40, -10*e^2 - 28*e + 94, -2*e^2 - 3*e + 18, 2*e^2 + 6*e - 12, 4*e^2 + 12*e - 36, -4*e^2 - 14*e + 32, -6*e^2 - 13*e + 56, 11*e^2 + 28*e - 114, 2*e^2 - 18, 4*e^2 + 14*e - 34, 9*e^2 + 25*e - 89, 10*e^2 + 24*e - 102, 8*e^2 + 22*e - 74, -11*e^2 - 23*e + 133, 5*e^2 + 17*e - 41, 10*e^2 + 22*e - 100, 10*e^2 + 24*e - 84, -14*e^2 - 31*e + 142, 16*e^2 + 39*e - 171, -9*e^2 - 24*e + 92, -5*e^2 - 10*e + 66, 4*e^2 + 12*e - 32, 7*e^2 + 19*e - 51, 11*e^2 + 28*e - 117, -6*e - 18, 9*e^2 + 20*e - 106, -e^2 - 2*e + 25, 23*e^2 + 58*e - 226, -27*e^2 - 67*e + 263, -4*e + 4, -13*e^2 - 27*e + 139, 5*e^2 + 13*e - 31, e^2 + 6*e - 8, 4*e^2 + 7*e - 28, 5*e^2 + 20*e - 46, 24*e^2 + 60*e - 234, 17*e^2 + 36*e - 192, 4*e^2 + 10*e - 40, -9*e^2 - 27*e + 65, -15*e^2 - 36*e + 141, -16*e^2 - 34*e + 168, -28*e^2 - 70*e + 266, 10*e^2 + 24*e - 116, -10*e^2 - 23*e + 108, 7*e^2 + 17*e - 65, 11*e^2 + 26*e - 131, 2*e^2 + e - 21, -18*e^2 - 50*e + 164, -10*e^2 - 23*e + 104, -3*e^2 - 10*e + 34, -6*e^2 - 20*e + 60, -14*e^2 - 30*e + 138, 32*e^2 + 74*e - 334, 14*e^2 + 35*e - 143, 18*e^2 + 40*e - 186, 13*e^2 + 27*e - 147, 4*e^2 + 6*e - 60, -14*e^2 - 39*e + 142, -9*e^2 - 17*e + 83, -6*e^2 - 17*e + 68, -2*e^2 - 2*e + 20, 10*e^2 + 27*e - 84, 17*e^2 + 33*e - 189, 8*e^2 + 20*e - 86, 19*e^2 + 45*e - 177, 18*e^2 + 42*e - 182, -6*e^2 - 11*e + 45, 40*e^2 + 92*e - 422, -25*e^2 - 55*e + 261, 19*e^2 + 39*e - 207, -26*e^2 - 66*e + 240, -e^2 + 2*e - 1, 19*e^2 + 53*e - 177, 15*e^2 + 37*e - 167, -9*e^2 - 23*e + 75, 5*e^2 + 14*e - 70, -11*e^2 - 20*e + 136, 4*e^2 + 6*e - 26, -16*e^2 - 40*e + 134, 14*e^2 + 36*e - 150, -30*e^2 - 68*e + 312, -6*e^2 - 12*e + 50, -2*e^2 - 3*e + 57, 24*e^2 + 55*e - 268, 2*e^2 + 12*e - 30, 19*e^2 + 47*e - 179, 13*e^2 + 32*e - 124, 6*e^2 + 4*e - 78, -4*e + 6, 11*e^2 + 23*e - 127, -19*e^2 - 52*e + 178, -9*e^2 - 30*e + 68, -31*e^2 - 68*e + 330, -11*e^2 - 25*e + 107, -14*e^2 - 33*e + 176, 4*e^2 + 13*e - 23, 4*e^2 + 9*e - 28, -15*e^2 - 28*e + 184, 20*e^2 + 46*e - 196, 8*e^2 + 13*e - 105, -16*e^2 - 44*e + 128, 28*e^2 + 75*e - 261, 2*e^2 + 10*e - 14, 8*e^2 + 20*e - 82, -21*e^2 - 51*e + 219, -4*e^2 - 3*e + 46, 42*e^2 + 108*e - 388, 34*e^2 + 83*e - 342, -33*e^2 - 70*e + 362, -5*e^2 - 13*e + 59, -13*e^2 - 29*e + 113, -11*e^2 - 33*e + 81, 21*e^2 + 54*e - 209, -11*e^2 - 31*e + 87, -5*e + 10, -22*e^2 - 57*e + 176, -32*e^2 - 76*e + 340, -38, 15*e^2 + 33*e - 165, -24*e^2 - 63*e + 206, -16*e^2 - 44*e + 126, 3*e^2 + 3*e - 65, -9*e^2 - 33*e + 67, 26*e^2 + 58*e - 302, -27*e^2 - 63*e + 293, -18*e^2 - 38*e + 190, -18*e^2 - 46*e + 178, -32*e^2 - 68*e + 348, -13*e^2 - 41*e + 115, 16*e^2 + 36*e - 162, -20*e^2 - 43*e + 207, -31*e^2 - 74*e + 309, -14*e^2 - 29*e + 154, 13*e^2 + 23*e - 157, 43*e^2 + 110*e - 414, -22*e^2 - 52*e + 208, -21*e^2 - 52*e + 180, -3*e^2 + e + 25, 15*e^2 + 30*e - 155, -17*e^2 - 46*e + 164, -4*e^2 - 12*e + 44, 2*e^2 - e - 26, 24*e^2 + 60*e - 238]; 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;