
// Make newform 4027.2.a.c in Magma, downloaded from the LMFDB on 25 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_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_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_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_4027_2_a_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4027_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![164087296, 387270655488, 164172661922816, 20389252841434048, 409033196288260608, -6386349128718113552, -199261554058612864392, 85618059790567356400, 31471780602164969458516, 126690742675262329227056, -2217729148778243021603870, -14269792732400872022346280, 88543330415839217721745761, 784820818003799146781497727, -2225988425498441994640241375, -27674992211008089515874907376, 35951451460498125206054659631, 699013815775574181306477434506, -326448415298031320706045608521, -13456882977614516971888381013549, -231486223870987000068544041006, 205564910481927845395168297369642, 62029122031934097761074831200206, -2563195919678637583629380294579557, -1178477306412635733225927438301837, 26638387571883530248801148343554716, 14185952799174989470621926659645077, -234445364427096980434683827494944466, -128016030174574785657344133217773088, 1769240899710203231657739787209900403, 916541666741659343617530065704245242, -11562595283461136686213540930579033472, -5334786261508056305053822173817183014, 65971090881717589030828709741753776398, 25435461091365823804028536314724688512, -330818315444592571665028990164566882193, -98446306291237640192915464556723026357, 1466286210002571089526164005044046846853, 297032911429969026375642727085050222611, -5772331365210047857148172125906379006374, -600895615315548083185492747431139212300, 20268719896693824783142196756502066267579, 91443732589597856056670559813545863977, -63718369294428825876770182179135099160079, 6040203149983089760516839787520456974731, 179929967175579697370723891323187846679974, -34759732277842657566181438337422498853141, -457740188415016795441990258979660641503634, 133029045771944321519979659999836408124577, 1051814078140267940030910124589692794844258, -407646445031986719719319356686212124970281, -2187998746372113223066868159671139004192548, 1060999774652515030631706979513366160869507, 4128385515749254886970645398746780750241133, -2411071127446554505296814614218370812518888, -7076486157668987950185056549121754507020070, 4859627451404820676256020760800971950122371, 11032133421423149749171187689129566913429715, -8776539741636994180691893790117901646399980, -15652765583078773834787869243772306541420000, 14305309452009228517733630106671646968728767, 20212663484602303069432974655610942289439776, -21157619828091012067676026829298147789762424, -23735307043416634858252681967025329220263636, 28514213712080076102818867398743731998147767, 25292857857752020906055627739877869592475371, -35135944388319833496797858290129834674909512, -24359291182376599901862282984446132022898391, 39695532755130380439327104296060143217336644, 21044398330438538030900164446829250489882966, -41212297161920447867294296401450565297485619, -16078988568986897590675233087343063728230286, 39394057555188399144777446412683853766859038, 10550465406813326550294758151511972799282107, -34723874168194849322788163927991948745668182, -5520273447020726492284290067938906797544306, 28259141012272825154750160547164386174026723, 1704718743553831468972779843161166781997593, -21253651229786974959617171637104972056770559, 655912967014453969468612934446131343560500, 14781954604397158414785562862004675923849099, -1728867576317945852223798347175217614364327, -9510299557647831276403280125648579560507625, 1903837457451546080833018089533982512780800, 5659817879180836703325226686773880214394205, -1600602236372132725356313806412987008791140, -3114207985857224674232947851962972952530961, 1143871412339815361376567800755717388548605, 1582616737048541104138210096613492031734974, -722903366262867217781257672352874774461411, -741478134051748611521170030577473422591439, 411776338839369417335849411323984086229042, 319328902837171325306216733870604538466662, -213663966667671301296277594211109118731101, -125820325485595842005455155168014011872761, 101647448921584358642558884187499858259590, 45006956232396640574153389944312867030783, -44519687036716356668690352660250362157854, -14420297370200170259233838512934869728745, 17999683198537075135241547598549974560881, 4031766675625679325557431817356276076270, -6729349059688277107863988449221357878244, -925413013955485406433338102689425257490, 2328598209216237513609769678132628016407, 141101458775215017701224195116695393451, -746075648090095018483561647482770664483, 7263189000792641717458829125530003934, 221283578056279870798686535756929726382, -16795763073811045145336050554114111274, -60709585872923167596666323709041973405, 8506299959970453950712312131697407521, 15384729754182591174346331105155495093, -3148377308964615242440735316147774775, -3593167436396769153807054146682560028, 977853035349902815506487064316001794, 770843835419411979702171612765809318, -266831274258914104259813312501762910, -151138949167476387661699402080416194, 65295234828084242577467247401409544, 26873878953064048306205156450198108, -14479940784122008180800625217927415, -4278153292743985740813824566689592, 2926455018539089058645469351699374, 595595368355710283822784825138599, -540581952715365522108986590271039, -68893676986802336145428697989857, 91370280712852865877973127897933, 5663182741089206909080357973361, -14127688866923589546820841072388, -49714774647463905509340827050, 1995511453176203415318165058222, -101205896068777447150530138479, -256823367383493820420844474891, 26497881983149930755847775932, 29997473069183892969735860558, -4692351345271799978078060361, -3161220083617507898172978683, 675620013602298780545681467, 297943271248169516655950902, -83434292863651713766321543, -24769295015047150340215384, 9025849465235968934831627, 1773131368383266027873864, -862818902249801695214628, -104006191276266680616832, 73065337692979644524488, 4340122673637145535883, -5472583651533251318023, -40062885522325910378, 360787447950779945253, -14283872727118922351, -20760851531365853250, 1756604800690828658, 1029172943363336574, -135253557845492382, -43050352063882449, 7996483735274988, 1465863157654468, -380995308700667, -37666965848360, 14761386214074, 571083808070, -460402823635, 3976373272, 11254093380, -559068857, -204827396, 18519900, 2497249, -356264, -14815, 4028, -47, -21, 1]>],Snew);
    return Vf;
end function;