
// Make newform 23.9.b.b in Magma, downloaded from the LMFDB on 05 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_23_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_23_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_23_9_b_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_9_b_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 := [2208782254549937077079536204800000, 0, 103782437973914306469472512000, 0, 847955819735403719760000, 0, 2817283398730424640, 0, 4503520431468, 0, 3434556, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [28844801054946544332620618659105584621812423792888887182643200, 0, -1883926563225245879036603478834206281937773250490456435840, 0, -17332660520835087945581706076087340063308011552970848, 0, -44145736551669712974930887808805499770750751220, 0, -43855176817463793744527836787758159579644, 0, -15144815165354659808904646611857183, 0], [-601315338605227841450419133116921507135198802273161599048384000, 0, -24755003553585647852070279280717035650617780153954532553600, 0, -134062359224632839880149184395909522607757509693098480, 0, -261477605998617832706597106689118655296203997996, 0, -211140435439874338909110677343772999946832, 0, -59940606532908780772070593683371597, 0], [767562077610618771665011787515767460242409819586813988296064000, 0, 83582056166284792545415711594095266329568538107857351593600, 0, 640603066763060997188433362264170768223998793152289520, 0, 1642247837411079881188355712329361998237341795524, 0, 1685386341249661632305838688716404776595208, 0, 597600882813860619876562380568311743, 0], [11042840732892298889615738587981539231335132009633423211382156800, 0, 284667536754672750935751542340689754312287261631541060414080, 0, 1680868565926390036369178133811471804778989784596799568, 0, 3843614451467042022926920979569294857840164109612, 0, 3718238233513085730526629852538148406492888, 0, 1277163973172800417451074763642649797, 0], [7039504045315395943810542927641574763727354848336920977626905600, 0, 286178881196054446490878956010679658352819878839211255669120, 0, 1721642953602642684744970105945982219828949975205987968, 0, 3883857395928548821301531155353160616713252281612, 0, 3720950873865344004609784470990681698950988, 0, 1272630563137926672604725539006142457, 0], [0, 274714709592681772522530475160893706232550143689179190966242176000, 0, 1132562758613175590040009664760256278714127686265799555440000, 0, 14577731101963780143661120815770592558481507771206505920, 0, 39785971265344695976576497048371239408316443758204, 0, 39125897153342717055743350227042153839452268, 0, 13215693521324601969977171181699345853], [0, 2639590265394511549462830912996172997892729738191432458624317504000, 0, 27643760412033625663178437086706011068940224523189968197680000, 0, 57883840869865968141896053701366840337924083129910501680, 0, 3900746928634684477259386342552079690474532498996, 0, -63598536111661240866944619152132441370620568, 0, -34503028782650751768714258739961941853], [0, 2987515140422475865407290777870621530170686361276705784630672128000, 0, -56800763346162184168952052867009555628657716440217372459696000, 0, -478925957670329702707331189233743415194312539652531233040, 0, -1191911220729137601594364277720672521603676606898108, 0, -1188247464596675050324541071489689278358520536, 0, -413453040992835962597425379676999403681], [0, -120662321096551374750055410619482535515179785642373150492373156864000, 0, -1187129530466448451870092779920556270036875074547123942486992000, 0, -6605631546706560923996016437798656062278287776370561015680, 0, -17145652324990347417954356259820924117743284154746436, 0, -18764947752531134573772139665864198860764855812, 0, -7092059573988274806806665710149491345027], [0, -318311892351543452822062574591080137094497135348006189989010309120, 0, -5837936072390927250720543430175834632160521132855273968387456, 0, -29573349774177314724969559149318834692867178132075419472, 0, -60986571759226605527143327243567522650715646234484, 0, -54714295927139893982536987126246277429063104, 0, -17736958631584082205874381642914785739]];
    Rf_basisdens := [1, 1, 5203937572940259822049823896750907176106551388456012447923200, 4336614644116883185041519913959089313422126157046677039936000, 6504921966175324777562279870938633970133189235570015559904000, 2601968786470129911024911948375453588053275694228006223961600, 1734645857646753274016607965583635725368850462818670815974400, 18071292738412783215380162270026662181789060000150224179276160000, 27106939107619174823070243405039993272683590000225336268914240000, 189748573753334223761491703835279952908785130001577353882399680000, 379497147506668447522983407670559905817570260003154707764799360000, 505996196675557930030644543560746541090093680004206277019732480];
    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_b();"
function MakeCharacter_23_b()
    N := 23;
    order := 2;
    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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_23_b_Hecke();"
function MakeCharacter_23_b_Hecke(Kf)
    N := 23;
    order := 2;
    char_gens := [5];
    char_values := [[-1, 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 := 9;
    raw_aps := [[-1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-6, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0], [0, -4, 0, 0, 0, 0, 0, 0, 1, -1, 0, 0], [2532, 0, 811, -53, -57, -27, 17, 0, 0, 0, 0, 0], [0, -28, 0, 0, 0, 0, 0, -2, 1, 5, 2, 1], [0, 24, 0, 0, 0, 0, 0, -5, 5, -9, -1, -3], [-53221, 94, 968, 281, -340, -151, 60, -8, -5, 2, -2, 3], [258438, 0, 20261, 613, 2720, -45, 299, 0, 0, 0, 0, 0], [-183658, 0, 11712, -741, -2003, 414, -510, 0, 0, 0, 0, 0], [0, 792, 0, 0, 0, 0, 0, 123, 44, -641, 5, 17], [356052, 0, 53513, 15513, 5762, -2211, -1075, 0, 0, 0, 0, 0], [0, 779, 0, 0, 0, 0, 0, 104, 25, 850, 10, -36], [196638, 0, -147766, -26127, -5311, -3282, 3068, 0, 0, 0, 0, 0], [0, -1535, 0, 0, 0, 0, 0, 264, 309, 1239, -58, -25], [-1086490, 0, -188770, -76560, 36426, 3286, -4174, 0, 0, 0, 0, 0], [0, 13442, 0, 0, 0, 0, 0, -95, 119, 2992, 89, 54], [0, -22955, 0, 0, 0, 0, 0, -1189, 325, 444, 61, -47], [4301620, 0, -75870, 57903, 97480, 726, 784, 0, 0, 0, 0, 0], [-123518, 0, 112595, 207103, -21757, -9405, 16003, 0, 0, 0, 0, 0], [0, 22817, 0, 0, 0, 0, 0, 199, 454, -967, -71, -721], [0, 21897, 0, 0, 0, 0, 0, -627, -175, 13774, 447, 453], [0, 20681, 0, 0, 0, 0, 0, 1389, 2370, -17721, -233, -107], [0, 4475, 0, 0, 0, 0, 0, 967, -3597, 4202, 489, -2136], [14181896, 0, 124682, 840978, -124875, -11390, -28546, 0, 0, 0, 0, 0], [0, -14339, 0, 0, 0, 0, 0, -616, 1036, 27349, -380, 302], [0, -1023, 0, 0, 0, 0, 0, -5684, -5287, -11726, 38, 970], [0, -3624, 0, 0, 0, 0, 0, 5311, 4341, -3688, -609, 1750], [0, 101982, 0, 0, 0, 0, 0, 2544, -5735, -4567, -288, 2133], [7855858, 0, 6232058, -2438611, -209041, 6870, 106204, 0, 0, 0, 0, 0], [-63684, 0, 3849980, -2236793, 283601, 93144, -14296, 0, 0, 0, 0, 0], [0, 101966, 0, 0, 0, 0, 0, -12784, 11844, -4920, -1984, -2436], [74484548, 0, -22743960, -1137521, -169235, -131988, -109140, 0, 0, 0, 0, 0], [0, 146494, 0, 0, 0, 0, 0, -6477, 21583, -43780, -2761, -2482], [-160121616, 0, -14035508, 1327417, -311646, -225114, -106342, 0, 0, 0, 0, 0], [0, 63781, 0, 0, 0, 0, 0, -4370, 4349, 88155, 6572, -1961], [-431141650, 0, -4565796, 2193581, -1417724, 320820, 10416, 0, 0, 0, 0, 0], [417441242, 0, 27175178, 854832, -1950492, 62398, -416746, 0, 0, 0, 0, 0], [-189176792, 0, 40917226, 677998, 1913569, 397798, -216690, 0, 0, 0, 0, 0], [105314728, 0, -37134924, -6926557, 4198255, 347040, -626936, 0, 0, 0, 0, 0], [0, -189861, 0, 0, 0, 0, 0, 8704, -4318, -79222, 13376, -12154], [0, -2322, 0, 0, 0, 0, 0, -3907, -15888, -147150, -4745, -21247], [56345168, 0, -40252833, -8803625, -742166, -1021995, 543759, 0, 0, 0, 0, 0], [-783090530, 0, -4677987, 8583857, -485954, -855105, -56849, 0, 0, 0, 0, 0], [0, -225204, 0, 0, 0, 0, 0, -36977, 65258, -52564, 7673, 29609], [-209560246, 0, 65700786, -5009964, -5546232, 352770, -1230498, 0, 0, 0, 0, 0], [361468268, 0, 37845576, 18836508, 14609709, -400122, -99840, 0, 0, 0, 0, 0], [0, -324226, 0, 0, 0, 0, 0, -24414, 9735, -111807, -23998, 34760], [0, -2430794, 0, 0, 0, 0, 0, 21915, -12949, -239662, 21011, 46480], [-1745773482, 0, -26561671, 1038053, 3902309, 210963, 470753, 0, 0, 0, 0, 0], [-743509864, 0, -74452904, 11526645, 123168, 3234990, -1275318, 0, 0, 0, 0, 0], [0, 1354439, 0, 0, 0, 0, 0, -25793, 141147, 575406, -39075, 2716], [0, 316985, 0, 0, 0, 0, 0, -255817, 77803, -536146, 17105, 14361], [1406137446, 0, 154677791, -7817, -7647133, 129675, -1920253, 0, 0, 0, 0, 0], [0, 3698317, 0, 0, 0, 0, 0, -15417, -131304, -234189, 13749, 24075], [-2271517068, 0, 112890527, 26967743, 1915679, -822723, 1269269, 0, 0, 0, 0, 0], [-1304732606, 0, 118579886, -29150744, -15440792, -69270, 517042, 0, 0, 0, 0, 0], [4000260698, 0, 2379477, -4660035, -2850386, 1022655, -2614461, 0, 0, 0, 0, 0], [0, 4040271, 0, 0, 0, 0, 0, 144529, 187563, -502476, 57859, -72786], [0, -1853573, 0, 0, 0, 0, 0, -68647, -450169, 1122372, -36277, -89025], [0, 5084181, 0, 0, 0, 0, 0, -540560, 373843, 260207, 32154, -38029], [3617735662, 0, 62903558, 92444716, -8370806, 6414138, -543206, 0, 0, 0, 0, 0], [1525235918, 0, -273078320, -6824985, -6172137, -947886, -3226074, 0, 0, 0, 0, 0], [0, 1364441, 0, 0, 0, 0, 0, -150323, -354222, -1598987, 128211, -13429], [-2160131044, 0, 457608830, -26896050, 18976203, 4585558, -1035622, 0, 0, 0, 0, 0], [-599861848, 0, 164107608, 67567023, 11055787, -4472976, -1215420, 0, 0, 0, 0, 0], [0, -8925119, 0, 0, 0, 0, 0, 21395, -130772, -1292455, -110387, -201753], [-5771546516, 0, -429922646, -1533806, 61243615, -1564562, 1266006, 0, 0, 0, 0, 0], [2878078940, 0, -645759489, -76315169, -46555823, -395523, -4936143, 0, 0, 0, 0, 0], [7601458586, 0, 270286021, 150029193, -6426123, 735, -2971623, 0, 0, 0, 0, 0], [0, 959841, 0, 0, 0, 0, 0, 917131, 249552, 1463601, -226599, 17], [0, -11329510, 0, 0, 0, 0, 0, 135797, 301708, -759270, -148469, -250351], [0, -17994035, 0, 0, 0, 0, 0, 6514, -96634, -36338, 252542, 24914], [0, 7576674, 0, 0, 0, 0, 0, -1158481, 399647, 2876541, 429323, -145849], [0, 12508456, 0, 0, 0, 0, 0, -579286, 557604, -3606048, 245194, 264458], [0, -13509125, 0, 0, 0, 0, 0, -992590, 619051, -1095469, -296312, -43813], [13651670296, 0, 594319967, 12351707, -97311073, 1501245, 17585017, 0, 0, 0, 0, 0], [0, 5449906, 0, 0, 0, 0, 0, -581048, 92507, 9559405, -154104, 19217], [-2462748634, 0, -93603579, -128786235, 83212933, 5347575, 3672117, 0, 0, 0, 0, 0], [0, -7244534, 0, 0, 0, 0, 0, 1909443, -1113311, -5423875, -269917, -10579], [0, -701098, 0, 0, 0, 0, 0, 1360793, 232684, 1135155, -30257, -76411], [0, -19421169, 0, 0, 0, 0, 0, 910081, -697986, 9553503, -70413, -178519], [0, 19527942, 0, 0, 0, 0, 0, -1009140, 334721, -6621997, 177680, -304845], [-7829738016, 0, 362250910, -187234277, 26159946, -18280230, 6214340, 0, 0, 0, 0, 0], [-2191250134, 0, -709944092, -11818479, -109338558, 33733428, -24124704, 0, 0, 0, 0, 0], [16581698606, 0, 130359758, 137405886, -11376648, -15579824, 10067642, 0, 0, 0, 0, 0], [0, 37172633, 0, 0, 0, 0, 0, 653079, -557545, 6766520, 150617, 240482], [20442872592, 0, -170217109, 207174135, 93069467, 3373821, -6134059, 0, 0, 0, 0, 0], [-26379566452, 0, 1684912026, 237857418, -35743881, -15479802, 27658710, 0, 0, 0, 0, 0], [0, 27186964, 0, 0, 0, 0, 0, -883583, -439347, -5750037, -54067, -546389], [0, -3189979, 0, 0, 0, 0, 0, -1759304, -589034, 15621953, -387060, -115840], [3155192536, 0, 2333066618, -174392509, -135964498, -35095602, 28351096, 0, 0, 0, 0, 0], [-312062448, 0, -1632599944, -234997485, -66101383, -27431844, 7291136, 0, 0, 0, 0, 0], [-3345449724, 0, -2653365944, 461139955, -136917, -5139360, 1970192, 0, 0, 0, 0, 0], [0, -33809199, 0, 0, 0, 0, 0, -58065, 195936, 11254797, 97221, 50637], [-2994084982, 0, 2396237077, 202742997, 111680700, 57580335, -4268481, 0, 0, 0, 0, 0], [0, 23620583, 0, 0, 0, 0, 0, -836713, -1712232, -10388679, 352489, 620435], [0, 42566436, 0, 0, 0, 0, 0, -460700, 2558017, -3756629, -556964, -194776], [-27888348524, 0, 1006159295, 292210987, -102815899, 60068409, -40185191, 0, 0, 0, 0, 0], [-5210648212, 0, -916094376, -386958377, -251694341, -39465132, -23662272, 0, 0, 0, 0, 0], [0, 89151463, 0, 0, 0, 0, 0, -1605880, 2404099, 10464857, -299790, -772235], [0, -92066795, 0, 0, 0, 0, 0, -2493148, 2008915, 10903316, -1303054, -953118], [0, -51711598, 0, 0, 0, 0, 0, 3255374, -295053, -3163983, -37858, -293715], [0, 35079373, 0, 0, 0, 0, 0, 7348273, -728377, -2577384, 591143, 13105], [39103053224, 0, -194874795, -128158759, -465018410, -22806915, 43658805, 0, 0, 0, 0, 0], [-9359488590, 0, 1892403080, 419852485, 72652796, -85817892, 34299680, 0, 0, 0, 0, 0], [-8451216588, 0, -2880104952, -736773844, 79780289, -24675482, -44773016, 0, 0, 0, 0, 0], [-72049598902, 0, -3034378816, -190357362, -496432146, -48116294, 4699784, 0, 0, 0, 0, 0], [5055066918, 0, 3515453995, -347531285, -639004227, -10498461, -17042269, 0, 0, 0, 0, 0], [9766086038, 0, 748726176, 580969062, 183241740, 14945358, -29708040, 0, 0, 0, 0, 0], [0, 24357828, 0, 0, 0, 0, 0, -2156825, 340124, -10574843, 1570553, 1852999], [0, -64563103, 0, 0, 0, 0, 0, -700727, 6102702, -9080949, 673215, -1471207], [0, 68936102, 0, 0, 0, 0, 0, 5368981, -2421413, -27118733, -2059775, -385205], [0, 52635663, 0, 0, 0, 0, 0, -1838279, -2192396, -55312983, -1139417, -2499203], [0, 11730617, 0, 0, 0, 0, 0, 823731, -4693226, 40394081, -394791, -173841], [0, -122447870, 0, 0, 0, 0, 0, 6372532, -8239721, 34043201, -1091768, -250610], [20695340968, 0, -1547425812, 32485089, -537457586, 142493910, -47337686, 0, 0, 0, 0, 0], [72710743386, 0, 2542558037, 108572697, 922744472, 64875675, -71995153, 0, 0, 0, 0, 0], [0, 85011128, 0, 0, 0, 0, 0, 1607676, 5373407, 50298817, -2083040, 1867708], [0, -43523804, 0, 0, 0, 0, 0, -1366147, -1826493, -52687150, -2177175, 2900752], [-195265903822, 0, 336043107, 388927875, -32729831, -69095385, -9426921, 0, 0, 0, 0, 0], [0, -66978254, 0, 0, 0, 0, 0, -117453, 4037809, 13630694, 197551, 5055124], [104112829144, 0, 696851196, 842634635, -177357605, -89292240, -90787880, 0, 0, 0, 0, 0], [-84802347070, 0, -5047787766, -1933752288, 164966064, 193816950, -25130442, 0, 0, 0, 0, 0], [0, 36698692, 0, 0, 0, 0, 0, -3814463, -1137698, 11051171, 394215, -828175], [0, 81150215, 0, 0, 0, 0, 0, -408788, -1433640, 16699908, 2790600, 1588120], [-51571448514, 0, 10526961408, 394127462, 754276976, -247550954, 258947032, 0, 0, 0, 0, 0], [0, -150163393, 0, 0, 0, 0, 0, -13231674, -642460, 9908113, 4240382, -1112006], [0, -48257906, 0, 0, 0, 0, 0, 477239, 8407316, 84091239, -3532195, 2118381], [163531185818, 0, -3179837484, 137519213, 460809310, -157104840, 111728304, 0, 0, 0, 0, 0], [0, -68015678, 0, 0, 0, 0, 0, 6127929, -7714106, -35615476, 1212107, 898061], [0, -259799183, 0, 0, 0, 0, 0, -4153811, -9661066, 26154011, -2816809, 2023599], [0, 106975356, 0, 0, 0, 0, 0, 882623, -8091618, 33547835, 1897821, -4894275], [200265090212, 0, -11556542993, -381742221, 811018422, 39255429, -106303125, 0, 0, 0, 0, 0], [0, -437191343, 0, 0, 0, 0, 0, 1473897, 12790245, 56468970, -381417, -6496424], [0, 302799771, 0, 0, 0, 0, 0, -8262510, -6106523, -27510859, -1500944, 584329], [0, -147855362, 0, 0, 0, 0, 0, 10539347, -16821415, 17246847, 4904447, 5649087], [0, -135793521, 0, 0, 0, 0, 0, -7963924, -15876373, -97962065, 4024798, -7257181], [-196205110428, 0, -2669811894, 1697496002, -1607077837, -281372354, -22985522, 0, 0, 0, 0, 0], [-241358838014, 0, -531682672, 493539709, 1026012476, 60704076, -320924360, 0, 0, 0, 0, 0], [208441776340, 0, -13958621666, 3726320002, -564835061, 229091770, 82965738, 0, 0, 0, 0, 0], [-205253682312, 0, 8693878672, 37326265, -1812897366, 3118170, -188761426, 0, 0, 0, 0, 0], [0, -99688610, 0, 0, 0, 0, 0, 17645099, 15175247, 72679291, 1324999, 819557], [-14026214600, 0, -10518918190, 197741710, 976031401, 46629486, 145148326, 0, 0, 0, 0, 0], [0, -349473936, 0, 0, 0, 0, 0, 20826931, 1476774, 32246082, -3530567, -819945], [-18869035852, 0, -28169993994, 902215422, -830070345, 34921638, 60965250, 0, 0, 0, 0, 0], [-186699648810, 0, 8142842489, 3887689941, 44195741, 1704675, 314701361, 0, 0, 0, 0, 0], [-110193112342, 0, 9299708616, -972693947, 691624090, -250156020, 31050084, 0, 0, 0, 0, 0], [-271054094424, 0, -4330479244, 5588751773, -1373104348, 10633290, -125396218, 0, 0, 0, 0, 0], [3441767540, 0, 1644780642, -6046963650, 471465231, 28821498, -123003498, 0, 0, 0, 0, 0], [0, -78933343, 0, 0, 0, 0, 0, -9161723, 1940613, 100052256, 7743619, -4277178], [292217549554, 0, -3923762446, -3745057256, -511831040, -211811802, 131767726, 0, 0, 0, 0, 0], [-18663363072, 0, -11342913778, 1255039515, 595583294, 65327130, 328255004, 0, 0, 0, 0, 0], [0, 685790375, 0, 0, 0, 0, 0, 8938512, -19327427, -60553322, 6179398, 3235964], [0, 334567866, 0, 0, 0, 0, 0, 10510662, -10830348, -249346176, -2952698, 3139072], [0, 232332792, 0, 0, 0, 0, 0, 6862749, -12469606, -29540468, -10257625, -14938441], [170088395856, 0, 10643885225, -3417199119, 72413258, 85560825, -597453823, 0, 0, 0, 0, 0], [0, -564949563, 0, 0, 0, 0, 0, -8516005, -5928205, -23421150, 1949321, 4475204], [0, -603530569, 0, 0, 0, 0, 0, -47295930, -23546714, 187952132, -4508618, -4380080], [297861099744, 0, 5058063176, -1672486265, -105914395, 265294440, -483798400, 0, 0, 0, 0, 0], [0, -184752563, 0, 0, 0, 0, 0, -36167707, 17026838, 33820045, 1706143, -13870321], [555612609014, 0, -32563380768, 2887666959, -1855626005, 253674978, -422753946, 0, 0, 0, 0, 0], [0, -921916679, 0, 0, 0, 0, 0, 24864642, 5250501, -85203552, 7978244, -5189050], [0, 650700811, 0, 0, 0, 0, 0, 28422387, -18667939, 53415436, -683043, -13547922], [0, 338133972, 0, 0, 0, 0, 0, 1680584, 28133978, -99734462, 1344924, 12713644], [90091694530, 0, 22482932384, 6118817602, 2633361694, -541250850, -339038792, 0, 0, 0, 0, 0], [42951583964, 0, -15454788366, -3956761926, -1544572545, 817802838, -757798314, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_23_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_23_9_b_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_9_b_b(:prec:=12)
    chi := MakeCharacter_23_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 9));
    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_9_b_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_9_b_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_23_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,9,sign)));
    Vf := Kernel([<2,R![-5317760, 268672, 147872, -3248, -850, 4, 1]>],Snew);
    return Vf;
end function;