
// Make newform 504.2.bf.b in Magma, downloaded from the LMFDB on 10 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_504_bf();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_504_2_bf_b();".
// 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_504_bf();"
function MakeCharacter_504_bf()
    N := 504;
    order := 6;
    char_gens := [127, 253, 281, 73];
    v := [3, 3, 4, 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_504_bf_Hecke(Kf)
    return MakeCharacter_504_bf();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_504_2_bf_b();".
// 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_504_2_bf_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_504_bf();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![868098613606530428333390520097857026304, 0, 92697116024880148769892021109481944906752, 0, 6462750742591167670818231828069030838204992, 0, 232806891055298303828842911667482574821411168, 0, 5626461975651992827734676304803917950231073360, 0, 98321873743405103574516934423199627472797183292, 0, 1319968509672753800336658060399008230594078259889, 0, 14081431070540754771413517818246345568678260644896, 0, 122504879652879420506694891765639227874639386711445, 0, 884972977469755246782410553419961329233948854490248, 0, 5387405714285068420698478231088352758391740620383105, 0, 27970812920121720621911587481801484698209824182481276, 0, 125146992322659735297579256616510391225494939349731544, 0, 486933555286540265922322676670441783747989742320125404, 0, 1660936299087790391740272883896943144840669083774878514, 0, 5002370488484336945357443359160304982238732682245300668, 0, 13387650772923763435257215084975416659895392228077390082, 0, 32018839082492313906210915422015624589355624492604347464, 0, 68784148435598000883647657892493670720659230127692934110, 0, 133333128373739378061093906594785145700638129029558556768, 0, 234178803878396362563905128518534742238895363885220118274, 0, 374061785094991707486496018716896638612570734154511184612, 0, 545264671284767979025483046220724795734929668757773954749, 0, 727604574526407589674483137342924066741092711739238228324, 0, 891358125345460851165481156624165218015841412761347278121, 0, 1005133936090375793029845472420202812501433017468115344056, 0, 1045848103160421821542883942386837697335200331953944754759, 0, 1006386897804431589374442996488806719133434913798552222404, 0, 897469607499046212254495304752334259719573189546879693210, 0, 743145653901850373476378312141198947506872594994466515088, 0, 572411291089089518219734482277867556901449221845515259534, 0, 410816092607879236448774864009377899163683418157096758332, 0, 275147182080453617195981343520321756812117645541543944330, 0, 172221148073323203189871696899110485409042318899759908780, 0, 100877067566460484034864094578737536909095662455721688631, 0, 55363312884139404890676952419559827916225652424337558452, 0, 28502009381388031647945909122320777648052461832435892153, 0, 13778957096107910086232361987058612454282456741064096360, 0, 6261439412681416716371028300700784639035781517934173312, 0, 2676988079886891193634021666183019148988313971994556068, 0, 1077706415376271566495941069866946322219682354289409873, 0, 408860663784996939243995898969873030983738440193167380, 0, 146279484907651205499804764739001857195124666506102199, 0, 49386926338080433970771460365169449662838160915838764, 0, 15744341997628063801222381000629319731370537469966364, 0, 4742003279405197668374344426926914657403764967784780, 0, 1350029817207111372431215343236333954882073722366608, 0, 363469346801664341973262333740610708502725616411424, 0, 92579326323359494088909554608406486207170736100686, 0, 22317298689382327187747127657874526502487158018276, 0, 5093206983413715690728290046091024393203669997342, 0, 1100741058551340782544343911318459779283974472220, 0, 225333925563349907631010643171330278118063193384, 0, 43701892509654068166005659521512310362329124736, 0, 8031038500360751499468978786995325581378985353, 0, 1398578554360913466388990986781084958283247188, 0, 230818801365011713257179223758736935444025543, 0, 36101788960717598658203119492851459073505536, 0, 5351073870659426120279716275389358397965567, 0, 751562760568600800828938707211336849538708, 0, 100007664017530211289473468082106546250848, 0, 12605176307316598799343336836595425056224, 0, 1504478564250242145736361676696472372293, 0, 169975224297716192363976743620531216268, 0, 18169922444648844633329988488231421195, 0, 1836767889495836520060874587887411532, 0, 175473545329958553604572316294369285, 0, 15830669035814571306391189823700852, 0, 1347526195953266871109922656447044, 0, 108114736276058106744754762286916, 0, 8166445439528209936884552610692, 0, 579955033456313199465022254912, 0, 38662642714866210226924735792, 0, 2415148013972629769744090412, 0, 141074579711531535007629348, 0, 7687079116088978873232792, 0, 389641947246439091773680, 0, 18312180030351914982096, 0, 794896211231605305595, 0, 31724096289186500988, 0, 1157688922068989379, 0, 38372517093235876, 0, 1145767550296134, 0, 30501074989476, 0, 714265738723, 0, 14453609952, 0, 246532878, 0, 3416808, 0, 36267, 0, 264, 0, 1]>],Snew);
    return Vf;
end function;