
// Make newform 430.2.k.c in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_430_k();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_430_k_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_430_2_k_c();".
// 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_430_2_k_c();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [49, -343, 1225, -2366, 2807, -2555, 2941, -1933, 4114, -562, 64, 320, 244, -195, 142, -61, 20, -5, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [17583867751200014208730878519238, -67829163417176049525954548392623, 77507504364461115675787363748007, -73067270560440165132711712914993, 71197329662551101408084686860703, -746995137728539167194688660357, 150701775133032380658785335992274, 8307109551886176773674059082025, 2899821659103702340747870084232, 17027907383853871188365813055521, 10518666291720340272738025775406, -4426187082470481637505744021858, 3645499976489528151410942720373, -1168395143559314996454834057913, 284139643960130607989710669938, -35843877256325117052307842988, 1510071520515909941672237830, 8261364502658507759575735353], [12056296935401428723792157482236, -46401294084923746487136365610331, -4250646775009931368925343356411, -36284745428958022157809577359173, 18744786697196267635897819902749, 16395045859680584967096213168385, 102952242268310583100409704857142, 55742408575848682418842652684433, -6991005292112273724136039954758, 15113497625297682344356290255347, 12960234739470876558296824506528, -1051578616330484024986914514518, 848582514544668192029416461295, 688901743547578181680401469285, -490094206199354446979678522092, 210073979712305778751779526166, -59718176323380335646909224474, 19187343771943262935445173005], [-18524047596025234092567691996483, 71721869030555575033277971049266, -147413294570015359258844066289463, 114213879149847993869049648888412, -161340949059353862625688864844911, 68515445172239843603154925590881, -190736707306636931984833376631594, 131734268227590733580951165193782, -26094145361029603638326659142369, -13235625476134031142781665781469, 3366841332172973243749773407621, 11246471814919514056460113166786, -9378790473174168332646479448111, 5758509693632919460896059255183, -2319840716028495763142523767363, 716177641145509709134784874201, -175182967247075389898796171764, 27957178033677471270740905198], [-78423661321528859789270069643818, 336188022630203182426112607738949, -448600907577458291963662292601622, 124923427011538510752588201090691, -666249132474000628994476374447676, -369470356333477607221277522613187, -1185437341764541411814957375808013, -261832377394000638422510865758006, -39123923125720064201780517023982, -158904160210300384628956663085559, -92070548612627969741142744028541, 21128575981542666552608970787965, -20346401416418003162647810184124, 3642107995543729977249960160601, 49892098047081901416326137287, -476274218870056939976900953005, 161212735523625295729399165829, -104483773210799619977777563744], [-306059521879546130106360392709, -28395832847205799748497345525653, 81784349846569288987511911133736, -107840742664274492059997949707995, 95556566335904653158678397929868, -122547751878740615847873086685946, 35427954933082489247806585661368, -231450385017729527052717512922893, 33596981846359982562016862476595, -9082714108902742180286632478264, -23918782727428511339596200209989, -10302646553215761614051745863392, 8650384040464419823224563111212, -7166781197539513196469536538656, 3205935141372559878359684530427, -1082041151173783912638976842431, 276131525255231419582852454764, -58936975527471553937248787699], [19277444571440424791617807446191, -132321670157894640089545355201704, 311698603869338809292851308762093, -279355274607055104513868983911422, 445922573102264882664160022673313, -206795467594608545429617099805775, 347368492426162631886828584871702, -490185033982385955244379922206296, 93693125532729543451475901787933, 11823908762139982705810763443711, -36036440617833764679912421440505, -29837127705590154299183520713322, 25387154251462293148892670681401, -18064623496271552624397353043637, 7709024393053789462194785158255, -2497138368171227483556285250761, 629706109727415839076472263136, -118977825614981040811364570340], [-6442032498893163259969584732078, -35259716079913527290314450870877, 150142533472681443070647578802676, -245878553792842650853158634753643, 136497650777612629273725430826778, -387029732413469555086869718826505, -72262407672885717100992930241429, -580285125547863334103895896250268, 67904223095073918470459804780726, -44993015754915682876062278213381, -67276055056355791996930496365449, -22641756685391691607827732795079, 18107306336463619987659691772786, -16520040651620016583615652542413, 7581642541689364585902953116211, -2615459332887513797979500052377, 669844906382069506494698753489, -152690932707453742894146986834], [-15555486252869671740769600039850, 105820404329041652983433529321220, -302254926829047947915606633015521, 391106010576700542502087336890360, -342796523413691377465822701644135, 456816567017188668301290477399340, -122676436247982309445064855567041, 763707474148455403657771559545687, -106852476266329053952032803525284, 33401824222056136305353029708314, 76543140219333501771299876314469, 35772926445060434538321682577589, -29273288296889283816770056636009, 23886226892651887554456682504860, -10638575203829720874227261448887, 3582434312317792847663122563643, -911111623423560632848539813515, 194618188899774734205442363961], [10351182495143177771613513587072, 50895843470528714972597402128317, -219045649258105129825746409482804, 430573010441985873668658283548399, -193190396319087705217060197129338, 590298132071168614815819125433595, 132443984512117098473985492462523, 864655347653789415988873195346802, -99824920441110642051157557462220, 71309989910505624391962323699803, 99830949497213036584182742365737, 33728985555676885156801930487801, -26651520821143850767040784593474, 24422801606749950412721697801131, -11219144757013669408936333349875, 3876332880181843542241708105481, -992492396316312004534948522719, 227384392904221447933903954840], [143991611747453448330019677187542, -558278606609108107144162461687043, 1087793285351321354657200723041115, -967385597703768789358774347032873, 1417048942254944471295291916012755, -594946169640344255502604977659565, 1438198635818461899743487833325162, -1297288622982928879614814193447019, 257381391292528377359242728397948, 87653432152870376168017230677993, -62177651484713882755460597388438, -95714903927308258652607469285562, 80799636009474585734369858314017, -52689591432356371211673317076717, 21759964696711748309746134210478, -6860855452003111019526521567708, 1703301596506792837331129631534, -293750066842174157126546711171], [-3067999441046049201953670957730, 86632229492693845603633367980729, -360001754204720750123644779319540, 548310617643556960826835814924415, -354290930453872786753124381821410, 810970197827317784220310526416609, 150059414417902842945370806953237, 1199173451168483793834214840636816, -145010079331265404884698301360986, 96860510019000011800060170244069, 137359775443392984682123152225589, 48186684064339285667878563970591, -38018259215707010189422338061890, 34440589039180348252084640707413, -15782558777989349523499032588007, 5438066438972223751139052039485, -1392676326699171361791455599289, 317458903119789219199379592650], [124365507223275967255427536571870, -448314766247501660737106331932911, 875328666561926178436206505399518, -1033979864134426258436639297475809, 892422284302027869238354764683192, -972204492504082401312236043894179, 850710699738392619204931419736667, -1363221778447573371063951416371038, 188474766758690353083215759475278, 4424387290257177788362315825425, -93315450664806894116621736272381, -86578679388592749703569158463107, 69688099563148825452248399625836, -48783503081587259462772995881095, 20664252601479900969322098739303, -6699766423020931509995947893489, 1664381074643371870907074361097, -320876633742510475112320386724], [53034654010783532624262193236559, -409930748249357179673232483677528, 788498518474879458078227255809998, -991797174555039530816276851000702, 902145341948885493936573908859224, -819804765248360780127832957102949, 839574078224408290315424811089369, -1436508479999731859440673344736185, 221580066713892985870312822563035, 11016177956690545206822001711983, -108428186997791244505615944311362, -84370864898572877981122245675189, 70231800129219314014372648649230, -50472709121552583647652837267223, 21582334451774857692192930626050, -7035330695727409125878865794832, 1762726056909689098901598852353, -341285815474505234943293408635], [-57946464141621063614695872926115, 315687895330615493055348233622612, -780232990486799023743504621798910, 899822348941520261819974633810758, -897381322334790219795017585654304, 921084190242551097938464218504253, -599020507346221052152382480300129, 1529169769129742091398887317868469, -225695110148913246653456010720723, 27561515743307972874858595607109, 132219843870594512212004224164226, 82863405719278017760955905187437, -67959638902794032540138633383882, 51362093133677284668380175487751, -22344371406967536814265811284686, 7385652786232611994822710765576, -1862251760336244374909635829137, 378041787673984369236075346867], [5340035016979890537201912621874, -227267065126484614180432173421283, 865513200565947090878047044491956, -958750662736814619043989847073085, 1071445266343649324858640589771474, -1036565931048746653602660070013699, 459851119609095062903791867685837, -2058263284353829001771991717530216, 320716166583234455841232694899946, -66753649144254176965483509656771, -205519367288708980466588058010027, -96392933413544763051502579811885, 80954024456910263555228179067442, -65579275544602507878366351081067, 29160030386420938926280155152677, -9785357204772982693997093914935, 2496021816962572043604210714783, -524915821019972922327311105074], [92665672461228866350578792111883, -731849203894432109963928228173312, 1869853493525693860159969461290599, -2567940696703379473660318910890362, 2011219366173803431269982851144843, -3101200106456280575179427609352811, 643887666076013602700500967973536, -4784303363863051073102246034695614, 631504407637124819575196204338613, -234514392037315494743265048630745, -479098658200769038624312355450855, -225765844703569570659538560973612, 182104586077912799600538701567003, -148772704871284184067016852409349, 66271586147188328128071225063537, -22342870873748765971652173170559, 5672275341152411416580199699298, -1220022906319047043127921620918]];
    Rf_basisdens := [1, 1, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 7372425117899221201663214583154, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308, 14744850235798442403326429166308];
    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_430_k();"
function MakeCharacter_430_k()
    N := 430;
    order := 7;
    char_gens := [87, 261];
    v := [7, 5];
    // 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_430_k_Hecke();"
function MakeCharacter_430_k_Hecke(Kf)
    N := 430;
    order := 7;
    char_gens := [87, 261];
    char_values := [[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]];
    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, -1, 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, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, -1, 0, -1, -1, 0, 1, -1, 0, 1, -1, 0, 1, 1], [1, -1, 1, -1, 0, 0, 0, 1, -1, -1, -1, 0, 0, 0, -1, 1, 1, 0], [0, 1, 0, 2, 0, 1, 0, -1, 0, 1, 0, 1, -2, -1, 0, 0, -1, -1], [-1, 1, -1, 1, -1, -1, 2, -1, -1, 0, 1, 0, -1, 0, -1, 0, -1, 0], [-1, 0, 1, 1, 0, 2, -1, 0, 1, -1, 1, 0, 0, -1, 0, -1, 0, -1], [1, 2, 0, 1, 1, 0, 0, 1, 2, 2, 0, 1, 0, 0, 0, 0, 0, 0], [0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, -1, 1, 1, -1, 0, 1, 1], [0, 0, -1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 2, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 1, 2, 0, 0, -2, 0, 0, 0, 0, 0, -2, -2], [0, 1, -1, 1, 0, 0, 1, -2, 1, 1, 1, 1, -2, -2, 1, -2, -1, -1], [-1, 0, -1, 1, 2, 1, 1, -1, -1, 1, -1, -1, -1, 0, 1, -1, 0, -1], [-2, -2, 1, 0, -2, 1, 0, -1, 0, -1, 2, 2, -1, -1, 2, 0, 0, -1], [-2, 0, 1, 1, 1, -2, -1, -1, -1, 0, -1, 0, -2, 0, -2, 0, 2, 0], [1, 0, -1, -1, -1, 3, 1, 1, 1, 0, 0, 0, 1, 0, 3, 0, -2, 0], [5, -4, -2, -5, -1, 1, -2, 0, 0, -1, -2, 0, 2, 0, 4, 6, 0, -1], [-4, -2, -2, 5, -2, -1, -1, -2, 1, 2, 4, 0, -2, -1, 0, -5, 0, -1], [-6, 1, 0, 5, 1, 2, -1, -5, 1, 0, 6, 1, -5, -2, 1, -5, 0, -2], [4, -1, 2, -4, 0, -1, 0, 2, 2, -3, 0, -1, 4, 1, 0, 4, 1, -2], [-2, 0, 0, 0, -2, 0, -4, 3, 2, -2, -3, 0, 1, -1, 1, 1, -1, -1], [4, -1, -2, -4, -1, 1, -2, 0, 0, -1, 0, 0, 0, 1, 3, 3, 1, -1], [1, 0, 2, -1, -1, 0, 2, 0, 0, -1, -1, 0, 1, 1, 2, 0, 1, 0], [6, -1, 2, -4, 2, -1, 0, 6, -1, -1, -1, 1, 0, 1, 0, 1, 0, 0], [4, -4, 0, -1, -4, 1, 3, 4, -3, 0, -4, -2, 4, 1, -2, 1, 0, 1], [-5, 0, -2, 5, -2, 1, 2, -5, -2, 0, 7, 0, -5, 0, 1, 0, -2, 0], [3, 2, 1, -3, 2, -3, 1, 0, 0, 2, -5, 0, 5, 3, -2, 0, 3, 3], [2, 4, 1, 3, 2, 2, 0, 2, 4, 4, 3, 4, 0, -2, 3, -3, -3, 0], [1, -6, -6, -2, -6, 4, 0, 2, 0, 0, -6, 3, 1, 0, 4, 0, -3, -3], [0, -6, -4, 0, 0, 0, -1, 2, -1, -1, 0, -2, 1, 2, -1, 2, 2, 1], [0, 5, 4, -3, 0, 0, 0, 1, 1, 0, -3, 0, 2, -1, 1, 1, 0, -1], [1, 1, -3, 3, -4, -2, 4, 5, -3, 4, 0, 1, -3, -1, 0, 1, 2, 2], [1, 1, -2, 6, -2, -3, 3, -6, -3, 0, -2, -5, 1, 0, -3, 0, 1, 5], [-1, 1, 1, -3, -6, 2, 0, -1, 1, 1, -9, 2, 0, -2, 2, 9, -2, 0], [3, -9, -1, -3, -5, 2, -1, 0, 0, -5, 0, 0, 0, 2, -3, 0, 2, -2], [-4, 1, 0, 0, 1, -4, 3, 5, -3, 0, 4, -4, 5, 2, -4, 0, 0, 2], [2, 5, 1, -3, 3, 1, 0, 2, 5, 5, 1, 4, 0, -1, 0, -1, 0, 0], [2, -5, -4, 1, -6, 1, 6, -9, -4, -1, 0, -2, -1, 2, 0, 2, -1, -3], [-6, 0, 0, 0, 5, -7, -2, -9, -5, -4, 9, -7, -7, 4, -4, -7, 5, 5], [14, 0, 0, 0, -2, -1, -3, 6, 2, 0, -6, -1, 1, -1, 1, 1, 3, 3], [-1, 0, 2, 4, 7, 0, 0, -1, 0, 0, 5, -2, 0, 0, 1, -5, -1, 0], [-3, 1, -5, 5, 1, 1, -4, -5, 4, 5, 3, 3, -5, 2, 3, -5, 0, 2], [-1, -1, 1, 1, 3, 5, 1, 0, 0, 3, 0, 0, 0, -1, 1, -9, -1, -5], [-4, 11, 0, 4, 3, -2, 0, 0, 0, 3, 8, 0, -8, -2, -2, -3, -2, 2], [1, 6, 4, 6, 4, -5, 2, -6, -1, 0, 2, -5, 1, 0, -5, 0, 2, 5], [0, 0, -2, -1, 0, -5, 3, -9, -3, 2, 0, -3, -9, 4, -3, 1, 0, 4], [5, -3, 3, -5, 2, -3, -2, 5, 3, -6, 0, -3, 5, 3, 0, 5, 3, -4], [0, 3, -2, 1, 0, 0, 1, 7, 4, 1, 1, 0, 4, -1, -1, 7, 0, 1], [0, -1, -1, 4, 0, 0, -1, 0, 1, -1, 4, 5, -2, -2, 1, 0, -5, -1], [6, 0, 0, -6, -3, 0, 0, 0, 0, -3, -1, 0, 1, 3, -3, 6, 3, 0], [-7, 0, 0, 4, 0, 2, -5, 0, 5, 0, 7, 2, 0, -2, 2, -4, 0, -2], [-11, -8, -9, 6, -9, -1, 1, -6, -5, 0, -1, -3, -11, 0, -1, 0, -1, 3], [7, 0, 0, 0, -4, 3, -3, 9, 4, 1, -9, 3, -1, 1, -1, -1, 1, 1], [8, 0, 0, 0, -2, 1, 1, 0, 2, 4, 0, 1, -6, 1, -1, -6, 3, 3], [-4, 0, -2, 2, -7, 6, 7, -10, -2, 2, 0, 4, -2, -4, 0, -4, -6, -3], [0, -2, 2, -1, 4, 2, 0, 0, -2, -2, -3, 3, 0, -2, -1, 3, 1, 0], [-11, -3, 0, 8, 3, -2, -3, -10, 0, -3, 0, -4, -8, 4, 0, -11, 2, 0], [5, -1, 2, 4, -1, -2, 4, -3, -4, -2, -5, -2, -3, 4, -2, -4, 0, 4], [0, 1, 3, -4, 4, -3, 0, 0, 1, 1, 5, -2, 0, 3, -5, -5, 5, 0], [2, 1, -4, -2, 4, -2, -4, 0, 0, 4, -6, 0, 6, 0, 2, -8, 0, 2], [-8, -2, -3, 3, -1, 1, 1, 3, -3, 1, 0, -1, -3, 1, 0, -8, -1, 2], [-7, 0, 0, 0, -6, -2, -7, -1, 6, -3, 1, -2, 6, -2, 2, 6, -1, -1], [-1, -4, -4, 5, -4, 5, 0, -5, 0, 0, -10, 6, -1, 0, 5, 0, -3, -6], [0, 8, 6, 5, 0, 0, 4, -2, -2, 4, 5, 2, 1, -7, 2, -2, -2, -2], [13, 5, 3, -3, 3, 0, 2, 3, 1, 0, -2, 2, 13, 0, 0, 0, 4, -2], [0, 5, 6, 2, -2, 0, 2, 6, 6, -1, 0, 5, -2, -5, 0, 0, 0, 2], [6, 0, 0, 0, 2, -4, 2, 8, -2, 0, -8, -4, 7, 6, -6, 7, 6, 6], [5, 7, 1, -5, 1, 0, 1, 0, 0, 1, -11, 0, 11, 0, -1, 6, 0, 0], [-2, 0, 3, -5, 12, -5, -12, 6, 3, -3, 0, -1, 5, 1, 0, -2, 5, -2], [8, 2, 2, 8, 1, 0, 0, 8, 2, 2, 2, 1, 0, 0, -3, -2, 3, 0], [-12, -2, -7, 3, -2, 0, 5, -4, -5, 7, 12, 6, -4, -3, 6, -3, 0, -3], [-2, 8, 2, 6, 3, 1, 0, -2, 8, 8, 5, -1, 0, -1, 4, -5, -4, 0], [0, 5, 2, -4, 0, 0, 3, 14, 0, 3, -4, 2, 12, -2, -1, 14, -2, 1], [5, 0, 2, 0, -2, 2, 2, 7, 2, -2, 0, -3, 0, 3, 0, 5, -2, 0], [-7, 0, 3, 9, 0, -10, 6, -4, -6, -3, 7, -6, -4, 1, -6, -9, 0, 1], [0, 7, 4, -7, 0, 0, 4, 7, -1, 4, -7, 7, 9, -2, 3, 7, -7, -3], [2, 8, 7, 7, 7, 4, 1, -7, 1, 0, 3, 0, 2, 0, 4, 0, -2, 0], [0, 0, -2, 6, 0, 0, -1, -6, 3, -1, 6, 3, 5, -3, 8, -6, -3, -8], [-1, -6, -2, 1, -1, -6, -2, 0, 0, -1, 10, 0, -10, 2, -3, -3, 2, 6], [0, 0, 9, -23, 11, -6, 0, 0, 0, 0, 1, -5, 0, 6, -6, -1, 6, 0], [-1, 0, 0, -2, 2, 3, 0, -1, 0, 0, 1, -1, 0, -3, 2, -1, -2, 0], [-4, 0, 0, 0, 2, 7, -3, 4, -2, -4, -4, 7, -7, -6, 6, -7, -5, -5], [14, 6, 6, -14, 4, 1, 6, 0, 0, 4, -13, 0, 13, 1, 3, 11, 1, -1], [-8, -5, 1, 8, 5, -2, 0, -8, -5, -5, 12, -3, 0, 2, 1, -12, -1, 0], [6, -3, 3, -6, 5, -5, -5, -6, 3, -6, 0, 0, 6, 0, 0, 6, 5, 0], [4, 1, -3, 11, 1, -4, 4, -2, -4, 3, -4, -2, -2, 1, -2, -11, 0, 1], [9, -10, -7, 9, -7, 4, -3, -9, 1, 0, -7, 2, 9, 0, 4, 0, 2, -2], [0, -5, 2, 0, 0, 0, -3, -4, -4, -3, 0, -4, 5, -7, 5, -4, 4, -5], [10, -5, -3, -5, -3, 3, -2, 5, -2, 0, -8, 1, 10, 0, 3, 0, 2, -1], [6, 0, 0, 0, 3, 2, -1, 8, -3, 8, -8, 2, 1, -5, 5, 1, -2, -2], [-13, 0, 0, 0, -1, -1, -3, -2, 1, -4, 2, -1, 3, -2, 2, 3, -4, -4], [0, 2, -4, 4, 0, 0, -2, 0, 8, -2, 4, -4, 0, 12, -2, 0, 4, 2], [1, 13, 9, -1, 2, 0, 9, 0, 0, 2, 12, 0, -12, -2, -5, -3, -2, 0], [2, -3, -2, 7, -2, -1, -1, -7, 4, 0, 1, -3, 2, 0, -1, 0, 3, 3], [1, -4, -5, -9, 9, -2, -9, 16, -5, 1, 0, -4, 9, 4, 0, 1, 2, 4], [2, 0, 0, 0, 2, -8, -3, 2, -2, -3, -2, -8, 0, 1, -1, 0, -1, -1], [14, 12, 13, -11, 4, 0, -4, 1, 13, -1, 0, 2, 11, -2, 0, 14, 0, 2], [-25, 0, 0, 0, 2, 1, 6, -10, -2, 4, 10, 1, -18, 5, -5, -18, 2, 2], [-5, -2, 1, 5, -2, 6, 1, 0, 0, -2, -3, 0, 3, -5, 3, -9, -5, -6], [0, -13, -5, 12, 0, 0, -2, -12, -6, -2, 12, -6, -11, 2, -4, -12, 6, 4], [0, -6, 6, -3, 0, 0, -4, 5, -8, -4, -3, -1, -9, 1, -9, 5, 1, 9], [-21, -2, 0, 25, -2, 0, -1, -23, 1, 0, 21, 0, -23, 3, 0, -25, 0, 3], [3, -8, -8, 0, -8, 7, 0, 0, -3, 0, -4, 6, 3, 0, 7, 0, -6, -6], [0, -11, -11, 4, 0, 0, 3, -16, -3, 3, 4, 2, -4, 7, 2, -16, -2, -2], [5, 13, 1, -5, 2, 1, 1, 0, 0, 2, 2, 0, -2, 2, -7, 2, 2, -1], [2, 6, -2, -19, 6, 0, 4, 13, -4, 2, -2, -3, 13, 2, -3, 19, 0, 2], [-1, 1, 4, -4, 2, 3, 0, -1, 1, 1, -1, 11, 0, -3, -1, 1, 1, 0], [6, 4, 0, -6, 4, -4, 0, 0, 0, 4, -7, 0, 7, -1, -11, 15, -1, 4], [-5, 0, 0, 0, 2, -4, -1, -11, -2, -2, 11, -4, -4, 3, -3, -4, 7, 7], [-7, -13, -1, 1, 0, -5, 0, -7, -1, -12, 0, -1, -1, 1, 0, -7, 5, 0], [-4, 4, 1, 10, -8, 8, 0, -4, 4, 4, 7, 3, 0, -8, 5, -7, -5, 0], [12, 4, 10, -17, 4, 3, -2, 3, 2, -10, -12, 2, 3, -2, 2, 17, 0, -2], [-13, -4, -8, 9, -8, -4, 4, -9, 1, 0, 5, 0, -13, 0, -4, 0, -1, 0], [0, 11, 3, -1, 0, 0, -3, 11, 11, -3, -1, 2, -6, -4, -4, 11, -2, 4], [-14, 2, -8, 11, 2, 3, 3, -3, -3, 8, 14, 0, -3, 5, 0, -11, 0, 5], [0, 5, 1, 9, 0, 0, -1, -8, 5, -1, 9, 2, -3, -3, 8, -8, -2, -8], [0, -11, -3, 3, 0, 0, -5, 4, -3, -5, 3, -2, 11, 5, -1, 4, 2, 1], [8, -1, -3, 2, 2, 4, -2, 10, -3, 2, 0, -5, -2, 5, 0, 8, -4, 4], [0, -12, -3, 6, 0, 0, -5, -9, -4, -5, 6, -3, -5, -2, 1, -9, 3, -1], [-3, 9, 8, 0, 8, -10, 1, 0, 4, 0, 17, -10, -3, 0, -10, 0, 8, 10], [-1, 10, -1, 3, 10, -8, 2, 9, -2, 1, 1, -1, 9, 0, -1, -3, 0, 0], [3, 1, -1, 3, 7, 1, 0, 3, 1, 1, -4, -3, 0, -1, 0, 4, 0, 0], [7, -8, 0, 2, 5, 3, -5, -11, 0, -8, 0, 4, -2, -4, 0, 7, -3, -3], [1, -6, 2, -1, -4, -1, 2, 0, 0, -4, 5, 0, -5, 4, -5, 0, 4, 1], [-4, -4, -5, 0, 6, 5, -6, -2, -5, 1, 0, -2, 0, 2, 0, -4, -5, 4], [2, 14, 13, -2, 2, 5, 13, 0, 0, 2, 8, 0, -8, -9, -1, 4, -9, -5], [0, 2, -6, 5, 0, 0, 10, -7, -2, 10, 5, 1, -4, 2, 3, -7, -1, -3], [-9, 0, -9, 2, 0, -6, 8, -18, -8, 9, 9, -1, -18, 7, -1, -2, 0, 7], [0, 0, 4, 0, 0, 0, -1, 10, -3, -1, 0, 0, -10, -5, 3, 10, 0, -3], [10, 4, 6, -11, 8, -3, -8, -9, 6, -2, 0, 0, 11, 0, 0, 10, 3, 0], [0, 19, 6, 14, 0, 0, 9, 1, 4, 9, 14, 4, 3, 1, -6, 1, -4, 6], [1, -8, -2, -27, 10, -9, 0, 1, -8, -8, 4, -2, 0, 9, 1, -4, -1, 0], [-8, -3, -7, 9, -7, -1, 4, -9, 3, 0, -1, 1, -8, 0, -1, 0, 0, -1], [-8, -8, -7, 1, -2, -2, 2, 3, -7, -1, 0, -8, -1, 8, 0, -8, 2, 4], [9, -7, -11, -3, 1, -8, -1, 16, -11, 4, 0, -1, 3, 1, 0, 9, 8, 8], [-4, 0, 0, 0, -1, -9, 4, -3, 1, -12, 3, -9, 2, 11, -11, 2, 5, 5], [-10, -10, -7, 2, -2, -3, 2, 6, -7, -3, 0, -7, -2, 7, 0, -10, 3, 4], [3, 12, 0, 11, 5, 0, 0, 3, 12, 12, 13, 7, 0, 0, -1, -13, 1, 0], [-3, 7, 13, -7, 2, -3, -2, 0, 13, -6, 0, 4, 7, -4, 0, -3, 3, -5], [28, 0, 0, 0, -10, 3, -2, 10, 10, -5, -10, 3, 20, -2, 2, 20, 0, 0], [-12, -8, -4, 8, -8, -7, 1, -15, -1, 4, 12, -7, -15, 10, -7, -8, 0, 10], [4, 0, 0, 0, 0, -6, -1, 7, 0, 7, -7, -6, 10, 7, -7, 10, 12, 12], [-9, 14, 13, 4, 13, -8, 1, -4, 3, 0, 8, -5, -9, 0, -8, 0, 5, 5], [0, 13, 2, 11, 0, 0, 5, -16, 6, 5, 11, -1, -7, 5, -1, -16, 1, 1], [-6, -7, -4, 6, 2, 4, -4, 0, 0, 2, 18, 0, -18, -3, 4, -16, -3, -4], [2, 0, 0, 0, -1, 12, -6, 17, 1, 7, -17, 12, 19, -8, 8, 19, -3, -3], [18, -10, -4, -18, 3, 0, -4, 0, 0, 3, -3, 0, 3, -1, 5, 16, -1, 0], [2, 0, 0, 0, -2, -9, 2, 8, 2, -1, -8, -9, 6, 8, -8, 6, 5, 5], [10, 12, -1, -10, 11, -9, -1, 0, 0, 11, -16, 0, 16, 6, -1, 3, 6, 9], [-17, -2, -2, -1, -2, -1, 0, 1, -15, 0, 12, 0, -17, 0, -1, 0, 2, 0], [15, -3, 6, -15, -2, 5, 6, 0, 0, -2, -23, 0, 23, -4, 7, 26, -4, -5], [-8, 2, 5, 17, -5, 8, 0, -8, 2, 2, 8, 8, 0, -8, 4, -8, -4, 0], [-3, 0, -7, 4, -7, -3, 7, -4, -11, 0, 4, -8, -3, 0, -3, 0, 0, 8], [9, 9, 4, -12, 9, -18, 0, -12, 0, -4, -9, -7, -12, 5, -7, 12, 0, 5], [16, 17, 13, -23, 4, 4, -4, 17, 13, 4, 0, 6, 23, -6, 0, 16, -4, -3], [6, -14, -3, 1, -3, 2, -11, -1, 7, 0, -5, -10, 6, 0, 2, 0, 6, 10], [-5, 0, 0, 8, 0, -1, 0, -8, -4, 0, -6, -1, -5, 0, -1, 0, 3, 1], [2, 3, 4, -8, -6, -3, 0, 2, 3, 3, 6, -1, 0, 3, 5, -6, -5, 0], [-4, -8, 1, 3, 3, 11, -3, 10, 1, -9, 0, -1, -3, 1, 0, -4, -11, -9], [1, 0, 0, 0, 7, -15, 4, 0, -7, 8, 0, -15, 7, 1, -1, 7, 5, 5], [-13, 0, 0, 0, 6, -10, 0, 7, -6, -7, -7, -10, -11, 2, -2, -11, -1, -1], [-8, 4, 2, 8, -5, -2, 2, 0, 0, -5, 12, 0, -12, -3, -9, -18, -3, 2], [-20, -1, -5, 20, 0, -2, -5, 0, 0, 0, -2, 0, 2, 2, 8, 5, 2, 2], [0, -7, -3, -3, 0, 0, -6, 7, 2, -6, -3, 6, -12, -3, 6, 7, -6, -6], [17, 0, 0, 0, -2, 2, -10, 14, 2, 1, -14, 2, 10, -3, 3, 10, 5, 5], [0, -8, -4, 2, 0, 0, 2, -7, -6, 2, 2, -8, -15, 9, -3, -7, 8, 3], [-10, -2, -4, 3, -2, 2, 2, -18, -4, 2, 0, 5, -3, -5, 0, -10, -2, -4]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_430_k_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_430_2_k_c();".
// 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_430_2_k_c(:prec:=18)
    chi := MakeCharacter_430_k();
    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_430_2_k_c();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_430_2_k_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_430_k();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![49, -343, 1225, -2366, 2807, -2555, 2941, -1933, 4114, -562, 64, 320, 244, -195, 142, -61, 20, -5, 1]>],Snew);
    return Vf;
end function;