
// Make newform 3.23.b.a in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_3_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_3_b_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_3_23_b_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_3_23_b_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 := [9831214131200, 0, 3861674040, 0, 126474, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [0, 12, 0, 0, 0, 0], [4539979294720, 227790065720, 909321664, 8098250, 12256, 65], [2269989647360, 309897772600, 454660832, 101935546, 6128, 1369], [67224621806080, 227790065720, 2396219584, 8098250, 12256, 65], [164396642835200, -5695866816440, 16324832672, -202456250, 189968, -1625]];
    Rf_basisdens := [1, 1, 61954080, 5162840, 10325680, 15488520];
    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_3_b();"
function MakeCharacter_3_b()
    N := 3;
    order := 2;
    char_gens := [2];
    v := [1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_3_b_Hecke();"
function MakeCharacter_3_b_Hecke(Kf)
    N := 3;
    order := 2;
    char_gens := [2];
    char_values := [[-1, 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 := 23;
    raw_aps := [[0, 1, 0, 0, 0, 0], [14445, -8, 1, 0, 0, 0], [0, 5130, -6, 1, 0, 0], [-574510510, -126, -3906, 0, 301, -21], [0, -28653498, 912192, 4124, 16731, -16731], [337522082810, -418104, -5813544, 0, -192476, -69684], [0, -8764344152, -91974624, 679840, -1569564, 1569564], [16747614778106, 12436830, 227197554, 0, -3319509, 2072805], [0, 229342967284, 1650549264, 21904400, 31820994, -31820994], [0, 1845671669086, -24377637474, 102204507, -424364472, 424364472], [19018277066858882, 374943690, 2540689110, 0, 618062065, 62490615], [113963812346776970, 30780634104, 450865290984, 0, 10357546236, 5130105684], [0, 141748686524828, -1552244904612, -2313832314, -27966569616, 27966569616], [45545555028294890, 139953853566, 2316820862226, 0, 2623893979, 23325642261], [0, -223395939914968, -602051441712, 32361621880, -7283601972, 7283601972], [0, -1942448441217582, -23302946997054, -21681642315, -418447086624, 418447086624], [0, -1633393408632738, 55429198222152, -378936008816, 949206824451, -949206824451], [20274875064690915482, -9243547773480, -115478118105720, 0, -6430168575380, -1540591295580], [12616928514362543450, 3833494278534, -110260641720726, 0, 29025368838271, 638915713089], [0, -98794912910399396, 250365650754144, -1208646032312, 4341317402862, -4341317402862], [-9529746884922331150, -65328327784224, -1290658485813984, 0, 33642170457264, -10888054630704], [64089565981887956066, -3010854737430, 1131550243681974, 0, -196955192662079, -501809122905], [0, 34003207646456242, -2675712056966352, -6367120771380, -48462763957047, 48462763957047], [0, -399911605035813772, -1072084412469972, 22064794832606, -16780279347756, 16780279347756], [260871948084498324290, 542468629927944, 4596139597346904, 0, 740834039130916, 90411438321324], [0, 3449724879452525690, -11542701870622950, -37829015690255, -210172785085080, 210172785085080], [4805819733113187994130, 1106301824346546, 23974873708209486, 0, -922751661516731, 184383637391091], [0, -1934296491468039450, 29977261088615352, -299639536207080, 503203997703087, -503203997703087], [-5929554810965516095174, -6804630619993800, -111164381678732376, 0, -374354775749604, -1134105103332300], [0, 5681626521444979176, 72867780380340120, 620049176104540, 1367644204231560, -1367644204231560], [-69735601027419611965630, 5463237218642874, 92221556256374694, 0, -194600435387799, 910539536440479], [0, 30714267979283512426, -27885787581262584, -4164864896166808, -944196017111847, 944196017111847], [0, -149026184655938451956, -231189564555711396, -2166265695524250, -4360484977301016, 4360484977301016], [44258024044849362948266, 114030430974819990, 1996449910600276314, 0, -15990454614434969, 19005071829136665], [0, 429016752678879391970, 2015582721547966290, -2254429532038755, 35751002577780960, -35751002577780960], [-273340477836521551238158, -67846885940559870, -470535617791851330, 0, -110040969091802195, -11307814323426645], [-1147538632919780401536550, -300277085283773496, -5585410420530392616, 0, 96798722077916836, -50046180880628916], [-838645813114627901657830, 453698118673398126, 8556679983337862946, 0, -165840778685760141, 75616353112233021], [0, 1064321568577657691148, -4593058799404679664, -22327717485816320, -84411162577135314, 84411162577135314], [0, -37930581219271114986, 10234684437310299174, 30243802491563855, 186002629504637184, -186002629504637184], [0, 591327372131994342706, -14258405683054643784, 4464428656465552, -254136055555640187, 254136055555640187], [3078554891738346962577002, -686558265038419320, -9794322206286568680, 0, -274719257392292220, -114426377506403220], [0, -1481585082480922208192, -22220751191264244432, 115949660139075096, -384375950543389176, 384375950543389176], [5216571490070025455518850, -2110552053141134304, -26987043042225194784, 0, -1364804085021173936, -351758675523522384], [0, -5570155492260908825398, 34871600218669311498, -159266736741234295, 605642853539676888, -605642853539676888], [4207979814058359311503826, 856152314864981730, 45235807265747987934, 0, -5161100336333048739, 142692052477496955], [6574950125222333313358202, 822495297508138710, -219379167068323110, 0, 2321272354256216935, 137082549584689785], [72200794638443192034563330, -4981091930286216534, -31764606704632018314, 0, -8542265355578598431, -830181988381036089], [0, 5726156526914413783146, -62086705302242886960, 94577475673059020, -1098557865146509515, 1098557865146509515], [43007687307927131382017546, 4748586871604462280, 40097349248296559064, 0, 6507627546407413156, 791431145267410380], [0, 30276286212446571138412, -157839570289572354492, -1275716752315651430, -2955247692919040412, 2955247692919040412], [0, -16202203224006413716472, -282177194210213789712, -528631800350296504, -5095517589505635156, 5095517589505635156], [46966606141220933591110562, 3290783578112511360, 127923437094138378240, 0, -12179507354266087040, 548463929685418560], [0, 12818325838388945329070, 925864003078298454480, -4198429476875579020, 16083454039590088935, -16083454039590088935], [0, -45432754337437224293920, -755351140438374152688, 3663762663821977800, -13095867222418612248, 13095867222418612248], [0, 7361789317028342389436, 144359511247374415680, 12944731717192099960, 3964783956259410990, -3964783956259410990], [0, -111736469447544730072026, -976378740362645705226, -6660151503338254377, -18148922310404914848, 18148922310404914848], [-381923603647841437731954718, -236089919483804169270, -3608043201167698351530, 0, -54464798371506300495, -39348319913967361545], [222256549098030271811616170, 123659681773980468024, 1194815574651117029544, 0, 144363186930315128476, 20609946962330078004], [0, -106015536989953036927884, 2116693222514032572636, -10955075809257066058, 36624335136758753148, -36624335136758753148], [78111443087386542418095050, -182097204374423677914, -3825007066694711542134, 0, 131675610075719485039, -30349534062403946319], [0, 367425907540485620082970, -3716532040170470940678, -5838753231159346015, -66992224277811196728, 66992224277811196728], [-2157285146512633596039669190, 242609810045817718134, 5443977563910282022074, 0, -233413454968886675529, 40434968340969619689], [0, 1032035395557197806064132, 7342367537742902233632, -30251160282039842376, 127872510286618985346, -127872510286618985346], [1850180592310442786740810130, -41308857068444379144, -234062308555419061464, 0, -75736440430886765156, -6884809511407396524], [0, 681242298752126233861358, -3990521931882698697954, -2342302244078733125, -71510281166913769584, 71510281166913769584], [5339582944152352758060239402, -399361066885287776970, -9876336584222873740230, 0, 536719800466901798455, -66560177814214629495], [4481795471506359080280231650, -1173930710840632376856, -19231492209197786313096, 0, -55669939691014439084, -195655118473438729476], [0, -227542420346727566257538, -7769792466014384372592, 155417861596604410100, -122094380293477819857, 122094380293477819857], [-680500325049937150937641894, -762772875215189065560, -25902328437136474883976, 0, 2198241197258331742996, -127128812535864844260], [0, 2491340442576137149185808, 6492101422189497730416, -73965745256627657640, 108005481261602353296, -108005481261602353296], [0, -150942590570789765703988, -34728486827100437497728, -61316113461410596936, -626721134069087519274, 626721134069087519274], [-944621037307636163368590430, 1960541089326462361194, 20947633756454264294454, 0, 1954675177608906954241, 326756848221077060199], [1741614129161745379952378090, -2029290465856165416504, -19601761012281793155624, 0, -2369957791997938408796, -338215077642694236084], [5545691732544315688484765066, -1238129411152704342930, -1957102984765860506526, 0, -3113064533518757534829, -206354901858784057155], [0, -4889349490892658077762208, -25525215526418796458832, -229598721993430932200, -480407283185346108072, 480407283185346108072], [0, -2282019399825943725620982, 11713373613241473908058, -265144913343872697679, 180759002378182816464, -180759002378182816464], [-13593721646413568310170800390, -2217759523156306950696, -70588260190866279281016, 0, 5604266911932416128236, -369626587192717825116], [0, 5438099509903269773526280, -31751690034332145972720, -250276526213959632040, -593809806993141138660, 593809806993141138660], [-37896160782359010643528804654, -13835968381155724788960, -231669697367451153530016, 0, 178370724698178952336, -2305994730192620798160], [0, -23512876232406965187869206, 45381386249567559836064, 311168947599762031668, 843721427413680929037, -843721427413680929037], [-54020514285116573236669797238, 14021001377635904038440, 305653644140214046170360, 0, -11995047974380385366060, 2336833562939317339740], [0, -12725421642844395182861784, -133587882436668716799504, -2189858209447416238968, -2620125565952735968452, 2620125565952735968452], [10123105920218408978988664610, 23682088980882067813416, 356775104216706221257656, 0, 6321063132999151494324, 3947014830147011302236], [22683233056243949227137213746, -6656546869328662768350, -9320659340553315576546, 0, -16936964746931843982659, -1109424478221443794725], [0, 36954287520696058805140590, 108263010254660510572032, 758096464094929461260, 2014492661414822988207, -2014492661414822988207], [0, -73553033020133118370301360, 216876241235796756603240, 1151532195526060900180, 3996168471588448607220, -3996168471588448607220], [-90464747548146995108328670990, 12190275203826242186784, 118915041742071612553824, 0, 14042701942505403982096, 2031712533971040364464], [0, 5356460588195551871947942, -759423948025896786803418, 171318171169766208879, -13542786410694253384824, 13542786410694253384824], [139380857394575492236064992610, -40756427457169688002854, -570512541496448728867194, 0, -18126874909396567418951, -6792737909528281333809], [0, -78284960716440607217255662, -2922409860280654659744, 644766710702313628580, 16896257213093341281, -16896257213093341281], [0, -34158609438321093381681904, 827089979635501997121696, -1444924188926943477008, 14614650616106077433208, -14614650616106077433208], [240592690988894143375440603410, -77425913171624694282126, -1490469285190470449217906, 0, 33339566499454257419301, -12904318861937449047021], [0, 55474451789816371569611718, 944092790369390791973928, 2958444389511851424016, 17175776012615391080679, -17175776012615391080679], [101261237656665573597814081466, 93710207108660316764310, 1516951947107298819651354, 0, 7480806339506632181191, 15618367851443386127385], [0, 80968689840175621301563108, -1291356882080461455733824, -4752391884274460463800, -23569129167609075330654, 23569129167609075330654], [0, -260907252449148477016736498, -1373214300266719069166658, -4170720033940031988661, -24968546794113558233904, 24968546794113558233904], [0, -18153034569698247859177396, 2821878283422500101066524, -5422040180937307853242, 49809750756015647391912, -49809750756015647391912], [570157890145957962861587259050, 166421745978619975538526, 2351000083252063312057266, 0, 70449280509711602264139, 27736957663103329256421], [-792062667438414453249814204198, 12785112122339499098040, 1065069248403983597073960, 0, -141997341060831990906660, 2130852020389916516340], [291284727004718376841229174810, 30094693452551205761454, 968809779255384411627234, 0, -77871925841032941489389, 5015782242091867626909], [0, 38929597890309719172197110, 127952135017767166016982, 42116052714866108395495, 6797293773338639578392, -6797293773338639578392], [0, -922315343375827694261477534, 3078235160915296885303200, 3269124794198074314980, 55318748387151523771305, -55318748387151523771305], [0, 366522411687475189227971764, 2547217527058702360846404, -23505682470299770010262, 42967561289944709656872, -42967561289944709656872], [668482854454362652479377508362, -513100349160116896163610, -7638473489464083716199990, 0, -152199832756310758865585, -85516724860019482693935], [-1890352643267890034489650442110, -248498474104249860823416, -1906062899111191619908776, 0, -372596389326606565635804, -41416412350708310137236], [0, 1110538960460186566779489014, -8031176379930063473559816, -1995473233105341950120, -143627664630869562951081, 143627664630869562951081], [0, -674791912174310036683583400, -3124995973589545222312008, 3504819730036721189580, -55427983128737944556688, 55427983128737944556688], [0, 906647437651291960591994580, 2092138094926261275911760, -60899186181225806389520, 30834696032837614956690, -30834696032837614956690], [1975603937212743697417801880402, -265777964668363277095200, -543174855275995842405600, 0, -647742981532787573752400, -44296327444727212849200], [1605484615234949481331824204290, 321688879482047850386874, 654978542000852100643494, 0, 784417130449990900967401, 53614813247007975064479], [-2339463626640556440059310606070, 837911533150471445663256, 14697435043997278696260936, 0, -122040470803792433645556, 139651922191745240943876], [0, 8567799284421559476002188, 7031304179814647227976916, 72807693518104320180770, 133359827516487020518956, -133359827516487020518956], [4777520034481291141774899904106, -422779773929166191756970, -3001043302100218498758246, 0, -674214377230980782865209, -70463295654861031959495], [-3395545238178323757579041009998, -1198985093481328563312270, -18956080673416253408102130, 0, -171167369656537107850395, -199830848913554760552045], [0, 1227570486505075613492906768, 11209072962873280826012088, -84707639548126259299844, 191086198671152201253804, -191086198671152201253804], [7970965809482292223979880533210, -1169839720915443224852274, -10673472975528332412591294, 0, -1470642617732620222491101, -194973286819240537475379], [0, -581428356737977494218831268, 25392868022535587471669328, 195355518336375117541440, 474375020224175681730678, -474375020224175681730678], [0, -2318236940889895738977217722, -9036089659444332732481914, -174495107984044712312225, -180054648345510732256344, 180054648345510732256344], [0, 490161492062149605328643202, 25225115514559816716044952, -112871773081166609699296, 438355087072728876033021, -438355087072728876033021], [214927199829504382114288615082, 2508917379887378017672920, 41494224664978428067391880, 0, 53510833301867593415020, 418152896647896336278820], [1305771208721717328161949674690, -1960340331895729598938104, -50807167504571171729792424, 0, 3022471439940390846804004, -326723388649288266489684], [0, 857515505265039638729340826, -30011634680079783634557030, 267423530932618963662705, -507269526687215533081800, 507269526687215533081800], [0, -742593403269841174193661418, 2950709610982344028861488, -109342501471207740071500, 40975975038483885507723, -40975975038483885507723], [-13347967094641725381105903804358, 2717576464063977263675070, 32148382882755898375542930, 0, 2190759697496176003173595, 452929410677329543945845], [0, 2191319334578518045405996110, -46859293402638770739513330, -134270138356488509322765, -851159182728173246347320, 851159182728173246347320], [-11947299391102767783734093541814, 3742194872875168731105720, 75292968352594409902782504, 0, -2153842300779155175170084, 623699145479194788517620], [0, -2650316493036488095527801416, -27727004742153291961702656, -400454021088846474534992, -538030872655113764444868, 538030872655113764444868], [-15378100391547249687689072902030, -1303718988067911699282126, 21846515012133905326434894, 0, -7262527468877627830189499, -217286498011318616547021], [3667501524396642789259170786650, -2686663531919279594108664, -69120569013659838630618984, 0, 4057140580278640899245764, -447777255319879932351444], [2058203403608729453897570094746, -1288973152787789004932250, -47074350976083381377491446, 0, 4265244182714482993658991, -214828858797964834155375], [0, -957845122653352361077937620, -10318682323144351366346448, 1125418182431998898289360, -63681664795577821010898, 63681664795577821010898], [-17617247741111180584747363686238, 60215337639551295211770, 16977959351041627935232230, 0, -2662395065063739946950455, 10035889606591882535295], [39988307861529219463667850189290, 8664531795399815674842024, 152163080217576683867975544, 0, -1292369493485514881212524, 1444088632566635945807004], [0, -14578575890582801047737701388, 116306734773868651627486932, -144803873566681907854286, 2061391277365510003220736, -2061391277365510003220736], [1558881541066262158078840257026, -8251356201268506875153280, -175204043317301841305031936, 0, 6280239993804454453190656, -1375226033544751145858880], [0, 2137113258322217875641516394, -115098347630640238521522486, -110115711584598126247895, -2067125748216925487125176, 2067125748216925487125176], [-30741268359629984119606036489990, 7598275357140134650014174, 162202365445145847943447794, 0, -5927407137690600629424149, 1266379226190022441669029], [0, 8648059502507516328557718302, -122981666019603265390082562, -1355337533307831965290485, -2341315914633040306818312, 2341315914633040306818312], [0, 10238396228717229599154749532, -163189669491948520766819268, 2423624594207313129687414, -2654427177262582892655264, 2654427177262582892655264], [-57565376292026120191661138324758, -15366606895969368929790210, -249803418356610112031956590, 0, -1051116096035450577424485, -2561101149328228154965035], [0, 25688304253657481267595744114, -30775053641117703951473166, 2020665881508684794112653, -333054613429742771192808, 333054613429742771192808], [33051327812869033712477123182130, -4936381466966771950066734, -209971982700083918527951314, 0, 21283159708439619893362069, -822730244494461991677789], [0, -2270020230625406492866763714, -170557454749021155494468520, 185002429173124368151000, -3025847145963971594385045, 3025847145963971594385045], [63915523195870201251974146849946, 39100177310842548545203080, 642462926152119613750736664, 0, 1534449282542699222663556, 6516696218473758090867180], [0, -58290676088091568696042275812, 305127803116350763144642368, 850842495088378727011896, 5539872465837161348334174, -5539872465837161348334174], [180405341313703110122225472651050, 9495475022666863536535656, 121504234821581445680018616, 0, 6125613703811046654818164, 1582579170444477256089276], [0, -9011588408013527628819053980, -292472480734445846105759148, -3929017346547038848023470, -5643689014530858557033928, 5643689014530858557033928], [33997411265707419919764337558346, -14148277119267936026719410, -102603426908702564532359166, 0, -22200198624293839318827389, -2358046186544656004453235], [0, 57062560871993510123454997296, 173241766283772485277713520, -2525249779627186082529000, 2823040492964453013973920, -2823040492964453013973920], [-47464621428128449977602737065670, 40984241131218847380944904, 495762105787820160717144984, 0, 31218096622082327049767236, 6830706855203141230157484], [0, 77566386991424783247608593576, 498786558567435245882359416, 4726564034711918096898892, 9413320406709049186852728, -9413320406709049186852728], [-188910464828863504330862057571910, 7664367769586881662257406, 134692013753739067387103826, 0, -1158758487881839947135621, 1277394628264480277042901], [0, -89654410659361758574864631516, 325787551142359322976851904, -755911125977060120436280, 5736644364044588611682754, -5736644364044588611682754], [-81359217455240431471217166523990, 55390578047093833929343134, 917900867116314123973301874, 0, 879238944763851363736171, 9231763007848972321557189], [0, -116124718069212859430149042888, -642474666457231525557505008, -2496378290107769361098696, -11740231003533538245073164, 11740231003533538245073164], [-249697209135050716096998490050574, 84470460336761621816391570, 1580782743878911111726434414, 0, -28823623044369569131095819, 14078410056126936969398595], [0, -199127803365799602507748918464, 112716138477702172563291336, -1915626437186205491644828, 1807542497403302493096828, -1807542497403302493096828], [-110420644186584928738597325018830, -128087082453730859201541096, -1483087904635792134389210616, 0, -108616133821064808717190164, -21347847075621809866923516], [0, -1324214902265198807393664842, 686952468384938238704972118, -12989797597492817238285529, 10875244335713952415629624, -10875244335713952415629624], [0, 45838093822584865365625092562, 995471671841510231238761448, -801010748027747439542040, 17690457274166852617884093, -17690457274166852617884093], [0, 21598655785453438047216142388, 1259868042678694644643657956, 6803092220874838059559610, 23226546357213279875018136, -23226546357213279875018136], [221370927988783411693571900868050, 46693562689268268561390834, 1174425051114563025282722574, 0, -66033167715570869321034779, 7782260448211378093565139], [0, -203498913058509044338812685626, -1312091228493120549963044016, -5273399493028260022345692, -23995207597344466251734253, 23995207597344466251734253], [0, 56256629771340488874224767176, 458195307208748396514546240, -13272665961674111050100240, 6759987704262566610963300, -6759987704262566610963300], [0, -209438874774816340448991496908, 122604616228167546791169408, 11482316360427458585477960, 3419616328405933898286378, -3419616328405933898286378], [164991913599897204333580654997762, 19369135639781327423596410, 1645655884714409047771049190, 0, -220472826230786709562962615, 3228189273296887903932735], [-67119968435908140790279404607990, -343427809847245980487206696, -5043784771592699937619313016, 0, -113335343199122178416799764, -57237968307874330081201116]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_3_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


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