
// Make newform 38.8.e.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_38_e();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_38_8_e_a();".
// 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_38_e();"
function MakeCharacter_38_e()
    N := 38;
    order := 9;
    char_gens := [21];
    v := [8];
    // 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_38_e_Hecke(Kf)
    return MakeCharacter_38_e();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_38_8_e_a();".
// 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_38_8_e_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_38_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,8,sign)));
    Vf := Kernel([<3,R![108015819711838162868595539904165656250967023561, -1948562379986117946477475735027697991686158779, -920305414221285359849156193095037316395171279, -24737284809001567901455245281309092809869178, 5911376741936935856134404356037752378256591, 178517371100498660441664077130273578849334, -3137634193461150141428473657175175582327, 59666402686798164188393216339202588861, 3775275320370694395193691151369891354, -476332564825651509811060785392312034, 12795882701177500973973281482449147, 21610894875993578628194432802156, 13988370656557996601704121378475, -479561465752913822004208703952, 30418458673722866791326259965, -840367814984801045159355468, 27195236446305820756025538, -341741557472170193374005, 8990773890506815548439, -29532229649838801783, 1221203031052371795, -15472915269304860, 504083095624827, -2972803849713, 77537897434, 302810589, -5241915, -99603, 2565, -45, 1]>],Snew);
    return Vf;
end function;