/* 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![29, 16, -15, -2, 1]; F := NumberField(g); ZF := Integers(F); NN := ideal; primesArray := [ [4, 2, -2/23*w^3 + 3/23*w^2 - 3/23*w + 1/23], [9, 3, -2/23*w^3 + 3/23*w^2 + 43/23*w + 24/23], [9, 3, -2/23*w^3 + 3/23*w^2 + 43/23*w - 68/23], [19, 19, -2/23*w^3 + 3/23*w^2 - 3/23*w + 24/23], [19, 19, -6/23*w^3 + 9/23*w^2 + 83/23*w - 20/23], [19, 19, 6/23*w^3 - 9/23*w^2 - 83/23*w + 66/23], [19, 19, -2/23*w^3 + 3/23*w^2 - 3/23*w - 22/23], [25, 5, -4/23*w^3 + 6/23*w^2 + 40/23*w - 21/23], [29, 29, w], [29, 29, -4/23*w^3 + 6/23*w^2 + 63/23*w - 21/23], [29, 29, 4/23*w^3 - 6/23*w^2 - 63/23*w + 44/23], [29, 29, -w + 1], [31, 31, w + 2], [31, 31, -4/23*w^3 + 6/23*w^2 + 63/23*w + 25/23], [31, 31, 4/23*w^3 - 6/23*w^2 - 63/23*w + 90/23], [31, 31, -w + 3], [49, 7, -2/23*w^3 + 3/23*w^2 + 43/23*w - 22/23], [59, 59, -20/23*w^3 + 30/23*w^2 + 269/23*w - 128/23], [59, 59, -8/23*w^3 + 12/23*w^2 + 103/23*w - 88/23], [59, 59, -8/23*w^3 + 12/23*w^2 + 103/23*w - 19/23], [59, 59, -4/23*w^3 + 6/23*w^2 + 17/23*w - 44/23], [109, 109, -9/23*w^3 + 2/23*w^2 + 113/23*w + 62/23], [109, 109, 4/23*w^3 - 6/23*w^2 - 63/23*w - 71/23], [109, 109, 7/23*w^3 - 22/23*w^2 - 47/23*w + 100/23], [109, 109, 9/23*w^3 - 25/23*w^2 - 90/23*w + 168/23], [121, 11, -2/23*w^3 + 3/23*w^2 + 20/23*w - 91/23], [121, 11, 2/23*w^3 - 3/23*w^2 - 20/23*w - 70/23], [131, 131, -5/23*w^3 + 19/23*w^2 + 50/23*w - 101/23], [131, 131, -3/23*w^3 + 16/23*w^2 + 7/23*w - 125/23], [131, 131, 3/23*w^3 + 7/23*w^2 - 30/23*w - 105/23], [131, 131, 5/23*w^3 + 4/23*w^2 - 73/23*w - 37/23], [139, 139, -2/23*w^3 - 20/23*w^2 + 43/23*w + 323/23], [139, 139, 17/23*w^3 - 37/23*w^2 - 216/23*w + 302/23], [139, 139, 17/23*w^3 - 14/23*w^2 - 239/23*w - 66/23], [139, 139, -2/23*w^3 + 26/23*w^2 - 3/23*w - 344/23], [149, 149, -1/23*w^3 - 10/23*w^2 + 33/23*w - 34/23], [149, 149, 1/23*w^3 + 10/23*w^2 - 33/23*w - 196/23], [149, 149, -1/23*w^3 + 13/23*w^2 + 10/23*w - 218/23], [149, 149, 1/23*w^3 - 13/23*w^2 - 10/23*w - 12/23], [169, 13, 6/23*w^3 - 9/23*w^2 - 37/23*w + 20/23], [169, 13, -10/23*w^3 + 15/23*w^2 + 123/23*w - 64/23], [199, 199, -1/23*w^3 + 13/23*w^2 - 13/23*w - 195/23], [199, 199, 3/23*w^3 + 7/23*w^2 - 53/23*w + 33/23], [199, 199, 3/23*w^3 - 16/23*w^2 - 30/23*w + 10/23], [199, 199, 1/23*w^3 + 10/23*w^2 - 10/23*w - 196/23], [251, 251, 6/23*w^3 - 9/23*w^2 - 14/23*w + 43/23], [251, 251, 14/23*w^3 - 21/23*w^2 - 186/23*w + 62/23], [251, 251, 4/23*w^3 - 6/23*w^2 - 109/23*w + 228/23], [251, 251, 6/23*w^3 - 9/23*w^2 - 14/23*w - 26/23], [271, 271, -8/23*w^3 + 12/23*w^2 + 126/23*w + 27/23], [271, 271, 8/23*w^3 - 35/23*w^2 - 80/23*w + 226/23], [271, 271, 13/23*w^3 - 31/23*w^2 - 153/23*w + 189/23], [271, 271, 8/23*w^3 - 12/23*w^2 - 126/23*w + 157/23], [281, 281, -w^2 + 2*w + 9], [281, 281, 13/23*w^3 - 8/23*w^2 - 153/23*w + 28/23], [281, 281, -13/23*w^3 + 31/23*w^2 + 130/23*w - 120/23], [281, 281, 11/23*w^3 - 28/23*w^2 - 87/23*w + 190/23], [289, 17, -11/23*w^3 + 51/23*w^2 + 110/23*w - 581/23], [289, 17, -8/23*w^3 + 35/23*w^2 + 80/23*w - 410/23], [311, 311, 5/23*w^3 + 4/23*w^2 - 50/23*w - 106/23], [311, 311, -7/23*w^3 + 22/23*w^2 + 70/23*w - 100/23], [311, 311, 7/23*w^3 + 1/23*w^2 - 93/23*w - 15/23], [311, 311, -5/23*w^3 + 19/23*w^2 + 27/23*w - 147/23], [389, 389, -8/23*w^3 + 35/23*w^2 + 80/23*w - 295/23], [389, 389, -4/23*w^3 + 29/23*w^2 - 6/23*w - 136/23], [389, 389, -4/23*w^3 - 17/23*w^2 + 40/23*w + 117/23], [389, 389, 2/23*w^3 + 20/23*w^2 - 20/23*w - 185/23], [401, 401, 11/23*w^3 - 5/23*w^2 - 179/23*w - 17/23], [401, 401, 2/23*w^3 + 20/23*w^2 - 43/23*w - 93/23], [401, 401, 1/23*w^3 + 10/23*w^2 + 36/23*w - 104/23], [401, 401, 11/23*w^3 - 28/23*w^2 - 156/23*w + 190/23], [419, 419, -6/23*w^3 - 14/23*w^2 + 83/23*w + 72/23], [419, 419, 3/23*w^3 + 7/23*w^2 - 76/23*w + 79/23], [419, 419, -6/23*w^3 + 32/23*w^2 + 37/23*w - 296/23], [419, 419, -1/23*w^3 + 13/23*w^2 + 56/23*w - 172/23], [421, 421, -8/23*w^3 + 12/23*w^2 + 57/23*w - 65/23], [421, 421, -12/23*w^3 + 18/23*w^2 + 143/23*w - 109/23], [421, 421, 12/23*w^3 - 18/23*w^2 - 143/23*w + 40/23], [421, 421, 8/23*w^3 - 12/23*w^2 - 57/23*w - 4/23], [439, 439, 7/23*w^3 - 22/23*w^2 - 93/23*w + 123/23], [439, 439, 1/23*w^3 + 10/23*w^2 + 13/23*w - 127/23], [439, 439, 5/23*w^3 + 4/23*w^2 - 73/23*w + 9/23], [439, 439, 7/23*w^3 + 1/23*w^2 - 116/23*w - 15/23], [449, 449, -11/23*w^3 + 5/23*w^2 + 133/23*w + 63/23], [449, 449, -9/23*w^3 + 2/23*w^2 + 90/23*w + 16/23], [449, 449, 9/23*w^3 - 25/23*w^2 - 67/23*w + 99/23], [449, 449, -11/23*w^3 + 28/23*w^2 + 110/23*w - 190/23], [479, 479, 10/23*w^3 - 15/23*w^2 - 123/23*w - 74/23], [479, 479, 6/23*w^3 - 9/23*w^2 - 37/23*w + 158/23], [479, 479, -6/23*w^3 + 9/23*w^2 + 37/23*w + 118/23], [479, 479, 10/23*w^3 - 15/23*w^2 - 123/23*w + 202/23], [529, 23, -4/23*w^3 + 29/23*w^2 + 40/23*w - 274/23], [529, 23, w^2 - 6], [541, 541, 6/23*w^3 + 14/23*w^2 - 83/23*w - 141/23], [541, 541, -6/23*w^3 + 32/23*w^2 + 37/23*w - 227/23], [541, 541, 6/23*w^3 + 14/23*w^2 - 83/23*w - 164/23], [541, 541, -6/23*w^3 + 32/23*w^2 + 37/23*w - 204/23], [569, 569, -5/23*w^3 - 4/23*w^2 + 50/23*w - 78/23], [569, 569, -7/23*w^3 + 22/23*w^2 + 70/23*w - 284/23], [569, 569, -5/23*w^3 + 19/23*w^2 + 50/23*w - 262/23], [569, 569, 5/23*w^3 - 19/23*w^2 - 27/23*w - 37/23], [619, 619, -2/23*w^3 - 43/23*w^2 + 66/23*w + 622/23], [619, 619, 17/23*w^3 - 37/23*w^2 - 216/23*w + 233/23], [619, 619, 17/23*w^3 - 14/23*w^2 - 239/23*w + 3/23], [619, 619, -2/23*w^3 + 49/23*w^2 - 26/23*w - 643/23], [641, 641, -1/23*w^3 + 13/23*w^2 - 59/23*w + 127/23], [641, 641, -14/23*w^3 + 44/23*w^2 + 117/23*w - 246/23], [641, 641, -11/23*w^3 + 5/23*w^2 + 179/23*w + 201/23], [641, 641, -1/23*w^3 - 10/23*w^2 - 36/23*w - 80/23], [691, 691, 5/23*w^3 - 65/23*w^2 - 4/23*w + 837/23], [691, 691, -2/23*w^3 + 26/23*w^2 + 20/23*w - 321/23], [691, 691, -2/23*w^3 - 20/23*w^2 + 66/23*w + 277/23], [691, 691, -5/23*w^3 - 50/23*w^2 + 119/23*w + 773/23], [701, 701, 2/23*w^3 + 20/23*w^2 - 66/23*w - 185/23], [701, 701, w^2 - 7], [701, 701, -2/23*w^3 + 26/23*w^2 + 20/23*w - 183/23], [701, 701, -2/23*w^3 + 26/23*w^2 + 20/23*w - 229/23], [709, 709, -18/23*w^3 + 27/23*w^2 + 226/23*w - 152/23], [709, 709, -33/23*w^3 + 38/23*w^2 + 445/23*w - 41/23], [709, 709, -33/23*w^3 + 61/23*w^2 + 422/23*w - 409/23], [709, 709, 18/23*w^3 - 27/23*w^2 - 226/23*w + 83/23], [719, 719, -4/23*w^3 + 29/23*w^2 + 40/23*w - 136/23], [719, 719, 12/23*w^3 - 18/23*w^2 - 166/23*w + 155/23], [719, 719, w^2 - 12], [719, 719, 4/23*w^3 + 17/23*w^2 - 86/23*w - 71/23], [809, 809, -10/23*w^3 + 15/23*w^2 + 123/23*w - 248/23], [809, 809, 7/23*w^3 - 22/23*w^2 - 93/23*w + 307/23], [809, 809, 7/23*w^3 + 1/23*w^2 - 116/23*w - 199/23], [809, 809, 10/23*w^3 - 15/23*w^2 - 123/23*w - 120/23], [811, 811, -7/23*w^3 - 1/23*w^2 + 93/23*w - 31/23], [811, 811, -7/23*w^3 + 22/23*w^2 + 93/23*w - 100/23], [811, 811, 7/23*w^3 + 1/23*w^2 - 116/23*w + 8/23], [811, 811, 1/23*w^3 + 10/23*w^2 + 13/23*w - 150/23], [821, 821, -4/23*w^3 + 29/23*w^2 + 17/23*w - 182/23], [821, 821, 4/23*w^3 + 17/23*w^2 - 63/23*w - 186/23], [821, 821, -4/23*w^3 + 29/23*w^2 + 17/23*w - 228/23], [821, 821, 4/23*w^3 + 17/23*w^2 - 63/23*w - 140/23], [839, 839, -16/23*w^3 + 70/23*w^2 + 160/23*w - 751/23], [839, 839, 22/23*w^3 - 33/23*w^2 - 289/23*w + 196/23], [839, 839, -22/23*w^3 + 33/23*w^2 + 289/23*w - 104/23], [839, 839, -16/23*w^3 - 22/23*w^2 + 252/23*w + 537/23], [859, 859, -7/23*w^3 + 22/23*w^2 + 47/23*w - 192/23], [859, 859, -9/23*w^3 + 2/23*w^2 + 113/23*w - 30/23], [859, 859, -9/23*w^3 + 25/23*w^2 + 90/23*w - 76/23], [859, 859, 7/23*w^3 + 1/23*w^2 - 70/23*w - 130/23], [971, 971, -10/23*w^3 + 15/23*w^2 + 146/23*w + 97/23], [971, 971, -14/23*w^3 - 2/23*w^2 + 186/23*w + 99/23], [971, 971, 14/23*w^3 - 44/23*w^2 - 140/23*w + 269/23], [971, 971, -10/23*w^3 + 15/23*w^2 + 146/23*w - 248/23]]; primes := [ideal : I in primesArray]; heckePol := x; K := Rationals(); e := 1; heckeEigenvaluesArray := [4, 1, 1, 0, 0, 0, 0, 10, -9, -9, -9, -9, 0, 0, 0, 0, 14, 0, 0, 0, 0, -11, -11, -11, -11, -13, -13, 0, 0, 0, 0, 0, 0, 0, 0, -6, -6, -6, -6, 19, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 33, 33, 33, 33, -29, -29, 0, 0, 0, 0, -39, -39, -39, -39, 27, 27, 27, 27, 0, 0, 0, 0, 37, 37, 37, 37, 0, 0, 0, 0, 9, 9, 9, 9, 0, 0, 0, 0, 46, 46, 43, 43, 43, 43, 6, 6, 6, 6, 0, 0, 0, 0, -18, -18, -18, -18, 0, 0, 0, 0, 33, 33, 33, 33, -1, -1, -1, -1, 0, 0, 0, 0, 39, 39, 39, 39, 0, 0, 0, 0, 57, 57, 57, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]; heckeEigenvalues := AssociativeArray(); for i := 1 to #heckeEigenvaluesArray do heckeEigenvalues[primes[i]] := heckeEigenvaluesArray[i]; end for; ALEigenvalues := AssociativeArray(); // 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;