
// Make newform 23.12.a.b in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_23_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_23_12_a_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_23_12_a_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [-51108001263703556, -9620508603737857, 1690347715497299, 180101325169073, -940430954112, -226650696110, 169360278, 97176782, -2148, -16849, -1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [98488024857119322316168098956459999336647172, -180830329900370592867477286422511616854962419, -4120546478260048495345432588113881411937132, 640919435981245003384273438128784465049067, 2692286230709070788888513187414833844961, -613191554210277309930563529875680878959, 3205340572133967378869356561373699645, 169216489207204603771860390768731241, -1433434772137487801385006251875713, -13121612000864272584035285400050, 129074576637811839733888066507], [-4484070621436540251431535111821470189207833092, 179399003987648849744397858546250190552785139, 5551872390981791618424860464375307714114412, -640919435981245003384273438128784465049067, -2692286230709070788888513187414833844961, 613191554210277309930563529875680878959, -3205340572133967378869356561373699645, -169216489207204603771860390768731241, 1433434772137487801385006251875713, 13121612000864272584035285400050, -129074576637811839733888066507], [451374674795760420587836911364871570965306468, -137175822443429224396996717660692604392633403, -19365466716135252092082847915869048380977740, -86579087846146383406686185838682576367277, 22245119671444753558066076158199192293241, 193587474484946966659487717029527146345, -10327594452672714440014681718516321387, -61642054525062936435346730664212319, 2043589384806127114260680896186023, 5027498422355652240774002333918, -135606053320340745332499725773], [-5185057621407586992569574899215746285709724, 128018706687328317217255196217180171546924933, 20734886744125037049628952177878275227045124, 412836859133463786700212664641777269897891, -27773277973259354082434087536943967904647, -433479789719824543506769786836648203847, 13901820311041915403271768372144283765, 115913265271482097155518942171430673, -2823916738660170849948944700419929, -8764228595756861676326305185010, 188710586569044925210430201091], [-39796852232562847106520792739041055286606516, -171378819959498756080578173988645961445791561, 45062410802251361161751495754072649571728380, 1173809174086103794225726313238526529822577, -83366779089387255202806281812607641689997, -1028602916760634134267663684701699416189, 48352611556516469192080625751246849799, 275299217646703353238480928268702795, -10406105587939458192602999182617555, -21137713564595160274011553223158, 711566823872929811729481669905], [-24897612300442080450118868202992133383823015764, -1293007844443955234403232803592596621526228177, 184806717180195889861251389034041684920621884, 6651924935539710913390072363538908767037401, -298968397141270590980784741747964273914037, -7070976231027183746829918842872194241477, 206097427824169111833549413519878745215, 2040350386903538266577134684877776323, -50378899650956503502481793884736299, -161579316736824404963327095423750, 3705451515511924452774692035961], [-2315942376927602939418159113616275587196902588, 1171967637886621339981305980395386483069937021, 143283874266260775411008106055356693547515948, 2795256836870203022070270527565180795757347, -234513929778385651890793968253337438877839, -4503468443793543405826784349685530999239, 153474661262614071219670005277077477965, 1401231932681567541557153457807656241, -36546727879735270091382625075613553, -113672762530432513177747107704330, 2655920889192512685094757775427], [2791557572983500784303018578369157852381051708, 427781502611133781593149233268505683381171299, 38605268385290708079567230629650356209819652, 4974739156416225898536043891154413471908493, -121496206438769928918112970087238286707281, -7114863720477006282073477432506921144041, 134289551737684718394514003897950446355, 2196380133957419472751176313550922399, -38965904302706108318175708688219887, -178273831762430363908310899605670, 3084435143288600863780032378093], [54923022773016969606920881763643230433835985908, -4277399869931822877896716563156945505378248871, -1004943499700179816961334552936856268048650428, -6669295943671523669269320793951995295407297, 1325520175019507317318655854192032084611549, 8585142001001652446338432370215698774989, -633315596138936059849008507171865778615, -2465678588070849567711651873171757371, 122125557491838848258388453605448963, 193094428525478204392741008419030, -7852597816495134375708518238817]];
    Rf_basisdens := [1, 1, 1431325912721743123079427876261426302177280, 1431325912721743123079427876261426302177280, 143132591272174312307942787626142630217728, 159036212524638124786603097362380700241920, 286265182544348624615885575252285260435456, 1431325912721743123079427876261426302177280, 715662956360871561539713938130713151088640, 715662956360871561539713938130713151088640, 1431325912721743123079427876261426302177280];
    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_23_a();"
function MakeCharacter_23_a()
    N := 23;
    order := 1;
    char_gens := [5];
    v := [1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

function MakeCharacter_23_a_Hecke(Kf)
    return MakeCharacter_23_a();
end function;


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


function qexpCoeffs()
    // To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
    weight := 12;
    raw_aps := [[3, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0], [93, 19, -2, 1, 0, -1, 0, 0, 0, 0, 0], [14516, -115, -23, 4, -1, 1, 0, 2, 2, 0, 0], [-69881, -2996, -139, -71, -18, -25, 21, -19, 22, -24, -23], [312972, -9560, 300, -128, 1, -47, -52, -40, 76, 42, 30], [2640510, -7206, 640, 124, -215, 7, 55, 193, -270, 96, -205], [1942863, 23975, 2026, -307, -245, 444, -599, 269, 494, -150, 343], [-6436343, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [20613394, -41225, -385, 4710, 5247, -1449, 3429, -1955, -1282, -834, 1271], [22928914, -223049, 88816, -7004, 5743, 8549, -2234, 7807, -9270, -3279, -7201], [51983469, 1399787, -330570, -20883, 822, -1725, 4740, 5628, 28770, -2892, 9024], [-157651616, 747200, 47407, 9256, 1530, 40414, -54772, 5157, -16280, 35331, -4961], [58872573, 1257641, 446824, 227207, -19515, 85158, -26227, -36041, 8328, 32616, -20319], [-494889138, 10175877, 1502806, 204968, -26961, -79555, 88116, -20099, 34766, -54231, -68371], [-310013529, 22758803, 260784, -346077, 87817, -330644, 103679, -124817, 53270, -35574, -21611], [1372987276, 7432768, -1324888, -493608, -382686, -144190, 40034, -29366, 358152, -233268, 7686], [2173575793, -6405991, 1568720, 1042789, 221521, -376160, 260617, -428511, 185644, -14334, 71031], [4248130849, 83510400, 4581449, -93997, 102260, -106471, -148471, -362617, 106428, -466722, -821], [4142537082, -37328956, 4015399, -603896, 71851, 990805, 444553, 519166, 4470, -53463, 513062], [5790198948, 110217541, 17095324, -918280, 117128, -635002, 353411, 412242, -249274, -31755, -514404], [1995090658, -100482524, 1874378, 992342, 1328184, 1529124, 210406, 672066, -1863574, 1133892, 162698], [3667918393, -239644068, -31146339, -1509841, 1012926, 2006715, 1154913, -926077, -635240, -620538, -707669], [3447508390, -557670030, 14381580, 8529436, 676086, -1280436, 504122, -940628, 167370, -1281102, -64788], [-16153878, -52596048, 3661898, 2968324, -2712531, -4198091, 4840439, 928709, 869012, -1499412, 1010855], [18237089106, -888214141, 61269431, 1647892, -732690, -3896208, 3634331, -1267291, 1675178, 1650366, -2907859], [59454855642, 513086015, -62110935, 9219478, 3117891, 3392163, 5073756, -4443794, -3449422, 1678392, 1392932], [-8427448849, 233637783, -36259108, -5377247, 907523, -9215198, -8825679, -2466701, 1642104, -2901324, 3664081], [42442078121, 591807551, -4600782, -6671639, -8023181, 5658954, -7565081, 7345115, 2779208, -161478, 4765285], [84110403700, -900162212, 183511476, 37427014, 1796895, 10907003, -5851111, 86287, -3109302, -4732128, -4407411], [69704158198, 1728124101, 209322480, -13478068, 6088459, 12189737, -8654168, 10770867, -6306038, -9295473, 9924231], [-50245304100, -1858534158, -50495452, 48216638, -3058440, -29532510, -637491, -4338759, -21643932, 4628760, -12596679], [-5504256556, -730149776, 313313896, 89462258, 25575414, -9023632, 3500680, -6426566, 9191356, -16089726, 10420138], [78459671404, 3910567758, -657763714, 34008114, -1238934, -23523420, 17511043, -13360691, 36448384, -8227410, -11770595], [-247108926957, 3097764541, 358696126, -3382461, -15689429, -13396508, 24955481, -12867315, -23048772, -17774430, -20442121], [43443876250, 5059122946, -767677527, 229956616, -11178641, -2530383, -7551873, 11304476, -8059194, -32856495, 9627740], [-292578523025, -9534715797, -529939152, -49859353, -62476513, 74348342, -50922369, 26036395, -40779354, 14708658, 4715821], [158137161006, -832024783, -1881618803, 38552924, 3396474, 5401714, -33339318, 19003576, -30696004, -4737210, -40184968], [-654488086424, 2309535390, 491932456, -38723232, 27732932, -57816108, 57972136, -14124590, 88823624, -41667378, 67605942], [149931319700, 4582233423, 1568011151, 302199906, 18350176, 55115840, 22955977, 40807469, -43853698, 33374424, 35734861], [-890468110306, 5062613190, -1366974606, -191248776, 37354804, 101359980, -9118351, 1977877, -174476212, 8805816, -82080179], [1155582312415, -17615066745, 1562616044, 192529111, 57623892, 3607737, -50506410, -25345558, -76778876, 98398092, 12719626], [-587162380716, 20297301221, -80712415, 349735188, -140540389, -237305177, -85533488, -152476578, 92723148, 72834228, -96964724], [296326253750, 1175974226, 1064070583, -139094346, 172483368, 22276298, 77967688, -177102259, 24144540, -17688789, -131578893], [-185723348614, 10826606157, 4301027229, 478022574, 30991449, -167063111, -168143, 10227597, 104814086, -20897178, 62241419], [711761673516, -8643613947, -275571479, -170409636, 35067039, 526590499, -167114944, -16660690, -59611588, 263907948, 157992980], [-1426527995612, -23317380988, 5450543826, -903960232, -124430772, -189136592, 124977918, -17441776, -58666340, -258284610, 30259972], [-861260540752, 63494495049, 278976117, 250315700, -308283156, 469595740, 19419281, 279889715, -178548136, -157139718, -41067265], [-2623674972837, 36329890534, 9903247555, -313025951, 562557612, 41704177, -50236161, -35274249, -150090486, 143762388, -59376057], [2534874188017, -32037755135, -13757428864, -1832743975, -143912933, 63802210, -114969407, 257806525, -73180800, -180527862, 83688311], [2272029073342, -578537237, 3542992978, 1053759322, -242557842, 240939706, -176055695, 440267982, -270100930, -9954429, 39769184], [1170963968314, 81870047278, -1611141615, 839849968, 500155373, 111239023, 133261545, -67487502, 186899902, 147966561, -38543506], [5991578816986, 32167107678, -2265532606, -2264173552, 761321, -682699555, 507398869, 37810817, 572930236, -478698738, 166635743], [-4424191701315, -90170365670, 3220668315, -1450282493, -583198070, -68983025, -345468793, 113962721, -86151572, -331474434, 584024433], [2284471841552, -112911309647, 8033060438, -1630698064, -938347432, 1079522854, -237652589, 442196852, -497181386, 282949731, -247623430], [4399879411928, 61146396540, -2358221644, -139796336, -328952942, 143069640, 659279330, 306254430, 1042075254, -268085088, -206929390], [4079065585750, 121464273630, -4946583256, 2919571538, -562505159, 615520935, -718498778, -721130630, 354728532, -275595366, 52503632], [2301017120848, 68732338616, 3809236728, -2202446768, 305727568, -1207572348, 329974132, 851490140, -531324556, -230969928, -234883316], [8932468632634, -114161031405, -13346867157, 1912622766, 517512185, -2277637399, 1323282267, -1188606901, -130503490, -487052358, 305727729], [1731540869728, -280949494, 5909574750, -847562834, -478970815, 2623303143, -360390017, 2693947737, -1136997348, 603131160, 3947323], [-2804491105309, 135991895466, 10732347381, 750582393, -153980648, 873249199, 616953365, -463393277, -1754526700, 1183443990, -1292050433], [3810428489831, -268222233509, 20247513744, -2768831545, 1745890967, -2352205770, 1434048343, 238387363, 770355470, -32874078, -133472331], [983967199322, -241339158498, -17209276190, 6841773170, 1881832174, 2672489652, -639799856, -2596324702, 667118504, 521179362, -638121950], [-23374210528322, 149550729967, -23280306814, 8012302656, -1721311065, 1638059489, 1031679332, -1677073481, 2320613466, -424309089, 1127617827], [20263367957016, -60146897026, 2956355982, -481801534, 272299008, 1774393900, 1325316478, 308062112, -894569490, 1431767454, 568980492], [5378188962344, 113129711615, 14621620453, 3142454830, 1688571440, -2076000728, -1584579493, 1252364981, -280917390, 917944122, 1644801817], [-34335802778616, -279063686130, -19628997272, -9118846962, -2132776628, -4866194894, 1915193547, -1867181241, -696469816, 411453960, -824425169], [14165985504138, 7765828566, -12743866344, -15966773976, 130263118, 3320938052, -1373954158, 416557384, -815931610, 1166084718, 1510025488], [5951914168446, 259886199969, -1513874835, -14100331622, -888064944, 3221823394, -670146283, 1914681565, -2265522696, -1318752420, -2721687243], [25136969330962, 118631169892, 29299400388, -1098082346, 1426846877, -896068325, -6889895930, 2266087908, -1135083456, 2520936216, 48619102], [19277991876186, 1103520601887, -87047774774, -6554470110, -2219193688, 4859959216, -219698711, 986924026, -596536726, -1237532421, -2003186064], [-51248857833922, 26789293870, 151113392784, -9011181902, 3367767620, 342034748, 751273724, 750186060, -3296405158, 3707400528, -5480385660], [-27371062341840, 344455402991, -103863668447, 4109023444, 7913516263, -5546702741, -1009402202, -96802814, -2736228396, 692427750, 4109312108], [10617922526461, 822132394615, 180895399646, 19210450481, 1016997122, 6634796761, 1066518822, -729964198, -5737116424, 3570675408, 2798501214], [-29482848889009, -375898197915, -144272213516, 2793112609, -6167880361, -1193574656, 4870729205, -528566563, 6633360330, -4963404690, -2621459609], [-60940682816428, 493417168466, 248802768598, -25652773340, 1824464356, 12027452572, 3326700290, 673609006, -3156651244, -1327015740, -3349084706], [92207237804337, 343718617445, 171115795260, 11891362837, 2953893017, 5393290782, -5556022295, 2024485677, -4944713358, 6143347182, 2202918043], [20912206673280, -676677524994, 40970842914, -27944262604, -3174303361, -20043529085, 4592573460, 3872954488, 6353858364, -6600505530, 1586323282], [-74589044925282, -567943090874, 102294922298, 9544572288, -10078085679, 21990977411, -4665802349, 4785638059, -5744705198, 1976779026, -3479504495], [32410027139550, -690364773627, -56760796496, 16108922614, -5005415372, -5365272128, 6520772607, -2555814656, -4718377862, -5855682165, -3003215250], [-4383758836265, 1220653741679, -175095389134, -70026632279, 6874776535, 8495440232, 4806603107, 2424120291, 1514659746, -3500864946, 2925493997], [-42363591551759, -2531379386209, -53298840190, 43408941925, 14839178228, -788435991, -8681077580, -11493842300, -568947094, 13213108944, -10008063204], [27953131354878, 3649949903328, 20071738052, 11247075038, 6403774926, -16045726998, 6356142836, -11052561318, 10009779226, 13554207318, -2075556206], [105867517295042, 533619199696, -156891976600, -14125429444, 8865931117, 1732396999, 8829380105, -2162906411, -21118019938, 3657553038, -106835189], [50418934267698, -1819972296570, 194200140345, -17507585908, -7616982251, -23530204477, 9829606591, -4098052404, -2345883554, 4821703365, -10090291488], [111024627535678, 1209737214545, -51304096963, -22816232760, -13125281596, -1369408268, -5989103610, 20061821880, -14078435720, -9241263330, 1717784252], [39821350756060, 1419416115116, -302832517928, -1811203074, -14100666856, -41192633750, 8760117900, -9819776762, 7613489160, -9269489274, -4220172734], [151427418648606, -763829116226, -257563287888, -1952232152, 4162903273, -13404318567, 11638707533, -11598463861, -8130228680, -12036757812, -8618604795], [-109840219150206, 1579638631300, -180655714642, 87320385486, -7015968153, 18539433945, 6391598446, 10465482898, -2719026500, -20249480706, 1118650540], [76238940903616, -1736044822883, 245789404173, 26270804716, 8931780160, -2020208736, 17829878309, -6690284749, 196649488, 3721604790, -13173676641], [-68233855334897, -1286381388465, -522152702290, 21972082557, -7254065797, -9913983428, -5439251091, 17844703173, -7289683346, -3010883610, -1228528153], [12241897493070, 4910574817717, -124342753153, 54184250442, 12019102347, 17545155483, -10701247138, 11940557848, -13555138386, -5693471304, -1765816386], [-45922066695138, 5163426531962, 271387762339, -90156396648, 22063625103, -35279867255, 6062620023, -13572637390, -17694748922, -32811213, 7492987702], [-168845495806114, 4686684249494, -438265572004, 18797076512, 20881240296, -22140021216, 35333301147, -9957243147, 240714228, -5410707006, -5074181655], [69451940228614, 242111152228, 78282712864, -16630574740, 18017966600, -45308460108, -73710767, -65866993779, 35979921540, -992214024, -3828976403], [27087446947474, -4400532929616, 868513083238, -23978037290, -13512973104, -11130371376, -13756869874, -20820321798, 39853090846, 21050055444, 18741579826], [112074820963914, 6206885568041, 747775484287, 27431330502, -20136572177, 3040778651, -53084444559, 2038682127, -12102098470, -8205327336, 17916031453], [294065356526232, 1252557739094, -219650800618, -11132596734, -4569071304, -28593347712, 11159312390, 31747359856, 1991689098, -13321465002, -1250364132], [11618414796577, 4837942801074, 169124906429, -24047244069, -22948983632, 20041052035, -28420131279, 5047042709, 9399265962, 846776424, -1862227627], [-231474810167170, -2234368267464, 329340114914, 168134339082, 9969076575, -15376352283, 7375493686, 1351858318, 12976127260, 29852804730, 47589162640], [428691323055072, -7878431188232, -987407127800, -26047551386, -3904055910, -70552774424, 3850156433, 21379695939, 34777162480, -8695996482, 50066909203], [89809192894565, -7322345950977, -1277809567554, -268106164199, -27341199591, 6633896322, -46620988313, -29746996805, -21159514718, -13352638602, -6239669447], [451100916967693, 1326898458105, -544781778608, -522567247201, -9112908955, -7571291270, 33500433757, -13523586801, -8201554092, 5815428720, -2013652055], [-54588357851422, 11867708618176, 479007934368, 357093091428, 49422348549, -23911167585, 38914301889, 21315850269, -62408567994, 27970254222, -37741477437], [212303625668681, 13946322678284, -1365192998219, 87230348103, 48289378032, 128455913521, -55535577825, 34720087601, 4404331732, 28931406666, 55485883717], [500422979949804, 17389951756670, 53516955419, -196807745536, 21568200352, -55040696784, 22180592828, -6620861429, -11339401108, -73450673631, 9903290317], [-1175224676696264, -3684169661787, 479951208767, -78722759378, -27276341286, 5023947112, -42708622630, 10754716004, 11895653588, -22149591414, -4515073108], [-657939155537324, -16064939545167, -32619722297, -56032696946, -22947075894, -114567283742, 24103528067, -17525615223, 52643713498, -83760056502, -50454334175], [-1038294031056148, 2899853111268, -294464814420, 256033819948, -12210767848, 49952480308, -4150691684, -117924649032, 92423542632, 36520030404, 30580022704], [-408507543859276, 5414670071513, -1208861120634, -112444472168, 12230071444, -88459005310, 40258575117, -111604485994, 4075373958, 36817477611, -55463874844], [262273184129328, -14606574495466, 1082637916168, 184750659016, -88852196988, -72923024960, 72128412528, 65139832866, 39927340860, -9107465322, -33612346698], [339649909218215, -112307118017, -366541018768, -348534157737, 90349145014, -13162964407, -6933956644, 6683673776, 8153016994, -39776530440, 26588939004], [-150089400040846, -1079883622232, -241980859988, -210567282732, -117614839630, 1052559188, -65884688756, 75533418160, -77495303458, 44710673568, 32474391012], [1241164952844769, -5145275190537, -175339035492, 43853059847, 8471140461, 118217250260, 26234881175, 26586375755, -78373303138, -8752824738, -36090832159], [-685331203506496, 9438898779306, -714922788988, 153069238708, -20908318212, -131539035378, 13217939394, -105868766860, 152344955206, 4705088358, 7393438312], [-368051521485552, 10046925369516, -2172112874228, 392823096098, -54586976964, -34842213088, 178819634852, -69998200766, 62621956782, -11200291902, -30395555922], [1323660862637235, -1475260790888, -552155608067, -486563756331, 152750825172, -135132993791, -56486310217, 24243892319, 36255390662, 35115507780, 33802878911], [457659576193454, 4874701935484, -1751467149321, -525993027340, -14220621923, 112182757923, 27104186283, 23495606460, -82861756642, -11153661279, 91151109784], [-1230036594341200, 14445357099185, 3405400191079, 60911524940, 63852666473, -106676106377, 91697312821, -54552705447, 90913221954, 14055643614, 22675886407], [1578428838695997, 34169730373166, -833169771139, -367510051977, 597788196, -7433707461, 27742270093, -12037774847, -16151101046, -118419193920, 15446138137], [67424310029525, 20736869842277, -752304383880, -507620164719, -69401559563, -116797045244, 210532670177, 42564637561, 110564650184, -104694072246, 68579550535], [1504739017164608, 17230564994901, 1872018298654, -862308473816, 39987511678, -134443516260, -46473166015, 119149755478, 2621499710, 75644160939, -711872552], [-967288160531097, 2146141743783, -4136952498124, 224421987295, 53910754411, 261635404880, 8091522595, -81864306357, -14773042580, -18078031626, -95344493091], [1205696947717876, 30336601890212, 1977088447914, -17979992582, -166619154742, 235208205680, -33950125369, 48736178031, -7300009828, 27480544656, 46146349923], [-415540352871644, -31922797559054, -2003600126654, 405242228832, 55826355892, 6348964200, -47663921038, -125802695970, 15260258316, -250522236, 31357623278], [-449698875397377, -15458004924561, 124573158428, 368152274991, -26777041560, -28523096241, -33684552558, 181004175394, 110427415742, -98471094384, -34228623742], [241107271530221, -10358106385903, 4184269861092, -1050677409483, -234797425696, -70990857221, 6605530408, 22229912120, 92542184944, -56305772784, -91007575912], [1024250806157284, -9626210613260, 1300350924746, -1138570343692, -62352340254, 181274114690, -146213942496, -72053505474, 72677436420, 171787700382, 68544990654], [-715942390886996, -41991278496379, -2930241260861, -424922529488, -96123392253, -80631598623, 127394654056, -98474585628, 31828870754, -341169637986, 55073523878], [-431616237594631, -58599495006991, -2010237182284, 524354171669, 248109496432, 96790552201, -232128664186, 393165143746, -111699198442, 111950032836, 148826856154], [2227742424010026, 5618316986547, -1799840410639, -403412274712, 13900850254, 91169286582, 76945901358, 221988469834, -236874682544, -27587022096, -121973664474], [-225677346813558, 31119966069139, 3446761156151, 1386877857658, -174363488361, -254948424275, 238914391864, -141477179752, -24206835372, -215970712470, -210097127958], [1016912236734216, 34078201130188, -1253207483746, 599880611148, -5827562392, -177342480266, -34656404776, -158364989898, -178716961054, 106086565386, 170048851434], [973571759215283, -20021195310913, 4380415396516, 712550747527, 118654827700, 18376556655, -328105108468, -92450955284, -135879741838, 157022782656, 70892894116], [-203938703296046, -84273573290428, 2713265968777, 287073763690, 134011986610, -144720911708, 762122480, 53811717277, -302230806952, 97282571919, -27735492833], [-1206208296952614, -5613503266620, -2571282960112, 925527003232, 23319515809, -270044376863, -106661568497, 90077802855, 66140063200, -125974576662, 133686890637], [20482882511533, -22253182374051, -636915089212, -623774292599, 122008101945, -47815766914, -254917897535, 49310324945, -298942871274, 82883564658, 256505639463], [2734347053026973, 9384903449697, 4147458490062, 127389578763, -260454456315, -177255840876, -76772924919, -327335267307, 242059699170, -127892472018, -24581255397], [802971651374269, 6409081653329, 2654428461240, 260552548917, 319255235623, -807967459780, 186631201685, -187863696191, 11469079514, -97631882166, -331450915805], [-730250561159122, -60074075976899, -2979603887519, 283213062644, 472412506132, 226845663358, -178603249533, -249079353319, -47671999638, 236582141718, 330908076029], [1278882356597380, 84229578866283, 4795688487857, 2430907085314, -309926552564, 364833242186, -139984914346, 642975468132, -438581204784, -51322867182, 15893172128], [-81815614761066, -31358130517529, -4402269948767, -1094488652896, 181799623634, -539881833744, -334274955819, -232886683803, 375698968210, 735637664280, -9204481495], [1050009134231926, -9037754350394, 5597760978767, -315380841924, -444505385799, 764859454887, -406378730793, 434702735758, -402308710426, 192757940499, -378483940282], [612771780491143, -59799647691515, 5080987195092, 150493458137, -111864276221, -473416231244, 175281148489, -521748034503, 695671254826, -193967947650, 157023351675], [-136818024651292, -10123178748417, 375096076363, 680317337010, -364627316254, -574955710234, 71648491683, 249367885291, 94125655026, 325761927000, 160439417551], [-2361024545105938, -21647419386405, -367725270637, -2432623690226, -354866858995, -232144300621, 629430047250, 21910823650, 195614514840, -20111297706, -312891198728], [-3361126469701026, 15426272560363, -2167691815641, 2216858374112, -727764862194, 425868012908, -408929681705, -469519918507, 214529820594, 65077005786, 298829300757], [1995578032967366, 43681544050567, -6306244054246, 796787419554, 376158420450, 881179525766, -44019019003, 89884302646, 238684591182, 100598566071, 218381426520], [-2426923636193978, 42020177207241, 8116873754469, 1000055490960, 681928850176, -136462718160, -177109690822, -443476286636, 524699078624, -271438948530, 465157665328], [-2127811762031966, 141663190956398, 16091774196389, -1105231159828, -14673866151, 57292911931, 519538232167, -373976265192, -7139065486, -240897316983, 250038257564], [1315155497933052, -154931212657505, 225661465823, 1551742227634, -614634719058, 685192164698, -308732068177, 805442964419, -200243232790, 34365596772, -183288291241], [4442365614400, -2360426666466, -17399571884886, 100803202182, 238560262173, 1370921256467, -341519792041, 667299288249, -886274162348, 248627260344, -398007584621], [-88805869772948, 169394674421250, 13688891647766, 468688398832, 349284195556, 294641656732, -946384945286, 793227864042, -691882201232, 824622475248, 269189228754], [1512364683742946, -77467010052192, -17972770227179, -506291162488, 570964799117, 523648123591, 168186751149, -512700216552, 232932542182, 236738735247, -65695234384], [5886286344018989, -112362752918275, 18454242360744, 1793700474307, 307192258549, -788149144654, -334541540321, 117718266761, -73024430056, 473680778928, 241997873251], [112045820595146, -115628930618496, -24835556728276, -754172405166, -23777809748, 190383310990, 351738331430, 467101304012, -1022646132284, 35648022954, -366113238504], [3405373258241240, 323927878709269, -27414534589381, -38249962812, -636045990715, -151333225611, -177436150850, 179558492562, 537761746200, -289039829934, -111006511088], [6239167611847264, -7758925105410, 6115716908203, -993646967296, -543989753334, 455993616946, 275025712928, -188003836769, -1089326273076, 72157709469, -453448487475], [1626699638134600, 22691697805380, 34075476538994, 2237441756298, -165804604859, 2320920879155, 22758259685, 701590828493, -912340037360, -21815078358, 169430552955], [5713928848880553, 177332851989433, 2886739169824, -494163062119, 392553056736, -1455682106597, -734838533024, -8020906616, 493087911892, 173223689544, 635880196216], [-3241586428197058, -41190827073732, 9130612947692, -6312709656236, -438553525444, 721840058536, 638420840273, 323925422689, 479350823980, 168646184892, -97656635215], [4069159029429660, 188393888293422, 4593313295980, -6276725013206, -959810401564, 374053372004, 58797663654, 1184610451610, -57032383678, -28012468908, -288637030566], [9594641709974354, -340411668202455, 8700343830490, 1238385428544, 266435217857, -1314894665713, -158695878264, -442379618495, -698915246322, 242680054485, -683010531635], [5857811035386037, -40129392209983, -12293338867040, 3549469465731, -949130296963, -1043125044306, -120196577925, 446357541649, -723938618484, 1047559878804, -608069865245], [-11072669307283558, -190636055958632, 19082583696696, 3581757884688, -387128793247, -603662230379, -723061632617, -114165869029, -729920505164, 1372454485326, 704200412585], [1940476870577722, 181248824735030, 15558705735890, 677215898026, 900175647120, 819556158178, 179306509204, 1213464320126, -1518864806892, 961340456982, -837649688022], [-3561924208248744, -158547452824040, -28205700862922, -1085796634576, -1323099608738, -1610147610382, -730022535448, -949542394798, 1468180226836, 173227679898, 235946610306], [12597356277427580, -124947579577961, 9773827584113, -1599016580222, 123451747554, 938088813650, -1751702332571, -676442005729, 80595676206, 262298171070, -813365249169]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_23_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_23_12_a_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_23_12_a_b(:prec:=11)
    chi := MakeCharacter_23_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 12));
    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_23_12_a_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_23_12_a_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_23_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,12,sign)));
    Vf := Kernel([<2,R![60024577238663168, 5191695182200832, -3199980978790400, 148783481621696, 4226023192464, -205410732416, -2171413128, 91689644, 453021, -16384, -32, 1]>],Snew);
    return Vf;
end function;