/* 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![19, 7, -10, -1, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, -1/4*w^3 + 1/2*w + 3/4], [4, 2, 1/2*w^3 - 4*w - 1/2], [9, 3, 1/2*w^3 + w^2 - 3*w - 7/2], [11, 11, -1/4*w^3 + 1/2*w + 7/4], [11, 11, 1/2*w^3 - 4*w - 3/2], [19, 19, w], [19, 19, 1/4*w^3 - 5/2*w + 1/4], [25, 5, 1/2*w^3 - 3*w - 1/2], [29, 29, 3/4*w^3 + w^2 - 9/2*w - 25/4], [29, 29, 1/2*w^3 - w^2 - 3*w + 9/2], [41, 41, -w^3 + 7*w + 3], [41, 41, -3/4*w^3 + 11/2*w - 3/4], [41, 41, 1/4*w^3 + w^2 - 5/2*w - 11/4], [71, 71, 1/2*w^3 - 4*w + 5/2], [71, 71, 3/4*w^3 + w^2 - 11/2*w - 21/4], [79, 79, 1/4*w^3 - 2*w^2 + 1/2*w + 25/4], [79, 79, -3/4*w^3 + 13/2*w + 9/4], [89, 89, -7/4*w^3 - w^2 + 27/2*w + 41/4], [89, 89, -7/4*w^3 - w^2 + 27/2*w + 33/4], [101, 101, 1/4*w^3 + w^2 - 1/2*w - 27/4], [101, 101, -1/4*w^3 + w^2 + 5/2*w - 17/4], [109, 109, 1/2*w^3 + w^2 - 3*w - 3/2], [109, 109, -w^3 + 7*w + 1], [121, 11, 3/4*w^3 - 9/2*w - 5/4], [139, 139, 3/4*w^3 + 2*w^2 - 9/2*w - 45/4], [139, 139, 5/4*w^3 + w^2 - 17/2*w - 27/4], [139, 139, w^3 - w^2 - 6*w + 3], [139, 139, -1/4*w^3 + 2*w^2 + 3/2*w - 65/4], [149, 149, 3/4*w^3 + 2*w^2 - 13/2*w - 61/4], [149, 149, -1/4*w^3 - 2*w^2 + 7/2*w + 23/4], [151, 151, 5/4*w^3 + w^2 - 17/2*w - 31/4], [151, 151, w^3 + 2*w^2 - 7*w - 13], [179, 179, 3/4*w^3 + w^2 - 11/2*w - 17/4], [179, 179, -1/4*w^3 + w^2 + 1/2*w - 25/4], [181, 181, 1/4*w^3 + 2*w^2 - 3/2*w - 35/4], [181, 181, 1/4*w^3 + 2*w^2 - 3/2*w - 51/4], [191, 191, -1/4*w^3 - 2*w^2 + 3/2*w + 27/4], [191, 191, -5/4*w^3 + 19/2*w + 11/4], [199, 199, 2*w^2 - 13], [199, 199, 1/2*w^3 + 2*w^2 - 3*w - 17/2], [211, 211, 3/4*w^3 + 2*w^2 - 13/2*w - 41/4], [211, 211, -1/4*w^3 + 2*w^2 + 3/2*w - 49/4], [229, 229, -1/4*w^3 + 2*w^2 + 3/2*w - 45/4], [229, 229, -3/4*w^3 - 2*w^2 + 9/2*w + 41/4], [239, 239, 3/4*w^3 + w^2 - 9/2*w - 33/4], [239, 239, 1/4*w^3 + w^2 - 1/2*w - 31/4], [241, 241, -1/4*w^3 + 2*w^2 + 1/2*w - 41/4], [241, 241, -2*w^2 + w + 12], [241, 241, -w^3 - 2*w^2 + 7*w + 11], [241, 241, -3/4*w^3 - 2*w^2 + 11/2*w + 37/4], [251, 251, -2*w^2 + 3*w + 4], [251, 251, -1/4*w^3 - 1/2*w - 9/4], [251, 251, -3/2*w^3 - w^2 + 11*w + 13/2], [251, 251, -3/4*w^3 + 13/2*w - 11/4], [271, 271, -3/4*w^3 + w^2 + 13/2*w - 23/4], [271, 271, w^2 - 10], [271, 271, 1/2*w^3 + w^2 - w - 11/2], [271, 271, 1/4*w^3 + w^2 - 3/2*w - 3/4], [281, 281, -5/4*w^3 - 2*w^2 + 11/2*w + 39/4], [281, 281, 3/2*w^3 - 11*w - 7/2], [311, 311, w^2 - 2*w - 6], [311, 311, -1/4*w^3 + w^2 + 1/2*w - 29/4], [331, 331, 2*w^2 - 11], [331, 331, 1/2*w^3 + 2*w^2 - 3*w - 21/2], [361, 19, w^3 - 6*w - 2], [389, 389, 1/4*w^3 + w^2 - 1/2*w - 35/4], [389, 389, 3/4*w^3 + 2*w^2 - 9/2*w - 53/4], [389, 389, 1/4*w^3 - 2*w^2 - 3/2*w + 33/4], [389, 389, w^3 + w^2 - 6*w - 9], [401, 401, 3/4*w^3 + w^2 - 7/2*w - 29/4], [401, 401, -3/4*w^3 + w^2 + 11/2*w - 15/4], [401, 401, 3/4*w^3 + 2*w^2 - 13/2*w - 33/4], [401, 401, 1/4*w^3 + 2*w^2 - 7/2*w - 51/4], [409, 409, w^3 - 5*w - 1], [409, 409, -7/4*w^3 - w^2 + 15/2*w + 21/4], [409, 409, 5/4*w^3 - 17/2*w - 3/4], [409, 409, 9/4*w^3 - w^2 - 33/2*w + 25/4], [419, 419, 3/4*w^3 + w^2 - 11/2*w - 9/4], [419, 419, -3/4*w^3 - 2*w^2 + 11/2*w + 21/4], [419, 419, -1/4*w^3 - 4*w^2 + 7/2*w + 47/4], [419, 419, -1/4*w^3 + w^2 + 1/2*w - 33/4], [421, 421, -1/2*w^3 - 4*w^2 + 4*w + 59/2], [421, 421, -7/4*w^3 + 25/2*w + 1/4], [431, 431, -5/4*w^3 - w^2 + 19/2*w + 23/4], [431, 431, 1/2*w^3 + 2*w^2 - 5*w - 13/2], [431, 431, -1/2*w^3 + w^2 + w - 9/2], [431, 431, -1/2*w^3 - 2*w^2 + 5*w + 29/2], [439, 439, -3/2*w^3 + 10*w - 3/2], [439, 439, 5/4*w^3 - 13/2*w + 5/4], [449, 449, -3/4*w^3 + 13/2*w - 15/4], [449, 449, 1/4*w^3 + 1/2*w + 21/4], [449, 449, 5/4*w^3 + 2*w^2 - 19/2*w - 43/4], [449, 449, 5/4*w^3 + 2*w^2 - 17/2*w - 59/4], [461, 461, -5/4*w^3 + 19/2*w + 15/4], [461, 461, -1/4*w^3 - 3*w^2 + 5/2*w + 31/4], [461, 461, 3/2*w^3 + w^2 - 9*w - 21/2], [461, 461, 3/4*w^3 - 5/2*w - 17/4], [479, 479, 3/2*w^3 + 2*w^2 - 10*w - 29/2], [479, 479, 3/4*w^3 - 2*w^2 - 7/2*w + 27/4], [491, 491, -5/4*w^3 + w^2 + 7/2*w + 7/4], [491, 491, 1/4*w^3 + w^2 - 1/2*w - 39/4], [491, 491, -5/2*w^3 - w^2 + 19*w + 23/2], [491, 491, -1/4*w^3 + w^2 + 5/2*w - 5/4], [499, 499, -9/4*w^3 + w^2 + 35/2*w - 21/4], [499, 499, -1/4*w^3 - 4*w^2 + 9/2*w + 47/4], [509, 509, w^3 + w^2 - 4*w - 7], [509, 509, -5/4*w^3 + w^2 + 19/2*w - 17/4], [521, 521, -3/4*w^3 + w^2 + 7/2*w - 27/4], [521, 521, 5/4*w^3 + w^2 - 17/2*w - 15/4], [529, 23, -9/4*w^3 + w^2 + 33/2*w - 21/4], [529, 23, 7/4*w^3 + w^2 - 15/2*w - 25/4], [541, 541, -7/4*w^3 + 13/2*w + 13/4], [541, 541, 1/4*w^3 + 2*w^2 - 5/2*w - 39/4], [541, 541, 1/2*w^3 + 2*w^2 - 4*w - 23/2], [541, 541, 3*w^2 - 2*w - 10], [571, 571, -5/4*w^3 + w^2 + 9/2*w - 5/4], [571, 571, 1/2*w^3 + 4*w^2 - 5*w - 25/2], [601, 601, -3/4*w^3 - 2*w^2 + 9/2*w + 17/4], [601, 601, -1/4*w^3 + 2*w^2 + 3/2*w - 69/4], [641, 641, 5/4*w^3 + 2*w^2 - 15/2*w - 51/4], [641, 641, -3/4*w^3 + 2*w^2 + 9/2*w - 35/4], [659, 659, 5/4*w^3 + 2*w^2 - 17/2*w - 35/4], [659, 659, -1/2*w^3 + 2*w^2 + 2*w - 25/2], [661, 661, -11/4*w^3 - w^2 + 41/2*w + 41/4], [661, 661, 11/4*w^3 + 5*w^2 - 43/2*w - 157/4], [661, 661, 1/4*w^3 - 5*w^2 + 7/2*w + 53/4], [661, 661, 3/2*w^3 - w^2 - 5*w - 1/2], [691, 691, 5/4*w^3 + w^2 - 7/2*w - 31/4], [691, 691, -2*w^3 + w^2 + 16*w - 4], [709, 709, 3/4*w^3 + 3*w^2 - 11/2*w - 45/4], [709, 709, 1/4*w^3 + 3*w^2 - 5/2*w - 83/4], [719, 719, 1/4*w^3 + 2*w^2 - 1/2*w - 55/4], [719, 719, 3/4*w^3 - w^2 - 9/2*w - 1/4], [751, 751, 2*w^3 + 2*w^2 - 13*w - 12], [751, 751, 3/4*w^3 + 3*w^2 - 9/2*w - 73/4], [809, 809, 5/4*w^3 + 2*w^2 - 11/2*w - 43/4], [809, 809, 1/2*w^3 + 2*w^2 - 3*w - 33/2], [821, 821, -5/4*w^3 + 19/2*w - 9/4], [821, 821, 3/4*w^3 + 2*w^2 - 13/2*w - 29/4], [821, 821, -1/4*w^3 - 3/2*w + 31/4], [821, 821, 1/4*w^3 + 2*w^2 - 9/2*w - 15/4], [839, 839, -5/4*w^3 - w^2 + 13/2*w + 35/4], [839, 839, 5/4*w^3 - w^2 - 17/2*w + 9/4], [841, 29, -5/4*w^3 + 15/2*w - 1/4], [859, 859, 1/4*w^3 + w^2 - 7/2*w - 51/4], [859, 859, -3/2*w^3 - 3*w^2 + 11*w + 41/2], [859, 859, 2*w^3 + 2*w^2 - 12*w - 9], [859, 859, 5/4*w^3 + 3*w^2 - 15/2*w - 63/4], [919, 919, 5/4*w^3 - 2*w^2 - 11/2*w + 29/4], [919, 919, 9/4*w^3 + 2*w^2 - 31/2*w - 55/4], [929, 929, -3/2*w^3 - 3*w^2 + 11*w + 49/2], [929, 929, -5/4*w^3 - w^2 + 9/2*w + 31/4], [961, 31, 5/4*w^3 - 15/2*w - 7/4], [961, 31, 1/2*w^3 - 3*w - 13/2], [971, 971, 1/4*w^3 + 4*w^2 - 11/2*w - 43/4], [971, 971, 5/4*w^3 - w^2 - 5/2*w - 11/4], [991, 991, 5/4*w^3 - w^2 - 15/2*w + 17/4], [991, 991, 3/2*w^3 + w^2 - 9*w - 13/2]]; primes := [ideal : I in primesArray]; heckePol := x^4 - 4*x^3 - 13*x^2 + 64*x - 44; K := NumberField(heckePol); heckeEigenvaluesArray := [e, 0, 0, 0, 0, 2*e^3 - e^2 - 30*e + 29, -3/2*e^3 + 43/2*e - 10, e^3 - e^2 - 13*e + 19, 0, 0, 0, 0, 0, 0, 0, -7/2*e^3 + 103/2*e - 26, e^3 - e^2 - 17*e + 17, 0, 0, 0, 0, -3*e^3 + 41*e - 16, -e^3 + 19*e - 8, -7/2*e^3 + 4*e^2 + 99/2*e - 66, -2*e^3 + 4*e^2 + 30*e - 48, 6*e^3 - 4*e^2 - 90*e + 100, -13/2*e^3 + 4*e^2 + 197/2*e - 106, -2*e^3 + 3*e^2 + 30*e - 39, 0, 0, -2*e^3 + 4*e^2 + 30*e - 48, 6*e^3 - 4*e^2 - 90*e + 100, 0, 0, -5/2*e^3 + 65/2*e - 2, -3/2*e^3 + 2*e^2 + 47/2*e - 48, 0, 0, -5/2*e^3 + 69/2*e - 22, -5*e^3 + e^2 + 69*e - 33, 5*e^3 - 5*e^2 - 77*e + 97, 9/2*e^3 - 2*e^2 - 137/2*e + 68, 3/2*e^3 - 39/2*e + 14, -15/2*e^3 + 6*e^2 + 219/2*e - 124, 0, 0, -5/2*e^3 + 65/2*e - 2, 5/2*e^3 + 2*e^2 - 73/2*e + 8, -3/2*e^3 + 4*e^2 + 39/2*e - 50, -5/2*e^3 + 2*e^2 + 73/2*e - 60, 0, 0, 0, 0, 3*e^3 - 3*e^2 - 51*e + 59, 3*e^2 + 4*e - 27, -3/2*e^3 + 51/2*e - 10, -3/2*e^3 - 2*e^2 + 43/2*e - 4, 0, 0, 0, 0, 4*e^3 - 4*e^2 - 52*e + 76, -8*e^3 + 4*e^2 + 112*e - 88, 3*e^3 - 45*e + 8, 0, 0, 0, 0, 0, 0, 0, 0, 15/2*e^3 - 6*e^2 - 219/2*e + 116, -e^3 - 3*e^2 + 13*e + 13, 21/2*e^3 - 6*e^2 - 297/2*e + 128, 3*e^3 - e^2 - 47*e + 15, 0, 0, 0, 0, -2*e^3 - e^2 + 22*e + 11, 5*e^3 - e^2 - 73*e + 27, 0, 0, 0, 0, 9*e^3 - 7*e^2 - 137*e + 159, 1/2*e^3 - 4*e^2 - 33/2*e + 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3*e^3 + 3*e^2 + 51*e - 79, -9/2*e^3 + 6*e^2 + 153/2*e - 112, 0, 0, 0, 0, -8*e^3 + 9*e^2 + 116*e - 143, -10*e^3 + 7*e^2 + 142*e - 137, 3/2*e^3 + 2*e^2 - 63/2*e - 20, -e^3 - 3*e^2 + 21*e + 29, 10*e^3 - 5*e^2 - 150*e + 147, -11/2*e^3 + 159/2*e - 46, 9/2*e^3 - 6*e^2 - 137/2*e + 80, 5*e^3 - 5*e^2 - 85*e + 105, 21/2*e^3 - 2*e^2 - 297/2*e + 76, 7/2*e^3 - 2*e^2 - 83/2*e + 48, 0, 0, 0, 0, -12*e^3 + 5*e^2 + 168*e - 119, 17/2*e^3 - 261/2*e + 66, -7/2*e^3 - 2*e^2 + 107/2*e - 28, 5*e^3 - 3*e^2 - 81*e + 65, 9/2*e^3 - 6*e^2 - 121/2*e + 96, 11*e^3 - e^2 - 163*e + 93, -5*e^3 + 8*e^2 + 83*e - 128, 7*e^3 - 8*e^2 - 113*e + 152, 0, 0, 2*e^3 - 4*e^2 - 22*e + 60, -10*e^3 + 4*e^2 + 142*e - 104, 0, 0, 0, 0, 0, 0, 0, 0, -15*e^3 + 9*e^2 + 219*e - 211, 14*e^3 - 4*e^2 - 210*e + 164, 3*e^3 - 9*e^2 - 51*e + 101, 9/2*e^3 - 6*e^2 - 153/2*e + 104, 6*e^3 + 4*e^2 - 90*e + 16, -3/2*e^3 + 6*e^2 + 27/2*e - 76, -6*e^3 - 3*e^2 + 90*e - 13, 0, 0, -9*e^3 + 135*e - 88, 9*e^3 - 135*e + 56, 0, 0, 14*e^3 - 4*e^2 - 210*e + 164, 6*e^3 + 4*e^2 - 90*e + 16]; 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;