
// Make newform 8027.2.a.d in Magma, downloaded from the LMFDB on 13 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_8027_a();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8027_2_a_d();".
// 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_8027_a();"
function MakeCharacter_8027_a()
    N := 8027;
    order := 1;
    char_gens := [350, 5935];
    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_8027_a_Hecke(Kf)
    return MakeCharacter_8027_a();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_8027_2_a_d();".
// 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_8027_2_a_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8027_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-164876704, -7435812768, 124367454492, 3847141545576, -35926944531234, -835102137970593, 5318404742327784, 101384357467655228, -457433437787234487, -7736826407735018558, 24671698452402467987, 396745201173124244601, -884609803484896276537, -14347896199478219406756, 22056451349635718494497, 380582121939877673312754, -394578483356351477118262, -7653371084054029649632732, 5133623077940382410105421, 119968855856060509923444897, -47740580201019644547147370, -1500329631483299741594184193, 284862886093181255358450297, 15263303790374013105996127307, -416979013641658748735535984, -128395419146416844909157897044, -13181332115689726494763894144, 905521876163288664911007708741, 189140556389271931883563778770, -5417904576243787681657934483060, -1611130485013166427314884115239, 27782678998792902057097736758308, 10346003375679244526560837938526, -123190900643947247073629566893979, -53829546460519804845290093179239, 476016887955410157077347471279869, 234817418864101002599127801256633, -1613943607639456129624997520539448, -876463593301939290563679125921790, 4830891500613091820892485238843186, 2838222599201792796938670438310087, -12835306766928239595490618319404576, -8056349057668360408813884711391184, 30419186477524648768990857918375704, 20208330478869419002118897282389171, -64589217409865642868062951937472644, -45092920096678250218027187846523451, 123357048582651381362010489455736894, 90012393153657572847463786095514448, -212673046338592509321806575176828683, -161509871387843056099669911677324299, 332053760816228492175749804601377936, 261586490579374568139013900191974049, -470889730572680568721880026876291435, -383838188731241951559399583725398308, 608119613606151087954356455435384781, 511931376427993500253498358184974214, -716884119559784357964312855424826227, -622392200451433839202239449722246073, 773082862801498380154853994667273278, 691557624168583723387576426375597198, -764100263977021049350191127032097925, -703896315927615319989104485342440865, 693363645106766310372912082350149603, 657663380164062083051163779898383336, -578510607289458500354253071612647265, -565088889347339328541414060651058246, 444397748496188136712920481316143279, 447265224630210906927187792275928221, -314654135954582721653967949764612306, -326577807093228037958353050915380392, 205545640666713819572512023205338118, 220265268403279819694662109566299770, -123973752969340086671902760957178695, -137385047509102629760118271135878462, 69079770966553447013761512701013430, 79322961131688085544080609118899917, -35574653813767301913671245557108142, -42432162851879733107273438999809883, 16934719371229838412698917371252948, 21044589759560778540638061245108126, -7451473724315915643759826319869621, -9682565199199523544422062432308286, 3029694432233104894359950881100294, 4134713663743174440365460581680413, -1137572107530660581861107182473980, -1639273491309167705254521248363116, 394046401088909308307360563588156, 603531722936782095822535826478723, -125734615930439997366541803262933, -206361550115887072788882791415047, 36877566957701497544992145170017, 65526872081786051126733140382654, -9910963247035083662937415868687, -19319564214918085291635937812800, 2429577458950818700669041358136, 5287238499798358964788005146880, -539493426904064853100975449139, -1342514651185664650171557370374, 107298756441538802706347195781, 316087576217288646622982235997, -18735097267340847237653328527, -68954736546104088666282012421, 2754880602282181587061102773, 13924635103252060014894388911, -304242936411642183589790270, -2600035016035290768168968200, 12639122392992532718221214, 448303629694622993548983268, 4977934678067457029581081, -71266282937203194410931911, -1862048811804082119835141, 10426108361747434526172131, 420015484782492879918290, -1400763420890277001432343, -75138591067214358721284, 172401527227321057265145, 11422749842267295305608, -19382385427805169176697, -1515426657035248425716, 1983877780025517228459, 177512930688420411671, -184150084998944460347, -18447680123464615411, 15430863959773941907, 1702418554343613561, -1160960786837359502, -139268135596626034, 77919218802390565, 10060379909530421, -4628890676156055, -637941816418352, 241075074016964, 35221415555112, -10876057562497, -1674817959942, 418585716128, 67606256246, -13468504919, -2271912691, 352386573, 61853906, -7199914, -1310858, 107741, 20289, -1050, -204, 5, 1]>],Snew);
    return Vf;
end function;