
// Make newform 80.18.a.k in Magma, downloaded from the LMFDB on 19 January 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_80_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_80_18_a_k();".
// 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_80_18_a_k();".
// 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 := [9773152229, -131718600, -1226310, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0], [-5671696560, -70387148, 872, 52], [3433900300800, 30424433320, -1121360, -27800], [291780406560, -1211116752, -638272, 1008]];
    Rf_basisdens := [1, 692029, 692029, 53233];
    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_80_a();"
function MakeCharacter_80_a()
    N := 80;
    order := 1;
    char_gens := [31, 21, 17];
    v := [1, 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_80_a_Hecke( : Kf := Kf)
    return MakeCharacter_80_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]];
    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 := 18;
    raw_aps := [[0, 0, 0, 0], [2426, 1, 0, 0], [-390625, 0, 0, 0], [-2821898, 461, -2, 1], [28368112, 13934, 130, -39], [-162532830, -45922, -431, 437], [9747645338, 700858, -349, -4561], [-13492468188, -2521288, -9926, -5883], [-83049392222, -12828185, 13670, 57051], [167494483846, 203234268, 328170, -102290], [1517789111572, -253381306, 496948, -427170], [3750602353922, -114055820, 336566, 3232278], [11793723773030, -492383218, -5819231, -2135703], [2355496734914, 1620052969, -6724312, -9466954], [15448389001086, -4057929451, -1778342, 19181503], [-128046346128934, -48419887230, -16394241, -35336165], [20567247326580, -70137345596, -82117426, 26699851], [-597651765899198, -3413993264, -40092424, 11964344], [316517319210150, -170425333701, 551750088, -135817798], [1635526198136284, -531087525882, -293967528, -215937872], [-1888369285167838, 22124645562, 1427884419, -329123537], [6857234154246488, -442519879276, -1838946464, 1741027412], [15428710871463570, 600939673589, -141422372, -87314500], [-19973041232149702, -1186111979124, -2519919798, 1934481114], [-27139408714107934, -1152872446898, 17466650249, -8191763051], [-82524246155171194, 1982385765844, -9879657538, 13838135258], [48570882041730106, 457373867587, 6762837470, -8687504421], [94688671916542190, -666954576861, -1195410576, 15172925808], [-100160306505912446, 18554114143124, 3336145750, -13943189282], [-193133325347714886, 17315122539996, -36438159102, 35618015490], [-220860504857140650, 53127416761329, 63212090982, -50971653913], [-161227381486733424, -12259629458734, -91768326842, 825685191], [-247249132858454254, -171059686359256, -65664683396, 13486753156], [-781350085277211836, -80040305089972, 204935755342, -59553546981], [201963065626464506, 107850546717204, -224368866282, 116709102446], [-4097859238808443460, -27425050716394, 145002001984, -72011366976], [979505441462232554, -216672562320804, 561539958114, -527930530190], [-6121189299269896158, -63335842128627, -72325406688, -344004127540], [-4535193109392984474, 746886053526309, 694645534674, -397200932423], [-3440097512098867078, -293491242004044, -1055042356074, -296226142474], [-792776262175345012, -91499426379076, -1299967867262, 29877018597], [-4791039155383477066, -470086121661624, 3003949577700, -164590092696], [-2548071700969880452, 1344148702085994, -1993063418004, -1876368795794], [-15978734878442300998, 317400840537994, -2587617559621, 2563476202071], [-24843945112861798286, -776959578366454, 3671454770347, -393530644417], [-9163881412850922696, -392583309360688, 571891435924, 2894972897030], [-8627225189317493472, -4215640423220126, 3861474390614, 375657232435], [5570387748315588434, 862064713499547, 1491331344570, -5996516097691], [-23277736736179743410, -5047585250432657, -12855965235172, 9645446723354], [-62783447695498567346, -8498661448431952, -4069272610592, -12083557032084], [-12175463081054698662, -2952508161398562, 30376951221441, -16240525188947], [28223610413906032632, 17081214441903412, 11433725001560, 6695565258460], [19838113655327428974, -4084518738667594, 18131953601629, 14238424061373], [-76980964194825688272, 8325013321925990, 20250410362546, -14290374497907], [208689857260691148730, 27234981009611996, -29029297410110, -17036676819918], [34039146153037157658, 10516766366073443, 18401706244234, -56351866607221], [176262282969361703634, -4777507156598232, -4634813740500, 73626254501196], [-127215494373435186724, -284959422578438, -56168865339508, 52857601937774], [196498597116733230106, 2849356391312164, 110491308376910, -47990333385914], [457956341489273483046, -3394083883208230, -94709366219573, 18162156407043], [81486362456275786890, -27339533342635035, 61632345638388, 517681948714], [216875831218020727842, -87407191373664216, -10824404522340, 18498213061892], [1310561921791662812646, 44189300932035955, 93497568163544, -44206641989266], [272434541869915612004, -45588612215797342, -187162409866592, 245952444781004], [-482310962808335562710, -93863387857262228, -100915597781686, 103957103074306], [-416547880724040235878, -146709629367095418, -62423001154899, -112444413882071], [445167657816971375112, -114926392385208278, 146183278123058, 181445409244169], [-1358510197838391504318, -42855671538016140, 59444432535174, -62865141038962], [3354120957847589809830, 184463396599370279, -350983219199396, 117346618032140], [-266535714485492624586, 480376973717486904, 88145363950044, 215344035064280], [267818181265258477778, 65616157176520748, 1111940860763530, -718056528584606], [1575907777301371211432, 345459080582300080, 660542441697164, -11345159314846], [165722048486293577870, 274740126107435741, -1442837167764386, 736467448192007], [-1795298981883920574822, 210011208466837676, -738055775500790, 573476490457650], [-2589781199846274784900, 157355341204074168, -1468217404193946, 424631694001371], [-3040995879123513768958, -149004121173273565, 124416745815370, 872420279434173], [-225919854860195893446, 698572805179359592, -819105193623700, -234415496113892], [-708961819456168607710, 654500910890787422, 542501363466577, -221536665049915], [12013358503518139373794, -479590335657673648, 730342155830920, 12848617049472], [-3268662194819588761602, -395449046697317094, 91584324850443, -1053710383408909], [276262297631332149212, -349500913800876852, 2909536541534130, 276046323227425], [8983454549755883485210, 445915435057495540, 1136526022015046, 2064944510602862], [-19220493303132257906932, 474759040483305874, 1656153932910092, -1724355338979938], [-14238930169694580266782, -1097991978313058770, -3226911966349223, 1269618583544373], [6742536096678056323640, 84537811985619888, -805568603277612, -1411914907442298], [-197222138597906155214, 1577144903531011313, -4237354609205420, 1956998927610486], [-26251838278546646204186, -1902307772316713666, 4759431129632009, 814413040205841], [-34944108453019486446438, 1600268951024577888, 636279304329744, -1065533285471968], [24617804030058387451422, 1572359644922528964, -4748269761329946, -3055310821907342], [12044645506718572998234, 3362400907256459439, 851228880095526, 41710227044461], [55226211244676363053574, -1334855810218818085, 4722414983697004, -6106985876374294], [17920982039829490708472, -577582119927020700, 2108589637509264, 9461322976746404], [63121119759058823607166, -4013805839757480023, -7036746320352778, 8259853989288077], [-19943660792587344448336, 758463953697187046, -13637458966767638, 7701570724034637], [82096467334103893944420, -2970709085955179488, 10403965885040866, -16160962289248895], [19162499182527654129946, 4611779620550546459, 7352989325519734, -11812823237709225], [-21090849250596534203450, -3651444521568166624, -4339928972835992, 13852426719291348], [103396595516909782038650, 1679710543767500736, 4061289707258400, 6542639343383872], [37271654113390398576842, -1644174599318545347, 5561539162998372, 14594475017940878], [191912144304068885304718, -12595509609894987060, -14683401808229502, 16751114606174510], [130630407636139480940206, 13886045080536181727, -9244767551379380, 5456163462237466], [-23309925624157547848990, -2753351589753999956, -13854433814519254, -29109975587557294], [103420300065933455480330, 5365742711075235201, -16265368118823672, -8238858233287420], [-25427155735683878364994, 13391435479262105858, 40696426128848023, -21031832013512145], [22835435080975933519624, -869535497970399318, 32587499809924866, -51530612082280327], [128705342362434700756842, -647915217227214024, 32928110691702420, 43697248261394012], [329955528372498995037166, 2766228865080762859, 15992107509022916, 5070750030666932], [-78040136059244375822830, 9390233955083932784, -49822110152623256, 13778217894753384], [41722648649352800594976, 24909933826895894228, -23408403368686412, -59594103884259098], [70907777242653750761366, 19658774470280457762, 3068773609801671, -55431746975965953], [-58169973920501708684402, 36305215434426018597, -27500148515079390, 26833214002252987], [-226969601012166780831198, -5980848053198017082, 63523256721579149, -6985586318014567], [-376089683201062864837670, 25756491910004649798, 936140289409005, -35322270813968151], [142216572771245360219788, 39143815326757339136, 57800502229312222, 11596845105849899], [-287234581108040588567124, 27983294736459285518, -39656910780448136, 49651786061438592], [-714686594514206590979250, -7872102475354504410, 12695493358839045, 66987428340296661], [124125451537695188702506, 6096274298986064737, 22154642587502348, -148790458788149692], [26138201243709779921838, -682355705861537039, 149901077236750814, -128913962077115723], [-462691769969647101432694, -39733578156222508814, -10470008604642985, -64200082361590533], [93750957830819687275420, 54361289724655218372, -23115365258872710, 70974505634301573], [-475220566804234819612630, 8452285860486866056, -33315018762867268, -103557939185021332], [-145278337842687646683150, -36336577576086340462, 25201664568786823, 45721961343237627], [389651942405820568020914, 21129759822657686334, 100702797380269809, 163523596111847309], [240125173124483138800610, -10745772457045846151, 140683960837303808, 155198443019060070], [368538299546950018646312, 16397763295950775694, -126204397810260866, 43992323892577271], [-910281847840604635038622, -32152314733385422796, -156822918417194938, 87287686344830414], [-119023539925118525035554, 96305069661778499900, -241480880938788326, 139002552911948974], [-1706586236878309822884744, 126927044184686550564, 14775205519627704, 62959702509226500], [-2395913443153561651500762, 56045695441427017885, -97623952003634746, 183343577844866181], [921342935991925060062762, 40794734705740508704, -149155668009485248, 98849757385605944], [-818496603133912598218068, 91487560818132727844, 123842732563459402, 287152164493834857], [-1477293088719755519923934, -119247483387075486881, -419450502122324758, -83862340280628841], [26477644741134791445908, -68046626099011406362, -20261930690219732, -199596317092116722], [3282837005256479619786794, 41257967239576659912, 7059824016533628, 74548795325686316], [-1703176613674621117514070, 91588554724384345072, 157418464601565800, -298730667185127688], [492168929266869032221122, 242343332004708171820, -10047577487045734, 82108899772718554], [-1402595170716666922962238, 144559361369664373522, -458776705070455801, -63677169141282709], [3210318889016361273272302, 161988794076091710719, -396704086877657648, -11856606499525182], [2357699027250357148514442, -74174481086862400190, -82723837525608913, -543165285112343565], [-4227183001669834220000646, -25766043928241161024, -977547157319438048, 446799505554315008], [3462646491125683184673344, -286015388324249973258, -807363974786817606, 685600409455461257], [-5385851506379474775275958, -210238988306652294292, 415642586618886826, -343290592800291774], [-2522960702143317532216702, -17804293637933901209, 688879422693104246, -754732776833751277], [7516412361977825945625382, -125545820628892043817, 49210092319824156, 198926139022641716], [16554921926963041472322, -353822867914431006080, 1004877998082938528, -334258234361332768], [-2492125372214905360969328, -275832768123546485956, 974936112088072828, -222114570743110306], [1442890932975028053847698, 393361883980365802234, 507371628824318387, -518883676236865497], [1952673503920004198665170, 319123501643015484132, 676633315422989118, 448976522252721022], [-7105463692010558568450236, -428621803494183326388, 403659203764773102, -167393293239710261], [-1341214717756752964827454, 69730301887793243635, -902997360484347346, 1222148288690790589], [7958327919957975607564762, 496076624106067310472, -1480601161968600660, 44523992044011252], [-4652388603349780766025330, 597258472766238644330, -120613172670169037, 1490816514744143715], [-7345212526077622484338966, 852337202664040990161, -335848546156295904, -132651083413491324], [-292244438476889590149786, -684134002381368490531, -481898591439403922, 906852295583949125], [3211206162450593518014134, -853457951219192134545, 291670411902585024, -1267442851118652444], [-7512857944399074952026236, 776225625510538753766, -784581464483538884, 1361709884353795594], [-14923654455966941327973264, 115379373438568496972, 104516256344296180, -501430356821449074], [-17059355740389546727242570, -841607387480950744866, -907134692471905959, -1169476114956759855], [7869246496175771024600458, -574337599535338008286, 1508186577213183391, 410731514058089971], [-10504776789391790875368018, -1235856110689471610048, 1975745791413440072, -931097113899264468], [20842492214660259690554902, 170673179451380108635, -662244999527039344, 1348216532781189702], [-14239143673272692542069382, -557864329581240431616, 171802438287019296, -463299415970370560], [11154466921567889645924654, -1681207832507447121423, 1128461935748257026, -734625824574484787], [-5356717394949938697312728, -252668813089283294950, 391247104208088778, -4017220184136120599], [-18877397430248657125610958, -1743189686832401353822, -4458497841873756737, -1388995178266902269], [-3327974128888227268501286, -1514177405622610163797, 4744167641319736330, -431035952485627689], [-19067726118610844840355756, 343172797199587034638, -3856826089872296644, 2466551434902553578], [-10930956259663249873822662, 834127769974737626550, -5139194810536114875, 6206203194488259945], [-24679166766559426238952846, -868085577831451533244, 4247543744563725454, -2987610831005539458], [-15194946712123336797000270, 303038456909959385038, 4411795390314239177, 463811592693865477], [8311115121366009723227964, -1180340584133749966088, -75048553430538010, 5689287480779296523], [3073685150185808764946382, -1044800389146218210128, -3496223566868270672, -218681869050764604], [9426558809908837013568932, -407802082568478844966, 7099062372614696656, -268521587754905664], [-16231094262174581313557406, -1887835088573591582482, -471526451336367383, 4346548714858343245], [11989569453821723732932496, 2778642789599336600848, 1476941094260273744, -2384916795430127764], [-30104735831436162754834966, 2354345642837280075700, -3373772997279157834, 4245511719287649750], [-24497755402907362091411960, 1184302707888023345242, 6157985514436529738, -4598979849868335439], [26783287456612856838778486, -1948301448477689438864, -1320990576246429232, 400429077319329956], [-11906050533767022934054222, -3190671027239208382201, -8010337829231620730, 850100353949595295], [1129711723861881134843922, 4905863384050038153952, -3647013401149492048, 1564786376982706112], [54420188210298269514391758, 3105595298298467115189, 8574680898705650958, 4436805068173476523], [-41987952854066114570944224, 1892250874608174221610, 4881312965758035726, 220358317210613279], [14509466173068059430248074, 927280503705606506238, -8942043185593973919, 5992931416497317493], [29565977844427127350102530, -5872063701821137594262, -3544155432455934517, 6608820677999186647], [21841355571782198838959474, -1617651249313987816157, 6307970827151329838, -8740067867231039199], [11389788126426940200019870, 8162426971854968823460, -241103285507331226, 1077846146437242090], [36583619792985994856200530, 2896684782738210832676, -5239058743098046130, -4114019381031518874], [-61452411165782926973550038, -577611226216716380015, 12337878699460596788, 949333201173149308], [-5675970235136481317951010, -4580970937906588866238, -2558831232720073961, -7420374633753550049], [37440692097129705478583812, 4422392673117579216486, 5572280234945017092, -11450419709901336566], [-16386365714875525191223958, -2701193778810909143240, -709020192995548684, 8335258595068421500], [-38449936445968678432817406, -5400100838544258059855, -1968389446027391788, -6239961540628852070], [-68263127023302278872129640, 8100903416101146746742, -9416124162906179562, 2966999867364664223], [27066631865259833987541922, -13122347805796377435544, 6116626315200576652, -6810223139799152100], [-26603951037402690283657522, -6739556716457404716585, -11891271141843123288, 18111839945727849310], [17896203949482550991890970, 5530620319688296523306, 7594672994333050171, -18543174924014604241], [-110411413199771256462581970, 14121510118831394272258, -12692990006167945753, 21374276220586655271], [-85777981489457214959507910, 5739776573664764779934, 5038846584018820513, -8036972972099365763], [31949148195440626896773090, 13055741491200653064736, -12230265719589641392, 5497994874001641936], [10911150356573529668584042, -5911369883712799534613, -1647408447352911850, 20878663053346614771], [-40978120325380912489053946, 7165204717035234798596, -28177042725412178282, 2518493906711335658], [107870531824716505567533580, 1245792324956003942042, 20354512257455570380, 18953094616161672170], [-109776314020644990546617078, 9436090914837329043766, -5584257176882382523, 20056406075575147657], [-77278685619217156988858414, 9584991327683923802656, 18925808479712120240, -39803808457751660400], [-182631763022742752029818556, -1365522262649434221788, -25503436234081007698, 4043914857769003967], [175817781245047699078648250, -1958657394353186244040, -15704058005442504908, 21193602254521486444], [1906222171310170665160608, -8722659746161397743864, -19189550252699085008, 6793862393247938548], [-69883885233253895858238374, 13106834010572057062777, 53463479928703621484, -15424333347502803660], [93710902233912074963360058, -10770047999287451661700, -23803346697654952814, 35082585890934278498], [24941475656356555436470424, 15218663094741459549554, 32171059103091495490, -4710790023723111655], [-44417013367094238797281158, -26446918448780985968506, -14197486900582222595, -29649860636502271983], [-81958903421662678537829846, -18934147128530359972540, 5318884512965744158, 130511730192608422], [14848486792920872631708090, 15774486306300652596107, 31579385241637630762, -16000985858259226785], [-264168935306963933321656274, 18022791422789344761939, 30494937509976359292, -9326775361821449664], [-97545526445294908481033008, -16765123628919004885772, 4602276477715222844, 2497815659717667458], [-230083280209867058492089258, 7084210336198403626126, 8639598664682931521, -1998339496617019879], [-174620496637270319070008922, 24551437348259935401649, 1729444094701645310, -26114799599224977061], [270969085047373627482389266, 13605505055631762829744, -26795748449752120456, -13524391100520703616], [-419169400879571155036663514, 15223432605284630543373, -21390252623029758126, 54360300678205209941], [339071997622454408744962674, 26712312589863981570546, 48992085902773547559, 52962808243894225011], [-288018439599957168976900006, -29771324008952524125992, 6532658893129462484, 53290141800188513284], [244996822216719051029333184, -18094933484064722427204, 64550179990946007012, -49407288818601555574], [440502307108621448512646866, -25236521300469796448004, 94623716109701653746, -75979258719095243342], [235506978255602273523950346, 30881604998555676243911, -64727504641230956534, 18657860256240944917], [12653434887458601866536190, -7569300551503744338729, 13528582816264874088, -93405916375504540710], [-96433810692596648648224342, -6148602742473789537344, 54532799639783275328, 15989740253622128240], [417092984073399392389594050, -48608790881988034403242, 43861783534205479189, -88164833938973159623], [194768484838687621634927424, 15520229897446648419688, 12013407803986448216, 70083799635495674236], [117578176753494327823468718, 39130301558277181813233, -13246496084335651302, -101491284313818108387], [365921980955208948130828200, 32917475931326962461338, -14997399892900589246, 85650099043835582201], [70088810539330564465885490, 37803933697110186418962, -19148722915776840777, -99582467206856636685], [356190219212959156049473876, 3122370457863131607576, -18321323219667398070, 77248166436750885153], [218562142461018645837068908, 16415223797812094028306, -81926920975558901052, 11863432576141472790], [197026502005682724342138966, -10146681795304136375974, 85156012689920162635, 70999314042874662691], [95588305541215807403354330, -55368862949243351410003, -48099539884833229184, 33622922363119447330], [-490806592487611493390103498, -37280059434246003203943, 31146094750985315190, -65916664384322692437], [-274770584310578353396652250, -62164817617501902802826, -156832650632040643891, 35257010003103575733], [343290550646396462935361354, 8351064439710912053718, 8780648352039420405, 102277080380619339305], [873959132882486673748447580, 28879954849661859332800, -105441759207348585034, -35625628220409124385], [-232553064965394684036490956, -30125331735725339611582, 176639302668903075808, -93429979086268432608], [-23205534384821458704035678, -107261305050265098529603, 66376562089142047012, 33697499530815441948], [-221985744400926680264695056, 21692693090146479138326, -95604548289816647582, -55876629306707119355], [-477376389848434800956332558, -77150511091009948748473, 33662905319277859978, -39368548944953031833], [-281630421043769911676221642, -67014127786055360449400, -29354871427779158860, 163345087646642263024], [220907754467601529327593634, 32269859333439293372476, -55492208337654296638, -260260455731650719686], [-384795303096441262070254872, 114042255565950998061912, -121972872347900515980, 193519272758414365806], [-1558440594119189162167143322, -80147825117526144926759, 125871745810848200894, 5059340026952853847], [-157466577554889133382892360, -70577133703324880360074, -2368002184235346554, 78747433364502742775], [-220923644395200528036591740, 77083597138458537232244, -255799151245903624970, 41607295524700991703], [-983746882495380096196818150, -56152398332560713817921, 9654345657591211678, -70061616495361880603], [-1716202052105789342360671918, 12546732801324644833406, 73326960507600625249, -54469250594831897643], [952568714290229204859934482, -47414444420235161264784, -43713303339617551032, 76753162118034028584], [-1084291617895891371360460898, 52704527626991180345401, -16926163711474274146, -20204072466089261571], [343729483502916917609338926, 112545284074167497820922, 80383802367458008907, -211608845430304277173], [734741909475131041596842170, 66769058712163354745688, -163022888100945223164, 136085899130120331564], [1545985850114568830574721236, -21652701429867800079072, 290773965802937074938, -181092875296684483443], [19575425018124699030909510, -5397374106766727376924, 49668399768469927926, -24714296288923585678], [82956705586286648281506678, 14663931803641668775519, -43490289821650600252, 12672215868241061156], [-1024627612750021616340849878, 59613111877677388950724, -110811281593614842722, -94144623215980329514], [-2637800709546908082297666246, 75391238757010443399520, -65209668842043546352, -94250421010825892560], [-1557721178627857050792066142, -138017554279087846550205, 328801826819923625862, 48729674318351323869], [1177551028080030387844474334, -44825547595137273158457, -424489158797004981132, 294163690734044372242], [-553720838429612291291901362, 152235787832662999632576, 156464391873741674424, -152215322187303380652], [-1322775104069242647876661262, 104831887301056808420104, -13602532472331402148, 74585088011265677724], [-1739360070395683052140873334, -82279224599285714720570, 157681437376867390877, -193635699718726502607], [596159733023217625161053492, -94881452900246811888048, 275640307372180848186, -53179548142785960387], [-656626930774466431064090426, -172653547776013476986944, 372634948244903428888, -239401954832264868764], [960232734600440266609746986, 10137902721111475470008, 131088993857019249844, 151362066328449415692], [238434232956550487014885746, 23830379414005437280865, 159420818081533927468, 165968573413885183710], [-516671197617705306316913486, 42924890881659401764692, -51959611057991538426, -120375093701746177546], [-222107064850527179852929922, -161532475655452877790008, 430578915783799459076, 183994884094059698616], [540845585823529443556247398, -228072980674603098325333, 178725643865682550636, -225271451085987503430], [-71907586531034585668629638, 36827089488568539892494, -104563338100050327063, 168771811475509966533], [-552432753871907910321830896, -41984060621340646333840, -353867228035931712248, -83156182496074276612], [-567307742491081611177264406, 156630189581652678094432, -395211081182599476544, 42703560620249480616], [-1362266482442538547138900702, -22731773236952016663593, -586047226272537713374, -256514013208233718197], [3666865214688828601823783478, 34890719333018584832919, 50556421101007832112, 288845199929685940464], [687978845465561449495720054, 37307412938784968487052, 115330858857042274322, -263911083752795608042], [351289055210816787584793542, -117426497324898647571758, -930760928924494835089, 299566035933277513575], [2273696504588511547090567680, 73495833469729757079402, 381716225013404521206, 143912381762877390711], [2798700764209762077238270002, 156851384428897295353051, 274779131732583110678, 58640275768845557509], [-3007180086595695683624506188, 93566998040999345718794, -46158240971742129944, 614537095014919134780], [969393097991899930261489198, 166116199008599416192249, -343955071040454943366, -213858855925260578631], [-603014588760472018259781882, 444623820206472731911264, -407378573890223738536, 900427033709847176172], [-3373240860014003144252833954, 111205907062175220792691, -443759559160160464636, 291378309459072414748], [4401218765458286361625848116, 253236237251594806527302, 41086599115517872660, -248425785673033326698], [-1481399763125474482881486918, 64113006655448108278746, 266492745138774456435, 212958834497661158367], [-111788099909599545066691454, 141699036033257453023262, -553265631741121242143, 692236940507321916829], [-5270429892255975268959916784, 392376736816360895429692, -634524328190170655908, 807764010869725776270], [-1936506775322905091397832522, -514117717864080351169458, -534846335510493477039, -709972433258913440383], [-4236383150083941699137678702, 286973107891448593607300, -1154104890221595829826, 637518810816076706054], [3418030058713855108015222430, 75070963417898939368455, 816399268829306691744, -392212185959246376262], [-3448764542746722668167342734, -229894447510564282028050, -1669276233576838316087, 7537687038171011885], [2329494312655857452802685888, -396547109150825586562658, -461937854389573442086, 304387712225472439461], [-2508401507950894796310983334, 498919434895035136029312, 987741760391945857872, -768890211442318664728], [-1088199261648544870932305390, 98591519114731051844652, -470167612651663385238, 471197253840916776962], [1634096048428950128754557252, -265409158775905475774506, -499778164254918198356, -149421989726370746158], [-6425738123446168654846898190, 559931983277697346341976, 936813616516354736804, -701136732177115193300], [-3045931739224412337760353828, 8793941106007093348480, 1315739591252538618878, 1946498469237405871], [-2626578712105545322648468458, -63329736475568170170229, 74638025943691310596, 765365163911136309142], [-5508240773858063356567694414, -420206133509775381952048, -895117786572703294712, 376811413586789721824], [2449032095678808719643425866, -618685474179247520206444, -86967471939031958618, 589338467833066606294], [-3519199426138827350060022536, -51762388984183638551588, 457535102396228117576, -550675957585088787528], [-2570306165755292281917854454, -8591959484067055358967, 63234525943107109596, 92116514025472767432], [4484975316479093992408743952, -404665739113751744678666, 1750886457610054866794, -2177532224016860802067], [918577200336023603166730914, 53876739876948952088794, 1090182139970299150307, -2242101222740420312041], [-1580166671171335680110887674, 429940907872542373174839, -2660212721347164891120, 1130451492727823735012], [-4131240292048557736176193418, 735911137006939519856188, 150819699688098537818, -1035059106832924071058], [1652902466467849232520075112, 45974560047527990075976, -3011292532093711962540, 592169727165964843670], [-9731584312337807645544929662, -143819226285683658198612, 403093277713544658138, -52553374421344388694], [-2850993262283439900922959022, 594080527018809586290899, -608458903558847918726, 835689692549000631945], [-5045223292126112491211786786, 966306253223535590687240, 1629425397859210890868, -1687275935993301271632], [-8527135669706847090607372702, -210306073554526162602856, -2605466160488278180508, 1460935316099487621932], [-6040524639076806186521995126, 340504792026895489649737, 1141759480031227631120, -715213403262842960720], [7543332005723016789115298646, -504650835467004275132595, 130408208151429362706, -296518712904456530863], [-2308200326445481275265640182, 1664741581748827230345556, 48457705428574777766, 749057737342248833126], [-11880536867173856976196337084, 86065741150942444484648, 377612398016005685650, -1255448100633448556219], [8611310432404777722515042500, -125772964302664172864418, 1249910577922635991740, 1482656317469258270686], [1446422876697908301457790426, -481256923222844493491780, 335109662514111612434, -639416801694077640894], [5172072847106211157226187958, 1081576920141854693960830, 2477687119424068948889, 639203679975114988217], [-8772963495196514342621398744, -827902876528341126961698, -3793691876451853950810, -132750624081665097281], [16303340191806846329061292290, 1016519718665376740838296, 1728273790897675183396, 2038176999004586388044], [12589448974050888684068210722, 505005302733720268854800, 512435339619840085240, 1197469239783096767496], [-3316893028449636693309284854, 164840781064367037325727, -1831143932263609513706, -2277867956600551146767], [2787399060111933476998182434, -47099676042907773558052, 80118306748912732642, 1092496015104860917938], [7406408347685099615205545150, -306708500513574764322258, 3128695717410739015617, -2929540807922321859199], [-14555841803796958453326089964, 351713622769640218977360, 105556764119580562098, 3476436224402965369861], [-5003163495220823230900086270, -1186457469718574798457799, -2373479385018117247004, 925225771609864720822], [21511974662088827156447707054, -764626327997982534506075, -1797871484951368357438, 376484911238830425539], [-1190719311857141430012371990, -1022858007028904565630186, 1059105335107522032885, 2067666048079791086009], [8888695833881921111556429234, 421899729799821575987796, 1069620215155755726006, -1252482786678818984338], [15859799239940591269454242666, 1204239469878362411925136, -104658037641801451192, -2420128555697192606784], [6628454268723696695033698632, 1271058335417326386695500, -1273488700456083898024, 882089500244740613636], [7216766848008665333452357826, 2343826435882722389386933, 4220300402040198826268, -358557532412648503912], [-8564621329083173462857711744, -199916452386678651903842, 4787963841930197320754, 1312359451080555399301], [8931014212594610663166575150, -449698633853206884398101, -857732557883924019608, -5193035785806693195828], [1124692537621698674427269938, 177206119514291805680188, 4499220975991853229122, -282986406889176879046], [26827342525594946573448282, -1257462902791171062404768, 4844279851997334905888, -1802433308048995971800], [5289202853649290595332174198, -2741502546846465638489590, -1280008623259660708301, 2581102007586593353323], [31913726759410379038338067158, -1115844079657224471628199, -3869491132866250762894, 1403563705863321585115], [-30005472904913269505603456574, 761531869840627305288048, -5562096062719965122472, 5442378694572091648064], [2928297787923396694409332906, 1897418692144955261608400, -1616134000598642619080, -2567634308507959104024], [-5119302066122237023374039478, 1073415705146722220645148, 5073360459292826176818, -3927558132372005400710], [-2048909305921972182051258244, -2102855634406054999891442, 4096591672572274944632, -2265661997924528015548], [24741715609466637534578991122, 1476421632486829306534316, -6007056225173473036310, -879581172089504469966], [-3385875449811666598671928108, 553374790278651167585728, 4427484452611722261098, 2247718563408913359565], [1502127411730388670841048442, 3397882670052146497308752, 5363781213728289391768, 242243777162949085448], [29803197372119775169065006262, 88586784800790171834951, 3407636160928660139436, 3326963106355280862320], [-21325712010271914852207677900, 3141351025553945871374998, -2785592486224285265908, 1106944104773127783294], [-14181459921558036954481810190, -236804602448557209296254, 3042427468822750579183, 997404244794041444259], [-744879031719047893113583552, 425155519652610008284034, -3265295931697636909154, -7400997451395827412693], [-14174082305030510299742225526, -500240421611977489289972, 4469526628070374026458, -3287717122974087086238], [40895424863292742508401123570, 1218551241420767668403088, -5537413556242294261032, -95630255665911187064], [3338510114112843016108901290, 3132481024766562537100759, -3650039011306321006462, 1374969167244740169061], [-3005089439126314344136881378, 738832110377229876639072, 3549177131979824877768, -6437721278585776843148], [24123570681877635144848735314, -3979616110185659258848510, 1776877332194059446847, -5074756217365566847333], [-33225202684281833688280361640, -2854122596832360215709252, -2924322177041579590776, 1500228164023500392880], [-59974850130729488632959128680, -442665499800927621911966, 2316788382651494855234, 2831453704947646999169], [-32526417761192210881691833262, -3297492105132879603244982, 1443027723785659634123, 6096869945922386823583], [-38295386204084847518750134158, -608977289989572416203233, 2255274761159912269314, -4970009965391368818005], [-27461554625078446359071547798, 1040762328800246648764694, -3126913704485333746955, -2342436995811535840791], [23685214605564076236348858954, -1166191575304421670117232, -1326808610718510120824, 565704316658707531088], [-32766496199891242653163690578, 1604632900132382684089709, 9196881095372476542646, -5651968367091337896361], [-33783537474667210577581735772, -4449276574698060828419228, 5622343182478473129086, -4071239800982766948665], [-13384355865406276905490178034, 2710261537103185745720775, 4376280275397677334384, -3003950720856532254650], [29873070410592055809340514026, 210239565558643099071666, 2392437637804769258583, -3745958642905791301141], [-3697275202646715900873421886, 1055498899316333258936058, 13086112629060204268035, -5543623648032096412049], [-24804188972468165719096042902, 3134578184487475277658699, -1612296249155309530254, 7185404975249008719947], [18869626868885969232081324502, -5502926720541547452383850, -3637518317544156201123, 5159692766194178751317], [-16191348980014003832867756704, -2032998512078108092466878, -4985708453833377989714, -2100730788994070608397], [49243851369648166607935080796, 2584798508194520796248928, -8404388790572329074, 1271477903178379187727], [-47442840279792437921818660198, 5500146078625722795311423, 13241306937163875761398, -10288571106686120690731], [-46883565534468329720356326950, 2018686644813896020383292, -15382690276622867176990, 14565175807194143670730], [52511753435929694897409632796, -3533144568434705482806154, -12385615243595750735216, 12979394355330667695016], [19096095798158669144909144274, 7666152104791663267684566, -8062361925914339517291, 3836504509610705335865], [45393284782991376260497901268, 5245013359540895032879792, 5530227997723769705570, -6929054408848304978027], [40597143096858521726454205572, -2614897209659301941047498, 15498826630275762706228, -11199918287358749698270], [-34928063770173337737852127790, -3141483943157185234235840, -10092886506656642261632, 1587809168085653992592], [-40095245234119839511678980762, 3365648733106725644912054, -2305353027354737973779, -12114719280551371946731], [41693350688400092942186712770, 4701843946962681141943252, 7107557959509672933830, -773825046062105902154], [399166730532900439656496558, -2628368232306062798594224, 9256419767018505337888, -12579389724208171454700], [54980921152926257636066748786, 1524801379199156007117172, 10597096466734627997174, 944210101928008381830], [-44574686974901408763419125618, -9762205077787432279297015, -6874978223000173409750, -8744678034312833956631], [-78447177797086003963426734446, 10329009137265999555143912, 835490669830982511628, 838267667566163189196], [84033051527369270666009308708, -978783533073853927922552, -1910829048510359077246, 11903644255319772458557], [-76893455094675770853794152094, -4276919231100723379907073, -15444812836889513971698, -41282888559894415857], [111207993435691974583628821132, -2377006981459148807545590, 2593599490916851506732, -6485732548131216762990], [773198337923928436069077682, 5956499602976153769900540, -22745746337132088744558, 8291857757602554608482], [143044542336835807563962539026, -2558609477484313818025199, -3429793240312571757100, -1953688627076968323586], [-116197276983862001125982148530, 535436103789491911551365, 6167966172093291605794, 6008424604988406658331], [102100042912482197182909000918, 2369590227607892829864430, 18341062177841034394049, 2507147307145114970993], [-45313703201445066550886767062, -4582053966419436335324140, -5055983478106687616522, 6725679287135492143534], [101863788626255748379439771108, 7048645513032407017512972, -22385916521940157236138, 1011581800435625019891], [-29868258478589932801325495434, -9802572602660861578888189, -8294005356603616600484, -907512302233082848798], [31651826240758143900679656620, -4675192695666833545789354, 5618889476934367041472, -6526179124316861172388], [110615188779554391688925414738, 1804851895048675294309344, -7034796648979788288672, -3604844206258459846936], [-50630393476869691922951346472, 6280144388124218621892628, -7715304365445267531016, 7791384567377795151892], [76171255759289122876177183354, -6896004459501634092529152, -26907489169305305553216, 19830123615714523279232], [120309896300804067228252430160, -8383304488243448379771762, -13582836022412057550726, 7099488433230954074545], [-104056015543051741430858968054, -15404251966767068761882840, 10592025992853697869388, 6934270493372617690716], [255584968734130738876217839282, -1059836878291730374526668, 3710374585394228354566, -1934284474356623707810], [10464305607363468458414151482, -9927266193598544041811650, -20047353581259729972287, 20022426065549674690357], [-80644652764136218589026256882, 1702518605360112211887325, 7551405822633979602806, 9095511320075894231255], [82426161771792193964833070482, -12774113983039006097421344, -13239522818434450817056, -2890030319842414504632], [14808528382446955100751026202, 7717709544271918370305392, 6731582549719335308808, 6976323631874209967160], [71333110848525327975655496892, -2949372816506981721253786, -9910234616362340119784, 9270507491977144021272], [157946898078514469090275229338, 524344072232384919790074, -600671789441879189229, -5609901890463958736217], [-102488813402665884196180870254, -4708740482298171098172072, 11703509249018877984420, 19381033056052914764988], [88515866937858794335065398898, -2023864044988313910230219, 18029583450505165664060, -27973013603940696059596], [47578847006845693924669394044, 1742681114986055505434692, 10326218523219936436130, -17551775500713643371811], [-80873245068458851781350232686, 7923745600250302232319276, -17001910298266819539510, 1602419143005093011666], [-125009301345870702701044376558, 15272418348832777879209332, -7928619728844591918890, -12198191771691164912202], [47758709078879126752955577770, -11443149365676957302141131, -25602872979679807476884, 27445439941823322831002], [-8340974070673358762360298640, 4578057332820508509976018, -25785952620929940646810, 20530045428176303545471], [67524092100979260007858015090, -5474423915572857392821214, -11970588572741327773297, 19349766760873173602331], [-98409393660644163478774652738, 9119462563362909015798388, 29976286781451775275566, -5940728061595794201782], [-3114657293191541638079466144, -3551138776802426169423320, -59287147786779914187808, 26596577216922217274740], [-15834592313612639917117843914, 18874592800455200852231005, -14984738041269386156854, 28968619515622061247441], [-235175803237972100675088819518, -9930558647524544469000818, 62777237494451660489, 7648854958865707399685], [-47755309333243418894068569502, 6628721912805639262682871, 48806315009864731389642, -13286578069473558617317], [-1265974047567992220906494302, 21766174034801386140173176, -5658355168314156734812, 11280908336109307773796], [-215363750988198134922058420318, -3063629325963199034538882, -889639766212660641903, 10974461609683883775421], [132719456609305417116189220862, -2612303946443041632580347, -2245797147175696672230, -42330897585660780821689], [89682283522149816511444073732, 4614403408745536442267116, -10816644215215343257186, 1934940474297311911787], [-2952700104649313077526488118, -8795705645795853965428464, -40599575000165738646504, 23531446863786213061080], [-138189358591890987808627381350, 10481444945221732610497836, -37726886675829417407238, 35922051918154959805866], [220888820954272892773936358922, -2791241664160953212963207, 28674378572479021520708, -20551114270829548608448], [-139876591456489557027270484130, -5894351872570663640191230, 61260915050380990267719, -11160768004065829634633], [-199391349104740217400506759064, 5247725900602116886119210, -18414490451954164693902, -8762448036813722541551], [162155621175967340532140281240, 4448630680725151418897064, 29216970326310607224660, 39743313136178335739506]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_80_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_80_18_a_k();".
// 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_80_18_a_k(:prec:=4)
    chi := MakeCharacter_80_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 18));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(2999) - 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_80_18_a_k();".
// 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_80_18_a_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_80_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,18,sign)));
    Vf := Kernel([<3,R![10642044899166480, 1096270378848, -213421608, -9704, 1]>],Snew);
    return Vf;
end function;