
// Make newform 21.11.f.a in Magma, downloaded from the LMFDB on 26 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_21_f();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_21_f_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_21_11_f_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_21_11_f_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 := [300517801880601600, -9516227338368000, 2022248850888960, 32158758551040, 8140577253696, 67553728512, 11177140432, 100480832, 11068388, 44516, 3773, -1, 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], [55118906115663215373528054482094718715374748160, 1935949925752984955269837587921625276026693120, 292455912871080090271143948118656334853154816, 10616729307056126194515245452044993007933632, 371822140683736914632099524036220976390592, 15354581899287105170527414678643745962752, 463924213053373362229050601898654785368, 15722540066229425871610817726608387896, 176884871480071443148950077847466488, 4886399126893414182835445154657729, 30939208497149042210289341565671, 1384939568965668757870948270385], [-2459863087797764840446919958226100284896000, 403663833092046541005765155155043739000960, -5110892255954574925195258157822219234880, 1465270902769165573038188935457216589696, -3885897100459464607566764006649161568, 1644626994942574450426518484164145232, -739273699589372816090093574652508, 1919456328128215714329955619881138, 2325655218590542211500912208671, 681061618643441527716771936943, -2003462651682392258751050081, 191045580664523457813188786], [251396844474007949218456837229270871919823468770560, 7450901837012447159447808940067627853654560787840, 668518561776764987446405333113233369896005165888, -3940313387702160079695410154424790773395152832, 1035296551981597610413195648976644585268545440, 648518970823336567346442591560460220367920, 353174038381645246379440100285015333369108, -5756952659186955317312164721029993824106, 75151082291613546348903427385801814341, -773890290249286581112898543232848662, -11706555400016354608684392468397024, -409744948945383010157447645566973], [122657185560079924958464340719897077587493120, -461769069754504325168491885565577729782400, 21106719143130345861414389398811769637440, -8147373027236903639018504049201501726528, -18325777234487751465056089942401736416, -10531127114857082960124356942191111696, -161354275253827920854969785504525916, -12403599849279248056548601314644234, -72013727106447543917185863564623, -4102828139354119261987315740464, -7240731112887982761209967302, -1177275765666193307085520123], [-412831826744948669290153526409839772368353814046720, 64518699189913317033870384905547633824920025352960, -2922345759626618475686574816737204028016975129728, 90012657475737446737711587220641841839152532288, -5158860204273610123944342569651881938375648768, 107780189514054529868562354418606864429076192, -5909840061918405746016979503116543147700656, 58139902596628537879320067634653707347164, -2269279291427900217375837921612923690210, 28799114205000986744425463601375913165, -654872073874347297154120856703322697, 3899049317860289111319053084042459], [-2125548719885039516056843030369902385270001157120, -100423193617920604335121232926557710791456984320, -11283364216835072763242870615245677356927939712, -408227321803491239308962449662678297235413824, -16135334281128226422271261277928165353454464, -587294996316259339608861347779406191990304, -17845056369700550877208376330283105645696, -584802531390501364508276291431256391972, -6755554246705144467621383383567954866, -181852396015414682864278714070233473, -1147626315963004473457913717787547, -51172513566890736794372451711955], [-7438255267970126180666512284656933833519297950720, -1219423001172432202567674725722781102485365761280, -53134306144447475052383354294883995260636744320, -4323548344026773288072299261504365660907169856, -96835945531067635105284848486668427587389312, -6592361455646294667658124440463449412997152, -88710106757336290458075347916781715420992, -4684422856033029052882675598641483183108, -27885279508859802896826693632705202106, -1518978790416708492363957283769129053, -3012155933242993865241183670346239, -322553827357677253632498797571191], [-199822382424827341694215541554178458147285721525760, -37730490704494039503923151007179932188435266101760, -2388046678009027417687458512125944102825387366912, -143859411535177164270823043490534824911064370240, -4865228575555788286476651098125770109598283456, -197054242929607456726288947167969053220084416, -5232017183078935052095266857363893455658568, -207013465836709700826080876233832193945560, -2140189709289066142358050890628655338952, -67414147228191085613373036753083171231, -266004362167528440226090085731210601, -19688670974125407726561824211980431], [76163258649137265094029274841736174499887432480000, -1779441067392723690396018505903575454703481060480, 674651444987376629708029291130144020573782222144, -25224633288298457512622862064662304107035713728, 1129035183840169777658066416103421436655760096, -35318586867734403601664878678963581768077744, 1340075539579643438552236037367278270222180, -40225290287782913616550472979790548522874, 450079575893962846800838005692380922441, -16675282466803494471554110522009564012, 183061032027563316464957935458537830, -4164681670015816060443395016537791], [-548697472790976298501516249505410192438746824121600, -1321014231198002204981060185431408344343455157120, -2337763155116858730961422681301311331506034050624, 114666056622650220632948531182843632948834807360, -3383026476243889177465455473822841970944745632, 190540175307793638192549660172136952024371728, -2946523402414086441932496515354145582526996, 257785569693942091239206489423861265514130, -691613614783680698370930170922355536049, 99533924890452048418803894377397133688, -571692871391775211303673943173343082, 27642988660227586981471164212624563]];
    Rf_basisdens := [1, 1, 54321263115871389673469996602879465257326223360, 321055244307615958258292138129030622812160, 81481894673807084510204994904319197885989335040, 107018414769205319419430712709676874270720, 162963789347614169020409989808638395771978670080, 1940045111281121059766785592959980902047365120, 3325791619339064673885918159359967260652625920, 162963789347614169020409989808638395771978670080, 27160631557935694836734998301439732628663111680, 81481894673807084510204994904319197885989335040];
    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_21_f();"
function MakeCharacter_21_f()
    N := 21;
    order := 6;
    char_gens := [8, 10];
    v := [6, 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_21_f_Hecke();"
function MakeCharacter_21_f_Hecke(Kf)
    N := 21;
    order := 6;
    char_gens := [8, 10];
    char_values := [[1, 0, 0, 0, 0, 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 := [[0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-81, 0, -81, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-138, -16, 69, 32, 1, 0, 0, 0, 0, 1, 0, 0], [3508, 169, -3707, -72, 0, -7, -2, -8, 1, -2, -2, -3], [39677, 0, -39677, 1900, 19, -36, -27, -27, 18, 11, 0, -9], [-1195, 177, 2352, 200, 56, 67, -79, 157, 61, -53, -28, 0], [-113018, -3268, -112934, 1592, -34, 240, 232, -36, 0, 204, 380, 120], [107979, 13973, -53940, -27946, -447, -1031, -66, -466, 99, -414, 66, -99], [2, -10506, -722012, 496, -280, -2, -500, -1024, 494, 774, -4, 494], [7929665, 139734, -716, -139580, 4802, -16562, -154, -154, -562, 2093, 100, 1124], [523559, 156436, 519947, -76412, 7898, -6310, -5645, 1869, 0, -4441, -7678, -829], [-43, -58537, -14576808, -5080, -3459, 43, 5166, -51080, -5037, -1578, 86, -5037], [23986506, 614612, -47986188, 609728, 2272, 33948, 2612, 63012, 8292, 1604, -1136, 0], [58380497, 133837, -6246, -125198, -13754, 349, -8639, -8639, 2393, -24155, -28310, -4786], [-21019846, 2383118, 10508708, -4731964, 27914, -144954, -9804, -73692, 31842, 15680, -24468, -31842], [-115199953, 64524, 115135429, 4275040, 41437, 191752, -62520, 191084, 127712, -44170, -64524, -63856], [76421315, -1194594, 76494725, 560592, -161133, -382722, 100613, 458865, 0, 76143, 127816, 2733], [-285257936, 14255744, 142650596, -28585196, 47244, 560088, -4268, 301672, -30452, 86232, 77976, 30452], [-371935440, 15316, 371920124, 23349324, -220557, 117684, 220673, 39021, -126694, -235757, -15316, 63347], [-320076922, -19840530, 119884, 19847164, 142388, 1172590, -6634, -6634, 126518, 57926, -146420, -253036], [-103887158, -13762326, -103735808, 6805488, 317725, 37946, -98041, -186437, 0, -148491, -347432, -299841], [184749, -332145, 1376780981, -25192, 65662, -184749, -344306, 670872, -209941, -275603, -369498, -209941], [-621805070, 189903, 1243833016, -24630, -434628, -609669, 649161, -1433871, -437409, 187015, 217314, 0], [1031318176, 57113564, -515626238, -114107896, -536814, 2191212, -83544, 1128456, 184932, -554658, -35688, -184932], [-2077147394, 165303, 4152919356, -176306, 461476, 3442271, -119867, 6542933, 1033823, 2053241, -230738, 0], [-1601992756, 39502844, -1601603296, -19946152, -1800678, -3992160, -156968, 3705372, 0, -286788, -703396, -676248], [7279436059, -8211459, -3639953358, 17840692, -206749, -3949867, -158820, -2210262, 947117, -836226, -1258954, -947117], [314921, 240150531, 536875429, 225838, 2000379, -314921, -855680, -5649820, -89083, -2089462, -629842, -89083], [-3800662008, 1049342, 3799612666, -63818332, 1001019, -16992656, -514211, -17171033, 1741930, 438485, -1049342, -870965], [12771539782, -137162696, -267564, 137391644, 4808696, 3639588, -228948, -228948, -38616, 1946452, -648228, 77232], [20730016482, 419549051, -1304360, -419152972, 6271128, 22225897, -396079, -396079, -908281, 2343406, -279956, 1816562], [-4067269919, -115250351, 2032176859, 230290966, -8816917, 16229589, 2014046, 6656694, -3125937, -9719072, -1804310, 3125937], [-48917748136, -1783008, 48919531144, -757756376, -609992, 3983016, -1552986, 5095014, -1342020, -989962, 1783008, 671010], [8753692931, -296041965, -17503716138, -288723214, 7311852, -15601857, -14630603, -23884963, 3649027, -7869461, -3655926, 0], [-381822, 758353142, 4478210366, 5565660, 4976446, 381822, -4802016, 11412264, 5947482, 971036, 763644, 5947482], [-61239123695, -1933208, 61241056903, 648401240, 1603481, -20183128, -9255010, -16453722, 3592396, -4114840, 1933208, -1796198], [-6707604892, -785448116, -6713753944, 395798584, -3448652, -30885312, -4717048, 28217948, 0, -2667364, -3285044, 3481688], [-1623568, -1672536080, 20475672480, -750992, -185318, 1623568, 3998128, -58818496, 872576, 1057894, 3247136, 872576], [-7036930628, 414234388, 14061976792, 406974040, -1757488, 17849844, 9017836, 28439340, 4624116, 18372590, 878744, 0], [231648382, 957950586, -113236424, -1902686400, 12148708, 94574010, -7855280, 49874772, 18390306, 9468962, -5359492, -18390306], [-39269183218, -1889940, 39271073158, 3202543792, 6146940, -146341672, 7375848, -148170308, -7437152, 21559668, 1889940, 3718576], [-10825000325, -3147936271, 21665090812, -3147748048, -9809144, 2281947, 9620921, 4752117, -14901939, 1344831, 4904572, 0], [5457390, -1464226342, 35734611860, -12970140, 8491638, -5457390, 2055360, 146969736, -18427530, -26919168, -10914780, -18427530], [-56497473223, 6688752, 56490784471, 4168283888, 3992698, 52033392, 23284212, 42042404, -6604472, 24580856, -6688752, 3302236], [16509557756, -3678323886, -10258424, 3702196672, 28720916, -22185122, -23872786, -23872786, 13614362, -33385114, -85232720, -27228724], [3780303352, -2907340272, 3754673944, 1466484840, 53705976, -11856132, -8054430, 12344838, 0, 488706, 9520548, 26118114], [-78354777046, 837452710, 40343364, -867484508, -148381532, 167892238, 30031798, 30031798, 10311566, -14127170, 79783828, -20623132], [72253649099, -9118772728, -144537624530, -9100449108, 44649048, 16534300, -62972668, 51392220, 48649952, -19481929, -22324524, 0], [150062162495, 6478011098, 150073526645, -3244687624, -12735051, 163697046, -60414695, -227899791, 0, -64202745, -132193540, -75566895], [32726844997, -4642301937, -16358363184, 9367057756, -49291751, -77817705, -34230380, -33849538, 92572511, -73403502, -48223502, -92572511], [-2301038, 17491055686, -359097884970, -54895792, -75743864, 2301038, 59497868, 243217216, -52594754, 23149110, 4602076, -52594754], [-138264067616, -5464637912, -78172548, 5524718324, 197111156, 224495004, -60080412, -60080412, -18092136, -21605246, -162149100, 36184272], [254114399823, -15933908554, 254284313289, 7881997544, -73025581, 51705210, 123968335, 15625303, 0, 67330513, 78023204, -102582953], [-109110567344, -6454778617, 218434030660, -6432328366, -111996980, 124936731, 89546729, 272323713, -190445721, -87692469, 55998490, 0], [-401525195126, 3802608970, 200681057314, -7406888936, 213201608, -346272006, 42610664, -254676252, 35248506, 92731774, -240939668, -35248506], [-52632748426, -156849552, 52789597978, 4425564736, 7410898, 760836480, -897912, 813418968, -208534128, 170773436, 156849552, 104267064], [744090057145, 8881382264, 744269536561, -4530430840, -60346981, -64847316, 185935378, 190956222, 0, 126108906, 192391340, -53370510], [160668492912, -15897680086, -80302019481, 31471912760, -168384211, 373410122, 64846504, 218932036, -258993462, -39083757, 258600908, 258993462], [1049967137684, 92670062, -1050059807746, -12048988668, 133452485, -327877712, -35751131, -346850689, 147394170, 138483777, -92670062, -73697085], [-475269810002, -30007769918, 202500120, 29917048976, -109094320, -920738562, 90720942, 90720942, 111779178, 126894724, 160383648, -223558356], [16198131000, -748555146, 15861006498, 542839824, 189236911, 325684582, -232976191, -446285939, 0, -120601357, -128827880, 216523145], [-147538602199, -7520130612, 294641390342, -7498653840, 319178400, -674389692, -340655172, -1327302612, 457290828, 390900029, -159589200, 0], [334092481223, 6769517545, -667861256458, 6928525702, -3793116, -1406819875, -155215041, -2654631593, -164697831, -286223643, 1896558, 0], [261680927502, 22264458584, 261410151750, -10996841416, -375894188, 521767356, -174993038, -606501810, 0, -84734454, -79210324, 186041298], [1835632120276, 16562064398, -917869019233, -32884591556, -434357908, -112048010, -9233620, -108983100, 133619050, -549509718, -230303620, -133619050], [-138247618, -11184389382, -1382488431329, -184051892, -393138395, 138247618, 460547128, 2131206008, -45804274, 347334121, 276495236, -45804274], [339398155, 29571060057, 760097747022, 216461042, -51302887, -339398155, -895257352, -605915268, -122937113, -71634226, -678796310, -122937113], [984185219315, -64729439372, 393203220, 64884942604, 62863564, 423596008, -155503232, -155503232, 548706452, -279574682, -1015216148, -1097412904], [-2038229212258, -131259780, 2038360472038, 108760691704, -92753850, -1436366592, 555690438, -1577843478, -545473332, 501442518, 131259780, 272736666], [-126537400094, 54471086490, 252348445872, 54456259840, 464467344, 1427019294, -449640694, 2839211938, 711527666, -348446452, -232233672, 0], [-590755479896, -9812833656, -590950678352, 5004016056, -556961086, 305276268, -397731934, -637942050, 0, -332665782, -600265412, -137467326], [262323506, -109063689882, -4224386716952, 276839596, 882447756, -262323506, -801486608, 327057608, 14516090, -867931666, -524647012, 14516090], [-3233341529843, 78651490636, -3232585551191, -39703734644, -1419348928, -679612226, 296708161, 724327503, 0, 44715277, -162562330, -711263375], [-747548791, -69322125005, 2447909060528, -712429744, -1184150073, 747548791, 2207527326, -1448765560, 35119047, 1219269120, 1495097582, 35119047], [1940285892289, -153413181127, -443740270, 153272658410, -2306086274, 278418441, 140522717, 140522717, -584262987, -871997703, 1005831138, 1168525974], [-2949723577378, -17581664178, 1474822615358, 34812273960, -1475133318, -1967019522, 169249240, -1022683092, -429401058, -1384230740, 181805156, 429401058], [-3598824192466, -507126696, 3599331319162, -31129593968, -208561812, -8383846544, -918004236, -7908802900, -64166104, -828001164, 507126696, 32083052], [7634665260991, 31650320401, -3817161245114, -63584783300, 563701953, 4035926681, -133799676, 2189348722, 58628265, 772673040, 417942174, -58628265], [314270676, 80381301980, -5063639810668, 248866164, -266672384, -314270676, -877407516, 3760968600, -65404512, 201267872, -628541352, -65404512], [-4401045050377, 103799711116, -4400192045413, -52326358040, 2082372192, -3519344696, 253599684, 3488609392, 0, -30735304, -345805596, -883740268], [-4455265630214, -76272737654, 8911060788964, -75598521620, 545935688, -1139029182, -1220151722, -1603842330, 144687498, -2416981426, -272967844, 0], [-1256933587733, 77761924807, -473696032, -76862606228, -538032138, -2401816843, -899318579, -899318579, 425622547, -2067653227, -3123578284, -851245094], [-4944221971306, 976124904, 4943245846402, -122449082696, 178376784, -5948280616, 983439474, -6601468742, 645873556, 364068138, -976124904, -322936778], [-384741340489, 69933861217, 772679623622, 70639606342, -1190301596, -5109318059, 484556471, -9512890993, -2491197519, 2045597367, 595150798, 0], [11540359749952, -109228654846, -5770029822949, 217126918528, -368727607, 3068424466, 243394352, 1684264260, -1030287110, 174770799, 1086996812, 1030287110], [-946667275, 173151531783, -17256439919885, 537779422, 497090629, 946667275, 1355555128, 5414973284, 1484446697, 987356068, 1893334550, 1484446697], [-58718932204, 166082873460, -624074468, -167027835740, 755644940, -1395157808, 944962280, 944962280, -1569036748, 2267747030, 4403923588, 3138073496], [-465530604, 74853642172, 1834628693171, -2392104060, -3449174676, 465530604, 3323165268, -1147432312, -1926573456, 1522601220, 931061208, -1926573456], [2325427822558, -38107802286, -4655261986652, -38664004716, 2195957784, -8839924398, -1639755354, -18236051226, 3850139106, 477460480, -1097978892, 0], [-9184301423561, 140261978821, 1713905096, -141023558564, -2875633062, 5024031479, 761579743, 761579743, 952325353, 85342955, 1332413876, -1904650706], [-4356592418574, 38809311750, 2179029648192, -75885646608, 1350504506, -6543442842, -1555577504, -2538282516, 3199854702, 1261804812, -177399388, -3199854702], [12843302846222, 127180251788, 12838892649458, -61385027512, -5344233894, -5254579992, -2559112580, 4165533000, 0, -1089046992, -708028396, 3321149772], [-4023936626475, -1610307442, 4025546933917, -250810388572, -1003660942, -4920622048, 1041898561, -4731152421, -2841675630, 644884119, 1610307442, 1420837815], [4822064624276, -90694687377, 1155176830, 89877878470, -1069042678, -23628257969, 816808907, 816808907, 338367923, 1099096475, 2112058798, -676735846], [94890387, -526767374255, -15620249315820, 671759474, -1976215493, -94890387, -861540248, -1092283108, 576869087, 2553084580, -189780774, 576869087], [1633591373258, 256216278532, -3267419334088, 258249543436, 2868744920, -1056432960, -4902009824, -79601016, 2269852476, 71445084, -1434372460, 0], [1312833090092, -54041622642, -654409162765, 100545077412, -10318249653, -17451491946, -163787084, -6718363692, -3523403310, -6467272175, 7701954956, 3523403310], [5113044069410, -411412099556, 5111227107686, 206614530640, 10103459442, 13039611588, -180656970, -12614614650, 0, 424996938, 1455647784, 2241958662], [2365915065437, 243323916063, -1182868707226, -493583984766, -11514096525, 2250497835, 2193616890, 1214074410, -6758501655, -9142828650, 4742535750, 6758501655], [2961545153, -338042604965, -14289777495792, 5175786988, 5691446887, -2961545153, -11098877294, -8439957280, 2214241835, -3477205052, -5923090306, 2214241835], [-16936295406620, 566507773966, 4370689844, -567215711756, 13830668088, 2617428182, 707937790, 707937790, 3662752054, 8331209624, -1538938684, -7325504108], [1800137466101, -784343292, -1799353122809, 586648481440, -7053016475, 9071224744, 5525588208, 7490809772, -4729516528, -7796101450, 784343292, 2364758264], [22562764706655, 206975561006, 22566211033233, -105210943792, 338023609, -3565039314, 3280811533, 5697075321, 0, 2132036007, 3115296488, -1314290571], [2318338950, -604028477374, -33307809429538, 3325111428, 482591136, -2318338950, -7961789328, -18464109672, 1006772478, 524181342, -4636677900, 1006772478], [3994698180420, 9814371220, -4004512551640, 224380390644, 6363612391, 24365675324, -7572380353, 23618345035, 18134081862, -4659526791, -9814371220, -9067040931], [12434915309935, -520187319456, 12424482126463, 265310251464, 630491328, -20568316452, -9876060702, 14169983574, 0, -6398332878, -9318937932, 4034850594], [-11098153183086, -31694491289, 22183542089964, -44500347626, -8564957644, 3555719847, 21370813981, -5694416643, -41580129, 7673932693, 4282478822, 0], [57313927963408, 104169505952, -28657225084232, -215195758240, 5311866030, -8086278528, 2633718816, -4304241792, -7378951392, 7423379790, 4223027520, 7378951392], [-33528384756316, 4263926832, 33524120829484, -177116540936, 8981959452, 31095520440, -903809358, 29975481282, 6287775348, 12796182714, -4263926832, -3143887674], [-11137084661323, 242264885270, 22277194314970, 242805736584, -1295526464, -9644237814, 754675150, -18747624314, -2484141010, 18769752152, 647763232, 0], [12359953874003, -290391602665, -6186034563395, 603132313164, 2585839384, 33542471887, 627132580, 10713609550, 10233855047, -8902280823, -22976240414, -10233855047], [-17842775610212, -9881428848, 17852657039060, -1285004508240, -9246852850, -22862628944, 3069724908, -20592060964, -15221721736, -5542551944, 9881428848, 7610860868], [-39247448687482, 142068009114, -5244029012, -137686557524, 20019131228, 30008186434, -4381451590, -4381451590, -862577422, 1246662434, -12281777348, 1725154844], [15525187473382, -491865942446, 15526790121748, 245131647040, -1133895483, -28635713334, 3328996215, 31430493427, 0, 2794780093, 5055344064, 1192131727], [20253751879679, 454253006436, -6012392520, -454678780152, 21219466998, -39290756940, 425773716, 425773716, -6438166236, 11461280931, 7715487384, 12876332472], [-46672235445208, -4002799932, 46676238245140, -224332008992, -8433071072, 47226237432, -2474514180, 49385342136, -3687390456, -15337856392, 4002799932, 1843695228], [-10804600308263, -509335467317, 21611025353078, -509597091066, -1565322700, -7092278253, 1826946449, -14446180255, -2086360301, 19525755763, 782661350, 0], [-27032852682824, 2053265521520, -27019152377480, -1033482913432, -3946260022, -30340528212, 1420455898, 27194215662, 0, -3146312550, -10859393548, -16846617894], [95339268, 1648246535420, 8822364610421, -1201528764, 6526080985, -95339268, 1010850228, -84453769800, -1296868032, -7822949017, -190678536, -1296868032], [23325692813020, 618653854066, 16807955376, -623258079400, -24133113244, 32988567126, 4604225334, 4604225334, 12203730042, -2858105954, 1608945960, -24407460084], [-50390534443652, -849909185380, -50384350199048, 421862470388, -3336227145, 33010852434, 4829754183, -30242513119, 0, 2768339315, 3475263762, -3415905289], [-20950157935951, -115892031584, 825297780, 113162838940, -25129219184, 129601783948, 2729192644, 2729192644, -1903894864, -7106224304, 10091472796, 3807789728], [55382422405794, 169317113788, -27690383480103, -354646168328, 12346259079, 71019254940, 4233683192, 36337350264, -14356495164, 18235387859, 11778257560, 14356495164], [-72497486015467, 13468819260, 72484017196207, -836333781548, 1396466269, -66987610868, -1250005137, -71060548909, 18791762438, -11925891859, -13468819260, -9395881219], [7853120893365, -392416063653, -3922901201612, 783106704962, -20523960795, -151684032985, -4303852646, -72182771422, 5593067797, -17509323300, 6029274990, -5593067797], [43182848680451, -2487442664778, 5990315128, 2482389864208, -26613981802, -2013210278, 5052800570, 5052800570, 937514558, -3201389761, 14220887152, -1875029116], [152124576, 902441404000, 52778489077310, 7741585224, 23719658712, -152124576, -8045834376, 124674146192, 7589460648, -16130198064, -304249152, 7589460648], [58624361854764, -853933114056, -29315204524302, 1723221941100, 28107353396, 62436381312, -1087108436, 28194593736, 9308519148, 20973051120, -14268604552, -9308519148], [-23957890272986, 2516589639651, 47933673064782, 2531620396588, 8112663376, -44454826363, -23143420313, -73878895789, -2861761873, 16753719026, -4056331688, 0], [-46703304499649, 1288630123917, 23358483223932, -2586147074096, 23839933091, 207353875757, -6145690056, 110507911986, 4775121953, 31356191250, 15032516318, -4775121953], [-18647499228998, -7675908084, 18655175137082, 47296582692, 6083053961, -105479572868, -12731213397, -98677199041, -1747068514, 7110802609, 7675908084, 873534257], [-10255600790732, 2235300569644, -25927153788, -2214302171524, 46829183900, 60885564576, -20998398120, -20998398120, -4928755668, -18582204290, -58066438692, 9857511336], [-1312642447, 375443719931, -80994780320215, 1567267968, 14901851672, 1312642447, 1058016926, 25275466024, 2879910415, -12021941257, 2625284894, 2879910415], [-51601624812714, -4018338354822, -4817951036, 4023359366580, 9063617500, 148412933930, -5021011758, -5021011758, 203060722, -5510214766, -15266095996, -406121444], [208940942115102, 2043867616538, -104478941322744, -4098367100800, -60512346272, 15831600570, 14837642832, -554464908, -27572398110, -62615233826, -4205775108, 27572398110], [-13779793929957, 249594744956, 27526869487426, 222742375936, -13990910368, -85147220620, 40843279388, -197146810260, 5866003468, -30867013418, 6995455184, 0], [-31670711972268, 3243667323708, -31705006080888, -1604686607544, -1427780606, -82390629912, -46498548652, 47323450800, 0, -35067179112, -58702988684, -773070492], [20955203280640, -1902432508888, 20896885917592, 980374935968, 56653299104, 51466266472, -27545031524, -59572176980, 0, -8105910508, 3227300000, 50211452540], [60489692539481, -2337780774804, -120986463518158, -2326533447660, 19715395656, -89016904080, -30962722800, -166786481016, 18325766340, -6071542459, -9857697828, 0], [124009007746952, -7528623396, -124001479123556, 8848060744072, 20433694330, 48396396400, -37107646350, 63275152982, 14700266372, 11288365706, 7528623396, -7350133186], [-64177823806562, 2847923582006, 128338180680388, 2855650509788, 21947192200, 50097826806, -29674119982, 107922581394, 25193860518, 12930742692, -10973596100, 0], [-13848803178, -1714837367326, 182908982482583, -16565342268, -40258245537, 13848803178, 44262948624, -81934744200, -2716539090, 37541706447, 27697606356, -2716539090], [-51170310483342, -26414780768, 51196725264110, -5638035457056, -56703006176, 35083831424, 43894084448, 29257396864, -64482430656, -43097147136, 26414780768, 32241215328], [-6181565170846, 1470616827855, 5459877994, -1487458084694, 8641112354, -251543907245, 16841256839, 16841256839, -11381378845, 38003069855, 61905149362, 22762757690], [117466528232184, 1394087217268, 117567337458444, -747448221764, -59196515817, -17276461978, 71718360573, 55391747131, 0, 38115285153, 42627494886, -62693941107], [37161742002124, -4216185856938, -74297823867872, -4197136786716, 8292002712, 140039114670, -27341072934, 299127299562, -6611066154, 79501500274, -4146001356, 0], [-1329910597333, 1704291693671, 2659523072320, 1672699309656, -41924430456, 238981919269, 73516814471, 446371454523, -31294261669, 56752249829, 20962215228, 0], [-45118030693756, -1911410316736, -45129512969884, 961446296432, -61062736452, -13043730792, 67918540468, 84789696636, 0, 71745965844, 147319357064, 83228241972], [-349530559805146, -3768661649386, 174760717930042, 7510664200740, -57814148586, 214674941294, 14968996052, 102775498116, -35783043094, -51969097596, 11690101980, 35783043094], [-15741526852, 2314993794612, 79908862186414, -35977012340, -78331287936, 15741526852, 67460066044, -33807611944, -20235485488, 58095802448, 31483053704, -20235485488], [6218086238, 5422753176010, 84447005455964, -11335114324, 7170558894, -6218086238, -1101058152, 65911791368, -17553200562, -24723759456, -12436172476, -17553200562], [112323713755910, -2650852157462, -224701533141328, -2691026016680, -17494725952, 77598878886, 57668585170, 115023898554, 13931770290, -29963729028, 8747362976, 0], [-92121792552155, -4787486683003, 29955844106, 4782708767618, 29331648982, 254636158581, 4777915385, 4777915385, 25177928721, 24221655261, -10844182566, -50355857442], [-367544159672824, -496983824400, 183768334460912, 989277701028, -50896262406, 107685461928, 6557149924, 50097355464, -12180698772, -51829863482, -1867202152, 12180698772], [320550296076304, -53315994968, -320496980081336, -2641676073820, 23239469441, -304640219308, -24264513049, -278780049969, -54911651258, 75530420801, 53315994968, 27455825629], [-145843008518740, 6230951616900, 323832196, -6208212244388, 81242476448, 156851126680, -22739372512, -22739372512, 23063204708, -4857506800, -91281322244, -46126409416], [10687381805, 19131275650463, -62986879512360, -44156060476, 9404290233, -10687381805, 22781296866, 58493337664, -54843442281, -64247732514, -21374763610, -54843442281], [-129392359843180, -977937445552, 64722372535010, 1930578770204, -11231894464, 305394351480, -26491444260, 178889789160, 27089105940, 14661888116, 51787565160, -27089105940], [-6496346282673, 2570150320314, 12934259841714, 2531613699444, -12427012072, 29951755498, 50963632942, 21366890126, 19896102762, 143692465734, 6213506036, 0], [-131603576853629, 2581024167616, -131653854822989, -1265373099128, -59786933785, 256275809316, -35740380450, -275256866646, 0, -18981057330, -21202791540, 31296912030], [-5346196240, -9693551360496, -19753888080386, 81307999168, 15004974964, 5346196240, -70615606688, -44601984832, 86654195408, 71649220444, 10692392480, 86654195408], [216067645476456, 1171118114522, -44861378320, -1164235508808, 66618766076, -93681271570, -6882605714, -6882605714, -37978772606, 19544171610, 17330955464, 75957545212], [-188714760607326, 16315243311533, -94389256064, -16312092040396, -96260005980, -234577343081, -3151271137, -3151271137, -91237984927, -54432545264, 81784171516, 182475969854], [-338434679544135, 919287449841, 169218653327019, -1788324765414, 91071407621, -323995299891, -18501451358, -160684094994, 52877244171, 75197066166, -31748682910, -52877244171], [262266001898066, -89381035392, -262176620862674, 4041672098176, -42326707864, -621992220416, -165862693248, -536910977536, -8599585024, -161135073584, 89381035392, 4299792512], [-30662137475834, 12699370609452, -30632227753814, -6364640165736, 29292347354, 553429866000, 32520338744, -530879434596, 0, 22550431404, 35130955468, -7359290616], [359379852776121, 29168452754, -359409021228875, 5618900247020, 137998719758, 70646784272, 32889738931, 49960720377, 16964777718, 279718725693, -29168452754, -8482388859], [81000691585978, -17092072774016, 80947113828226, 8572825265884, 51501220819, -536234344798, -52401839833, 501691757549, 0, -34542587249, -51225921914, 19035170503]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_21_f_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_21_11_f_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_21_11_f_a(:prec:=12)
    chi := MakeCharacter_21_f();
    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_21_11_f_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_21_11_f_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_21_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,11,sign)));
    Vf := Kernel([<2,R![251144346540441600, 14809298020761600, 2339921213378560, -35941500446720, 8190073487616, -66881573248, 12108530192, -152858328, 11481368, -59914, 3843, -11, 1]>],Snew);
    return Vf;
end function;