
// Make newform 71.2.c.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_71_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_71_c_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_71_2_c_a();".
// 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_71_2_c_a();".
// 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 := [961, 620, -228, -1639, 9316, -13514, 17787, -13621, 12709, -8426, 6406, -4046, 3162, -1990, 1278, -604, 268, -91, 28, -6, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [79380059851951668449370342396795297835, 229299483550525226184576202955031171835, -517011608108476414868435026870277607762, 2442027900590980067625467294235185195160, -1565363480123945843222118931640334417284, 1937713187454187932645877906691338865198, -1323228127759250965281020809968542066717, 1193390634637278698945161352358382306062, -706491512252509539675957039916790158124, 574070837884582424036470379596115401162, -356470299540565401063305846514922742018, 276116314243909801832569194448207269682, -156331046537543686654881202689277471914, 87690911490234777408994601873608069702, -37397677034162240516101677668363953758, 14898915432011348674000048344849065074, -4582140182000067179713243095070733158, 1259788179190990231672249472469586239, -226197831436775784853466127769678267, 33189818980766452400734169248789752], [2046798092606599839314422376908065241943, -114022005371710052650277126595604766839, -39042628747687776242701570800621798426685, -11038444277082257552444989813036404912261, 22974644757842515332331411129419533210062, -23017832632135126015762115398684052708113, 24574453783318224628953670606944191778191, -21351852158675615568686642478659859476589, 15197530782812001706531183821861048744027, -9709814229446175921943804981793455122418, 7519764946527643204929696638305331060208, -5652396015997036047239072410819965624977, 4409585571717672427764287856165621218508, -2462237297001873029965379978739432638729, 1225097502003792846816048587517824034777, -476636184762656308743364527586673166058, 162142521354339107586494141010955705165, -42123233056870518607354768341020037081, 8302774191934239927191832337849329142, -592037823073454824853542816956702724], [-5520682793027248642734455443670060370185, 15443532314387124331680955572769917843642, -79899765502105826760535227772527756958075, 72381256192899796729380335583061495794864, -94673693612346756474112241144537687238628, 86566301785913048527226170277147318990522, -71873683713866403407586241722682391868907, 54444500772035981353278786996158283294909, -39372208371600918317852985155718196131432, 27454084557099539951887204254668110742268, -18919983875786895809911335522650353587252, 12943028547562924468137092207840722008504, -7814105969274175525944864315166451537912, 4431834971633036948847387413625875812728, -2008497221959410123197862363453687465434, 828299766297584248520505754087229496278, -272072318926778820694507512940375628344, 78710251350496395026662920512804166257, -16392766940394405530752502936414798022, 2560647091998440917721623948283719285], [-464688978758175783195549724904669516247, 4514551986291479260373160086083817630562, 80233889226489630357750774658195400809333, -114294006557234611325501471882921802671458, 173756577200606713320774570110622615872156, -110372232784995042800634442024026623754092, 119781002648086284981193184165368787333217, -68167136544858171177171215893782929116775, 55884671192795043336349314859222149373786, -31198209155061704773345493695997468925606, 28271194085301826045746388272596741285070, -16458378813622880619743761051181082710286, 11342730185184921032583309911419450472422, -4560447080954012761872157341464242444650, 2006418815072873766702461922790384824242, -525694131616687776275375702286850964256, 145903296680303527518222498789441417772, -9541673478226611459112538363048707403, -1616228350873362564816048794141950386, 2681266620450202593517758618945382617], [-5827846275015123591361699392648944863991, 5752766460533784756452595873363994086809, 28372122677845256135279172094838715092524, -60146097951520049486863057667529648171562, 181164185019702301702650310734635363049774, -122312108721729867381818548200838694444574, 136015342095926200777761943519951576044425, -92317479026816832214173539462218446592598, 79667681088507040164992129455391124592494, -46687714881100260880750368613256131708884, 37635995283339554728313719525248545876558, -23428039461134010788817054602486106088516, 17217814559859667950735857172394242343258, -9171498492642416780584273092951534073100, 4526555734822611220529148562621097282328, -1754536768279745606190847940347262782918, 602847759882911600767618784341379136298, -159982506862680894922496416210396918973, 33891267290777386745497456125019545187, -3200525129724954795489084070134990014], [-11150169777727433375842595488147351322137, 4739088754954245304930228636479177885201, 36941000253067700112874996367229054442880, -91136536021643726467261164670905060364290, 186770408856536222473001617667064073961576, -159099160025016523173954356244231238576132, 151876203033832476149368179550228363225969, -114597596187667554176630857026526434055074, 87238241428998044318813669717737994849074, -56531601598669376602531436705443554293350, 41828918358871550596719583079948764292362, -28631243385558717173942684209426949906820, 19601120639319841621116987059296543883506, -11069726281072541857946702126648766742152, 5307861459867376484028669894223740433924, -2148005523728129305633739064657484307378, 726383334920233773990892771955469939120, -202613535259813130086195644061091233267, 42378949490117241585431220587668228051, -5276485441740031460727574283768361706], [-9450817585766473665439125053479087711039, 98422741855594332554361734238253377359697, -166834009418401561111683558223792464447272, 305276579403416299273357160143449663663246, -314956293625424577047096596261547414395592, 315157419439681706307317578067911332640508, -247903350239502582016896507074055703727115, 199540222210000183993425028273022564834868, -134376352024604599826833059530167538029786, 96654723067030918165422730951657452121046, -64868720210344279084790034325898825553366, 45533286598749973193007378376864689612408, -27701021212752544450577530225140836873862, 15183147083682024542365122487724566289788, -6805072802361638200083451322344024205920, 2689540241586945226463538873042701791802, -864477654338504593679208801044508483200, 236388329691269036735850510524215584945, -46156299022695625258735809352389700085, 5989451817061668276273255738500950302], [-1296005302288771537443453259541020468335, -1267165306959213661130026762199789425852, 116753505226802347177483469952697065249, 3151508939598785499742973354780438353388, -5424798693518319013821267612238841990958, 5725926418803865765736286663110120059770, -5114844284381658317086972312234154975793, 4224985282752783709692028307223670986925, -2940054624710717152720235890166981786352, 2017055715477707154910737774380077698438, -1403194582708382481237041788350081576718, 1047038182353339072746928680152642996026, -704073891526478751352710606897877062710, 417599280862928831114104273721939479954, -199002114893150431752156104766907075948, 82893410724169294437756360319778395200, -27925189994380590591715591748791699202, 8003508784839020278596367659698963191, -1655106589988922439169215462244652882, 226398976749818567255415565439954587], [4079927315695253520531279479026763849467, 19560282832075117278034603303928517432544, 78351737831646318898725708213809957988981, -81582076200359153695576649245967810808862, 146569795394978755593847416209868806601626, -37356557353491014358466919898331419034770, 80606949430624080245421033469687725810269, -13179246322756337266060561888817863415985, 23844938800668585583285082303044882134916, -1676754859520088175819495845162022543528, 13476337780035821105084591331109775686592, -2819613465610711999544274316480534823534, 3238048978259509283244712858664611522320, 1813029046051599281928865864838386984344, -1076603614949544996107511937341179393748, 1004049213089653716054669701617045881544, -389235525596264012572799356478916888582, 171175347897991927032064523207991315379, -42239172418128553081729158590278410164, 10511454460775095526908280445077253385], [-163571048693940975282554802796819212886, 254153187220923028070693530071321518207, -114066131427016713931752958057419077943, -912672277872767372540080713423635793766, 1354219278915922367068486536881258151974, -3724644664414885074604167057942530124732, 2104719789444728502644935240607851255210, -2580812736512629278154770652613532529953, 1533507829309467559427229530777881455920, -1379954035383759330023326735571154164978, 733239866415572098874535349794304167894, -660653492309399461503736049284579768706, 385386981250862506294261107230690006208, -293577890653457387557068201116048518986, 139560576984799408101189102967509692964, -68414975905045080056426291187988708500, 23674433075541963682540295374437528070, -7942682571673900356925274584920936254, 1770062673906201586639469810179906629, -345807639989582349066637899518001865], [15662822695762772382894493139006295804137, 30970996713114758684960384413480828496027, -299962963088848261019864033204923336278602, 574979127045571602228550233439833024425970, -729395444333439003265192456324594067658580, 643799003604793602026262778627143548672972, -569360236552366538709136920548781661852267, 424940870269192487916799938221171972259054, -308054132646060821881249820043895897018004, 206411746794357395878015130776093491488008, -149447375015247314471545513684901221815462, 101496123292107393432770846719913212191410, -64930048480121883449761941678744156877020, 34544736454948673161455278088377190517024, -15767064858275130676560360488211366673924, 6062197836803962746436298895272084456538, -1962477437510230050223947467239568762010, 515285373177015382702322071744920300643, -100240351102605645034457870559509899763, 10919150651161224888179199110176493850], [3048417437958218738104829319265419566124, -3489275715602567146113713960959360859503, 273942224326967810001212122689178573489, 8526196439604547026845286962613167986102, -14886259538593496257324175769560802689050, 14770144824284847429371444573671995374122, -13678581657947213196162443331158791225216, 10855657368060787066387901852896682012111, -7841325708693739855633493858647625385480, 5289891097349674309468503092855963137818, -3873564580472982028284524106056624081790, 2769257182548385151087097392477796258058, -1867849197091529215725890141002282521072, 1053384296650360191703762166382534937826, -497850078134380585761318787239694248364, 199796573100032930926102817744113742388, -66575043861317798743856871843139069538, 18309861553008456268560653381822546840, -3714677532814775823489963934621283161, 450433820800270765757589294506531247], [83119265233956280399050517187306861127, 68615299465719399715372905440348604477, -165350992766262111345006743587205318298, -2729951136045403626081496162407963965116, 4492667303011248344732674554097322165530, -6773910139011959715147534196356468276074, 5098836198804606333275316599329294979441, -5042017267265757887338663687549156256754, 3298172710456767610909303554256767638588, -2531516894732530657720320934917933654988, 1560464616956958147981298561579406128068, -1261922542956236959326427085317734172692, 804404640886658749046674638847947824040, -538014540641316909473666114939379415492, 257648574899657150851221059886336820296, -116964640445961165586683488020432126610, 40137857609591679720585000392393984052, -12577372875524902049301243003660362449, 2729585124220396260568057409468368409, -466818431349285580525500094178398236], [19759596780652275429204056563079191520717, 66598754218012318468002773710571131288658, -129020200856134550636030212510392290104957, 398534387506288606588801373201869629211842, -444888278323797470225886322286880709090436, 589539116354749599107555206502844765930466, -424940149817153874801758974492039037417629, 390412975514721455152884549457920392102383, -251676753403813341696544219092658780431972, 197122137325341500887256812843874765716216, -122705411373166635035236872183218129262814, 95075601115687875002506300569844085030044, -56963404021822007264468658467284978713194, 35911482954080249109668393038558654627858, -16524474618953619198908022352738716067350, 7279555318918419951232579971633130758254, -2430945918963522454342346614633955416594, 747011982649014699494169161158253063231, -157914896523350510330686687728183478716, 27169866929529130436130154774147298329], [-1258463218560843674277566828967944351943, 2399621708023604233244800111596690762109, -366545511018980673788109786351561928116, -6445017095760895562807586408350409880372, 10739698256780314367125278906238214140606, -15004338610929323745974813840646679838454, 11684616332616245810620053814412357552017, -11168640274398115118084542287337174377624, 7406415604070411320817840866452497197732, -5643488751790622168450065719211119471844, 3544631496297442177658378505036211865776, -2830293103695718332280815531491723286604, 1801938348146094500912412905961752452660, -1173939563811038799193421022401810943320, 558209192229697203955083578014846574292, -249174046694610694374569654627484761440, 84912634550479088481035126185713863396, -26217568922095944169003657536304910261, 5621207158161709796735377686687643703, -937060969198745135086350753960119290], [-40645779189165334695954197100469677932725, 7183044845625173420100097013717017952640, 97961015953020096894640042279881161986387, -366137026428599661649735610599526260509280, 458292124732753215459609222083125503618758, -589435095202938095446758019885229953886438, 434695499614934942833428772013144546510181, -403815354022496838733480770608866950797425, 263349539893701386165039215401796525782986, -204782901769117752000748675317607762761620, 128229960567178228723144494294235767789350, -99881086405376738125473789387133808270168, 60946519024364875883671277093625303047336, -38667702454944338388597446227525501220516, 17964270821253209285795766742030959341934, -7931386383372251336365349041111042415066, 2664421218527124708629917596823351638106, -818520093860068795518770278104480137715, 173739682571310883799899432269475725106, -29495355086125482818780691020842928695], [34385906462236945677392062979542868031180, -7123785427802276206378333347351407680423, -80116359457358596007948208340123470552547, 367341910706819241218503155810808406231108, -438602283397534740987403237038367161221500, 613670440261433162080316003455871828805106, -436462548188646126929218455242239106758302, 420310916316096453164274167966734862044735, -272605792571799817969741420342224539019546, 215783999967437721489819464453899278926714, -132251799937336632331934346270598588239802, 104318616253422434809133604158355034573916, -63214081776109052785891568233862461185470, 41070303592692773423870040027084312750882, -19151256862666142866548259681825424235906, 8594206982117242478922868495897987777098, -2903132961831627476475232508728024916886, 906146329797627606632679338447907329624, -194310791694164606372394539843016558185, 33887276439719256439882436421822100815], [32955135976926328640222636148580829740768, 57414283823249939808460142664792843315943, -12772390195893737506306360302135096299773, -65683808449391710725131711031421752914748, 299597664401694777807731411932953833873800, -455765908141040954587863857988812233026344, 359806272747867236778178556762225544553854, -359635934197048196267431284294315356127789, 246652788287429353468436195708529657073066, -187492729658733300211004928874609061218206, 114788556712695812703156913114145081734238, -92962426452190222381363312465567445408802, 60409982731291218381341694010226095930422, -41972256953213133728051490604163413146484, 20479299264843823621746037090701767532054, -9510767791478976514078838562333990587188, 3312543659737852418313879675061586871604, -1058505300378218245627910771859839966564, 234699672525449641031107611250175982063, -40973676757550111573438213343827580773]];
    Rf_basisdens := [1, 1, 927287529174375227802284894954976025138, 14372956702202816030935415871802128389639, 28745913404405632061870831743604256779278, 28745913404405632061870831743604256779278, 28745913404405632061870831743604256779278, 28745913404405632061870831743604256779278, 28745913404405632061870831743604256779278, 927287529174375227802284894954976025138, 28745913404405632061870831743604256779278, 927287529174375227802284894954976025138, 28745913404405632061870831743604256779278, 927287529174375227802284894954976025138, 927287529174375227802284894954976025138, 28745913404405632061870831743604256779278, 927287529174375227802284894954976025138, 28745913404405632061870831743604256779278, 28745913404405632061870831743604256779278, 28745913404405632061870831743604256779278];
    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_71_c();"
function MakeCharacter_71_c()
    N := 71;
    order := 5;
    char_gens := [7];
    v := [2];
    // 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_71_c_Hecke();"
function MakeCharacter_71_c_Hecke(Kf)
    N := 71;
    order := 5;
    char_gens := [7];
    char_values := [[0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, Kf := Kf); // the value of chi on the gens as elements in the Hecke field
    F := Universe(values);// the Hecke field
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),values);
    return chi;
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 := 2;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 1, 0, 0, 0, 0, 0], [0, 1, 1, 1, 1, -1, -1, -1, -1, 0, 0, 0, 0, 0, -1, 0, 0, 1, 1, 1], [-1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, -1, 0], [-1, 0, 2, -1, 1, 1, 2, -1, -1, -1, -2, 0, 0, 0, 2, 0, -1, 0, 0, -1], [-1, 4, 0, 2, 1, -2, -1, 2, -2, 2, 1, 0, 0, 0, 0, 0, -2, 0, 0, 1], [2, -2, 1, -1, -1, -2, 0, 0, 0, -2, -2, 0, 0, -1, 0, -1, 0, 1, 2, 0], [0, 0, 0, 1, -2, -1, 1, 0, 0, 0, 1, -1, 0, 0, 0, 0, 2, -1, 0, -1], [-1, 2, 0, -1, 1, 0, -1, 0, 1, 1, 1, -1, 1, 0, 1, 1, 0, 0, -1, 0], [1, 0, 0, -1, -1, 0, 0, -1, 1, 1, 1, -2, 0, 0, 0, 0, 0, -1, 0, -1], [-1, 0, 0, 0, 3, 1, -2, 0, 0, 0, 0, 2, 0, 1, -2, 0, 0, 2, 0, 2], [-3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -1, 0, 0, -1, 0, 0, 0], [1, 1, 2, 1, 0, 0, 1, 1, -2, -1, 0, 0, 0, 0, 0, 0, -1, 1, 0, 0], [5, 0, 1, -1, -5, -4, 0, 4, 1, -1, 0, 0, 0, 0, 1, 0, 1, 0, 0, -1], [1, -4, -5, -1, 1, 0, -1, 1, 1, 1, 0, 3, 0, 0, -3, 0, 0, 0, 0, 0], [3, -3, -4, 0, -3, 0, 0, 4, 1, 0, 1, -1, 1, 0, 1, 1, 1, -1, -1, 0], [-1, 3, 1, 0, 0, -2, 0, 2, -2, 0, 0, 0, 1, -1, 2, 0, -2, 0, 0, 0], [-1, 2, 3, -1, 0, -4, 1, 1, 2, 1, 0, -2, -1, 0, 2, 1, -1, -2, 0, 1], [3, -1, 1, 2, -1, -2, -1, -1, 2, 0, -1, 1, -1, 0, 0, -1, 0, 0, 2, 2], [1, -6, -5, -4, -4, 3, 2, 3, 4, -2, -2, 3, 0, 0, -1, 0, 0, -3, 0, -4], [-2, -2, -3, 0, -4, -1, -1, -2, 0, 0, 0, 2, 1, -1, -2, 1, 0, 0, 0, 0], [-3, 4, 4, 1, 6, 0, -1, -4, -2, 1, -1, 0, -1, 0, 0, -1, 0, 0, 1, 0], [-1, 2, 4, 2, 4, 0, 1, -2, -2, -1, -1, -1, -1, 0, 1, -1, -2, 2, 1, 0], [-6, 1, -4, -1, -1, 4, 1, 4, 0, 3, 3, -2, 4, -1, 3, 0, -1, -1, -4, -1], [4, -5, -2, -3, -5, -3, 0, 2, 0, -3, -1, 1, 2, 0, -2, 0, 2, 0, -2, 0], [6, -6, 0, -2, -3, -1, 2, 0, 0, -6, -2, 6, 0, -2, -2, 0, 3, -2, 0, -2], [4, 1, -5, 1, -5, -2, -3, 2, 1, 1, 3, 0, 1, -1, -4, 1, 1, 0, -1, 1], [0, 2, 1, 1, 4, 2, -1, -4, 0, 0, 3, -1, -1, 0, -1, 1, 0, 0, 0, 0], [2, -7, 2, -4, -4, -2, 5, -2, -1, -7, -4, 0, -2, -2, 0, -2, 0, 0, 4, 0], [-2, 1, 2, -2, 3, 4, 2, -4, 2, -2, -2, 0, -1, 1, 1, -1, 2, 0, 1, 1], [2, -1, 5, 0, 0, -4, 0, -1, -2, -3, -3, -2, 0, -2, -1, -2, 0, 4, 6, 2], [-10, 6, 4, 2, 7, 1, -3, -11, -2, 4, -1, -2, -2, 1, 2, -2, -2, 2, 1, 0], [-4, 2, -2, 1, 1, 4, -7, -4, 0, 2, 2, 1, 0, 1, 2, 1, 0, 2, -2, 0], [-1, 5, 3, 2, 2, -1, 2, 2, -2, 3, 3, -4, 0, 0, 3, 0, 0, 1, -1, 2], [-1, -6, -7, -5, -5, 4, 5, 6, 3, 1, -1, 2, 1, 0, 6, -2, -1, -3, 0, 1], [-3, 4, 1, 5, 3, 2, -2, -2, -3, 5, 2, 0, 0, 0, 1, 3, -3, 0, -3, -1], [0, 2, -4, 2, 5, 0, -2, -5, 0, 0, 3, 0, 2, 0, -2, -1, 0, 0, 0, 0], [6, -5, -1, -6, -6, -5, 2, 0, 1, -4, -4, -1, 0, -5, 0, -5, 0, -2, 3, -1], [0, 6, 3, 5, 5, -1, -5, -8, -1, 5, 5, -3, 0, 4, -5, 4, 0, 2, -4, 1], [-1, -5, -2, 0, -4, 3, 5, 2, 0, -3, 2, 5, 2, -1, 0, 0, 0, -5, -2, -5], [-9, 1, 0, 0, 5, 4, -1, 0, 0, 2, 0, 0, 0, 1, 0, 0, 4, 1, 0, 1], [0, 6, 5, 6, 7, -8, -6, -7, -5, 0, 3, 0, 1, 0, -6, 4, 0, 5, 0, 0], [-3, 0, 0, 3, 5, 5, 0, 0, 0, 0, 3, -4, 0, 1, -3, 0, 1, 0, 0, 0], [4, -11, 3, -5, -1, 6, 6, -6, 6, -5, -6, 0, -3, 3, 0, -3, 6, 0, 3, -2], [-7, 15, 5, 4, 8, -6, -4, -1, -5, 7, 1, -4, -1, 0, 3, 1, -7, 5, 0, 7], [-5, 6, -1, 5, 5, 2, -4, -3, -3, 3, 3, 3, 0, 2, -6, 2, 0, 3, -4, 3], [0, -4, -1, -4, 2, -3, 3, 3, 0, -4, -3, 0, -2, 2, -3, 0, 0, 0, 0, -4], [-4, 4, -2, 2, 7, 7, -2, -3, -1, 4, 0, 2, -1, 0, 2, 1, -4, 1, 0, 4], [7, 1, -5, -1, -8, -4, 1, 4, 1, -1, -1, 0, 1, -1, -4, 1, 1, 0, -1, 2], [-9, 1, 1, 1, -3, -3, 1, -1, 0, -1, 0, -2, -1, -2, 1, 0, 1, -1, 1, -1], [-2, -10, 4, -3, 7, 6, 3, -4, 0, -5, -7, 2, -4, 0, -4, 0, 3, -3, 4, -3], [1, 0, -1, 2, -3, -3, -1, 1, -1, -2, 0, 1, 3, -3, -1, 3, 0, 0, 0, 0], [3, -10, -2, -3, 3, 11, 3, -6, 3, -3, -6, 4, 1, 0, 0, 1, 3, -3, 0, -3], [0, 2, 4, 4, 9, 2, 3, 1, 4, -1, 1, -2, -1, 2, 2, -1, 4, -4, -1, 0], [-4, 7, 3, 8, 10, 8, -8, -6, -4, 4, 0, 5, 0, 0, -4, 2, -4, 4, 0, 4], [2, -6, -3, -3, -3, -5, 0, 5, 3, -3, 0, 0, 1, -1, -2, 1, 3, 0, -1, -4], [-1, 9, 3, 5, 2, -7, -1, 7, -6, 5, 1, 0, -1, 1, 2, -2, -6, 0, 2, 2], [0, -6, -2, -4, -4, 2, 4, -2, 2, -4, -4, 2, 0, -2, 4, -2, 0, 0, 4, -2], [3, -6, -5, -6, -6, 2, 9, -6, 5, -1, -1, 0, 0, -1, 2, -1, 0, -8, 1, -5], [-4, 3, -2, -5, -1, 1, 0, 2, 0, 2, -3, 0, 2, 0, 8, 0, -6, 0, -2, 0], [-3, 11, 9, 10, 11, 4, -10, -8, -9, 3, 3, 2, -3, 0, -7, 4, -3, 9, 0, 3], [6, -1, -1, -3, -5, -2, 2, 1, 0, -4, -2, 3, 1, -2, 4, 0, 9, -2, -1, -2], [2, -3, -2, -2, -15, 0, 0, 1, 4, 0, -1, -2, -1, 0, 2, -1, -1, 1, 1, 0], [-5, 3, 1, 4, 1, 2, -1, -4, 1, 3, 1, -1, -1, 2, 1, -1, -1, 1, -1, 0], [-1, -6, -8, -1, -11, -3, 1, 12, 3, 1, -1, 6, -4, 0, 2, -1, -1, -3, 0, 1], [8, 6, -3, 6, -6, -8, -5, 8, 0, 6, 5, 0, -2, 2, -5, -2, 0, 0, 2, 10], [1, -4, 0, 0, 1, 1, 2, -1, 3, -1, -2, -1, -3, 1, 1, -3, 7, -7, 2, 0], [-2, 5, 4, 2, 8, -1, -2, -3, 0, 1, -1, 0, 0, -1, 0, 0, -3, 3, 1, 0], [4, -1, 0, -3, -3, 2, 3, -1, 1, -4, 7, -6, 4, 0, -1, 1, 4, -1, 0, -4], [4, 14, 0, 7, 7, -9, -14, 0, -5, 9, 9, -2, 0, 2, -5, 2, 0, 7, 0, 5], [8, -14, 7, -12, -8, -2, 12, 0, 7, -8, -9, -6, 2, 0, 4, -1, 8, -7, 0, -8], [0, 4, 3, 3, -2, 0, 0, 1, -7, 0, 1, 2, 1, 0, -2, 1, -2, 2, -1, 0], [-8, 4, 7, -4, 10, -3, 0, -11, -7, -3, -3, -7, 0, -3, 7, 0, -8, 8, 3, 0], [8, -7, 2, 2, -7, 1, 4, -1, 2, 2, -4, 0, -1, 1, 1, -1, 2, 0, 1, 0], [1, -10, -7, -7, -1, 3, 4, 2, 6, -1, 1, -2, -2, 3, 2, -2, 1, -1, -1, 0], [7, -9, -4, -3, -10, -5, 1, 4, 0, 0, 1, 5, 4, 3, -5, 0, 1, -1, -4, -1], [1, 1, -3, 7, 6, -2, -2, 3, -5, 0, 2, 3, 4, -2, -3, 4, 0, 0, -2, 0], [2, 3, -6, -3, -3, 0, -3, 9, 2, 5, 5, -2, 0, -1, 2, -1, 0, -1, -5, -2], [-11, 15, 3, 1, 8, 0, 2, 0, -4, 1, -2, 0, 3, -3, 6, -2, -4, 0, 2, 3], [7, -7, -1, -2, -2, -3, 2, 3, 4, -3, -3, 2, 0, 2, 4, 2, 0, -2, -3, -4], [-4, -6, 8, -9, -2, -1, 7, -11, 7, -8, -7, -7, -6, -1, 7, -6, 0, 0, 7, 0], [-5, 2, -6, 3, 4, 0, -7, -4, 4, 7, 1, -2, 1, 0, 2, 1, 2, -2, -1, 0], [3, 4, -7, 1, 1, -2, -9, 6, 1, 5, 5, 3, 0, 2, -4, 2, 0, 7, -5, -1], [-1, -5, 2, -3, -1, -8, 2, 8, 1, -3, -2, 0, 2, -2, 4, 1, 1, 0, -1, 1], [9, -3, -1, -3, -15, -16, 1, 16, 1, -3, -1, 0, 6, -6, 5, 3, 1, 0, -3, 2], [2, 10, 0, 0, -2, -5, -3, 0, 0, 3, 0, -1, 0, 1, 7, 0, -5, 3, 0, 3], [1, -10, 3, -8, -8, 1, 7, 5, 2, -8, -8, -3, 0, -6, 14, -6, 0, -1, 6, -2], [-11, 8, 4, 7, 15, 5, -4, -5, -7, 7, 4, 0, -4, 4, 0, -3, -7, 0, 3, 8], [18, -2, 2, -1, -9, -7, 4, -2, 0, -3, -3, -5, -2, -2, 3, 0, -2, -4, 2, -4], [-6, 10, 2, 6, 4, -2, -4, -2, 0, 5, 4, -4, -2, 2, 0, 0, 2, 4, 2, 4], [3, 5, 1, -2, 13, 3, 0, 7, -9, 3, 4, -1, 1, 3, 1, 1, -5, 5, -4, 0], [14, -9, -9, 2, -13, -11, -2, 11, 7, 2, 2, 0, -1, 1, -10, -3, 7, 0, 3, 2], [4, -4, 7, -7, 0, 7, 7, -4, 3, -4, -4, -7, -4, 0, 3, -3, 4, -3, 0, -4], [7, 14, 4, 7, 7, -14, -10, 12, -7, 7, 7, -4, 0, 0, -8, 0, 0, 9, -1, 7], [0, -7, -10, -1, -8, 2, 1, 8, 2, 0, 0, 6, -1, 0, 1, -4, 0, -2, 0, 0], [-4, 6, -6, 3, -2, 9, -2, 6, 12, 11, 10, -4, 1, 9, 4, 1, 8, -8, -10, 0], [13, -18, -4, -9, -17, -8, 6, 8, -6, -9, -6, 0, 4, -4, 0, 0, -6, 0, 0, -10], [-4, 11, 0, 3, -11, -13, -2, 0, 0, 7, 3, -8, 0, 1, 6, 0, -1, 2, 0, 2], [-7, -2, -4, 0, 4, 2, 0, -5, 4, 2, 2, 4, 0, 2, -4, 0, -2, 2, -2, 0], [-3, 9, -2, -3, -4, 7, 3, 7, 2, 3, -1, -9, -3, 0, 6, -1, -3, -2, 0, 3], [6, 0, -5, 1, 1, -5, -8, 7, 1, 1, 1, 5, 0, 2, -8, 2, 0, -1, -3, -1], [-4, 5, -1, 9, 6, 0, -2, 0, -11, 2, 4, 5, 4, 0, -5, 4, -7, 7, -4, 0], [12, -2, -4, 1, -7, 2, 5, 4, 0, 7, 5, -1, 4, 6, 2, 0, 1, -5, -4, -5], [-9, -2, 12, -2, -2, 8, 9, -8, -1, -3, -3, -11, 0, -3, 8, -3, 0, -5, 2, 1], [6, -23, -12, -4, -12, 7, 4, 6, 3, -6, -8, 13, 2, 0, -2, -4, 6, -3, 0, -6], [-14, 16, -8, 7, 7, 13, -2, 0, -1, 15, 15, 0, 0, 6, -4, 6, 0, -1, -9, 1], [-8, -4, -3, -5, -5, 9, -1, -2, 1, -3, -3, 1, 0, -4, -4, -4, 0, 0, 6, -1], [3, -6, 3, -1, -1, -9, 1, -4, -6, -12, -12, 8, 0, -7, -8, -7, 0, 0, 9, 6], [2, -16, -3, -11, -9, 8, 11, 7, 9, -2, -4, 3, 1, 0, 9, -5, 2, -9, 0, -2], [-10, -1, -5, 5, -6, -5, -4, 5, 0, -2, 10, 6, 5, 1, -10, 0, 0, 4, -5, 4], [-3, 1, -3, -2, -7, -1, 3, 3, 0, -2, 1, 2, 3, -2, 6, 0, -1, -3, -3, -3], [-5, 10, 8, -1, 3, -6, 1, 2, -1, 5, 6, -6, 5, 0, 6, 4, -5, 1, 0, 5], [6, 3, 1, 4, 18, 16, -1, -1, 0, 10, 3, -4, -1, 6, -2, 0, 1, 1, 1, 1], [7, -16, -15, -6, -5, 2, 3, 9, 8, -1, 2, 6, 0, 2, -6, 0, 11, -11, -2, 0], [20, -2, 2, 2, 2, -23, 0, 4, -3, -5, -5, 5, 0, -1, -6, -1, 0, 6, 5, 3], [-2, 6, -2, 2, 13, 11, -2, -11, -6, 2, 3, -2, -1, 0, 0, 0, -2, 6, 0, 2], [10, -4, 5, 2, -10, -3, 5, 6, -1, -8, -4, 7, -1, -3, -7, -1, 0, 0, 4, 0], [1, 0, -3, -1, -6, -4, 1, 5, -8, -1, 2, -2, 4, 0, 0, 3, 1, 8, 0, -1], [-1, -3, -1, -4, 6, 8, 1, 1, 0, -10, -3, -1, 1, -1, 2, 0, 1, -1, -1, -1], [4, -10, -5, -1, -21, -12, 1, 17, 8, -4, -3, 5, -1, 0, -3, 0, 4, -8, 0, -4], [-5, 1, 4, 7, 6, 4, 2, -4, 0, 8, 3, 5, -4, 3, -4, 0, 4, -2, 4, -2], [-3, -3, -3, 4, -3, 5, -4, 6, -5, 3, 5, 10, -1, 0, -1, 1, -3, 5, 0, 3], [-1, 11, 10, 2, 2, -4, -3, -3, -1, -1, -2, -8, 2, -4, 8, 2, -6, 6, 2, 0], [-21, 17, -1, 8, 8, 18, -10, -4, -3, 14, 14, -5, 0, 5, 2, 5, 0, 5, -8, 3], [1, 4, -1, 8, 5, 6, -8, -6, 1, -1, 1, 3, -2, 0, -9, 6, 1, -1, 0, -1], [17, -6, 7, 1, 6, 2, 3, -7, 0, -3, -6, 3, -7, 3, -4, 0, 4, -3, 7, -3], [3, -4, -7, 0, -8, -2, 0, 5, 10, -3, 6, 1, 0, 0, -3, 1, 3, -10, 0, -3], [9, -9, 1, 0, -5, 2, 2, -2, 3, 0, -2, 0, -4, 4, -3, -6, 3, 0, 6, -7], [8, 0, 6, -7, -4, -11, -1, -6, 0, -7, -13, 0, -6, -6, 6, 0, -8, 1, 6, 1], [-3, 4, 2, 0, 13, -2, -1, -2, -5, -1, 1, 2, 3, -2, -2, 3, -2, 2, -1, 0], [3, -11, -19, -3, -24, -7, 3, 21, 10, -3, 6, 5, 6, 0, 0, 3, 3, -10, 0, -3], [11, 13, 2, 4, -4, -11, -5, -2, 0, -1, 2, 1, -2, -5, 4, 0, -2, 5, 2, 5], [7, -10, -4, -9, -13, -11, 8, 11, 1, -9, -8, 0, 6, -6, 2, 3, 1, 0, -3, -12], [1, -7, -5, -7, -4, 1, 0, 5, 0, -9, -2, 7, 5, 0, 0, 0, 5, 0, -5, 0], [-6, -2, -4, -6, -4, 5, 5, 1, 9, 0, 7, 1, 2, 5, -1, 2, 6, -6, -7, 0], [0, -9, -9, -1, -13, -1, 2, 2, 6, -3, 2, 2, 3, -1, -2, 3, 9, -9, -2, 0], [-3, 9, 9, -1, 17, 2, 1, -14, -5, 3, -2, -7, 3, 0, 4, -4, -3, 5, 0, 3], [-8, 5, 3, 4, 7, 15, -5, -15, 4, 4, 5, 0, 1, -1, 4, -3, 4, 0, 3, -5], [-8, 4, 5, 2, 11, -6, -3, -12, -7, -3, -4, -1, 2, -6, 1, 2, -4, 4, 4, 0], [-7, 13, -6, 2, 1, 4, -3, 6, 0, 16, 8, -7, 6, -2, 8, 0, -2, 3, -6, 3], [-4, -5, 4, 1, 1, -1, 4, 5, -5, -10, -10, 7, 0, -4, -5, -4, 0, 4, 10, 5], [-14, 13, 8, 3, 27, 4, -1, -10, -13, 5, 4, -3, 0, 4, 3, 0, -3, 3, -4, 0], [-11, 32, 6, 20, 20, -2, -10, 8, -13, 19, 19, -5, 0, 7, -3, 7, 0, 10, -9, 13], [-6, 0, -5, -5, -7, 9, 11, 5, 0, -4, 0, -8, 5, -1, 16, 0, 1, -11, -5, -11], [7, 8, -3, 10, -6, -10, -2, 10, -9, 10, 2, 0, -1, 1, -4, -1, -9, 0, 1, 7], [4, -13, 2, -4, -16, -12, 6, -2, 0, -16, -6, -4, -2, -5, -3, 0, 2, -6, 2, -6], [-17, -13, 1, -14, 1, 0, 8, -23, 9, -8, -6, -6, -6, 0, 6, -6, 3, -3, 6, 0], [0, -21, -4, -8, -8, 1, 15, 5, 1, -20, -20, 16, 0, -7, 0, -7, 0, -11, 8, -1], [-4, -10, -6, -11, -11, 12, 5, -5, 8, -2, -2, -3, 0, -3, 11, -3, 0, -1, 3, -8], [8, -14, 10, -3, -3, -4, 5, 7, 4, -10, -10, -3, 0, 1, -1, 1, 0, -3, 6, -4], [-8, -11, -11, -8, 1, 3, 2, -6, 11, 1, 2, 4, -1, 3, -4, -1, 0, 0, -2, 0], [6, -11, 8, -2, -2, 2, 5, 10, 8, -3, -3, -7, 0, 6, 5, 6, 0, -3, -6, -8], [-25, 29, 2, 23, 33, 25, -15, -25, -2, 23, 15, 0, -8, 8, -6, 2, -2, 0, -2, 2], [10, -5, -5, -8, -16, -12, -2, 12, -2, -8, 2, 0, 6, -6, 1, -1, -2, 0, 1, 6], [-2, -9, 1, -2, 32, -3, 5, -7, 2, -8, -5, 4, -2, -3, -4, -2, 0, 0, 5, 0], [10, -18, 7, -6, 1, 10, 6, -11, 5, -10, 3, 2, -3, 0, -4, -2, 10, -5, 0, -10], [7, -10, 8, -9, -11, 15, 9, 4, 4, -7, -8, -6, -4, 0, 2, 0, 7, -4, 0, -7], [6, -20, 9, -10, -9, -11, 10, 3, 7, -6, -16, 4, -2, 0, 4, -1, 6, -7, 0, -6], [3, -27, -17, -4, -13, 1, 8, 1, 5, -7, -2, 10, -3, 1, -10, -3, 1, -1, 2, 0], [22, 3, 0, 1, -18, -11, -5, 11, 5, 1, 5, 0, -4, 4, -4, 4, 5, 0, -4, 0], [-2, 22, -1, 14, -3, -10, -8, 1, 0, 16, 15, -3, 1, 7, 0, 0, -10, 8, -1, 8], [-2, -12, -13, 3, -15, 1, -3, -4, -5, 4, -2, 11, -3, 1, -11, -3, 0, 0, 2, 0], [14, -20, -2, -1, -6, 6, 10, 2, 0, -5, 1, 5, 2, -3, -9, 0, 9, -10, -2, -10], [14, -9, -6, -2, -23, -12, 0, 12, -11, -2, 0, 0, 9, -9, 3, -2, -11, 0, 2, -5], [-8, 17, 8, 7, 7, 4, -14, -2, -4, 13, 13, -14, 0, 3, -2, 3, 0, 7, -5, 4], [3, 0, -9, -4, -4, -5, 5, 12, -2, -2, -2, 7, 0, -6, 4, -6, 0, -3, 7, 2], [8, 2, -3, 6, 6, -7, -14, 6, 1, 3, 3, 6, 0, 7, -9, 7, 0, 11, -9, -1]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_71_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_71_2_c_a();".
// 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_71_2_c_a(:prec:=20)
    chi := MakeCharacter_71_c();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_71_2_c_a();".
// 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_71_2_c_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_71_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;