
// Make newform 8018.2.a.k in Magma, downloaded from the LMFDB on 18 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_8018_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8018_2_a_k();".
// 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_8018_a();"
function MakeCharacter_8018_a()
    N := 8018;
    order := 1;
    char_gens := [2111, 1901];
    v := [1, 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_8018_a_Hecke(Kf)
    return MakeCharacter_8018_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8018_2_a_k();".
// 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_8018_2_a_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8018_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![838784, 14087904, -460122016, -5714941424, 7567882524, 128118353570, -65545607321, -1233160947854, 500840535097, 6642242280931, -3050776845582, -22260796337501, 12353135358003, 49223309253473, -32643830518774, -74555946868375, 58375029460725, 79121250455674, -73415740405638, -59213367818723, 66935835649309, 30633498814651, -45214641484190, -9991469659948, 22954437134574, 1148546779925, -8825591551273, 726396723467, 2571855354682, -499799076041, -563470519608, 170226779488, 90709275143, -38790544478, -10131500375, 6319035116, 652218247, -746083001, 2281510, 62997706, -5301656, -3644927, 572556, 130476, -32106, -2059, 982, -22, -13, 1]>],Snew);
    return Vf;
end function;