
// Make newform 126.12.g.f in Magma, downloaded from the LMFDB on 25 August 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_126_g();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_126_g_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_126_12_g_f();".
// 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_126_12_g_f();".
// 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 := [1009014063467621795987302656, -1112376701583815650159392, 2095132539294357007444, 957931577042666086, 716243548908965, 70092626926, 27351029, -2, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [12873552246880200888436665296955016257817535937264950400, 35142094781957395781823700442238432456419079222003068, 26261203499249615521247915304384938568931749644138, 12738754315442187194234978896440269673395344159, 1583907509551474342494458512388424882703394, 446761470044330483764336921631701412239, 14784871693278671222066409233854418, 17059788756288731131010264047091], [-321888857234980309449875061235466173475856551656889064646840755252552, 55794349376749431693713482028479871691940194415473461674185817156, -38809553583703968464540821590550146022429959919764840650394666, 2305457154173563688299483304498889480272932488045524749149, -2099366630376373241046914011754025746014293491700106938, -45639127747622948620804338848686030135927576915539, -9488072210403336009025472054473777965724902450, -5520436720931824561643176978805292081004231], [-9442336641476482547257893574485688987860232706504702069961014966400, -55752933855454136301279561235133666964372784244593462872359466724, -19261748373323132412118177068927175063345359272896483885349658, -9343466693011337989807644900545970672757507146523815780519, -918490359285900093858684836138674647462075290034561738, -327685173268457552332540468334361474982993134971799, -10844227999525574373437958929320615100794371138, -10096195085770316805450443335139903901938255], [5277497688223357942392888573110492229029380288735614768, -81144000531578127554787407056801957713230619940800, 89316284841275280200562871067620852097393320600, -1231546947448447235219672820699637213115632135, -77321677288775229180382259355321707932400, -57738239296561538461924855963246116925, 3326885727145201088919190180735852, -2204405196750771579622713638125], [891931637727877208569753487494810705915298553339080140193617931311872, 1221890150290042064755776933979526172297292016845316611746463122196, 1079218345410255147042089423392886113171209121765330937537827982, 312274676666943091556148171261250165964435022895372880538373, 60537173246818880722094611891161468249517350877307011286, 9052202168756292231566849866318563382700960729258869, 1139527654858891657462328850654216456258578152358, 382532462850035118073801935705182707844844609], [2938393360694294077402464905112379690446665463544953707163684975251904, -343258595363423671428350161194039445490709722426073853658836548428, -1220327096535928138581346967209293921376199502925223375294636706, -576052055887034312183911729792609640155313464708136683823811, -83153353310121507697975147807089623698390406691989444442, -16631232891218312003462384053815847876639577325679347, -1506047859964985403004423111686049857124455847722, -721434980436973704933682620449251195015582183], [-1634259078156864589429475446162713722476794719173277564845897384060128, -3599898737514737498804930515226729303810006105611441685988239894460, -1802239299472176995387769155305768864749537356864942092877411626, -1270411485929143875682646558694318508831088208611505344948639, -141846914515563034210611655778100308118271211386892442562, -49013826215717200130236798766689453816431385360291823, 237408283732209223750774750108293796895164509518, -1880512473380612055826894646027885782975367603]];
    Rf_basisdens := [1, 31304977765010484232903573097358622179390315576047161824, 8586491202905831808372623548197689155817432018062795966995883272, 4293245601452915904186311774098844577908716009031397983497941636, 572427776082742589325093673660074179943562166049414, 34345964811623327233490494192790756623269728072251183867983533088, 34345964811623327233490494192790756623269728072251183867983533088, 34345964811623327233490494192790756623269728072251183867983533088];
    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_126_g();"
function MakeCharacter_126_g()
    N := 126;
    order := 3;
    char_gens := [29, 73];
    v := [3, 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_126_g_Hecke();"
function MakeCharacter_126_g_Hecke( : Kf := false)
    N := 126;
    order := 3;
    char_gens := [29, 73];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := ISA(Type(Kf), Fld), 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]];
    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 := [[0, 32, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 2770, 0, 1, 0, 0, 0, 0], [3377, 1185, -1, 1, 1, 0, 0, 0], [150317, -150312, 9, -7, -5, -1, -1, -4], [238735, 3, 25, -7, 15, 26, 4, 11], [1279559, -1279566, -16, -201, -214, 15, -2, 9], [-62, -2145833, -91, -1643, 86, -105, -24, 19], [-215, 3917657, 245, -2463, 74, -252, 141, 178], [-26942714, -227, 1355, -282, -2087, 2091, 509, 791], [-18493738, 18492761, -1293, -14174, -13168, -1667, 661, 316], [3743, -67444856, 5444, 27778, -5172, 6329, 1429, -1157], [-194327822, 7892, 15508, -5850, 24174, 5574, -2042, 3808], [196311499, -8234, -8786, 4255, 12835, 3427, 3979, -276], [-14797, 153838521, -23361, 196755, 21182, -25388, -6385, 4206], [-153341352, 153312352, -48802, 185817, 184411, -7792, 9198, 19802], [3098118286, -3098182368, -106763, -64386, -64265, -21522, 21401, 42681], [30024, -859498402, -23258, -333060, -14716, 37382, -15308, -22666], [4570831743, -4570811943, 16061, -755038, -805855, 74356, -23539, 3739], [-4852590656, -115515, 32915, 20650, 1158000, 243295, 94865, 74215], [-14875182396, 14875074987, -171963, 1341487, 1362643, -64011, 42855, 64554], [-64457, -550782574, 486434, 356555, -143008, 7047, 207465, 135961], [-12282377886, 11062, -177658, 41649, 2307797, -241431, -52711, -94360], [160424, -10580955840, 1006632, 2580030, -530992, 425920, 370568, 105072], [47621728132, 320255, -270563, -12423, 5077601, -898650, -307832, -295409], [-84508514366, 84507315838, -1755746, 14833154, 15558556, -1366712, 641310, 557218], [818094, 12987166663, 1264547, 16710553, -1160294, 1398241, 342200, -237947], [314214, 27775631454, 1661047, -75415, -915790, 772109, 601576, 143681], [-135812022840, 135811569707, -469043, -6024953, -5166417, -1295759, 437223, 15910], [50459618960, -588465, 113641, 118706, -9478530, 1171865, 469759, 351053], [697132913, -4027147, -5230273, 2314355, 21360822, 509666, 1712792, -601563], [-1378031, -49890177905, 1576292, -34539316, 471908, -1613985, 906123, 1142077], [307551014362, -307551727832, -1874312, -160576, -2216162, 2502958, -447372, 1160842], [428542200295, -5956600, -2932332, 2222233, 21676035, 6758635, 3734367, 1512134], [-393546, 428178463410, -8919998, -83996380, 3882836, -2334964, -3489290, -1547872], [-612471915747, 612462700202, -13923252, 88824830, 93132799, -8815807, 4507838, 4707707], [918043920604, -918052868242, -15445686, 68064762, 66465894, -850722, 2449590, 6498048], [-18334334, -804427608722, -16908112, 28957126, 21430712, -29049690, -3096378, 7618978], [-702943056720, -12478195, -21091885, 8392520, 59718072, -4528015, 4085675, -4306845], [5075727, -49276792649, 23488661, 174906761, -13456046, 11803750, 8380319, 1652296], [536619487617, -536625755940, -11607748, 303475609, 299993980, 2552731, 928898, 5339425], [-1199418176209, 4819481, 19741595, -6140269, 119844555, 16242902, 1320788, 7461057], [-18993949, 2119748530017, 14750443, -421959739, 9294982, -23641440, 9698967, 14346458], [-2821921892711, 2821897784931, -40992714, 127957916, 125518674, -4783604, 7222846, 16884934], [-2136787723866, 1274581, 34900555, -9043784, -596465142, 41395177, 7769203, 16812987], [3153266014474, -3153274261668, -5345716, 167114922, 192313744, -36347494, 11148672, -2901478], [3115465994944, 1425886, -15848822, 3605734, -82167410, -22306328, -5031620, -8637354], [-3449512374026, 64919503, -53487399, -2858026, -608469379, -180468379, -62061477, -59203451], [-1587056870127, 1586982640316, -144884597, 336950601, 273445865, 59929711, 3575025, 70654786], [24273041, 2798526211920, -103459662, 660078722, 21965432, 13290325, -46238473, -35255757], [-81797711, 2645978510951, -85662273, 79140059, 99703078, -131649250, -17905367, 31946172], [-122580839486, 78842342, 95269962, -43528076, -866896754, -18886646, -35314266, 8213810], [3400689498139, -3400632029804, 57454053, -333073685, -448053201, 172462133, -57482617, 14282], [2990965027336, 18622688, -80721228, 15524635, -125945105, -133491239, -34147323, -49671958], [-115227029, 11172484969941, -238510797, -1187258385, 187585942, -209020000, -72358913, 21434058], [9188255661300, -9188203554676, 106482648, 13418590, 72333414, -61184224, 2269400, -54376024], [-1666471233941, 1666587958644, 136678410, 431952808, 258364523, 270359281, -96770996, -19953707], [-146639627, -22146020190151, -367871971, 1461765992, 264460490, -278869872, -117820863, 14409382], [-25431343054106, 25431430244579, 162248983, -1685496703, -1634702119, -38662621, -12131963, -75058510], [-6434720857326, 115165489, 425049615, -135053776, 933291670, 329772413, 19888287, 154942063], [15633765277113, -15633654965609, 53581625, 2886936352, 2496123707, 557854028, -167041383, 56729879], [23645798627866, 220630457, 397738271, -154592182, 217151333, 111069539, -66038275, 88553907], [-24691918509611, 9333296, 326012700, -83836499, -2008265817, 391182607, 74503203, 158339702], [-11728359157376, 11728502850822, 246722130, -2024327558, -2002628398, 18965602, -40664762, -103028684], [-63658850, -61277001089865, 10132680, -2324142820, 46874008, -87095854, 16784842, 40221846], [-857849487, -31860225399963, -431147431, -2806792850, 858738562, -1287218768, -889075, 428480206], [-356194638, 26211102952933, 1022068441, -1655247601, -123871666, -294258805, 480066304, 418130471], [24788994192233, -846983854, -1066964530, 478487096, 3104673444, 148516082, 368496758, -109990338], [23549014917141, -23548902531010, 128904758, 1369170863, 1193954482, 271083885, -95867504, -16518627], [1261614504198, -1058525550, -1258044770, 579142580, -3021693392, 279863750, 479382970, -99759610], [-20259236998905, 20258719382796, -986035572, -5091256917, -5461283088, 320829525, 49196646, 468419463], [5776836, 63229558328704, 82544378, -6637196758, -37639220, 24596446, 31862384, 13042774], [47437381208440, -47438340265781, -1525158367, -17362402948, -17142591344, -612767919, 392956315, 566101026], [663120867, -82788984235488, 1747693966, -4998489422, -1229574280, 1277908007, 566453413, -48333727], [75351062782965, 1103677086, 2119693974, -805842765, 6023234423, 718182567, -297834321, 508008444], [1750878201, -3168308659363, 1690790353, -12229046621, -2077018702, 2789387552, 326140501, -712368850], [27220438612801, -27220543145360, -6524808, -4350205305, -3847116934, -705628681, 202540310, -98007751], [1576154423, -33343666904932, -416911706, 28743181650, -1094158856, 2123233851, -481995567, -1029074995], [1884107831, 116463880925499, 2150432473, 21367800515, -2367459254, 3067837458, 483351423, -700378204], [51652284897673, -51653363523599, -1391817742, -14686026478, -13468350074, -1983110514, 765434110, 313191816], [175209013309342, 899926292, -2914921820, 503748882, 28891786410, -5218523286, -1403675174, -1907424056], [-99755373573041, -2183893221, -4353191767, 1634271247, 15647714093, -1619676572, 549621974, -1084649273], [-73204188993705, 73205098390940, 1167186556, 26424038727, 25378612220, 1697034421, -651607914, -257789321], [318253796646061, 959029885, 869187463, -457054337, -16912472165, -591817970, -501975548, -44921211], [340857453, -133053466720399, -513569631, -30218127776, -67258110, 374486508, -273599343, -307228398], [-616380348, -66301575751240, 1275082651, -51928453199, -16928782, -607915957, 633309130, 624844739], [-43965052623700, 2186113611, -2907499, -545801528, -3061011142, -3829333193, -1640312083, -1094510555], [2607874226, -31760171427339, -2477790192, -20148139168, -1095183304, 3155465878, -1512690922, -2060282574], [-20273091276768, 1705945850, 6708483622, -2103607368, -14566666910, 5400199290, 397661518, 2501268886], [-244078552144183, -976009880, 80551804, 223864519, -58695182001, 1808707045, 752145361, 528280842], [-1473097975, 114407581142323, 4014438065, 56929472603, -427296846, -1259449552, 1900394821, 1686746398], [-189681931048723, 189684394667234, 4250741670, -15750893487, -15316761032, 242362897, -676495352, -1787123159], [6445020635974, -6441951958945, 3168263953, -59374861114, -65213454400, 8807683391, -2969090105, -99586924], [241593870017170, -636128851, 4602147303, -991504613, 13352137699, 6865909618, 1627633464, 2619138077], [-2027693828, 120673489188309, 1582156981, -17944750919, 989292270, -2522339963, 1038401558, 1533047693], [-81185815959478, -4466173526, -8736358298, 3300632956, 1634919082, -3104644202, 1165540570, -2135092386], [2530145062, -355368219456252, 467500806, -52700859915, -2211116372, 3635703248, -319028690, -1424586876], [-231541585212216, 231543439078140, 5406756954, 19863004620, 26813945862, -8649966348, 1699025106, -3552891030], [-6523399752, 188365136576923, -21017106811, 4425396829, 13625562526, -13336181015, -7102162774, -289381511], [-446088159, 413020016600960, -3982249462, -2862856084, 1949770312, -1420973315, -1503682153, -528796997], [-1005292848690996, -868036112, -3075982136, 986004562, -94794844120, -2325914474, -117968450, -1103973012], [-974555076062885, 974557765822420, 6574265050, -68243707246, -61969709771, -7468743455, 1194745980, -3884505515], [78724499396978, -78712976089778, 16738388523, 94053564436, 86652194005, 13709596308, -6308225877, -5215081323], [11175553740, -616631798726406, -10533331360, -86549946902, -4727110448, 13539108964, -6448443292, -8811998516], [808082845940801, -808087378597521, -5399753171, 127174107524, 133638131611, -10129584356, 3665560269, 867096451], [332987376411405, -332984144660505, 749413016, -74050139308, -87960654760, 19624604236, -5714088784, 2482337884], [516513653503894, 2313198873, -2539817453, 56654645, -44291937467, -7222869844, -2369853518, -2426508163], [12376463292, -1139841546472050, 31132736656, -138777231094, -22354265296, 23553595940, 9977802004, -1199330644], [-2703184698930318, 2703182638312928, -3323074446, -49476387182, -49142523570, -1132023946, 798160334, 1262457056], [-248569501411513, 1041127812, 6783337292, -1956116276, 123607840204, 6657197944, 914988464, 2871104740], [19413680237, 1660574695455416, -1077071864, -3805257549, -15100115444, 26963737959, -4313564793, -11863622515], [1128697869553430, -1128678874673326, 34004728244, -113082083182, -106042298970, -3054752248, -3985031964, -15009848140], [1062418199200374, -18996733736, 17072168664, 481141268, 107930481472, 54584494868, 18515592468, 18034451200], [1835211319526019, -1835208301596615, 11266992227, 63165328196, 81876657857, -23942463080, 5231133419, -8249062823], [-1473051012298334, 1499908285, -29100074549, 6900041566, -134251893047, -38999932685, -8399949851, -15299991417], [-2118937127884237, 2118947365591922, 19771079488, 210201156761, 218325856800, -7420364157, -704335882, -9533371803], [-1106676591544465, -33937072344, -34096497228, 17008392393, 143039325423, 16769255067, 16928679951, -79712442], [-331693381644132, 331671202967886, -36282178362, -135503929272, -133457083128, -10122020274, 8075174130, 14103502116], [9422429567, -1290244400753379, 11240254181, 193996174372, -12034045326, 15439452230, 2611615759, -3405406904], [-403831093198734, 28714430725, 38879439499, -16898467556, 353812017384, -1650954395, -11815963169, 5082504387], [2429435989936284, -2429477093382899, -61380577079, -84250514761, -62875012923, -42201817989, 20826316151, 20277130464], [-4547428018102737, -16040126356, 3822189916, 3054484110, 143363190342, 32847958518, 12985642246, 9931158136], [-15869390295, 2150845427024553, 52727709325, -85592559280, -8395571494, -11671604548, 24264961789, 20067176042], [-1217409702587892, 1217396669666212, -31716082009, -108126269436, -138109907063, 35633876276, -5650238649, 18683160329], [11023908246, 1083407913152389, 72419243893, -335632298653, -37786824154, 29917320323, 26762915908, 7869503831], [1033090639948308, -55042915516, -83927666044, 34742645390, 127912952913, -8584480402, 20300270126, -14442375264], [-22040649656, 1446415769715922, 34601670992, 426326838688, 3791851328, -23936575320, 18248798328, 20144723992], [-8777045974, 3011074731167148, 38601973538, -282440809910, -8419152636, -4567469656, 17196198610, 12986622292], [1189099002074791, 37845823313, 5425970139, -10817948363, -11130530010, -59447728124, -27027874950, -16209926587], [-38479295925, 978451423956278, -85932910960, 200674161854, 65156601124, -71057596487, -26677305199, 5900995363], [-1825113753231961, 1825089576691063, -46529730649, -616249278744, -634955766201, 16883136310, 1823351147, 22353189751], [-1197227857209822, 55313844396, 48365176964, -25919755340, 667142356288, -36342756488, -29394089056, -3474333716], [-39298118807, -2394592962001078, -3511022526, -126514394327, 32842904056, -55719570835, 6455214751, 22876666779], [-5897981590065262, 25935025364, 35574240340, -15377316426, 134729924776, -918493962, -10557708938, 4819607488], [9704711959, 5767772943712775, -82150402373, -424022184437, 25096391382, -2843483732, -34801103341, -22252907650], [2206380760055351, -16520504876, 17536174180, -253917326, 665994346062, 50831101258, 16774422202, 17028339528], [1079604752713924, -1079548877123674, 86254793410, 564178749616, 543565178596, 46109958110, -25496387090, -30379203160], [5543164505386700, -5543133868469968, 65405373890, -166699511980, -123667973970, -47163078436, 4131540426, -34768457158], [-7666301128752764, 19669662524, -95601119124, 18982864150, -343055018873, -153923308322, -38652526674, -57635390824], [8433168957167863, -8433104936999288, 80614416068, 716794362091, 638536767420, 125683515753, -47425921082, -16594247493], [-7808945324551432, -20176129208, 17567976600, 652038152, 14244302290, 57268196864, 19524091056, 18872052904], [-14318148108, -8384394768709054, -70059337764, -58327145365, 39478253592, -34057274904, -25160105484, -5420978688], [-7577354148021648, 7577488086958784, 198648690084, 679031739860, 605283124432, 142977799616, -69229184188, -64709752948], [-6011007787333318, 18242760256, -36535162868, 4573100653, -618525750839, -77593784033, -22815860909, -27388961562], [4848412631593518, -4848401682292201, 25178304825, 480939406055, 501727813945, -24068110081, 3279702191, -14229003508], [-1300171829822020, 151627908896, 201166384744, -88198573410, 736369435664, -13890859638, -63429335486, 24769237924], [-2571215218382571, 188777966717, -11095756905, -44420552453, -336275821421, -344231137886, -144357414264, -99936861811], [-3482686357843662, 3482570234267548, -195831108298, 567294195618, 560418751294, -29540599606, 36416043930, 79707532184], [-24537504612, 2917250709855412, 91175090194, -707970107338, -16840032388, -16117488418, 41377537000, 32957520806], [90381061068, -4484428811095598, 86770938064, -1240833159744, -107013224080, 143887673108, 16632163012, -36874449028], [-1373700996, -5355614273875350, -4315942598, 926236935142, 2825337836, -2786369914, -1451636840, -38967922], [3050657122368410, -131021278505, -72659288695, 50920141800, -124053628458, 138463126515, 80101136705, 29180994905], [1067972761914397, 208338411046, 271988961454, -120081843125, -300491471753, -24606017513, -88256567921, 31825275204], [159302207678, 11221303866825768, 149277999374, 227281088308, -187152965892, 252878690624, 27850758214, -65725724732], [-6435620273002393, 6435431992452353, -358390256113, 117943998434, -15824019705, 115597174172, 18170843967, 170109706073], [-3312149723134114, -59545044347, 138615122187, -19767519460, -2375524464970, 277472730341, 79312563807, 99080083267], [56507989036, -17507206098435117, 62507342023, -811670309519, -70209328038, 91612653055, 13701339002, -21403325017], [-177022654031, 14849352400067031, -146363104993, 1575602849917, 200163365222, -277104336642, -23140711191, 76940971420], [-5319067862679161, -222832131824, -201194893248, 106006756268, -52682217772, 138462614132, 116825375556, 10818619288], [6732256992537904, -6732492298065352, -344210755946, 173909606191, 317804975593, -270295668352, 126400298950, 108905228498], [-66581263130, -7983401261026280, -194698121460, 68682546844, 131144259088, -132153392674, -64562995958, 1009133586], [713616662562510, -214044313577, 2083673489, 52990160022, 1389952220198, 377182140621, 161054153555, 108063993533], [-22774085586349325, -38581595021, -138051239191, 44158208553, -269333698230, -105046257702, -5576613532, -49734822085], [-50548458806, 18654180157508838, -106901749813, -3053573985659, 83199466970, -92148192291, -32651008164, 8948725321], [2636774160775602, -2636885354750054, -179752086744, 979277064752, 995990676780, -59349474188, 42635862160, 68558112292], [2448302918797851, -2448363308520706, -79575803330, 4517911251693, 4581132455978, -104424846665, 41203642380, 19186080475], [1256953537747774, -1256699712049775, 409498691671, 3172588804938, 3131956389956, 138785119309, -98152704327, -155672993672], [26814092375397472, -26814071637826767, 135056043031, 15873256465, 317353532033, -395061177189, 93580901621, -114318472326]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_126_g_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_126_12_g_f();".
// 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_126_12_g_f(:prec:=8)
    chi := MakeCharacter_126_g();
    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_126_12_g_f();".
// 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_126_12_g_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_126_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,12,sign)));
    Vf := Kernel([<5,R![856027516974692260855832010000, 528042532759823830125168000, 381475564412940159894900, -13887508215303876000, 9029357773539925, -473791750360, 183023925, -11080, 1]>],Snew);
    return Vf;
end function;