/* 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![4, 8, -7, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [2, 2, 1/2*w^2 + 1/2*w - 1], [2, 2, -1/2*w^2 + 3/2*w], [9, 3, -1/2*w^2 + 1/2*w + 2], [13, 13, 1/2*w^3 - w^2 - 5/2*w + 2], [13, 13, -1/2*w^3 + 1/2*w^2 + 3*w - 1], [23, 23, 1/2*w^3 - w^2 - 5/2*w], [23, 23, -1/2*w^3 + 1/2*w^2 + 3*w - 3], [37, 37, 1/2*w^3 - 1/2*w^2 - 3*w - 3], [37, 37, 1/2*w^3 - w^2 - 5/2*w + 6], [59, 59, -1/2*w^3 + 7/2*w], [59, 59, -1/2*w^3 + 3/2*w^2 + 2*w - 3], [61, 61, -w^3 + 2*w^2 + 7*w - 7], [61, 61, w^3 - w^2 - 6*w + 3], [61, 61, w^3 - 2*w^2 - 5*w + 3], [61, 61, w^3 - w^2 - 8*w + 1], [71, 71, -1/2*w^3 + 1/2*w^2 + 5*w - 5], [71, 71, -w^3 + 3/2*w^2 + 15/2*w - 6], [83, 83, -1/2*w^3 + 3/2*w^2 + 2*w - 7], [83, 83, 1/2*w^3 - 7/2*w - 4], [97, 97, 2*w - 1], [107, 107, 1/2*w^3 + 1/2*w^2 - 4*w - 1], [107, 107, 3/2*w^3 - 7/2*w^2 - 9*w + 13], [109, 109, -3/2*w^2 + 7/2*w + 4], [109, 109, 1/2*w^3 + 1/2*w^2 - 4*w - 5], [109, 109, -1/2*w^3 + 2*w^2 + 3/2*w - 8], [109, 109, 3/2*w^2 + 1/2*w - 6], [121, 11, w^2 - w - 5], [121, 11, w^2 - w - 3], [131, 131, -w^3 + 11*w - 1], [131, 131, -w^3 + 3*w^2 + 8*w - 9], [157, 157, -w^3 + w^2 + 6*w + 1], [157, 157, 1/2*w^3 - 2*w^2 - 11/2*w + 4], [167, 167, w^2 - 3*w - 3], [167, 167, 1/2*w^3 - 3/2*w^2 - 2*w + 1], [167, 167, 3/2*w^3 - 5/2*w^2 - 10*w + 9], [167, 167, w^2 + w - 5], [169, 13, w^2 - w - 9], [179, 179, w^3 - 7*w - 5], [179, 179, 1/2*w^3 + 1/2*w^2 - 2*w - 3], [181, 181, -1/2*w^3 + 1/2*w^2 + 3*w - 5], [181, 181, 1/2*w^3 - w^2 - 5/2*w - 2], [191, 191, -1/2*w^3 + 3/2*w + 2], [191, 191, 2*w - 5], [191, 191, -2*w - 3], [191, 191, -1/2*w^3 + 2*w^2 + 3/2*w - 10], [193, 193, -1/2*w^3 + w^2 + 9/2*w - 4], [193, 193, 1/2*w^3 - 5/2*w^2 + w + 5], [193, 193, -1/2*w^3 - w^2 + 5/2*w + 4], [193, 193, 1/2*w^3 - 1/2*w^2 - 5*w + 1], [227, 227, -1/2*w^3 + 3/2*w^2 + 4*w - 9], [227, 227, w^3 - 2*w^2 - 7*w + 5], [227, 227, w^3 - w^2 - 8*w + 3], [227, 227, 1/2*w^3 - 11/2*w - 4], [239, 239, 1/2*w^3 - 3/2*w^2 - 4*w + 3], [239, 239, 1/2*w^3 - 11/2*w + 2], [251, 251, 1/2*w^3 - w^2 - 1/2*w - 2], [251, 251, -1/2*w^3 + 1/2*w^2 + w - 3], [263, 263, -1/2*w^3 - w^2 + 17/2*w], [263, 263, 1/2*w^3 - 5/2*w^2 - 5*w + 7], [277, 277, w^3 - w^2 - 6*w + 1], [277, 277, -w^3 + 2*w^2 + 5*w - 5], [311, 311, -w^3 + 5/2*w^2 + 13/2*w - 8], [311, 311, -w^3 + 1/2*w^2 + 17/2*w], [337, 337, 2*w^3 - 3*w^2 - 13*w + 9], [337, 337, 5/2*w^2 + 3/2*w - 8], [347, 347, 2*w^3 - 7/2*w^2 - 25/2*w + 14], [347, 347, 2*w^3 - 5/2*w^2 - 27/2*w], [349, 349, w^3 - 3/2*w^2 - 11/2*w + 4], [349, 349, -w^3 + 3/2*w^2 + 11/2*w - 2], [359, 359, -1/2*w^3 + w^2 + 1/2*w + 4], [359, 359, 1/2*w^3 - 1/2*w^2 - w + 5], [373, 373, 1/2*w^3 - 3/2*w + 4], [373, 373, 1/2*w^3 - 3/2*w^2 - 3], [383, 383, w^3 - 3/2*w^2 - 15/2*w + 8], [383, 383, -2*w^2 + 1], [409, 409, 1/2*w^3 + w^2 - 13/2*w - 4], [409, 409, -1/2*w^3 + 5/2*w^2 + 3*w - 9], [431, 431, 3/2*w^3 - 5/2*w^2 - 10*w + 5], [431, 431, 1/2*w^3 - 5/2*w^2 - 3*w + 13], [431, 431, 1/2*w^3 + w^2 - 13/2*w - 8], [431, 431, 3/2*w^3 - 2*w^2 - 21/2*w + 6], [433, 433, 2*w^3 - 4*w^2 - 14*w + 13], [433, 433, w^3 - 1/2*w^2 - 9/2*w + 6], [443, 443, 2*w^3 - 11/2*w^2 - 21/2*w + 24], [443, 443, w^3 - 5*w - 3], [457, 457, -2*w^3 + 4*w^2 + 12*w - 13], [457, 457, -w^3 + 1/2*w^2 + 9/2*w], [467, 467, -3/2*w^3 + 7/2*w^2 + 7*w - 7], [467, 467, 3/2*w^2 + 1/2*w - 8], [467, 467, w^3 - 7/2*w^2 - 15/2*w + 12], [467, 467, 3/2*w^3 - w^2 - 19/2*w + 2], [503, 503, -2*w^2 + 11], [503, 503, 2*w^3 - 2*w^2 - 12*w + 7], [503, 503, 2*w^3 - 4*w^2 - 10*w + 5], [503, 503, -2*w^2 + 4*w + 9], [529, 23, 3/2*w^2 - 3/2*w - 8], [541, 541, -1/2*w^3 + w^2 + 1/2*w + 6], [541, 541, 1/2*w^3 - 1/2*w^2 - w + 7], [563, 563, 1/2*w^2 + 3/2*w - 6], [563, 563, 1/2*w^2 - 5/2*w - 4], [577, 577, -1/2*w^3 + 5/2*w^2 + w - 11], [577, 577, -1/2*w^3 - w^2 + 9/2*w + 8], [587, 587, -w^3 + 1/2*w^2 + 13/2*w - 2], [587, 587, -w^3 + 5/2*w^2 + 9/2*w - 4], [599, 599, 1/2*w^3 + w^2 - 9/2*w - 12], [599, 599, -1/2*w^3 + 5/2*w^2 + w - 15], [601, 601, 1/2*w^3 - 1/2*w^2 - 3*w - 5], [601, 601, -1/2*w^3 + w^2 + 5/2*w - 8], [625, 5, -5], [659, 659, 3/2*w^3 - 1/2*w^2 - 8*w + 3], [659, 659, 3/2*w^3 - 4*w^2 - 9/2*w + 4], [673, 673, 2*w^3 - 2*w^2 - 16*w - 1], [673, 673, w^3 - 3/2*w^2 - 7/2*w - 8], [673, 673, w^3 - 3/2*w^2 - 7/2*w + 12], [673, 673, 2*w^3 - 4*w^2 - 14*w + 17], [683, 683, -1/2*w^3 - w^2 + 9/2*w - 2], [683, 683, -w^3 + 5/2*w^2 + 9/2*w - 12], [683, 683, -w^3 + 1/2*w^2 + 13/2*w + 6], [683, 683, 3/2*w^3 - w^2 - 11/2*w + 10], [709, 709, -1/2*w^3 + w^2 + 9/2*w - 10], [709, 709, 1/2*w^3 - 1/2*w^2 - 5*w - 5], [719, 719, -3/2*w^3 + 3/2*w^2 + 11*w - 3], [719, 719, -3/2*w^3 + 3*w^2 + 19/2*w - 8], [733, 733, w^3 - 3*w^2 - 8*w + 13], [733, 733, -w^3 + 7/2*w^2 + 7/2*w - 12], [733, 733, w^3 + 1/2*w^2 - 15/2*w - 6], [733, 733, -3/2*w^3 + 9/2*w^2 + 8*w - 19], [757, 757, w^3 - w^2 - 4*w + 1], [757, 757, -2*w^3 + 7/2*w^2 + 25/2*w - 10], [769, 769, -2*w^2 + 4*w + 7], [769, 769, -2*w^2 + 9], [827, 827, -1/2*w^3 - 1/2*w^2 + 6*w - 1], [827, 827, -1/2*w^3 + 2*w^2 + 7/2*w - 4], [829, 829, 1/2*w^3 + 2*w^2 - 7/2*w - 12], [829, 829, 7/2*w^3 - 8*w^2 - 41/2*w + 32], [829, 829, 3/2*w^3 - w^2 - 15/2*w - 2], [829, 829, -w^3 + w^2 + 8*w + 5], [839, 839, 3/2*w^3 - w^2 - 23/2*w], [839, 839, -3/2*w^3 + 7/2*w^2 + 9*w - 11], [853, 853, 1/2*w^3 - 3/2*w^2 - 2*w + 11], [853, 853, -1/2*w^3 + 7/2*w + 8], [863, 863, 2*w^3 - 11/2*w^2 - 25/2*w + 26], [863, 863, 3/2*w^3 - 5/2*w^2 - 10*w + 13], [887, 887, 2*w^3 - 7/2*w^2 - 29/2*w + 8], [887, 887, 2*w^3 - 5/2*w^2 - 31/2*w + 8], [911, 911, 2*w^3 - w^2 - 15*w - 3], [911, 911, 2*w^3 - 5*w^2 - 11*w + 17], [947, 947, -w^3 + 3*w^2 + 6*w - 9], [947, 947, w^3 - 9*w - 1], [961, 31, -3/2*w^3 + 3*w^2 + 23/2*w - 8], [961, 31, 3/2*w^3 - 3/2*w^2 - 13*w + 5], [983, 983, -1/2*w^3 + 2*w^2 - 1/2*w - 6], [983, 983, 1/2*w^3 + 1/2*w^2 - 2*w - 5], [997, 997, w^3 - 13*w + 7], [997, 997, 1/2*w^3 - 5/2*w^2 - w + 9], [997, 997, 1/2*w^3 + w^2 - 9/2*w - 6], [997, 997, -w^3 + 3*w^2 + 10*w - 5]]; primes := [ideal : I in primesArray]; heckePol := x^4 + x^3 - 29*x^2 - 51*x - 18; K := NumberField(heckePol); heckeEigenvaluesArray := [0, 0, e, 1/3*e^3 + 1/3*e^2 - 29/3*e - 12, 1/3*e^3 + 1/3*e^2 - 29/3*e - 12, 0, 0, e^3 - 30*e - 26, e^3 - 30*e - 26, 0, 0, -2/3*e^3 + 1/3*e^2 + 52/3*e + 10, e^3 - 27*e - 20, e^3 - 27*e - 20, -2/3*e^3 + 1/3*e^2 + 52/3*e + 10, 0, 0, 0, 0, -2*e^3 + 54*e + 46, 0, 0, -4/3*e^3 + 2/3*e^2 + 113/3*e + 24, -e^2 + 2*e + 22, -e^2 + 2*e + 22, -4/3*e^3 + 2/3*e^2 + 113/3*e + 24, -1/3*e^3 + 2/3*e^2 + 32/3*e - 10, e^3 - 27*e - 32, 0, 0, -2/3*e^3 - 2/3*e^2 + 67/3*e + 36, -2/3*e^3 - 2/3*e^2 + 67/3*e + 36, 0, 0, 0, 0, 26, 0, 0, -1/3*e^3 - 4/3*e^2 + 26/3*e + 30, -1/3*e^3 - 4/3*e^2 + 26/3*e + 30, 0, 0, 0, 0, 2/3*e^3 - 4/3*e^2 - 55/3*e - 4, 2/3*e^3 - 1/3*e^2 - 70/3*e - 6, 2/3*e^3 - 1/3*e^2 - 70/3*e - 6, 2/3*e^3 - 4/3*e^2 - 55/3*e - 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1/3*e^3 + 4/3*e^2 - 44/3*e - 38, 1/3*e^3 + 4/3*e^2 - 44/3*e - 38, 0, 0, 5/3*e^3 + 2/3*e^2 - 166/3*e - 54, 5/3*e^3 + 2/3*e^2 - 166/3*e - 54, 0, 0, e^3 - 27*e - 20, e^3 - 27*e - 20, 0, 0, 8/3*e^3 + 2/3*e^2 - 247/3*e - 64, 8/3*e^3 + 2/3*e^2 - 247/3*e - 64, 0, 0, 5/3*e^3 - 1/3*e^2 - 151/3*e - 52, 5/3*e^3 - 1/3*e^2 - 151/3*e - 52, 0, 0, 0, 0, 1/3*e^3 - 5/3*e^2 - 35/3*e + 28, 1/3*e^3 - 5/3*e^2 - 35/3*e + 28, 0, 0, -3*e^3 + 81*e + 56, -3*e^3 + 81*e + 56, 0, 0, 0, 0, 0, 0, 0, 0, e^3 - 27*e - 56, -3*e^3 + 81*e + 68, -3*e^3 + 81*e + 68, 0, 0, -5/3*e^3 + 7/3*e^2 + 139/3*e + 16, -5/3*e^3 + 7/3*e^2 + 139/3*e + 16, 0, 0, 0, 0, e^3 - 27*e + 16, e^3 - 27*e + 16, 50, 0, 0, 4*e^3 + e^2 - 116*e - 106, -8/3*e^3 - 5/3*e^2 + 244/3*e + 70, -8/3*e^3 - 5/3*e^2 + 244/3*e + 70, 4*e^3 + e^2 - 116*e - 106, 0, 0, 0, 0, -3*e^3 + 81*e + 92, -3*e^3 + 81*e + 92, 0, 0, 10/3*e^3 + 1/3*e^2 - 308/3*e - 102, 2*e^3 + 2*e^2 - 55*e - 76, 2*e^3 + 2*e^2 - 55*e - 76, 10/3*e^3 + 1/3*e^2 - 308/3*e - 102, -14/3*e^3 - 2/3*e^2 + 427/3*e + 124, -14/3*e^3 - 2/3*e^2 + 427/3*e + 124, -11/3*e^3 - 2/3*e^2 + 346/3*e + 90, -11/3*e^3 - 2/3*e^2 + 346/3*e + 90, 0, 0, 4*e^3 - 108*e - 74, -2*e^3 + 54*e + 58, -2*e^3 + 54*e + 58, 4*e^3 - 108*e - 74, 0, 0, -7/3*e^3 - 4/3*e^2 + 188/3*e + 74, -7/3*e^3 - 4/3*e^2 + 188/3*e + 74, 0, 0, 0, 0, 0, 0, 0, 0, e^3 - 27*e - 56, e^3 - 27*e - 56, 0, 0, -e^3 - e^2 + 41*e + 44, 6*e^3 - 162*e - 142, 6*e^3 - 162*e - 142, -e^3 - e^2 + 41*e + 44]; 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;