
// Make newform 8002.2.a.d in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_8002_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8002_2_a_d();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
// To make the character of type GrpDrchElt, type "MakeCharacter_8002_a();"
function MakeCharacter_8002_a()
    N := 8002;
    order := 1;
    char_gens := [3];
    v := [1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_8002_a_Hecke(Kf)
    return MakeCharacter_8002_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8002_2_a_d();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_8002_2_a_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8002_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![388376961, 10570555501, -23494918782, -839932706348, 553474736751, 24993955178997, 2051823320104, -387628027171402, -241763291944428, 3548872252004469, 3671027782942977, -20844265152836518, -29038152566497426, 82649321152473905, 146742440851029378, -226021912941987124, -517306638472838215, 418122566008032750, 1336191139109997859, -456114003009831955, -2606511500670270769, 27646431814888278, 3912378805814802303, 974958813126391803, -4562619642775882339, -2186828872395046513, 4134543655046796311, 2963521245965485382, -2869052659041772135, -2917743080442421771, 1452560293153302504, 2210231952332941087, -449050909675041337, -1318726321011751990, -12850353005133984, 624503679985874940, 115732381487753619, -233643458637278634, -82801017896345495, 67569116399313694, 37522485126062140, -14202380149649307, -12537695331604266, 1725778767922526, 3216295772836825, 91113517078210, -636354524027558, -106127401414882, 94956748281724, 29663711345796, -9944631095153, -5281260795800, 550294497590, 665677330816, 25562772995, -59460604575, -9294700379, 3496136340, 1050725418, -97890854, -69153744, -2844455, 2646653, 387895, -42332, -14542, -583, 182, 25, 1]>],Snew);
    return Vf;
end function;