/* 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, 14, -13, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, -2/19*w^3 + 3/19*w^2 + 37/19*w - 3], [5, 5, 3/19*w^3 + 5/19*w^2 - 27/19*w - 1], [5, 5, -3/19*w^3 + 14/19*w^2 + 8/19*w - 2], [9, 3, -2/19*w^3 + 3/19*w^2 + 37/19*w - 4], [19, 19, -w], [19, 19, 4/19*w^3 - 6/19*w^2 - 55/19*w + 1], [19, 19, 4/19*w^3 - 6/19*w^2 - 55/19*w + 2], [19, 19, w - 1], [29, 29, -5/19*w^3 - 2/19*w^2 + 64/19*w + 2], [29, 29, 10/19*w^3 - 34/19*w^2 - 71/19*w + 9], [29, 29, 4/19*w^3 - 6/19*w^2 - 55/19*w + 4], [29, 29, -w + 3], [49, 7, 5/19*w^3 - 17/19*w^2 - 64/19*w + 11], [49, 7, 6/19*w^3 - 9/19*w^2 - 92/19*w - 1], [71, 71, 3/19*w^3 + 5/19*w^2 - 46/19*w - 1], [71, 71, 6/19*w^3 - 9/19*w^2 - 73/19*w], [71, 71, 6/19*w^3 - 9/19*w^2 - 73/19*w + 4], [71, 71, -3/19*w^3 + 14/19*w^2 + 27/19*w - 3], [101, 101, 7/19*w^3 - 1/19*w^2 - 63/19*w - 3], [101, 101, -9/19*w^3 + 23/19*w^2 + 81/19*w - 5], [101, 101, 9/19*w^3 - 4/19*w^2 - 100/19*w], [101, 101, 7/19*w^3 - 20/19*w^2 - 44/19*w + 6], [121, 11, 6/19*w^3 - 9/19*w^2 - 54/19*w + 1], [121, 11, -6/19*w^3 + 9/19*w^2 + 54/19*w - 2], [139, 139, 9/19*w^3 - 4/19*w^2 - 100/19*w - 2], [139, 139, -7/19*w^3 + 1/19*w^2 + 63/19*w + 1], [139, 139, 7/19*w^3 - 20/19*w^2 - 44/19*w + 4], [139, 139, w - 5], [149, 149, -1/19*w^3 + 11/19*w^2 - 10/19*w - 6], [149, 149, -3/19*w^3 - 5/19*w^2 + 46/19*w], [149, 149, -3/19*w^3 + 14/19*w^2 + 27/19*w - 2], [149, 149, 1/19*w^3 + 8/19*w^2 - 9/19*w - 6], [169, 13, 14/19*w^3 - 40/19*w^2 - 126/19*w + 13], [169, 13, 10/19*w^3 - 34/19*w^2 - 52/19*w + 7], [191, 191, -10/19*w^3 + 15/19*w^2 + 109/19*w - 6], [191, 191, 6/19*w^3 - 9/19*w^2 - 35/19*w - 2], [191, 191, -6/19*w^3 + 9/19*w^2 + 35/19*w - 4], [191, 191, 10/19*w^3 - 15/19*w^2 - 109/19*w], [211, 211, 1/19*w^3 + 8/19*w^2 - 28/19*w - 8], [211, 211, 1/19*w^3 - 11/19*w^2 - 9/19*w - 1], [211, 211, -1/19*w^3 - 8/19*w^2 + 28/19*w - 2], [211, 211, -1/19*w^3 + 11/19*w^2 + 9/19*w - 9], [239, 239, 4/19*w^3 - 25/19*w^2 - 17/19*w + 12], [239, 239, -1/19*w^3 - 8/19*w^2 - 29/19*w + 5], [239, 239, 10/19*w^3 - 15/19*w^2 - 128/19*w + 1], [239, 239, -4/19*w^3 - 13/19*w^2 + 55/19*w + 10], [241, 241, -2/19*w^3 + 3/19*w^2 + 56/19*w - 4], [241, 241, -6/19*w^3 + 9/19*w^2 + 92/19*w], [241, 241, 6/19*w^3 - 9/19*w^2 - 92/19*w + 5], [241, 241, -2/19*w^3 + 3/19*w^2 + 56/19*w + 1], [269, 269, -10/19*w^3 + 34/19*w^2 + 71/19*w - 11], [269, 269, 8/19*w^3 - 12/19*w^2 - 129/19*w + 11], [269, 269, -10/19*w^3 + 34/19*w^2 + 71/19*w - 8], [269, 269, -13/19*w^3 + 48/19*w^2 + 60/19*w - 8], [289, 17, 30/19*w^3 - 7/19*w^2 - 384/19*w - 14], [289, 17, 11/19*w^3 - 45/19*w^2 - 80/19*w + 17], [311, 311, -12/19*w^3 + 37/19*w^2 + 108/19*w - 15], [311, 311, -24/19*w^3 + 55/19*w^2 + 273/19*w - 22], [311, 311, -8/19*w^3 - 7/19*w^2 + 110/19*w + 4], [311, 311, 4/19*w^3 + 13/19*w^2 - 36/19*w - 7], [331, 331, -1/19*w^3 - 8/19*w^2 + 66/19*w - 2], [331, 331, -6/19*w^3 + 28/19*w^2 + 35/19*w - 9], [331, 331, 20/19*w^3 - 68/19*w^2 - 161/19*w + 22], [331, 331, 16/19*w^3 - 62/19*w^2 - 87/19*w + 15], [359, 359, 13/19*w^3 - 48/19*w^2 - 79/19*w + 11], [359, 359, -7/19*w^3 + 20/19*w^2 + 101/19*w - 13], [359, 359, -15/19*w^3 + 51/19*w^2 + 116/19*w - 17], [359, 359, 3/19*w^3 + 5/19*w^2 - 84/19*w + 5], [379, 379, 3/19*w^3 + 5/19*w^2 - 65/19*w - 9], [379, 379, 25/19*w^3 - 9/19*w^2 - 339/19*w - 11], [379, 379, -25/19*w^3 + 66/19*w^2 + 282/19*w - 28], [379, 379, 3/19*w^3 - 14/19*w^2 - 46/19*w + 12], [389, 389, -13/19*w^3 + 48/19*w^2 + 136/19*w - 24], [389, 389, 11/19*w^3 - 7/19*w^2 - 118/19*w + 2], [389, 389, -3/19*w^3 + 14/19*w^2 + 46/19*w - 10], [389, 389, -13/19*w^3 - 9/19*w^2 + 193/19*w + 15], [409, 409, 2/19*w^3 - 3/19*w^2 - 56/19*w], [409, 409, 6/19*w^3 - 9/19*w^2 - 92/19*w + 4], [409, 409, -6/19*w^3 + 9/19*w^2 + 92/19*w - 1], [409, 409, -2/19*w^3 + 3/19*w^2 + 56/19*w - 3], [431, 431, -6/19*w^3 + 9/19*w^2 + 130/19*w - 13], [431, 431, 12/19*w^3 - 37/19*w^2 - 108/19*w + 11], [431, 431, 10/19*w^3 - 15/19*w^2 - 166/19*w + 14], [431, 431, -8/19*w^3 + 31/19*w^2 + 34/19*w - 8], [461, 461, 5/19*w^3 - 17/19*w^2 - 45/19*w + 1], [461, 461, -3/19*w^3 + 14/19*w^2 + 8/19*w - 8], [461, 461, 3/19*w^3 + 5/19*w^2 - 27/19*w - 7], [461, 461, 5/19*w^3 + 2/19*w^2 - 64/19*w + 2], [479, 479, 5/19*w^3 - 17/19*w^2 - 26/19*w + 7], [479, 479, 1/19*w^3 - 11/19*w^2 - 28/19*w + 7], [479, 479, 7/19*w^3 - 1/19*w^2 - 82/19*w + 1], [479, 479, -5/19*w^3 + 17/19*w^2 + 64/19*w - 3], [499, 499, -11/19*w^3 + 7/19*w^2 + 118/19*w + 2], [499, 499, 9/19*w^3 - 23/19*w^2 - 62/19*w + 4], [499, 499, -9/19*w^3 + 4/19*w^2 + 81/19*w], [499, 499, -11/19*w^3 + 26/19*w^2 + 99/19*w - 8], [509, 509, -6/19*w^3 - 10/19*w^2 + 73/19*w + 9], [509, 509, -1/19*w^3 + 11/19*w^2 + 47/19*w - 7], [509, 509, -6/19*w^3 - 10/19*w^2 + 73/19*w + 2], [509, 509, -9/19*w^3 + 4/19*w^2 + 138/19*w - 2], [529, 23, -4/19*w^3 + 6/19*w^2 + 74/19*w - 1], [529, 23, 4/19*w^3 - 6/19*w^2 - 74/19*w + 3], [571, 571, 1/19*w^3 + 8/19*w^2 - 66/19*w + 6], [571, 571, -9/19*w^3 + 23/19*w^2 + 119/19*w - 15], [571, 571, -11/19*w^3 + 26/19*w^2 + 156/19*w - 18], [571, 571, 3/19*w^3 + 5/19*w^2 - 103/19*w + 9], [599, 599, 6/19*w^3 - 9/19*w^2 - 16/19*w - 2], [599, 599, -14/19*w^3 + 21/19*w^2 + 164/19*w - 7], [599, 599, -2/19*w^3 + 22/19*w^2 + 18/19*w - 13], [599, 599, -6/19*w^3 + 9/19*w^2 + 16/19*w - 3], [601, 601, 23/19*w^3 - 63/19*w^2 - 264/19*w + 31], [601, 601, -36/19*w^3 - 3/19*w^2 + 476/19*w + 23], [601, 601, 36/19*w^3 - 111/19*w^2 - 362/19*w + 46], [601, 601, -16/19*w^3 + 43/19*w^2 + 125/19*w - 8], [619, 619, -5/19*w^3 + 17/19*w^2 + 45/19*w - 11], [619, 619, 5/19*w^3 - 17/19*w^2 - 26/19*w - 2], [619, 619, -5/19*w^3 - 2/19*w^2 + 45/19*w - 4], [619, 619, -7/19*w^3 + 20/19*w^2 + 63/19*w - 12], [691, 691, 7/19*w^3 - 1/19*w^2 - 120/19*w], [691, 691, 3/19*w^3 - 14/19*w^2 - 65/19*w + 6], [691, 691, -3/19*w^3 - 5/19*w^2 + 84/19*w + 2], [691, 691, 7/19*w^3 - 20/19*w^2 - 101/19*w + 6], [701, 701, -7/19*w^3 + 20/19*w^2 + 63/19*w - 2], [701, 701, 5/19*w^3 - 17/19*w^2 - 26/19*w + 8], [701, 701, -7/19*w^3 + 20/19*w^2 + 82/19*w - 4], [701, 701, -7/19*w^3 + 1/19*w^2 + 82/19*w - 2], [719, 719, -8/19*w^3 + 31/19*w^2 + 53/19*w - 12], [719, 719, 8/19*w^3 - 31/19*w^2 - 53/19*w + 6], [719, 719, -8/19*w^3 - 7/19*w^2 + 91/19*w + 2], [719, 719, 8/19*w^3 + 7/19*w^2 - 91/19*w - 8], [739, 739, 9/19*w^3 - 23/19*w^2 - 43/19*w + 3], [739, 739, -16/19*w^3 + 24/19*w^2 + 163/19*w - 9], [739, 739, 16/19*w^3 - 24/19*w^2 - 163/19*w], [739, 739, -9/19*w^3 + 4/19*w^2 + 62/19*w], [769, 769, 24/19*w^3 - 74/19*w^2 - 254/19*w + 35], [769, 769, -3/19*w^3 + 33/19*w^2 - 30/19*w - 11], [769, 769, 3/19*w^3 + 24/19*w^2 - 27/19*w - 11], [769, 769, 24/19*w^3 + 2/19*w^2 - 330/19*w - 19], [811, 811, 5/19*w^3 + 2/19*w^2 - 102/19*w], [811, 811, -5/19*w^3 + 17/19*w^2 + 83/19*w - 7], [811, 811, 5/19*w^3 + 2/19*w^2 - 102/19*w - 2], [811, 811, -5/19*w^3 + 17/19*w^2 + 83/19*w - 5], [821, 821, -6/19*w^3 - 10/19*w^2 + 111/19*w + 13], [821, 821, 1/19*w^3 + 8/19*w^2 + 10/19*w - 12], [821, 821, -1/19*w^3 + 11/19*w^2 - 29/19*w - 11], [821, 821, -6/19*w^3 + 28/19*w^2 + 73/19*w - 18], [839, 839, -2*w^3 + 26*w + 23], [839, 839, 18/19*w^3 - 65/19*w^2 - 143/19*w + 24], [839, 839, -18/19*w^3 - 11/19*w^2 + 219/19*w + 14], [839, 839, 2*w^3 - 6*w^2 - 20*w + 47], [859, 859, 10/19*w^3 - 34/19*w^2 - 109/19*w + 19], [859, 859, 3/19*w^3 + 24/19*w^2 - 46/19*w - 14], [859, 859, -17/19*w^3 + 35/19*w^2 + 210/19*w - 14], [859, 859, -10/19*w^3 - 4/19*w^2 + 147/19*w + 12], [911, 911, -1/19*w^3 + 11/19*w^2 + 28/19*w - 9], [911, 911, -5/19*w^3 + 17/19*w^2 + 64/19*w - 1], [911, 911, 5/19*w^3 + 2/19*w^2 - 83/19*w + 3], [911, 911, 1/19*w^3 + 8/19*w^2 - 47/19*w - 7], [941, 941, 11/19*w^3 - 7/19*w^2 - 99/19*w - 5], [941, 941, -1/19*w^3 + 11/19*w^2 + 28/19*w - 10], [941, 941, -13/19*w^3 + 10/19*w^2 + 136/19*w - 4], [941, 941, -6/19*w^3 + 28/19*w^2 - 3/19*w - 6], [961, 31, 10/19*w^3 - 15/19*w^2 - 90/19*w + 2], [961, 31, -10/19*w^3 + 15/19*w^2 + 90/19*w - 3]]; primes := [ideal : I in primesArray]; heckePol := x; K := Rationals(); e := 1; heckeEigenvaluesArray := [-1, 0, 1, -3, -6, 3, 0, 6, 3, -6, 3, 6, -9, -6, -15, 3, -15, 6, 3, 12, 6, -6, -15, 6, 4, -5, -5, 13, -9, -6, 0, -21, 6, 9, -3, 6, -12, -15, -5, -14, -23, 4, 15, -12, -12, -6, 3, -18, -12, 18, 15, -30, -6, -21, 7, -20, 0, 18, 15, -30, 3, 6, 12, -30, -6, 6, 30, -33, 20, -16, 29, 29, 30, -6, -24, -3, -32, 22, 22, -14, -15, 3, -30, 3, 9, 36, 0, -18, -24, -12, 0, -18, 30, -18, 18, 21, -18, 15, -27, 21, 8, 8, 15, -24, 12, 15, 12, -3, -36, 9, -27, 42, 21, -30, -10, 8, 26, -28, -18, -24, 0, 21, 36, 0, 30, -24, 30, -48, 21, -15, 0, 36, 36, 9, -15, -30, 0, 18, 25, 25, -2, 25, 18, 42, 36, 30, -30, 9, 48, 27, 14, -40, 41, 14, -48, -48, 15, -24, 12, -42, 30, -21, -46, 35]; 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;