
// Make newform 4027.2.a.b in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4027_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4027_2_a_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_4027_a();"
function MakeCharacter_4027_a()
    N := 4027;
    order := 1;
    char_gens := [3];
    v := [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_4027_a_Hecke(Kf)
    return MakeCharacter_4027_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_4027_2_a_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_4027_2_a_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4027_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-17579932200, 2247318652320, -41292455335902, -526216038072615, 14644029809017866, 33257270804631827, -2030020219600067022, 1223386558097692500, 155619247050051209689, -279645477355964074750, -7675014687859240086820, 18112335508523635881703, 266142251431884732926257, -695074029016210096578911, -6880410764261965850007923, 18443659757546491825619464, 138186815257275387390732277, -363475996142713919562022490, -2221965365570339624268544087, 5553323678195269256454677028, 29257074548038825649314187402, -67723602483498469737613227720, -320973296102564473865356666932, 673349071489222189410743383920, 2974060794352987862676651300289, -5546180499497707696522185322670, -23529370258043683991593743560750, 38309435608833127099123556318068, 160379556770810263221664437760461, -223961580037103649497660265887173, -948969826285247459643280337761152, 1115374193128582584622876344530123, 4906244548563130772476274204281958, -4749445134469438020712969821693074, -22290239428318588190885245768680745, 17294083054434875649161976403621711, 89441918644949874841361515418112881, -53565113803921222306382419454245309, -318408180346955811910696190646106323, 138936759572628363758175743991374233, 1009707903672929677278424938486261837, -289770172170944680128696011134371020, -2862497106546537609253494721648148402, 427143581426667087306397892340940969, 7278366178135828426677258967337448897, -155227237996713799875603272572497843, -16645849610865096473909566392764565970, -1639897191433398070077222495288457728, 34328243736731182345743350849834771853, 7284596440685822333045177732292213856, -63974623885329848278766151841967438603, -20582105894778015576768997410000349690, 107932552406753826395252556506169917680, 46327256768909830573668833954589712044, -165078953461905208028839340534324337028, -88670420369870602134397571101165944025, 229105662820315358311421780945121480841, 148546379323285784859511745908663629102, -288641860908556580131727052866604257057, -221280877422738161226211897576809287261, 330015238559989476082150197969973225297, 295998995292207882954804414386613939185, -341991504383841978837456461602650569481, -357926395768245590244874164295320955056, 320362448988986391123562707915935639064, 393127697211204674657330440260006565841, -269933549774749595831060854258627688570, -393606900527612186423052623561152846924, 202739187914194223182836518347952251293, 360217828443281900030773436641103112666, -133413053207764556053497703475638564253, -301959231420655710842114202896153775768, 74124434909146586553127880546667237134, 232217702466475520229171531490664818332, -31414158709035911159878483557403206728, -164019303121704613421674343246574991914, 5875855973576466756168392689654231956, 106476423762208156518038215139564500184, 5973269478395863849944626160938129479, -63546533632750793383199639079551012082, -9106588221251781778277430015076403320, 34860032195035551962639386011376748846, 7965223274652247088403476558355364416, -17564544706891363825660459684299780805, -5524609267262369235895230129652786643, 8116789161472615765423528728620726440, 3286228051482297683105212432575187263, -3431663109817175941583059506912252756, -1729974792231097031680582945376785079, 1322174068612221011029797994362457478, 818719702484438604865087702406410458, -461293837798723730225003992313079267, -351395249582722153718944121440553740, 144186850635469570784525863493813764, 137493094721711609814230974416053886, -39593547458016435266518915919359980, -49196316328838276415193473713434182, 9162996511786589795079606389407014, 16124422652724309767530557052096793, -1590996748044854248525949497913787, -4844090384826415536887140340183751, 100096786254704576033508763890542, 1333531709964330804045083847173453, 68347586130667710362213665101909, -336017125152437174625389038838224, -40349098541963830340864897434239, 77332067307121880068448663512113, 14600453563929856591271456962387, -16200202105478901551707047569101, -4226931083687700817386378491302, 3073091058666755150752834349795, 1048795577176732395131310151910, -523583896524898035671713616929, -229211492766492890863552464628, 79052385924476015811765543916, 44689677055280730386025918085, -10320216875824628950752035298, -7820667076664762938712152949, 1104109380897678625391365530, 1231286964681210830993328208, -81990931297529448503208406, -174366874117347644697700392, 252992105366988211081743, 22158987337421913562922595, 1293950543270369643869786, -2515707602218273666702562, -293311808811287698841443, 253300556974607504746550, 44888618743431055751713, -22361296263001051997172, -5504580507379516200469, 1698179864001494354922, 567924458046037864224, -107071009539994523727, -50152453368174101878, 5156754740820993178, 3806248049431940835, -136423533495413441, -247334448954893031, -5145728555078312, 13617207802594934, 992766768947975, -623225438014398, -78649297697821, 22926846046423, 4352151658681, -633462226088, -182205983981, 10826590739, 5803782778, 6418231, -136186968, -6846861, 2170800, 214717, -18924, -3300, 9, 22, 1]>],Snew);
    return Vf;
end function;