
// Make newform 4009.2.a.c in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4009_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4009_2_a_c();".
// 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_4009_a();"
function MakeCharacter_4009_a()
    N := 4009;
    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_4009_a_Hecke(Kf)
    return MakeCharacter_4009_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4009_2_a_c();".
// 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_4009_2_a_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4009_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-104841, -2999886, -16736586, 260240853, 3138191271, -16012444, -130283756163, -408166780662, 1754838183406, 9884954795740, -6412155358618, -105227318965725, -59266964580584, 637853334535727, 802986108446647, -2452924388253853, -4593278058677433, 6222150847868140, 16693460168851895, -9974517841111168, -43222222510451219, 6799142371143277, 84183488573951363, 12163411673438186, -127180900644667386, -48473249764377033, 151654449256191811, 89925290512747050, -143784573739081166, -116775965701711820, 107983752857725979, 116657602374667068, -62815018961246619, -93184948409397941, 26358910272117335, 60678750182645581, -5825680189417394, -32527731732183327, -1707561988731463, 14407043400942907, 2604578273008690, -5262546523731768, -1593445478999956, 1571834011832929, 681843302809107, -376416718320409, -225534080477047, 69116187930409, 59592507615266, -8558353012444, -12708113759626, 291511276724, 2182962510620, 165502967754, -298317562657, -49610004949, 31571908519, 8312753269, -2445519796, -969930718, 119045072, 81660323, -1149284, -4859394, -326996, 189803, 26949, -3958, -987, 7, 15, 1]>],Snew);
    return Vf;
end function;