
// Make newform 81.12.c.l in Magma, downloaded from the LMFDB on 20 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_81_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_81_c_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_81_12_c_l();".
// 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_81_12_c_l();".
// 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 := [141844474156177975, -2248952416659900, 2259611521703223, -21338578334950, 10720227603096, -61176011352, 20475172451, -71329410, 17884836, -35000, 7011, -6, 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], [-17838672674552702435, 3804442621357920317, -3830059495349872963, 51273815765090846, -25737098801705427, 120289212054467, -40196596928913, 85901917766, -21503329409, 18566645, -3713329, 0], [26714284279196544438475, 3586603511567479979, -3765921629511148501, 358916710355635922, -180159691611937989, 842024484381269, -281376178502391, 601313424362, -150523305863, 129966515, -25993303, 0], [58702297121721383974460645, -348094074464417731090007, 348799528797117806066953, -1411654768074154766546, 707692989768321909477, -2239704263732701097, 748197235341204363, -1396752812826866, 349614115343159, -283941424295, 56788284859, 0], [-1578742599032681445364537445, 18071245499737862428027607, -18126315785399870582241673, 110203799084721851864786, -55259997940373953874277, 189799271665923952937, -63401760963640748043, 116030522839820786, -29041775331770039, 22763081209895, -4552616241979, 0], [-1455872536064392661982995, 3305110127325026143757, -3267601285524704779123, -75094175436122377474, 37738360422656775933, -229647977483212813, 76750568150455647, -172538169881434, 43190480481391, -37292007355, 7458401471, 0], [-35759443654991883376142969835, -42097688544491322026863378798, -9257021980312778623838212046, 152353650755618394885394027, -62024899170775949281502909, 334064044639184120849976, -96776621281506999994598, 229346949444093916293, -51743111823978538259, 47893631172524396, -8931841605389012, -176482897265], [-22650536577686047539140214365, 8372652487055254055623502397, -86803917170404123157939459, 58017945329078000509631068, -223080188228731644006961, 89390816957417497338455, -158768811783520163113, 45401295786567625880, -29080688632165299, 6459139731809097, 1941311869915, -352965794530], [-79124311824174247366277831918145, 29826681234200527864123666137328, -335748685539569545897825908208, 229836714665135291298361982267, -809566207540416851045829499, 496725888926951769649746690, -891445948269566427385900, 447712137009996609966573, -437119659488810813485, 177526058959004417602, -78073434201452434, 25564203641949131], [-124027130918192324622304718425567320, -33683656525761797437131886197993127, -400904408919395004537136765266035, -290103004108441749389545418126123, 377188697940629005118397972766, -829766068988703444191853968055, 1507751364247433042375369107, -944273824387319760618398769, 1109151274980769519830286, -433316091800357006979229, 238125218175814189837, -68133735405205089713], [-3657512982978173463505343247204315, 318397884777164886406042239850226, -7781846633927486967563104875374, -235470758206414871836218504677, 94303287949554972880418979379, -1967912040209368194302782344, 192264420156635543144340346, -2602804626731573417264427, 109137068126469612322813, -1255489941342140796820, 19047006204612627628, -200912608837586945], [3809265159636289279268677317560516120, -67033077895963746529706001406956953, 45709209965439801394400942572673587, -1676228074643763601261224301239893, 145217403050148587307547662983586, -5389999215015178331137719779849, 172533346715330386292902487469, -6012942669177219271791877199, 81603658752900255979249202, -2667498753789759227111075, 13189652296449891758899, -406880784178064637519]];
    Rf_basisdens := [1, 7681498279312654080, 7681498279312654080, 3536903207719070945280, 5305354811578606417920, 7681498279312654080, 36957340442919574416958721280, 36957340442919574416958721280, 36957340442919574416958721280, 17016802088384301820430771220480, 36957340442919574416958721280, 25525203132576452730646156830720];
    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_81_c();"
function MakeCharacter_81_c()
    N := 81;
    order := 3;
    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_81_c_Hecke();"
function MakeCharacter_81_c_Hecke( : Kf := false)
    N := 81;
    order := 3;
    char_gens := [2];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, -1, 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, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1707, 11, -1, 0, 0, 0, -11, 1718, -1, -1, 0, 0], [0, 0, 0, -2, -1, 0, 22, 3812, -2, -2, 0, -1], [0, 0, 0, 10, -9, 0, -2392, -110164, 94, 10, -2, -9], [-306089, -8247, 159, 0, 0, -6, 8247, -314342, 159, -5, 6, 14], [2061007, -17968, -1682, -514, 18, -18, 0, 0, 0, 0, 0, 0], [2941966, 92116, -1810, -1234, -23, 54, 0, 0, 0, 0, 0, 0], [-2268746, 57374, 2106, 0, 0, 104, -57374, -2211268, 2106, -534, -104, 531], [0, 0, 0, -5051, 306, 0, -1257803, -16921666, 14953, -5051, -250, 306], [-30651204, 1089796, 3116, 0, 0, -1080, -1089796, -29562488, 3116, 4508, 1080, 1012], [-27902315, 3476983, 57803, 34997, 3292, 1152, 0, 0, 0, 0, 0, 0], [105317814, -2119410, -118792, 0, 0, 4418, 2119410, 103202822, -118792, -27004, -4418, 5958], [0, 0, 0, -54174, 843, 0, -14647420, -133150684, 154574, -54174, 3426, 843], [0, 0, 0, 162640, 29862, 0, -17557476, 99470144, -59192, 162640, 1620, 29862], [-676091626, 22010012, -732760, -160496, 28224, -3124, 0, 0, 0, 0, 0, 0], [-2306338044, -13824436, -507820, 0, 0, 1296, 13824436, -2320161184, -507820, -133708, -1296, -54054], [0, 0, 0, 514281, -98418, 0, 11407013, 2251530842, 89093, 514281, 13914, -98418], [-2902768302, 14826124, -1112398, 0, 0, 57162, -14826124, -2887885016, -1112398, -523954, -57162, 97081], [-11547156790, -151395402, -2676490, -151070, -3771, -24068, 0, 0, 0, 0, 0, 0], [7535277563, -50632626, 2073108, 1412472, -94818, 12222, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1425190, 190363, 0, 171988950, 7736240156, 7612866, -1425190, -123396, 190363], [0, 0, 0, 3263900, -273438, 0, 92329908, 17808246332, -5310100, 3263900, -201896, -273438], [-46766658837, 1474940, -6862020, -2740092, -366228, 273760, 0, 0, 0, 0, 0, 0], [0, 0, 0, 4433412, 915318, 0, -203612830, 45150793394, -510568, 4433412, 16494, 915318], [0, 0, 0, -7767660, -308754, 0, 25645498, -15178825906, 26097624, -7767660, -90122, -308754], [-54061884848, 395378124, -3152976, 0, 0, -214500, -395378124, -53666721224, -3152976, 1965400, 214500, -1637374], [-25448341508, 82622632, -57610448, -821920, -202752, -322808, 0, 0, 0, 0, 0, 0], [36821134921, -1225888949, 9853499, -628675, -2604104, -532692, 0, 0, 0, 0, 0, 0], [-65353202527, -1195431968, -7810868, 0, 0, -215716, 1195431968, -66548850211, -7810868, 7412980, 215716, 1901736], [-58343052374, -1520474282, 34382222, -40871926, 3723655, 646524, 0, 0, 0, 0, 0, 0], [69902263230, -170660816, 27511790, 0, 0, -614, 170660816, 69731601800, 27511790, 25140842, 614, -6391809], [0, 0, 0, 40933286, 1741734, 0, 3548404008, 86534065781, -83916646, 40933286, 410878, 1741734], [-45309650976, 352660492, 132230012, 0, 0, 57960, -352660492, -44956932524, 132230012, 30604460, -57960, -3873530], [344447599555, 7974878299, 161855925, 0, 0, -1978314, -7974878299, 352420499540, 161855925, 13741305, 1978314, 14898438], [0, 0, 0, 97240532, 11003554, 0, -5269328064, 156110475128, -370558404, 97240532, -872292, 11003554], [611841133607, -10198877581, -61463123, 0, 0, 2155110, 10198877581, 601644411136, -61463123, -18249327, -2155110, 6561690], [-516672553412, -9078316988, 47583932, 36278852, -4723778, 6223104, 0, 0, 0, 0, 0, 0], [1037446871218, 21247652070, 193071870, 0, 0, 1675396, -21247652070, 1058696198684, 193071870, -128276394, -1675396, -20586249], [0, 0, 0, -88591641, -25075296, 0, 9288496353, 198648329684, -57476385, -88591641, -7035244, -25075296], [690559726748, -27594630288, 588059000, 691864, 10349352, 2669128, 0, 0, 0, 0, 0, 0], [583780711318, -21728796440, -687427240, 1459112, -5359412, 1846080, 0, 0, 0, 0, 0, 0], [0, 0, 0, 454271486, 6134823, 0, 28838720430, 1013483502044, -512874802, 454271486, 4159672, 6134823], [-422961258847, 19559910758, 139106854, 0, 0, -12646152, -19559910758, -403413994241, 139106854, -332877834, 12646152, 14346576], [-912830742179, -593215065, 661164217, -58059949, -88102278, -8206978, 0, 0, 0, 0, 0, 0], [572421146956, -51821944052, -7831876, 183541892, -78278600, -17901504, 0, 0, 0, 0, 0, 0], [-388599888538, 80064042368, -1499073926, 0, 0, -8617314, -80064042368, -308544463484, -1499073926, 271492494, 8617314, -22693671], [0, 0, 0, 492138682, 30619799, 0, -33618864146, 998117842748, 1553558866, 492138682, 39436164, 30619799], [0, 0, 0, 387334854, -1772595, 0, -11608222416, -589109518912, 2607169218, 387334854, 13241114, -1772595], [-5344508759549, 51622537665, 110101041, 0, 0, 1390836, -51622537665, -5292884831048, 110101041, -666223127, -1390836, 61546580], [-1657233147437, -11233805758, -3259845140, 116397320, -69765498, 37255554, 0, 0, 0, 0, 0, 0], [1044205808800, 91150886996, -2642111376, 0, 0, -6356572, -91150886996, 1135350339224, -2642111376, -889198776, 6356572, 67097070], [0, 0, 0, -1738685254, 42093634, 0, 7506968844, 7509981840125, 293123646, -1738685254, -7921770, 42093634], [-7373343476978, 88397103828, -115656878, 95308610, 304793703, 61378274, 0, 0, 0, 0, 0, 0], [359387609985, 224422938894, -598887760, 0, 0, 26287226, -224422938894, 583836836105, -598887760, 2496604556, -26287226, 218784366], [0, 0, 0, 276872784, -24954570, 0, -6675340844, 13073203353944, -2508630120, 276872784, -51248372, -24954570], [-702841849671, -122821029375, -1888966893, 3384744969, -217354590, -85627098, 0, 0, 0, 0, 0, 0], [5595536023910, 223814451342, 2203456002, 11814270, -198964995, 109778400, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1184758688, -285178240, 0, 290722547704, 8466329668910, -996176144, -1184758688, -16314984, -285178240], [0, 0, 0, -1733311620, -175582098, 0, -178075104318, 14452178299691, -2437009248, -1733311620, 71214086, -175582098], [-11360398567508, -231810991248, 2771298744, 0, 0, -40171128, 231810991248, -11592249729884, 2771298744, 2979504040, 40171128, 229098200], [17058684651611, -405270621645, 7458025153, 0, 0, -231677238, 405270621645, 16653182352728, 7458025153, -770381699, 231677238, 107204850], [10252223125196, 466362257784, -5840978712, -1761274824, 185548776, 23170608, 0, 0, 0, 0, 0, 0], [54035287246184, -215826430960, 793434520, 0, 0, -17724440, 215826430960, 53819443090784, 793434520, -856307192, 17724440, -216611568], [0, 0, 0, -5012579718, 816505662, 0, 321010135520, -2223082235263, 433895702, -5012579718, 259271322, 816505662], [0, 0, 0, 996826783, -263791944, 0, -410346553047, 18750947625956, -1736242025, 996826783, 206518548, -263791944], [0, 0, 0, 4750469626, -307936825, 0, 687890441032, 14464375016, -9415336850, 4750469626, 353746638, -307936825], [14613608947054, 245250211242, -11916002952, 0, 0, -157141194, -245250211242, 14858702017102, -11916002952, -6443959364, 157141194, 1303592138], [92209836401242, 202863962408, -5458038294, 0, 0, -57120874, -202863962408, 92412643242776, -5458038294, -1587616242, 57120874, 1276222653], [0, 0, 0, -1367310652, -285202226, 0, -127509409470, 33528466018742, -8953855656, -1367310652, -541928274, -285202226], [0, 0, 0, -3602071824, 677467800, 0, 526806809360, 50748749327762, -354094800, -3602071824, -404621088, 677467800], [6611627281346, 211734569290, 10355500094, -5091054350, -964294137, -669446376, 0, 0, 0, 0, 0, 0], [0, 0, 0, -2974001320, -622590500, 0, 1309092304704, 25786048461656, 20703522696, -2974001320, -229874808, -622590500], [-70743998022190, -1220152447924, 10398757264, 0, 0, 249454644, 1220152447924, -71963901015470, 10398757264, -9893459256, -249454644, -208338180], [112361433485812, 170281529896, -42716477704, -6070226872, 2456552212, 122869440, 0, 0, 0, 0, 0, 0], [5302706161790, -745157862974, 34493712466, 0, 0, 670064804, 745157862974, 4558218363620, 34493712466, -4042977686, -670064804, 1190244393], [0, 0, 0, -7825081096, 124964532, 0, -1621679926880, 54047641648046, 25011833192, -7825081096, -170253912, 124964532], [55966945989433, -807733582391, 19182579077, -6728735365, 290973088, -84423168, 0, 0, 0, 0, 0, 0], [78943112276769, 1663251804574, -57696889870, 0, 0, -427052324, -1663251804574, 80605937029019, -57696889870, 7421710106, 427052324, -4396228848], [-44436172360323, -920458852286, -29031488998, 0, 0, -334717632, 920458852286, -45356965930241, -29031488998, 4902433946, 334717632, -783561992], [-11677911378848, -124713096776, -28258433616, 0, 0, -1451217240, 124713096776, -11804075692864, -28258433616, 19528157472, 1451217240, 892461348], [0, 0, 0, 12202637961, 1711168128, 0, -1195999510921, 90168208137698, 57890433089, 12202637961, 379180212, 1711168128], [-123005916676088, 520483340380, -18517215608, 5264753504, -2282898690, -536124668, 0, 0, 0, 0, 0, 0], [-20983813458329, -1440500379188, 84518851874, -2770517830, 1617107974, 34195590, 0, 0, 0, 0, 0, 0], [0, 0, 0, -252908304, 4866017694, 0, -2526691835980, 20948923549400, 6890359160, -252908304, 1778228460, 4866017694], [0, 0, 0, -36622620564, -1179053406, 0, -415247709468, 44282160645260, 19026263484, -36622620564, 2798816408, -1179053406], [-54356717903670, -4236448279754, -32252862048, 24934583988, -1871811666, -426527374, 0, 0, 0, 0, 0, 0], [0, 0, 0, -14030071546, -3015384404, 0, -4153909609518, 113392246464113, -17682808122, -14030071546, 1720167456, -3015384404], [0, 0, 0, 35960611096, -2792466972, 0, 2983508390692, 136920473788310, -17108382944, 35960611096, -1585057108, -2792466972], [83770701642060, 2342230266928, -30902830540, 0, 0, -1446855588, -2342230266928, 86111485053400, -30902830540, -35322785380, 1446855588, -1456529666], [43413015463924, 4171251581172, -22478287652, -21536411740, 1586623266, 56547776, 0, 0, 0, 0, 0, 0], [0, 0, 0, -26017958046, -1218822075, 0, -3405432598646, -40164457471972, 62376203394, -26017958046, -2921357648, -1218822075], [-19571606708660, -5444713416068, -106444590868, 51193858004, -2044338008, -566600832, 0, 0, 0, 0, 0, 0], [356970927079522, 1880043283488, -88050847218, 0, 0, 1361159914, -1880043283488, 358852331522924, -88050847218, 14379553194, -1361159914, 1140718743], [135714973712658, -5369414800184, 5284459046, 0, 0, -933475830, 5369414800184, 130344625436644, 5284459046, -76963549438, 933475830, 3801138163], [326630343525824, -8934177434808, 81433863464, 69215799448, 3881979144, 1256223136, 0, 0, 0, 0, 0, 0], [210486154252506, 7071307874548, 48231260816, 0, 0, -1151166932, -7071307874548, 217556310960122, 48231260816, -32511670120, 1151166932, 12683379204], [127617873961938, -7237489692646, 210652269312, -48276692916, -10622935998, -961784162, 0, 0, 0, 0, 0, 0], [-99682980578590, -4732442736096, 137415794214, 76530188334, -3298486287, 288700866, 0, 0, 0, 0, 0, 0], [-766161920440271, -5745799140035, 21201346157, 12868905083, 8577987316, -4273157628, 0, 0, 0, 0, 0, 0], [0, 0, 0, -126399985092, 3076874838, 0, 392524705676, -486762817944604, -247242373636, -126399985092, 547966080, 3076874838], [135943146449057, 8643031760511, 80704688783, -115560059543, -2591043300, 5358427948, 0, 0, 0, 0, 0, 0], [-675027301128696, -403638415508, 388310134508, 0, 0, 2460693256, 403638415508, -675428478850948, 388310134508, -129200397604, -2460693256, -12181042782], [0, 0, 0, 14647574666, -16596224496, 0, -2286133450614, -592661805756427, 164913004274, 14647574666, 2840784700, -16596224496], [278785394045700, 16507867397764, 491072703212, 0, 0, 3008378448, -16507867397764, 295296269821912, 491072703212, -164299474612, -3008378448, -10840175654], [359718758393639, 2195461625226, 62569115076, -114826693488, -3820307610, 2027204082, 0, 0, 0, 0, 0, 0], [0, 0, 0, -21505159366, 308767095, 0, -8709921603508, -775473497152108, 117010029446, -21505159366, 3267881330, 308767095], [-582074032642849, 6605469785816, -101904485212, 96169835956, -17059893480, -5261242084, 0, 0, 0, 0, 0, 0], [-970835700054644, -5550070589436, -187960566300, 0, 0, 1429278256, 5550070589436, -976384341365824, -187960566300, 83387876676, -1429278256, -3279148128], [0, 0, 0, 79024924384, -1642296178, 0, -11283114525134, -561458871289489, -395460607844, 79024924384, -4478658102, -1642296178], [-556423176989630, -3902266981710, 181999800606, 0, 0, -6844510680, 3902266981710, -560332288482020, 181999800606, -28711188722, 6844510680, -26571929749], [-910123674577402, 16280339483292, 230048326344, 139333447920, -21891234504, 1810168524, 0, 0, 0, 0, 0, 0], [-864233438069507, -10685496456526, -467674227096, 0, 0, 10110688142, 10685496456526, -874908823837891, -467674227096, -109537104708, -10110688142, -33780617442], [0, 0, 0, -12507430304, 10039758872, 0, 3595494742912, 15778954970312, 369965116384, -12507430304, -569469696, 10039758872], [956697499850692, 14950676589496, 475502621420, -75430651732, 310556350, -9151836516, 0, 0, 0, 0, 0, 0], [0, 0, 0, 86218253238, -41864933034, 0, -4865617860896, 830004019859369, -768388768806, 86218253238, -7403471738, -41864933034], [-488406132697088, 3125087864916, -805618564620, 0, 0, 8111008968, -3125087864916, -485272933823204, -805618564620, 138298084324, -8111008968, 809680802], [-771943834284482, 26847082788034, -399974149334, 207570617486, 7364871531, 9751165612, 0, 0, 0, 0, 0, 0], [-2550979003609870, 25736145764572, 76399417192, 0, 0, -1166843092, -25736145764572, -2525244024688390, 76399417192, -87482107664, 1166843092, 19284021288], [0, 0, 0, 4147247770, 9467448687, 0, 28254458625620, -796050391724824, -363438320426, 4147247770, 6585390586, 9467448687], [309282288122667, 3788267878093, -171493136659, 0, 0, 9117830388, -3788267878093, 313079673831148, -171493136659, 11513694629, -9117830388, -29421946580], [0, 0, 0, -142322314210, 12569099596, 0, 62657818504674, 8064544375661, 61946947470, -142322314210, 9946526952, 12569099596], [0, 0, 0, 390516170544, 48961802808, 0, -32121387148192, -1147551768250210, 347174810064, 390516170544, 6576688752, 48961802808], [9004085374296, -22604603268820, -309790960380, -541433159364, -1718417970, 8744517952, 0, 0, 0, 0, 0, 0], [0, 0, 0, 94322894814, -35788917363, 0, 63989763979424, 1471677246636944, 183003873098, 94322894814, 2490869058, -35788917363], [231187154990921, -29322479630389, -363782719045, 111502382557, 17122236876, 6650261564, 0, 0, 0, 0, 0, 0], [0, 0, 0, 210502133995, 40618809920, 0, -3010784713679, -2419630614856012, -1428786230021, 210502133995, -17115779880, 40618809920], [522204839888726, 53225776891458, 919680619730, 167043109222, -29772321543, -6127264628, 0, 0, 0, 0, 0, 0], [0, 0, 0, 641949428026, -51452758915, 0, -8345998116794, -204080175197716, -316675250222, 641949428026, -936400092, -51452758915], [5757998589524322, 6803612066476, 303120603176, 0, 0, -5962716612, -6803612066476, 5764796238874186, 303120603176, -510593224432, 5962716612, -34585385888], [1352304563469268, -39200571527312, 1067611159496, 482612434760, 34347923236, -9574582392, 0, 0, 0, 0, 0, 0], [-402805876717916, -30992635855124, 1304345982948, 0, 0, 25389601272, 30992635855124, -433773122971768, 1304345982948, -130053271692, -25389601272, 19880600148], [-2686057269188974, 74853137564426, 51048065518, 0, 0, -21582295968, -74853137564426, -2611225713920516, 51048065518, 308490884526, 21582295968, -8025427365], [-3248687939523994, -13149449811060, -1662756410568, -441808604544, -135503754648, 26919211212, 0, 0, 0, 0, 0, 0], [380023660090917, 103105032796844, 1427245512374, 0, 0, 9033382890, -103105032796844, 483137726270651, 1427245512374, -382223569102, -9033382890, -114135027318], [3054754232248441, 58992395357766, -520092601470, 0, 0, 6333028644, -58992395357766, 3113752960634851, -520092601470, -42109047206, -6333028644, -79450081192], [1503931177050621, 49855315281565, 438923828061, 652732696011, -31495380984, -29405460508, 0, 0, 0, 0, 0, 0], [3983567808623654, -39964328158924, 1503978263458, 0, 0, -18982161198, 39964328158924, 3943584498303532, 1503978263458, 999791009454, 18982161198, 51520219017], [1090697636250071, -66077373437521, 1617066492349, 0, 0, 23366755018, 66077373437521, 1024643629567568, 1617066492349, 371541452281, -23366755018, 75405829806], [3939793933381443, 4883751949626, -2194727769702, -33599248938, -13442739588, 15110001432, 0, 0, 0, 0, 0, 0], [-1782112937508224, 11924193233584, -1485963512344, -1331033624632, -100935234824, -36201064968, 0, 0, 0, 0, 0, 0], [0, 0, 0, -895574354185, 19770499224, 0, 83508207654421, 1953013785477656, 1767304794887, -895574354185, -52156489128, 19770499224], [-4060088342388980, -11552177139060, 721625098812, 0, 0, 14635055280, 11552177139060, -4071625884472760, 721625098812, 394378932892, -14635055280, 160007538236], [1404457529479170, -1978579417340, -29393076618, -87860504778, -65010840435, -21444861250, 0, 0, 0, 0, 0, 0], [-3399469804037714, -125240758516208, 20090577944, -530184475816, 8517952540, -4790622888, 0, 0, 0, 0, 0, 0], [0, 0, 0, -588978277994, 46194566229, 0, 82496899900810, -3367283346110116, 788193005710, -588978277994, 58470235220, 46194566229], [0, 0, 0, 120389652824, 145986544612, 0, 41219474488236, 8943747599556878, -848920483440, 120389652824, 31240108212, 145986544612], [0, 0, 0, -136977428050, -66411407592, 0, 86684003020754, 6465853671368537, 1199942587646, -136977428050, 12924410168, -66411407592], [-9725364809052592, -25659791141932, -1917229672412, 0, 0, 87781221240, 25659791141932, -9750936818973284, -1917229672412, -3145008204, -87781221240, -26124837006], [4621217815354906, -26137078303814, -3517526180330, 132104458346, -3781128393, 40736345056, 0, 0, 0, 0, 0, 0], [1668474995631799, -145574678009769, -3323378545029, 0, 0, 54721932672, 145574678009769, 1522955039554702, -3323378545029, -191131128197, -54721932672, 33647070680], [-11144577215740406, -125256051205078, 1697393197600, 210847220300, 179380722546, 86243592558, 0, 0, 0, 0, 0, 0], [6220153334562376, -221882895283484, -1355918188228, -2188434702652, 121478198302, -53455695264, 0, 0, 0, 0, 0, 0], [-5336283594001978, -14272734756654, 2418829197010, 0, 0, -1533928692, 14272734756654, -5350557862687324, 2418829197010, -1157987233766, 1533928692, 51501002067], [0, 0, 0, -1210776834216, -87394021140, 0, -123085373050288, 14943011041676912, 2110134490856, -1210776834216, -8456094120, -87394021140], [0, 0, 0, -428490419150, 58531375359, 0, 204272997830814, 746479921026548, 248091044794, -428490419150, -13854720468, 58531375359], [3136603160170790, 52288996276830, 3511637142162, 2499189468270, -162041559891, 95565516192, 0, 0, 0, 0, 0, 0], [0, 0, 0, 684131406542, -233705060946, 0, -289226287993820, 12222014224848449, 702064800602, 684131406542, -52157612862, -233705060946], [7288575048763987, -172555330322018, -6092386720036, 320594958272, 118075098178, 41277004902, 0, 0, 0, 0, 0, 0], [4919228187574911, 293334523021189, 902816073437, 0, 0, 107541802348, -293334523021189, 5212670252398448, 902816073437, -285297408667, -107541802348, 171319658076], [0, 0, 0, -1499505393306, 78417667053, 0, -164462132064268, -5987479402560880, 5306604241722, -1499505393306, 35219840478, 78417667053], [-7326642172399381, 372788654903794, -540376411738, -273517965806, -233669083680, 28166967564, 0, 0, 0, 0, 0, 0], [-13019677977118622, 95838215391162, -1693527612498, 0, 0, 99837308544, -95838215391162, -12923739924418916, -1693527612498, -997301470418, -99837308544, -280640598361], [2256429090292034, 32758696598912, 7496227380506, 711017361394, 166481803179, 61179523214, 0, 0, 0, 0, 0, 0], [21647017262436774, -284915809742902, -2738484082000, 0, 0, 89379877950, 284915809742902, 21362190832571822, -2738484082000, -2412222602716, -89379877950, 168133156326], [0, 0, 0, -868616518624, 21871212948, 0, -217743658028552, -1284651182956360, -4653430833328, -868616518624, 173426647752, 21871212948], [1411990454785850, 380822053305630, -429091817826, 3758451731322, -150905152779, -153658134756, 0, 0, 0, 0, 0, 0], [0, 0, 0, 259145969845, 339404512940, 0, 154719663953359, -12839129514518602, 4431080950597, 259145969845, 19457488344, 339404512940]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_81_c_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_81_12_c_l();".
// 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_81_12_c_l(:prec:=12)
    chi := MakeCharacter_81_c();
    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_81_12_c_l();".
// 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_81_12_c_l( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_81_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,12,sign)));
    Vf := Kernel([<2,R![96196663132264857600, 2593278943183503360, 312298873945767936, -4280234909773824, 538564645916928, -2602148571648, 249662133792, -1021312800, 85690548, -135702, 10539, -9, 1]>],Snew);
    return Vf;
end function;