
// Make newform 5.28.a.b in Magma, downloaded from the LMFDB on 05 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_5_a();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_5_28_a_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_5_28_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 ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [-1939393055148057600, 1593173725628800, -8285617904, -105406182, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [-1, 2, 0, 0, 0], [-154378926928912992, 43203932098384, 12666282090, -488562, -119], [-68238456632840496, -43826971437112, -7386287694, 488562, 119], [76115971140653735760, -4529658424428368, -8248407182202, -3065694, 85711]];
    Rf_basisdens := [1, 1, 21119977584, 1319998599, 147839843088];
    Rf_basisnums := ChangeUniverse([[z : z in elt] : elt in Rf_num], Kf);
    Rfbasis := [Rf_basisnums[i]/Rf_basisdens[i] : i in [1..Degree(Kf)]];
    inp_vec := Vector(Rfbasis)*ChangeRing(Transpose(Matrix([[elt : elt in row] : row in input])),Kf);
    return Eltseq(inp_vec);
end function;


// To make the character of type GrpDrchElt, type "MakeCharacter_5_a();"
function MakeCharacter_5_a()
    N := 5;
    order := 1;
    char_gens := [2];
    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_5_a_Hecke(Kf)
    return MakeCharacter_5_a();
end function;


function ExtendMultiplicatively(weight, aps, character)
    prec := NextPrime(NthPrime(#aps)) - 1; // we will able to figure out a_0 ... a_prec
    primes := PrimesUpTo(prec);
    prime_powers := primes;
    assert #primes eq #aps;
    log_prec := Floor(Log(prec)/Log(2)); // prec < 2^(log_prec+1)
    F := Universe(aps);
    FXY<X, Y> := PolynomialRing(F, 2);
    // 1/(1 - a_p T + p^(weight - 1) * char(p) T^2) = 1 + a_p T + a_{p^2} T^2 + ...
    R<T> := PowerSeriesRing(FXY : Precision := log_prec + 1);
    recursion := Coefficients(1/(1 - X*T + Y*T^2));
    coeffs := [F!0: i in [1..(prec+1)]];
    coeffs[1] := 1; //a_1
    for i := 1 to #primes do
        p := primes[i];
        coeffs[p] := aps[i];
        b := p^(weight - 1) * F!character(p);
        r := 2;
        p_power := p * p;
        //deals with powers of p
        while p_power le prec do
            Append(~prime_powers, p_power);
            coeffs[p_power] := Evaluate(recursion[r + 1], [aps[i], b]);
            p_power *:= p;
            r +:= 1;
        end while;    
    end for;
    Sort(~prime_powers);
    for pp in prime_powers do
        for k := 1 to Floor(prec/pp) do
            if GCD(k, pp) eq 1 then
                coeffs[pp*k] := coeffs[pp]*coeffs[k];
            end if;
        end for;
    end for;
    return coeffs;
end function;


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 28;
    raw_aps := [[3983, -1, 0, 0, 0], [974132, -24, 1, 0, 0], [-1220703125, 0, 0, 0, 0], [31129770763, 2507598, -1504, 717, -1019], [-6861992464705, -2133682058, 6017885, -815971, -364203], [252979004321084, -70107408780, -150135410, 2653814, -600698], [2276493082388472, 1029869194572, 1346705938, -156260182, -190202726], [-35576108888420541, 8773867740638, -17141474061, 249935921, -125908279], [1062841519092492645, -24385926528430, 277440033164, -9877769005, -355396965], [28535421546705932238, 1349144997358240, -4294072377144, 12048663440, 78879959312], [98151696947124710826, 1294668934681956, 24631818021680, 612498154022, -244392302154], [-318950102105102271906, -60456544380061944, 37486081402332, 2707352386972, -4249503908804], [-2890722627968697995884, 207600262887288236, 1630408822132330, -7381906758118, -10807874573174], [-1291214049244691442022, 260171068221193124, 3891747623996847, 21650598946690, 12065002805170], [3992175222431757944717, 136540339312231906, -3920811821166766, -81297437515645, -16640368306485], [40698961540183744569200, 9242435479407091628, -3030701106795294, 642515763106554, -263821287145878], [-350740809870097550659395, -9648783707252214494, 90346951843785737, -2486858229098433, 902456694255655], [-343153569744434368448278, 31939883348187620000, 66705793567542000, 9545799047422000, -2012668490546000], [-10481194589587564968378, -121215369154839378788, -675038146046824227, 11163426839041038, -5805322496239266], [2747610793121853227657792, 706616652784320456000, 491908527694079750, 6116723535243000, 23436973966483000], [10557030036088072330351136, -731833644846382583636, 254187377647803554, 38002178638733178, -21565773455444246], [-3732222009665771312822716, -2060091046423766414296, -10973808504954563864, -41161720124530692, 123056651827193756], [-9878634141074759747585556, -1231287890792528463528, 6738022718707203573, 184283255329059000, -152087076554133000], [36113842731620955185309334, -4005353027273258120520, -51710412321063143772, 537247901631873540, 259474844824418916], [223611378443207742908057444, 44643404071777412441204, 115783820624209618334, 164279082317777846, 1081261208067195078], [465198173238602335397040398, 5959039156148886758784, -188799882809039451480, -4569625243998191392, -2005586670064884256], [384129044242325328076487389, 22768973400118233568514, -246654795609162338944, 9361761754556048491, 3486028485150312563], [-828647229322354326727676068, 1524196387933953915704, -237828195419479427029, 1224419434878437344, -4653922596498373408], [1739278263872157109492402518, 59650585059094630531288, 381959734406350780132, 2266025145738308276, -4140575234007649388], [2702354976259116313786631654, -204695806203536608300040, 835545680864058441380, -23992961173318733596, -2717867865972240828], [1013299551802819827629766097, -1776379876535404501046070, 3115516067830098694330, -3596929072740691553, -55784556105036363129], [13136920983709743690058512145, -1289978808450506759455318, 366944803592734474835, 108454285715929096659, 110118197699135551387], [-63262643064601884906420988398, -4287436926700008633944032, 19170403114910553146912, 126508370992134318896, 102626020198577911728], [8617607371347752481984675837, 6777929762453393909970722, -1430765341609168794127, -290268890154421640481, -12610526638517634617], [132017746200469001959895919342, 411593783395642774276408, 21108376825977276731220, -710321041105952705404, 512876591879878953188], [-59427538724971987877373037512, 234161990074165084597744, -108707381486518987060930, 28665527397239252128, -72009073506826316896], [-37386109970437619918207524914, 4270013478461038764047160, 141894280589686990363236, 3484711013564882645956, 404473705132029302308], [-26282702810510158543993687360, -36081874226451668309907616, 91535105257291449433145, 314124264349249261172, 951182207878639763796], [-859424149051193509509360072761, -10007569203098498307454490, 59224969922042379250108, -2620852157391516204031, 24773246524853064217], [-262354814089233074009145200986, -34543170999579480787249464, 387325726706526182756604, 6361332146226500312252, 710858544081199302236], [-271199303558745048090652800837, 22942312223063077736374030, 444035961360392755270511, 3492828708893014098345, 4355502185024868337537], [-2744677431465774658518597158, 135383394234106128835047320, -714650602246387646482900, -5714457571673077883660, 5771147366929833585620], [-752943897014413490252035465022, 275235917741048068329078484, -549917350363565914018980, 21417858980776741837758, -12562780639717388232306], [-1181366418870942865651935500680, 212361344672510603881392332, 195983989858842511246322, -42586502223819321831574, 194608743872955549018], [3897503209717934343447140675752, 417697043839050052894028716, 785521813374401496342514, 19729943880357388717370, 24457587746892612554410], [-2130577477698026181166981540374, 49659934352406249308658724, 412100644130589188971610, 42817672962531538157038, 17963921727128830513214], [21674694243419618933099313525293, -1363126248979642607913471166, 2870298634283468494846895, -104378667092848041751417, 14526371401704818735919], [10554771590685357711953892115531, 2472494812530691907376633934, -8188555928664759475992386, 60162090239032336616133, 88890479863623781643069], [-20591061410868449719714954856214, -2315151477979896768436401084, 5058119515890013732247405, -209446105250169061164566, 13571592964099825791962], [9015746170402742116290382216930, 1456432242816940963386723128, -2241888025338395971112564, -369732588791288715720604, -215094642141630748874300], [-38841873689412963033312176581524, -4640268790790164970098814860, 306081369715622824794398, 94168757469267886689206, 316087580621725872783558], [-14666369874120895114554907535004, -7194547264550011616932689432, -9651324606408207020521352, 129143087316520656952796, -434819616768530292886916], [7279098613802250375645963968252, 10247436748226615566960719180, 9790406216086504471436650, -31665328648156899929590, 272809332294743853627130], [-47320006519575193729591585281053, 21397610669696376872289032030, 38132600321466786492730025, -208364940934831302585015, -165974190159852190780895], [-297467200837921070604089401642378, -501634323800645052446239016, -9939047607659311424950124, -253192323845527976187276, 277405375112975559150932], [-165445066245899958523993873829335, 19138103130639963066100331194, -69998662983895830438617340, 306607228481479090479727, 221088018308846305373911], [-13190494187178084323749477965422, -12493853741441244455947410736, 38776795214092264706301144, 2318310089920035017307608, -683231938865159090048488], [249648262364002564095111185019746, -28219943278668238459703026284, 25817033347877516669951980, 820447886326489501498142, -812558831685354841150994], [77379306962755894367925675848638, 17718903278570690677778743064, -112889697652781717701504220, 1819498877297894230126100, -3105752508679913409394700], [71895441108590550529142518817376, -32753701779088676328772642844, 95332767593682802551324430, 3029628028974267789059422, 1724216567638946844992046], [353646401321469274585710012809306, 38794729747892985956176215140, -402176062793773688199235757, 413725423407303606862386, -1442029337497959353404702], [548229443210883556029846754270874, 54830947349185327482006784608, 145594098314847366527414592, 7401226364711622795384848, -3785900946505238048269936], [2005302559388267608623078834130010, -19608394195580675715819332124, -186471715570947109275536279, 1782938398344498621884618, 6313711447394639938463674], [-665759836680946472200288285260844, 113877395546370883241055305736, -15570178758183187531084170, 18656557597642542330464132, -14109778252403190424144924], [-4166728308646884346369800740796114, 138558906799776476640725052808, -123104012708026667153844500, -13847211942563158126656100, 6355380715001941777392700], [-96300708114172181616664020441516, 77948317369618035832051583860, -1185025536241643420599147362, -35545026784459137575088586, -9858732292594395672051898], [-196503072220446020224316538832081, 121178345578855284421165470678, -1159613800528524123343122535, 12966860574230775270789661, 47624815619547330460373], [-3650332913541426692371679621844466, -50797865287340480760970753544, 503029877235997397216705492, 93954250723251626056949412, -2970808089295728844773884], [-3508445956418390139090204098265340, 235383930759232121255018517768, 1218306404393874916034451679, -51464537343756476865691736, 17152522547992911619426152], [-15421240172159350147942104167992174, 151787369994894413223294993064, -1102818971189540653156104460, -2455891953501975109261332, 27226039198769996354801164], [-11881750800955484940696208218334938, 721342462137401899522451230856, -3557416117038350106267016084, 46403223054897788842888220, -63977172827244444445833540], [6391457894124536467349673650199102, 1435841754699871234910231564524, -7337142580361150153405054738, 129350968989368958927195658, 104260864147955681861708538], [-19602164359853244301647639735052727, -1254845499507165051037750242694, -3233066467570088310943146722, 139318228423309943516474231, -28524437150561253507915617], [-18228666559434459220768376607531274, -436829708236778932419211066296, -10117641666666241561302253076, -249153065704653947007475012, -87644179088164050602410916], [35297775623148730127641715893958741, 1005820906014488478561951138962, -16141252026319421246281119339, 76310740847505805323016279, -35414109477083609687489921], [31856986616134034750244453067664755, 477144474094738231204190190046, -12886062135967271946825107762, 19797486079287993434139293, 131377079774907930529668949], [-15206901897034824747841798796361638, 6063972273640559953326521567472, 15203929290353342186412843048, -191152247690438605637356856, -172208979942329119962102392], [-12986732443963514075053389198612724, -3780511655339006306358240795628, -16365936575917469992988925666, 476184809515779806967496102, 246886832762804257711743286], [-17331170427002312769998087132460950, -1327852860124937683091688633008, 16187276335856850576623694760, -155476650236935165412019496, -31408352892695226680375528], [-82584905825031208843760443845695384, -1481543422956480639146709828540, 9154553178860829716523643902, 285010524952169212894591790, 25033253411020452694385534], [-21044718326660718689489492024404473, 13668629145176835871455527580550, -10227772634804491809246618021, -231308676377537554197369235, -41271111731365397029806427], [31097779178968453142524290409748766, -2531835285024392467834848700904, 12462452604710350576052589380, 122985185136157901028146452, -877442642559052840229585164], [194252939068988858726059400504305970, -1202217678223577215501091150668, 84745814952219230025573877460, -734186553821828791513115666, -181916932055979003959462338], [-205314099359178052565829457938601836, -9907425231375313381984466561388, 78261390063408335680005979438, -1122381022780146889176990810, -514532885353282262534320330], [79562768923885861626971318168865386, -3504852681039039248016433007452, 72143927603494317946944457338, 464483558823682788095612206, 151769475609601784451290494], [-113816564598183844940771920807343674, -12969150350418240340273493286244, -28610800882661762970250839733, 3176069241336862741992764614, -1307837206121074403788080298], [-558066575414582156339020426920497692, -10703253911372599672584767976148, 31457954788779921065460926250, 174307429309956476725968474, 1814040346594751888939010762], [-232024567426100964390270272579368998, -32210031324072870950216375903136, -90927200889064278420613418384, -1158729653693446521196535856, 3087184356361470379502598992], [-347718497474219991506496020383518122, 45696341166832906052603271039424, -54038847162432683760927472280, 3049951578859997769842708288, -1602638862665535383082382016], [438454543061204353188860106526112751, -225844741958183985869793900042, -153959840407784783724315255490, -3889256833152915825169432735, 327880419236153306032193145], [383679252440470890469490911908769306, -26577201436563081435006481296732, -35579931735535717612649130967, 5597822159230621603048484330, -3606653288475630179839670310], [1245162158074051817102961774059447396, 14788394765446278227932636252392, -101760287028392914013237086344, -700213267581384782625635236, 2862926392689490473586537724], [759472979833071754719637614117593599, 4132293276266226981478227507286, 185769825532264107281601243472, 6109900327391504532278021817, -151853185382573148024500719], [172621011292300929629401140240646379, 123485024737879937301759886699438, -118183831931497539479262468735, -6771074664350399678741058719, 5101840243231330021328743033], [1732696708764124482951887566631585399, -25526884660063666163685848819354, 221491147688467654901043839855, -2353978858934020756820590323, -2306374387673933353753284539], [-708293219227791452481561580391002079, 201331200284894073411367148352682, 360408973695908589734411031756, 877468601085433656057435447, -6948380174070153339723828129], [-471821121434275513456731658386646534, 97246767823930038184971284628120, -149155790819054827006283355428, -11307161483828826882847291340, -2291725580718501428176468716], [2394014003754635866220706940868208746, 134497264624293976439180445153216, 926137883363147932825625168480, 8890233923999329431202447392, 6181093445794205178632340256], [-2142381546129450737242578289870741730, -46199067713320147473934333995380, -631053637528469480818479899761, 9736835125134573879333638270, 21246690730635001988232364110], [-2375747441731980684699003010476588530, -300903251950795950488915969244848, -551455740919765634446799785440, 13298588675549592071510346424, 9837831718690316261808983032], [21113835789680071259351250894918682, -514504737078193203408121049221084, -995898773179145316861125617491, -7208346922854709109531319750, -8105159542349481519050865750], [2854520950750849748541767242347216622, 287127522196151892629942868918024, -1300685387964894287555768266164, -49955794693968677777505518756, 20513946583689763419848631292], [-9651731256025282212590060550260116528, 276102851070376579973263826999552, 2003364622079416428239379860045, -22538480868045308722109994572, 12642536490839928429839674004], [5922863632705015088756180360415529952, -567159881411130957462001192133260, -946993590492817642233857275066, 56690671510750835637985856470, -46828252078179180640536882202], [3157663881938166356310665389608640959, -458254003682433418333908146403082, 70997344462534567536308826665, 65390425648881290279735078541, 23426916778860276968596726213], [6832036574768048750304417661419908906, 765123904285743673158182569264576, -1104536521583068898941181318000, 48872872256374862715831522784, -25726789553620782055780531488], [-1057336934815875229882492734806049404, 672209527151619725995752637008904, -166887852263155574355080646893, -36042641043952082378142543112, -9225606867346881034740086216], [-3370142989224232003794745097216519838, 1202516851688893748864192048265440, 1509418432005766602311166008272, 49197268616092152784421444112, 23157796932946703202550115216], [-3021826218680340233808530667634620774, 983302364894177861923680185650564, 6188535289316204605104994180590, -10089828743067568968715884082, 12564328782155360899834698014], [19391284506892875316164666024798849272, -1333671412864041629619126371694220, -4788494694378715123621318809850, 21310413965043800693773905110, -23712233522112873798598783770], [-19572921350496522952987599897031967007, -146954593119747353679483991506902, 4708986852648708006276009709766, -67260114048903692400358593953, 51967185045503777872949433671], [17418903292047439747175992963712305772, -2493750746417710326296581484216268, -2553319855446596781369580903010, 48368460486783331135486175318, 6169776043125461158324636774], [21454768690524297184863596738986846980, -1047314417950552482549565061893916, 13328007227838678831615845038918, -69871330321186477244513595458, -94035300462464033302639495794], [24899921294107128727929189599619605357, 2144145416050304496965561247554690, 6799685455315439880095768547269, 61937348939774861693797404095, 69027015928143626572445215143], [32112600580142573005429758226228469168, -429067496001050873149371659018976, -8205662241388763814771989514530, -158676069998180961090074471512, -19510504338847916309555979416], [31266516133558838253194857938285082108, 1457233407762198482861490846371404, 2605971534690150286185396063370, 448381095221598829669492492298, 310112603580975354829664369914], [-38161440994555183148931512226809797900, -953171531028789403831879116589528, -32075354487083334063922629084023, -324663244492727457853773258624, -48913581937534481037703541632], [-52349814603948627073764241778787475345, 574191856505466388962786225462838, -3889432747027846289759071140136, 496171127838042270987857526569, 78176863484086370595428854017], [-15329608259632229791431848431730678248, -2105514182371308758050301628529604, 10431395369746273646693469190986, -298109574109036936438381544270, 128425442949667719578680385890], [-64235439539338950264275786350011274541, -3774787991647946385032513962374018, 23649583754682899120503682427487, -153230007901162033980020631471, -98450155699298152146355606039], [11580914658917758431164430925370063946, -202434937923631604367139820861904, -28699340439368981608112647880120, 494839809460765369468640294952, -233745463861503067767674352664], [43655693086040156771856899654533526096, -2842241679668274100746618805638836, 19797627317664091699997060267394, -207149645956951813902877626262, -324175662407082097941317280166], [49195236733138462515044580879025732612, 7885758937577873274023672189205380, -13296708652846685576980133316010, 337038272985280563600747338862, -396495026042133943420653940034], [-79151665148397828234886443614936897822, 35338753170327554852146227246068, -13959460782671431431227703187657, 723594437393803748564674678362, 199139556556880135416131531466], [-23631797453410403034206067559640406087, 7220934147006093931613619375068474, 14229422368421560669670396611095, -1252304027883744999143710831237, 37261964266173500654916774659], [116934894133193765004995255341219924406, -15266973392406821796041854067482984, 59810661990688621457606331566980, -660621501723277500901318302508, -654677344713674919547804442444], [-33019903039334883274684104619913767002, -15632004052298751087193407399567232, -61987706530659559662708098602248, -518714573968403043394086439264, 577915504635017817770217686432], [58650920145103805764591989850538194412, -17831235128812561566399011799540680, 72682682424427149434539326272464, -124924066592245073325495883020, -609822067263204484422310573612], [-102902304782560011392107796918750423097, 3547892647479565382680940737850534, -88016004309958370597794306104580, -61916213729991067735147434975, -1502371738937977598874983359175], [163363408332715218126719529480763561402, 265841952079634644140086471140144, 1225186407906363826953775958968, 2929129613809403622590737542504, 1000054360685074309669387378472], [321630844660246622717874146385842900263, -1735327842558767834937718649712314, 122582102058053448513512918356163, 795979913849570239184975288237, 864787277252664865361441908197], [415351672517483842944059461715830619877, -9174412805378348093485178718768110, -65539830766987868897204400390868, 1654318280179451276286779050227, 1571098514634818373802249300411], [295198386047112931782116027674670271986, -30153247262381606706691058352559564, 54873617991482239306604412895080, 944932497884749279813813958782, -671960478014606440229809559474], [-622359449063931297643791024963389330870, 8557000913099862880388431687210416, -8950385465523691636117379803064, -2279115016348023966719774077592, -229365143990870673402759536856], [69109961667479169750434276592589625498, 3363589258070024843324208701765504, 156703443926046380100724626329120, 2391155373416841077108053709248, 948836989300019649616149347264], [-273775910216742090997230962697893403042, -10146435272475679164655917447085416, -210296305836495532316927969322156, 3069597069955077657044018620948, -912828759657265202971322694668], [247463140945336016035378765049753877328, 34813092407200224196422754681012252, 184279257097270312825865204027674, 4098473566082643047649198956354, 708886714374347058259184689522], [-346714280833445966997620065058402056602, -21687241742132880412527174109070628, 2506459790291302983707078004337, 5322251471034178894176717876414, 1778428768022824043869797737102], [-71708591299872930916890211984780569464, -58216112744495515194937714510242468, 386328108806381678413379993409914, -3737584590987285323066814411358, -1633347800293520044060614088494], [-557894571971763851769835409221026660246, 6009231327771995089349496194975552, -135967508985256967081114026896608, 4633273886896275104351587688544, 4891906874881655557277263243616], [-279810291646548978474137847869623802521, 51132731996172548141521070649766278, -212106769335033278167238880248035, 5657058021082701305889851935861, -4180042135322861778245863867027], [-852071849114014687218407113404311033322, 14822641626051087112540070488485544, 192207569384050790171788797825820, -9173486508684120993415358182772, 1604398018166495583105905983404], [1668470304180258103802527113659277679629, 7860243373308322849236394276098786, -193938192322730645184370846960236, 1905379333489227989013638694667, -727478397831315582731899442669], [349154734694747695975367045166136396236, 18481076761667426990843274586619096, -160491529694344277226284804253225, -20062733453023706679899823963776, -913089572724293496198328957568], [-962876809117158004060043123515458391014, 18692825412489399912806707918979712, 652088682941238185821626505227776, -13656011093768490638168832901696, -1298239545506637690808757860416], [-560293823935526403371831257556837888870, -46774272136296468798769819084416636, 939500233404978619588092920307398, 58487407194911290210104055598, -2025444541410620258765136066690], [1929415597473688200012160697182715238808, 11262099665513110116920838524800140, 967734091818735583222597613064386, 4068184616992356249357203778378, 6425574528800849247714856951354], [-1514225157405910934299517793385603871850, 206365037544721140074699483244143176, -641455168066249995042078679491844, -877585685192093017637976716292, 2050470766604616176838369158044], [1611747524453863295678641258083701013725, 9594043430854273891553085434804066, -229764378067659968137393977067503, -9701330374369226753980645218113, 6043669060454466965074901716135], [-563903478029938018509618720832930290553, 18722272204852742786361916728420582, -139678695012899484011077352139910, -3612035110426317588201624195207, 12048714887357667924617627402449], [3946996343652028810993258775929348574210, -109626070674501667115693489991700768, 263243463279963406729977813519040, 2846067443540469301982779186896, 4374468238715679141427816923728], [-1736453132901724881374080562765055143824, 53896823942455945172010640077457556, -1239050359470433731133876720056570, -23205073979878012495476197558778, 12692124612806265726574066807446], [5118389823228525707580989177790677791016, 153385657534121191702770585251462640, -1483393936609003973876958054795867, 12115874387222693911447040852796, 128433740139123552575480158428], [-2243990614849721894538082322317318853905, 213775116014811428455458869684580790, -994075999884245108409592014154028, -14594838734776759374532306901415, -11732124999539772472895466038095], [130744660053211521090941714617092529344, -117011377007443887728656012194026208, 1898200632966716686127692315698971, -33728224591068126747434613980260, 4973979738564088720871594549820], [-1324519046380993857924581781336556603330, -64219564724781102611227077293783508, 1285200829756770023094136209464260, 51678696791637527012196156402754, 21310936929841365415990806916722], [4441400182496537184801929190561960620258, -322789817319523846245355676353154476, 1862714628275108573009955619068174, 22999207511903160027744360590278, 2267661335099121328798216772182], [-312181776161392284299555488784276723836, 305417443416945707489448384183505484, -113000955114497536494270270721094, -68501534716347172910254854915382, 7650305347827934213934128042426], [-2538110699245809893439595096088573793192, 245308842468168373903102659692600332, -1721449433578856917369858477936158, 15491462998344474988874708159754, 4807412416742524437758270089722], [2848245067020064950095834968162036415610, 557042312832606181704114369236381512, 52516044928552409579748728275860, -48740264424527786701758998878756, -20093360807463628303240017208708], [-2937139116850888997663892168077825210262, 311530614683264665095962115823520260, -270110374867712645065466066977391, 39882727723362741790812015068698, -24977206237658753416654737152886], [-6064795305005493213019537086844841909430, 873611136519588836294898637415488448, 884988956986513967342059225168416, -25210588507967093774354269666016, -48287690560838475216450105425888], [-5094037386863929525347319867454023350181, 727108806892899375263376224416183470, -1946574054361152342534243040738932, -13939123118267532472427724112371, -55438029471443382813379192265403], [232293070170838036273624366343202210855, 87287480842515453874552756381943302, -5660509977557246862231446857308815, -13402226135692098920774994998651, -30080042155001996048598250525443], [18321458221697422260053405142089125170288, -628703808892790715325607947788103476, 969915718552758357368693644259170, -94723122261889779551862384109270, 15826805029777610022984150980890], [-19525036025780506575825605604431623670267, -1870704650084302454608133818579566382, 2127012107717079552032160957077288, 75958126809275015546425419857667, 4865293474514084422121046528331], [-6078944052334146521692417298196472480002, -236711396130724863482881719223930836, -1118093137005369207499144744574580, -52897385894909152348119540743582, 72565077660500432111541357533074], [18138742593836946453450220611752030227692, -135738566213124222787970629201988284, 2394379769842723858520279999481574, -93597702209350977820539012435890, 358734950490240935754234979230]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_5_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_5_28_a_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_5_28_a_b(:prec:=5)
    chi := MakeCharacter_5_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 28));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 1;
    while true do
        trunc_vec := Vector(Kf, [0] cat [f_vec[i]: i in [1..prec]]);
        B := Basis(S, prec + 1);
        S_basismat := Matrix([AbsEltseq(g): g in B]);
        if Rank(S_basismat) eq Min(NumberOfRows(S_basismat), NumberOfColumns(S_basismat)) then
            S_basismat := ChangeRing(S_basismat,Kf);
            f_lincom := Solution(S_basismat,trunc_vec);
            f := &+[f_lincom[i]*Basis(S)[i] : i in [1..#Basis(S)]];
            return f;
        end if;
        error if prec eq maxprec, "Unable to distinguish newform within newspace";
        prec := Min(Ceiling(1.25 * prec), maxprec);
    end while;
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_5_28_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_5_28_a_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_5_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,28,sign)));
    Vf := Kernel([<2,R![-12783803780642635776, 6144845117710336, 4473573947392, -262965912, -19916, 1]>],Snew);
    return Vf;
end function;