
// Make newform 12.11.d.a in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_12_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_12_d_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_12_11_d_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_12_11_d_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 := [1648684816, -344403128, 101463432, -9587938, 2092829, -147714, 30608, -1066, 198, -2, 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], [-319611005063159694582672, 335690363418459138322488, -9972499972996597707108, 7421508231889413592827, -520588536343518703086, 133217088577972139196, -4135098999535025202, 866840028580050498, -10617846828144012, 4777429206717243], [138176154449247025883471192, 2077866539674224928688160, 3590167781275253920297724, 290635608588960074612913, 81450882246208754247238, 5391190466481343383452, 664185951330364058330, 62309791757744002046, 4759286524274815484, 244514118165802049], [3562184677354643152346156020, -472197871339060434705012064, 119946400642994070806778488, -7881913751830270469003155, 2057279143818991878258574, -161065151537227499757796, 17399371203657263226522, -867568192030995250890, 61094477451775937552, -6956003609714575371], [799325383998374735364623280, -200862412340721645600310560, 32501892010779144078818412, -4650356582597071798686153, 461018153155023600411690, -92231550063765008493660, 4021307961432448536294, -662445338394291108078, 2043647962356372540, -4074401261735809353], [-12798241643837765335247478288, 2310091957847957517733893280, -463566037968121253114083732, 47432635866637246745233525, -7297565567994471237856994, 940173598313698671124364, -62266727766819475748990, 6137478113104649769142, -140390274454448131732, 40946879772659454085], [9328228357856593825858481080, 1008201159213673133314361368, 189955483629097698382984484, 44867912595724383218728245, 5476710502601004804923566, 869620934184691905258164, 42748973619824852650578, 8443283742927685413934, 427161687787190661692, 40040567016769138229], [8027818694497427725620649220, 1599969854882240469364611340, 122242577853610486327425852, 61421330382795854754272307, 4654520791073348634739386, 1196834826639495118486344, 35397998674387297358206, 10913793378645562939958, 449020066197220706832, 53958474794391512307], [-17717548849782258618425143948, 3063784151383619291861511676, -642895758724408004714681504, 61350948513513740325556393, -10207533804115811223296962, 1242244064941865331524176, -87521298290337040914174, 8034975102562038780138, -206758686747266430884, 54900553566834144609], [29386959163296740160283748288, -8537636403937481754889384112, 1266245414440285888599400188, -201418898124871689874699023, 17095941284939570978393958, -4002728165471237713272660, 152929966958268613377370, -29256442348958154057106, -36415201309600845492, -178045243840232938623]];
    Rf_basisdens := [1, 9477279336007388358008, 85295514024066495222072, 42647757012033247611036, 9477279336007388358008, 85295514024066495222072, 42647757012033247611036, 42647757012033247611036, 42647757012033247611036, 85295514024066495222072];
    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_12_d();"
function MakeCharacter_12_d()
    N := 12;
    order := 2;
    char_gens := [7, 5];
    v := [1, 2];
    // 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_12_d_Hecke();"
function MakeCharacter_12_d_Hecke(Kf)
    N := 12;
    order := 2;
    char_gens := [7, 5];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 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 := 11;
    raw_aps := [[2, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [319, 0, 37, 0, 0, -1, 0, 0, 0, 0], [-49, -16, -242, -3, 0, -1, 0, -1, -1, 1], [-18, -68, -190, 68, -26, -12, 10, -26, 14, 12], [-29100, 118, -2962, 114, 24, -76, -5, 2, -18, -38], [225856, -268, -3242, -436, 736, 110, 170, 60, 100, 124], [-3870, -3836, -20444, 422, -768, -30, 112, 290, 98, 30], [-1170, 9176, -8860, 834, -3288, -10, 664, 622, 206, 10], [-4708331, -2628, -192269, -14028, 1488, -2291, 382, -204, 1580, -572], [-16889, -22728, -75830, -8807, -4980, -701, 1556, -1945, -2377, 701], [-19259546, -646, 924424, 20766, -20760, -98, -3907, -1202, -3006, 1526], [27602980, -33100, -23558, -75220, -33152, 10458, -4502, -4164, 7652, 2652], [-304714, -18580, -1484936, -13002, 53292, 674, -15708, 10214, -3082, -674], [723690, 239296, 3716376, -47750, 38756, 18350, -7140, 8154, -7350, -18350], [-153091355, 106924, -4162157, 147652, 22736, 11517, -3786, 3204, -20388, -28268], [72720, -1346452, 599916, -235804, -133748, 2140, 36852, -11520, -58416, -2140], [-345526710, -256478, 16226348, -210282, 205896, -120414, 63825, 19526, 49546, 107982], [-4055696, 2444836, -20661028, -25260, -575172, -65684, 105156, 88864, -22736, 65684], [5511294, -3014712, 27343688, 256174, 34220, 117706, -7532, 113614, 93470, -117706], [314108314, -501052, 24827296, -168084, 61776, 246044, 58402, 15244, 55828, 217564], [-11952181, -4778648, -59780526, 55717, 551628, -184249, -181708, -9045, -32133, 184249], [1391382, 9348052, 8903942, -1132216, 753562, 44688, -127658, -198242, -271882, -44688], [-1368162170, -481048, -1743788, -2599144, -2008256, -862380, -394412, -239496, 169160, -287880], [-1892607098, 467744, -61299212, 1333440, -378144, 1947644, -105296, -7904, -178976, -66752], [2809762645, -1884268, -33217901, -4018276, 918736, 1095957, 317770, 18300, 562340, 407244], [18148465, -24946848, 98465146, -6672389, -2198520, 818185, 483608, 1082273, -1463551, -818185], [-31149468, 27136092, -165949228, 6910432, -818548, -659792, -125228, 659668, 1562660, 659792], [7763205184, -268114, -13248950, -146406, 6512568, -594480, 1348695, 578218, 384518, 616866], [-1711992362, -1618176, 173279476, 1392096, 5483232, -1083108, 1287200, 572352, 284992, 1382624], [90464901, -142181688, 433000950, 18923235, 5426652, 8049, -551100, -3214203, 4732821, -8049], [19638720, 158573828, 121639000, -18940568, -3111592, 840600, 1125416, -549472, -4524992, -840600], [-5262735608, -1090596, 568657006, 13321092, -8459712, 1015374, -1453474, -322572, -1616660, 1678100], [81459736, 266681116, 437358716, -16040196, 14330892, 3792484, -3582732, 3792520, -3061928, -3792484], [1570118791, -18474576, 569224621, -14954352, -4422720, 11842919, 682968, -286704, 2512752, 6294480], [153941783, -283595360, 785224710, -7820627, 3984360, 3428207, -407752, 1074855, -1098105, -3428207], [-38131249386, 379810, 163553624, 12934038, -442680, 6705510, 32145, 330182, -1256438, 1561806], [-125826978, 448354868, -624651472, -11329082, -15605868, -4648782, 4707260, -7871954, -3994466, 4648782], [-3680856, -534133288, -30906264, -6082720, -38408168, -3472064, 10453416, -6877560, -2388696, 3472064], [-77751372401, -8887848, -1091865323, -61182744, 25814400, -12867337, 5351244, 739656, 7743864, -2190456], [-12291120, 1019016948, -93869740, 13664956, -22504588, 2630020, 2599564, 14736352, 4073744, -2630020], [14682079136, 31372758, 1083289194, 115210002, 29550360, 2059016, 4424491, 5073186, -11443762, 3367162], [747820512, -1059607328, 3737535468, 8890612, -9184660, 13625228, 4255956, 5786064, 5628960, -13625228], [67126360218, -8483156, 4009383296, 36001380, -31308432, -50287404, -5117034, -1454140, -4417508, 6477876], [76590247969, 35641268, -540297857, 54295772, -15808208, -9378695, -5957382, -846180, -8530044, -10559860], [-664155339, -1532806944, -3148578198, -133366305, 30681264, 5948469, -14826000, 34571205, -31854459, -5948469], [201523408, 1925688404, 919624596, 89485052, 33431220, -12380348, -141044, -45247392, 19276176, 12380348], [-154178695, -368755512, -1039629994, 225075335, 31463700, -34679395, 3576748, -80450087, 47598985, 34679395], [-1061791470, 1009570756, -4997076254, -252897768, 9613566, -5825360, -4742830, 3532394, -64680782, 5825360], [433956384036, -34182050, -1488906562, -22042518, 92249400, 74204604, 21763695, 8496698, 9540598, 20295474], [-292698153098, -5026000, 190457332, 41104688, -2878496, 44016108, 398584, 1102800, -3614032, 7781232], [-71236116, -395245360, -522856812, 59309576, -134586308, 21484456, 12966852, 104203356, 20198508, -21484456], [31571931990, -130992980, -10761434212, -526871292, 213527568, 45655272, 49502838, 7197188, 70216924, 6075348], [132346494, 1078515660, 151767138, 237964788, -372369690, -30959484, 91539978, -24749706, 51751326, 30959484], [392031068674, -156756960, 7806676096, -267995232, 153692352, -150343840, 42965712, 10289376, 44773920, 49038624], [-2655916488, 827212312, -13681909036, 273355460, -9371228, -92104932, 8908828, -118369016, 45312632, 92104932], [-662857986275, -485089036, 9795206059, -704450692, 77382928, 122891389, 53477946, 376092, 105451524, 137657132], [2822532297, 39842072, 15250717838, -849632033, -63421140, 66729093, 44695316, -48631031, -195725735, -66729093], [293061776272, -323510698, -2658836870, -1188918126, -159790824, -283224136, -16152725, -39552350, 125903950, -23477126], [100533966274, 182849400, -5578860944, -64408728, -379297632, -222500136, -95428612, -40739736, -27898280, -124636024], [1576276672, -5618314708, 8783028240, -449761744, 466457232, 9792208, -67179344, -187947648, -109992384, -9792208], [-1071869839187, 338124684, 408358171, 497915940, -1011273456, -69318091, -231943578, -84530268, -125766084, -170091660], [-2552287056, -11717832972, -13142791956, 354655620, 242125260, -50171844, -71266764, -7230048, 76120944, 50171844], [-10011431340, 2034732296, -49770740548, -375521688, 13732500, -156948760, -39503444, -12667484, -133117612, 156948760], [-823425267414, -917051636, 5396200400, -2507193468, -693848592, -309792668, -84216634, -107990812, 263529980, 33009620], [-1393997802407, 593365260, -23571988841, 1149859716, 715107312, 253107433, 102847942, 79465188, -112164868, -65319980], [-14081637484, -13310744004, -73685860996, 1599625640, -1676855724, -451335256, 368607820, -248910812, 287072596, 451335256], [-1332806935334, 719285588, -17357755904, 1167261852, 291544464, -80443988, 4858730, 38900284, -145883676, -155408692], [-1035875250, -22051192180, -5593216914, -193278856, -1097013614, 29339200, 209784990, 287212854, -40984914, -29339200], [1131696595306, -1379437486, 11001334732, -2346898458, 538527048, 421620306, 212650281, 19062358, 349051130, 369261150], [1155516380374, 224079008, -46814992172, -1470870400, -946001888, -364416228, -231891152, -133322208, 69506528, -381529344], [4852066590, 19486202280, 25507673624, -936141698, 13252412, 311917690, -85013564, 638719534, -156056002, -311917690], [-8157576313, 32309393960, -42739108310, 1482912825, 262273260, -210091357, -101145228, -67783705, 318205367, 210091357], [1805478503650, -46181878, 81572386084, 1404608142, -2526986904, -274836446, -492440635, -180299138, -263684718, 16326950], [4855114026, -37909464036, 26220422556, -588717162, 1931425512, 173243154, -426200952, -53378550, -103868502, -173243154], [690628968, 43438392416, 2834248300, 1357880476, 1995111260, -35917308, -444859612, -251590120, 330490792, 35917308], [-3616307158289, -1413306376, -54712583675, -3960909688, -626451392, 1042076327, -40884964, -130204632, 439048600, 72297640], [4797299720146, 3125820026, -182355808412, 3278557854, -565576344, 1289732210, -373669187, -45411506, -565692350, -1065334922], [2055113071852, -1694102724, 157283690194, -28689660, 1133478432, -854334886, 392169774, 148995540, 188357388, 882187284], [-1058942582322, 2744332000, -25886542660, 1570368960, -119401056, -3774777068, -267371056, -45063712, -354487264, -1085274304], [-53051033574, 24149839172, -265330842038, -2695074728, -4529935018, -1072388976, 944854586, -321872302, -941865926, 1072388976], [3729829173360, -619926410, -129808977190, -3348357198, 5405036376, 620744376, 1117777851, 396667010, 648887662, 256076058], [-24675991290, -12627072096, -126455983760, 339464750, -3228387644, 178161770, 221534972, 2520409526, 129406630, -178161770], [-6174550616390, -997575544, -123927485480, -4000484712, -154678944, 1875461760, 14864388, -101969000, 437604776, -91770504], [41121592817, -57365809840, 201802199290, 2401556859, -2643256440, 681064073, 664319832, 667041185, 770655233, -681064073], [34958463822, -1677171284, 188081791206, -8811392768, 2357878154, 1607306168, -644063322, 1825681302, -1801021650, -1607306168], [8914701473752, 3417307780, -62562668498, 4024696444, -690090208, -1868240154, -417718158, -43025940, -663332556, -1109860244], [4012091486502, 2245216192, 2786481524, 1718255904, 3072855264, -4019604004, 431555968, 255635456, -159429888, -579725024], [-10303920093929, 5707532696, -265064131907, 3505066856, 4117890496, -2860362577, 335089388, 298564872, -524080712, -1881838328], [29014687633, 2368498008, 149356899958, 1039462303, 8799316740, 459326437, -1780510948, -1217946511, 374697185, -459326437], [23252935050, 96444332244, 111962060538, 3797795544, 255831846, 217248720, 12930666, -90305790, 1003761066, -217248720], [49756184478, -1274252336, 244247074564, 6659910162, 4548487272, -564605978, -166996456, -4445107426, 1523826046, 564605978], [-52682288505, -140361718640, -261005235242, -1795406899, 2741074008, 62918415, -1313157080, 2574472727, -433122121, -62918415], [-68684550228, 44628703676, -356467603304, 7597396228, -3148580608, -1735469652, 451037984, -391040980, 1465481644, 1735469652], [-75215357888, 137025421652, -386253714048, 9007678784, 5452259328, -1743144512, -1531113536, -1070949696, 1816133568, 1743144512], [67508550486, -134545722216, 347771335368, -2261897754, 10666748412, 1800386034, -2307913596, 365292006, -115377930, -1800386034], [-23284033818671, -10919562268, 333092703487, -15715998676, 274488880, 167942345, 907023314, -116852052, 2281454836, 3003048220], [28082508323116, 1110145900, -558336601358, -7707821996, 12587073824, 2921009802, 2360030214, 851272164, 1314971772, -593136476], [-28634122758, 57274749388, -146113870604, 3449457614, 4716031776, 600858138, -1899055088, 3481046714, 1012578938, -600858138], [22215934754248, -12907549546, 216129293026, -19915590510, 23382836568, -1179818704, 5746548811, 1857072610, 4064807182, 5174576506], [-177997785742, 176221410708, -884895723880, -10265600254, -8476754412, -3344985658, 1623349084, -1361627582, -3402646478, 3344985658], [-6369568595693, 7848506552, -507686375, 26725230056, 19737464416, 3280630627, 3592509660, 2296738728, -2001935592, 1522790408], [-201397878018, 211800610196, -1026344175086, 20351288260, 20043101846, -4220685132, -5396631334, -2677261642, 4032650782, 4220685132], [27801493402708, 8104188612, -825248397782, -3309421476, 7451466048, 132307546, 700640242, 321787884, 114128948, -3683541428], [66690691516, -50455362580, 337256812776, -10472822140, -18482310096, 3166890604, 3409734832, 8010261372, -1826482884, -3166890604], [-31142026452710, -15726735652, -504238069328, -48128477964, -3642058320, 4340207668, 172572206, -1274350508, 5442546444, 509295620], [101109326436, -362880823652, 553969897104, -33812611292, 4184625800, 3529235564, -337025832, 692713092, -7570843932, -3529235564], [39651174104086, -19929323584, 408995703412, -14266218592, -14451377312, 22106071260, -1209685760, -1108559616, 2014866944, 6286955424], [-231144409422, -167476612360, -1194890689228, 29356521030, 8045226672, -3742721278, -3855588272, 3634405138, 6403449938, 3742721278], [-22974856087278, 15497787436, -420138273400, 33946904484, 15349475376, 5628125164, 2057174678, 1896986564, -3473596900, -1429816972], [68133509101, 409069342312, 335239362782, 5955049347, 2902094580, 2671525489, -1445054868, 5549650381, 2156643709, -2671525489], [53331561579386, -16080756390, -76998602916, -35095858242, -29768618904, 11113374458, -4948836179, -3185910546, 2845969826, 415542550], [27112053467002, 3058409400, 2128673723464, 42839725608, -25415490144, -19433977952, -4937659364, -1072504536, -5585300584, 2447339080], [110459617448, -617957271204, 621509551088, -44281426216, 15522549024, 3050841032, -1975499360, -4569710552, -10307646296, -3050841032], [-53817259113, -234044455744, -284380572202, 12665953309, 2484497208, -3582162177, 370144712, -7547238233, 2270947783, 3582162177], [90933848361568, -4629149364, -1512723869498, -41649410028, 33555711936, 5528622950, 6758367318, 1871966916, 6028866972, -906341916], [258763248346, 199264372468, 1350186129224, -40959465126, -5990554764, 3959432974, 4095768060, -6433084502, -9250008038, -3959432974], [42233508270, -214573390680, 161636473252, 34137040322, -12311108120, -3228812170, 3936474776, -6663603154, 7727057038, 3228812170], [-88424471079605, -38994603328, 1583622185953, -52022117536, -18922238432, -2019888589, -759477568, -2052771456, 6692130688, 9726013792], [242851630932, 294237247060, 1150730296536, 54707612044, 4012788080, 1072483268, 19753200, -3019317612, 13945023828, -1072483268], [-10573599592266, 16900260946, -1544781456376, 20871394854, 35060659080, 16773153734, 5772748777, 3210385622, -1296044934, -2338507106], [22950717908610, 14257253704, 1034504280320, 37632307608, -30884506848, -17695370312, -7184523100, -2037601960, -6218638360, -3966391432], [27958232787331, 33661634504, -1277738511623, 63035738072, 63736427488, 5762759411, 10520829476, 6487746648, -4909327640, -2189869640], [216940290786, -863977570500, 1045539660994, 46562027336, 31424041534, 4104269504, -7730751214, 3603232826, 12666574210, -4104269504], [-540455281378, -81505786716, -2730041118664, 1884251774, -22504017252, -6945400582, 1151835316, 10951275406, -1265287202, 6945400582], [-90535138331111, 4420010876, 681655438807, 9942052820, -13376207312, -16005110727, -3021802370, -1017840588, -1972242388, -1764523932], [82222932388068, 13225619278, -900697139650, 23522379258, -7118146248, 18805582668, -2424003417, -325225846, -3547103450, -3553544958], [7327370178, 1152293763648, 30701007852, 11736860382, 16190562504, -258142038, -3630861768, -1925257470, 2869679586, 258142038], [183741176087, 193605252448, 760035970518, 111138897757, -38045689416, -10747526977, 13180023464, -25421931417, 25097842695, 10747526977], [-33505368776612, -7121779618, 2246250904006, 4441303338, -53398916616, -29758979244, -10127828817, -4371578438, -2769343882, -227133966], [130151903484, 435360983556, 828763509096, -133552984764, 7527979056, 14911299756, -3824346576, 22680707004, -29660421252, -14911299756], [-234016016508, -307095400840, -1061506096416, -53827616716, 72709501720, -5927096612, -13487357016, -24687170268, -14938678332, 5927096612], [-654019584845, 1026438935560, -3401401393870, 92440924749, 4327888476, -16212009665, -3960597468, -4697508269, 19057228771, 16212009665], [-55974116843404, -48012880050, 1822055979726, -41779220550, -62001491208, 29691113468, -8535582233, -5287376886, 4078343078, 11997031618], [27921139109896, -48690458940, 4057735462750, 3898719804, 82227225888, -18381329610, 21429610898, 8802084012, 7650885748, 29897469740], [41210190648594, -59671042052, 3157309894424, 20644736148, 106327129968, 39888528844, 27587122814, 11744034356, 8198108204, 39253464356], [171894872320201, 16652015756, -207702988841, -58977905980, -32218075472, -77552191703, -8868672570, -5067180828, 2531378172, -18458157292], [161102910454, 1162993040164, 814352394932, -23756169798, -46234362840, 1692722206, 12053725800, -287818154, -5515861898, -1692722206], [30800011915795, 63470391768, -2440472559623, 146832014472, 77932341024, 46419749859, 11586272300, 9328195464, -14140237256, -3602665432], [-92387241539144, -86370397636, -2552615336738, -262372670236, -5640670976, 16680675902, 3893153102, -5674243692, 30483280972, 4190552308], [-110752817778, -1392690292020, -566669037012, -20773082694, -68926078608, -5039090562, 16917047520, -3781202034, -6453043314, 5039090562], [-151561200559679, -50847086436, -1886496333041, -161475136716, 28017815472, 7033917505, 8581223950, -781605996, 20288871884, 3962262340], [-109911597965, -2163422895584, -588607572106, 34064400201, 5767450080, -13331523005, 3881055072, -34623193373, 5183219299, 13331523005], [-425464816212, -859492426164, -1838503586660, -188087190016, 98080581316, 8292593072, -25294259620, 11389050236, -44948649236, -8292593072], [-27435997765744, 122320605150, 1087098582330, 261615196074, -26920794120, -48575023504, -13962876305, 1721535546, -34811894794, -23766104462], [-349788709566, -1227538978328, -1891539731552, 85402335018, -38683891908, -5407089314, 3447971972, 19484914706, 19998811426, 5407089314], [-253065417213938, -91853029966, -2020281262016, -230401880250, 62355327240, 28853846158, 18641546393, 1426974454, 31575194970, 16491781694], [53234310410164, 37021900452, 6616739917258, 196461849276, -122362589568, -52635309734, -26023626974, -6107288820, -27618098668, -53784788], [1577012991226, -81448532836, 7975320319824, -39095666446, 14989243068, 34494078454, 262989364, 18452877930, -1150396998, -34494078454], [631619998848, 400014717312, 3010936266100, 93500279948, -71753072588, 1501710452, 20169205772, -7422040048, 23750497600, -1501710452], [-19074726604590, -47044884494, -74137242220, -149085599802, 2219145672, -33283007862, 3121351929, -2805390538, 17464266010, 1850090430], [-207050701752230, 32090697904, -2092793777576, 119177390224, -38361015616, 104565659096, -9410820008, -823422192, -15527951248, -1752530992], [1454570374806, 2603093457124, 7414915913272, -21506623018, 150545679660, 31995010434, -29680588508, 171684806, 2622096854, -31995010434], [-439420357080, -4339756330264, -1989232159180, -137515983852, 73643427876, 7745936780, -21739117028, 21058977016, -32442511768, -7745936780], [209871383042, 1976600178732, 1066095234008, -10078071790, -14086993356, -12563857162, 13825307644, -53778094382, -5660482238, 12563857162], [327064036500, -217585845008, 2143893133780, -307833927024, 186912108972, 32955544000, -43924112236, 21739883972, -68719595756, -32955544000], [531794875683, -4205662932992, 2385798811102, 220461816401, -9597838488, -19368921093, 13263116248, -62823547597, 50273223827, 19368921093], [-432634324116284, 73430468268, 1606037649514, 135140987604, 125180996832, -105361230030, 20102792678, 12860397348, -11236004036, -6188634076], [426394063673458, -127966187776, 3325564592464, -121357617792, 261005575296, 19792239088, 63841558784, 23224273408, 34786023936, 64033480064], [416638333441183, 98193029736, -10957719476123, -39111668712, -144287361600, 78795181911, -39217984108, -16769611272, -11357523128, -62893408648], [-1326641337072, 1839263554996, -6439697191708, -255210462100, -201146802812, -20913167148, 45664047100, -2422552736, -69030907312, 20913167148], [-294061801971716, -112211619220, -5222775443870, -177080262700, 87847763872, 202856066266, 26427000582, 5843372004, 29480513148, 35390354468], [-909687401927, -1195240914624, -4406592413366, -11847197357, 279465524808, 17245580497, -82682055304, 68508276905, 1349595785, -17245580497], [3496672031850, 1899488583132, 17505481868338, -33282843904, -170470353122, 55890929960, 54535154930, 8220663362, 5652021514, -55890929960], [-588242154139004, 71506001420, -6329848547894, -75702748300, -117893056544, -27728231950, -31746008554, -14731997628, -4564026596, -53286970556], [-1746787219776, -1153252306232, -9114653015100, 272970729340, 29545878788, -29880249724, -23319598020, 33852263568, 60772619904, 29880249724], [-1115815966725, -1025568432936, -5437210547382, -27410474979, 216798263268, -31314180465, -42853217700, -76699572933, -14681163861, 31314180465], [86759990987154, -175520186174, 9604992539684, -38370470922, -288025756344, 146950843498, -42286036447, -21380222170, 948815786, 54740944046]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_12_d_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


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