
// Make newform 2009.4.a.n in Magma, downloaded from the LMFDB on 20 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_2009_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_2009_4_a_n();".
// 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_2009_a();"
function MakeCharacter_2009_a()
    N := 2009;
    order := 1;
    char_gens := [493, 785];
    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_2009_a_Hecke(Kf)
    return MakeCharacter_2009_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_2009_4_a_n();".
// 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_2009_4_a_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_2009_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![-1306924717782556737536, 19252575537886390124544, -306414858567493353472, -813170751324072949317632, 1667642631555916472516608, 8436794548611030923083776, -16999360142853782870392832, -42786261166352655805644800, 73001396008164802106695680, 125846227411177958161170432, -177416045562933913123268608, -234687624210734510636474368, 277582666294972276643456256, 295796037794396303853571584, -301550802291525655703161216, -265025281178845875548137216, 239121137491270260934233008, 175565592015199083938341472, -143372287451314025577313848, -88623777885934359966880384, 66698776303145955881790977, 34888124914725887084625210, -24548670548086100943217621, -10903893509482440305855720, 7255790794411168080911413, 2743304163825622291108514, -1742285929566346931969939, -561572410809261848136090, 342949984051793274672085, 94304878219437163490020, -55718093431331831361733, -13070760758620852905322, 7509414887872174044690, 1501566236398234942822, -842446829695507452565, -143337754284466603364, 78816116988163188374, 11379324233559179364, -6151170012964003394, -750622632702133078, 399932443215445086, 41024970824930446, -21592891022599138, -1848359918324908, 962899099372570, 68109211775684, -35175862168053, -2028923154646, 1040292153754, 48046813194, -24485903773, -882457748, 447437641, 12107002, -6112367, -116674, 58689, 704, -353, -2, 1]>,<3,R![182205102447546615275206908820112, 8798653906692754017947339295682560, 101834768947797210921772163147503136, -237831219795848337163207089119622848, -4495480507525172583924818846124965904, 982913622907027541052057444134369200, 46200508059464940712077869023784332600, -24720847835568305046233969070712921440, -126150632792992399374210380108846029612, 55486197257329330035037968251315495720, 154966729494312297972203235003668172920, -52354354586905363674638177334444346924, -105751839604912285378806266370732504639, 27085186351561223802795758343825851816, 45633492749035074375367124359512805208, -8680865751146107115228681620230156972, -13518904828441622837198208760410560780, 1838456028159642075621958572077109132, 2901849161771470391751162115636088744, -263617308317787368569849260604962508, -468255169211013722005173984007531586, 24845482013374544708161120973702888, 58309397077001461092266991482046608, -1241539451840247566615476610998800, -5711966762133688069258895462677160, -31929520199972817672012292127820, 446537240082333948080218706368764, 12756957055891452972200310497748, -28158817422925622483493892354087, -1365815071765329114544641768788, 1443599027011919929604130727904, 95509381119388207343398023896, -60483052117470979883064040038, -4974184697786484283632935504, 2076800139646334494108241956, 202348405875632531926561916, -58457411405546374713204914, -6575310215907624163591960, 1345234887095093441434760, 172600693610911839264132, -25144940318883037919062, -3677175629654831550796, 377196414994500071832, 63574592481498075996, -4444520634607205150, -888007724635061648, 39482984571335876, 9929837974740024, -240244948009964, -87566339847124, 679059655228, 594930979844, 3440691529, -3002187116, -51266192, 10588760, 281662, -23280, -808, 24, 1]>],Snew);
    return Vf;
end function;