
// Make newform 72.11.b.b in Magma, downloaded from the LMFDB on 27 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_72_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_72_b_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_72_11_b_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_72_11_b_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function ConvertToHeckeField(input: pass_field := false, Kf := [])
    if not pass_field then
        poly := [3348211684, 279415575, 12144527, -121569, 30855, -51, 5, -3, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [-1, 2, 0, 0, 0, 0, 0, 0], [-5385260908, -518764921, 3220592, 639715, -38788, -6467, 640, -39], [5561421676, 107723129, 114219920, -639715, 38788, 6467, -640, 39], [25027780436, 831567895, -64144, 4083379, -42820, -5907, 640, 73], [-3601739852, -1496543073, 18107440, -1923813, 547420, -17723, 2496, -127], [-56323662812, 299736339, -64144848, 10212255, -1067988, 81793, -2688, -51], [21257762140, 1701809933, -75156144, 7125889, 270164, 1247, -2560, 147]];
    Rf_basisdens := [1, 1, 29360128, 29360128, 29360128, 3670016, 14680064, 7340032];
    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_72_b();"
function MakeCharacter_72_b()
    N := 72;
    order := 2;
    char_gens := [55, 37, 65];
    v := [1, 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_72_b_Hecke();"
function MakeCharacter_72_b_Hecke(Kf)
    N := 72;
    order := 2;
    char_gens := [55, 37, 65];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0], [1, 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 := [[-5, 1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 1, 0], [-13, -52, 1, -3, -2, -1, 1, -2], [-17940, 71, 163, -104, -4, 8, 8, -16], [88, 183, -168, -280, 32, -8, -15, 48], [42494, -14520, 414, -832, 426, 64, 64, -128], [206388, -45903, 3605, 104, 1604, -8, -8, 16], [-26369, -107044, 2341, -1743, -3178, -69, 485, 246], [101824, 403261, -17216, -10176, 12800, -1344, 771, -1152], [127852, 511760, -10556, 9940, 15320, 412, 5764, -1352], [-241176, -968855, 24296, -17192, -31008, -3768, 3503, -6064], [-11687250, -533968, -133100, -54080, 9308, 4160, 4160, -8320], [-1410292, -375783, 153345, 34320, 19368, -2640, -2640, 5280], [418630, 1783288, -14462, 70938, 48092, 3678, -67518, -7620], [-1595416, -6425733, 157160, -93480, -198176, -11448, 11165, -8112], [118671972, -8652361, -771017, 247936, 270848, -19072, -19072, 38144], [1200152, 5054859, 73752, 343336, 106528, -17224, 59229, -133200], [-153950668, -1278015, 1637061, -213720, 79716, 16440, 16440, -32880], [-3109979, -11761740, 921511, 940395, -462382, 22137, -44825, -174222], [352284402, 18279720, 9466214, 346112, -261118, -26624, -26624, 53248], [9084134, 36757528, -1294462, -425734, 1122172, -81154, -476542, -116740], [-215876156, 59776399, -1463761, -906048, -2036192, 69696, 69696, -139392], [-790659474, -92502760, -13716086, -1174784, 2462798, 90368, 90368, -180736], [-1185370846, 67181496, -36922974, -1440192, -3454698, 110784, 110784, -221568], [-8301816, -31257785, 2020872, 2310840, -1033632, 336360, -1309519, 347280], [-11908937, -47094980, 3278093, 3625209, -1622458, 313939, 1157837, -42970], [-1753814116, -104446425, -10736661, -5743192, 2638116, 441784, 441784, -883568], [33443424, 134862479, -3814304, 1031840, 4223616, 213216, -1007855, 328384], [-2390513762, 356988256, -23231512, -8181888, -12813320, 629376, 629376, -1258752], [16167264, 58681824, -1386240, 4356384, 2720352, 1688160, 3768000, 3553344], [18684639580, 97145215, -36478285, -3986424, -4577516, 306648, 306648, -613296], [8143179246, 29406224, 116259292, -9014720, 2197748, 693440, 693440, -1386880], [28387749260, -406870983, -89545695, -19983600, 8897448, 1537200, 1537200, -3074400], [105407952, 414353795, -3963696, 14726064, 11529408, -405360, 19639981, -4796256], [271816433, 1107278052, -20167125, 22357471, 31577290, -462859, -1739925, -6862230], [-325685528, -1322224173, 33155304, -10165288, -38895136, 1314376, 7586373, 6155856], [-65628546004, -1366833183, -256778967, 21093072, 37221384, -1622544, -1622544, 3245088], [-100341951, -332685436, 65970555, 94357263, -19914870, 2245893, -5213573, -17413110], [-421484008, -1669806575, 83776280, 52580136, -57541856, 111288, 22943959, -12838992], [146599510452, -2516979601, -332664233, -7195760, 69979688, 553520, 553520, -1107040], [-221799552, -796339947, 57278592, 42333312, -34201344, -3821184, -46689429, -21091584], [1115709160, 4377112768, -188827880, -90620136, 145438448, -3841272, 30242904, 12091536], [-44309038366, -1320042312, 170916450, -140237760, 38699862, 10787520, 10787520, -21575040], [-1168691152, -4594896561, 140676656, -26594736, -149484992, -8978064, -70635391, -18040992], [171516987, 698738732, 36255961, 105580853, 14375310, 4318311, 52480345, -14519858], [-304818233876, -6992835087, 1681041145, -44668208, 276809800, 3436016, 3436016, -6872032], [2828755508, 11209037808, -447647844, -197268596, 358991848, -19956604, 22891740, -5563512], [666397326084, 4675196255, 1185852031, -27684800, -114414304, 2129600, 2129600, -4259200], [-3532233968, -14322195223, 368783632, -130744208, -432043840, -4223792, 108928519, 21070624], [-27510391090, -2099819496, -2073690678, 257723648, 18109710, -19824896, -19824896, 39649792], [-242377170, -1037519944, -194678886, -449027022, -11830836, -36007578, -151734374, 13235916], [-242882185534, 17199106680, -1401515406, 75256896, -594978042, -5788992, -5788992, 11577984], [-835042127932, -5051071113, -2137421625, 658215584, 138087504, -50631968, -50631968, 101263936], [-68359483650, 5000912672, 2452320760, 78322816, -76965208, -6024832, -6024832, 12049664], [5401373405, 20963617876, -1141526449, -830498637, 737846338, -23138415, 94201615, 143994018], [-2668884208, -11285816007, -237987568, -1011383184, -255202112, -25003824, -66995785, 184085280], [3382627998, 13515183384, -565598838, -135132606, 470990220, 54084630, -261795894, 182515884], [-1079687656, -4976273907, -453697512, -1192939736, -91032032, -103480648, 99130587, 13663152], [-320368722962, 24545900248, 5182281626, -275228928, -643072514, 21171456, 21171456, -42342912], [1502385219556, 4098339561, 244094341, 531528088, -88719428, -40886776, -40886776, 81773552], [-8974671248, -36013818457, 1153356400, -102779376, -1164725440, -80041296, 298183145, -194418720], [-166167319308, -32405809647, 11566356437, 633417512, 1460894372, -48724424, -48724424, 97448848], [2479319699, 9702013772, -698201119, -770530467, 342867262, -59862753, -168078879, 28010046], [-686497868302, 30581073744, -3022416756, -1179701952, -1163020668, 90746304, 90746304, -181492608], [3298354112, 13180820101, -203187520, 721564224, 469127680, 189683904, -62703173, 341239680], [477427103428, -74977975431, -4929471803, -1704082952, 2145459820, 131083304, 131083304, -262166608], [-282411980254, 59992456608, 6975252312, 1123484544, -1634961720, -86421888, -86421888, 172843776], [-375575830284, 10514987351, -6527178929, -3948166352, -814264648, 303705104, 303705104, -607410208], [-17163600880, -67095697709, 3043727120, 1805585264, -2216086592, 150304208, -693005539, -38059744], [529326893886, 50502396800, -6577251296, 509666560, -1807132576, -39205120, -39205120, 78410240], [-1485665239, -7134657084, 298883603, 325390887, -170793734, 69211149, 1211103059, 108982938], [-7769071054, -31488286168, -21925274, -2519259666, -1020298604, -434811910, -64304090, -565917836], [7278698824, 29712373845, 339820872, 1789492856, 635853920, -161856728, 1270575459, -892479216], [-3252540300372, 36328407561, 9389940353, -3033768400, -1072237768, 233366800, 233366800, -466733600], [19486759792, 80488563776, -1888204976, 575206800, 2264937440, -178258128, -1530780592, -634011552], [-3844596840, -17708599889, -470500200, -1637920344, -339188448, -18543048, 1162037177, 358486704], [29074855776, 114721374407, -4001995424, -145314400, 3807669888, 243336672, 678218713, 705504448], [59355360510, 56491103432, 39009675070, -114071360, -571559542, 8774720, 8774720, -17549440], [2968957938098, 28344941520, 29267901036, -8171177664, -517675740, 628552128, 628552128, -1257104256], [-9103024802132, 135458027551, 17725400171, 1051537656, -3727376276, -80887512, -80887512, 161775024], [21858383264, 87796418585, -3227360864, -367921824, 2923785088, 239229728, -1416323513, 749862208], [-19598339930, -76988479656, 4446410242, 4971035706, -2373837124, 825889470, -360744062, 1028437116], [1649965707330, -48790204296, -53318184718, 4152529472, 132145286, -319425344, -319425344, 638850688], [33430744157, 128175171956, -4177631633, 461925555, 4290515746, 236157329, 5126737519, 533951266], [12227456942796, 256291371575, -50786911229, 6591657592, -9464126356, -507050584, -507050584, 1014101168], [5384387739422, -405927594744, 24604680366, -3841045312, 13630797402, 295465024, 295465024, -590930048], [-1963631539822, 35823702864, -24177717876, 9727758144, -1283794044, -748289088, -748289088, 1496578176], [39815332496, 159250017385, -5395122544, -37475088, 5205161152, 342447696, -1129748729, 951099936], [-30290536202, -118425059624, 1033038770, -3166042134, -2993763940, 755408206, -7566693454, 2868883100], [-15819516621892, 132009658383, 33309234867, -1377816856, -3276194940, 105985912, 105985912, -211971824], [-33511200852, -146944598768, -8640686460, -22904892780, -2478703272, -666113316, -2114005948, 3894411576], [-123521313417, -499752358244, 13979499821, -4722770759, -15759920538, -1161929325, 5901296813, -2014612954], [13807803147780, -214795642201, 8136357943, 2945985952, 7388728592, -226614304, -226614304, 453228608], [7484219907356, 151755985233, -17353634559, -7157633184, -5934692688, 550587168, 550587168, -1101174336], [80056239771, 312363607116, -14016839655, -9627108267, 9941138862, -1475706681, 5437067481, -1651416306], [45868891256, 185659640261, -10895037832, -12615619128, 5594405536, -2014354536, -5099137341, -2385570192], [14849276170478, 241109410704, 20982661884, 16689238592, -5982725292, -1283787584, -1283787584, 2567575168], [-17996417977660, 814589339577, 80267218053, 1067831544, -23616268308, -82140888, -82140888, 164281776], [103213072248, 418511407955, -11647045256, -457293112, 12078336672, -1319875944, -1712491979, -3515335568], [8067233927924, 384885560673, 160719921477, 15056439528, -6222405564, -1158187656, -1158187656, 2316375312], [67077903976, 258301909713, -10584413336, -7448439720, 7821419744, -1922452536, 10671347143, -3424634544], [11122651619244, -265975751953, 263090128603, 14185874872, 18017059724, -1091221144, -1091221144, 2182442288], [-16879594839282, -1541345805040, -106554113636, 18304816192, 47509980212, -1408062784, -1408062784, 2816125568], [10591322688596, 322961565513, -85907256339, 19136790504, -11907199356, -1472060808, -1472060808, 2944121616], [-25057728833406, 13170048480, -128680087864, -49897853824, -7918843240, 3838296448, 3838296448, -7676592896], [-24244336472820, 232015380359, -33895040813, 15210520312, -7558688404, -1170040024, -1170040024, 2340080048], [-2785654753314, 410649190976, 182086901488, 10961057536, -6638613424, -843158272, -843158272, 1686316544], [-346156486153, -1357745287396, 60422882093, 32139118137, -45187606298, 1668566547, -8199159891, -3446221530], [61948296111506, -129460795224, 158231963526, 18305364480, 10506825570, -1408104960, -1408104960, 2816209920], [-44018105324, -153886965232, 15367189852, 18771265324, -6535292152, 1107469924, -11706284324, -1647274040], [342182944416, 1351897388393, -56689512800, -23193324448, 45029884800, 125931552, -969881609, 6144642880], [27062225680590, -37483838056, -266182712726, -24284289536, -9004370194, 1868022272, 1868022272, -3736044544], [63992231925428, -521963893287, 52373656941, 994166472, 18593624436, -76474344, -76474344, 152948688], [-149139414315, -625432261772, 1415277239, -30240189125, -16220577102, -629589399, 8240628215, 5828676434], [27173398662558, 2429343904712, 239628575614, -43188471872, -73529498806, 3322190144, 3322190144, -6644380288], [-71112902430796, 2256269640321, 139658102853, 49394413224, -64968488412, -3799570248, -3799570248, 7599140496], [357861771469, 1412898171540, -74895138017, -58545572925, 47611115810, -3977528511, -12433297697, 3698189826], [-655108045072, -2583453039655, 99493087472, 22879143312, -86315098304, -3476835024, -8520069321, -15281082144], [74461582484068, 1565482386127, 134438757023, -64241904480, -50466745904, 4941684960, 4941684960, -9883369920], [179077647904, 710883482909, 5860581664, 55039524064, 19741589120, 3835182496, 34242408643, -3213129152], [-43607863734878, -1341575914632, -225856019918, 11257420096, 36745183558, -865955392, -865955392, 1731910784], [38875384568, 81520461943, -49196556808, -67124455608, 13696171936, 3876314136, 11039713681, 27440977776], [-68124228213148, -2034970434969, -328606385337, -44794175296, 52042903008, 3445705792, 3445705792, -6891411584], [-104674667619284, -1621213134447, 59092198585, -81189251312, 48763919464, 6245327024, 6245327024, -12490654048], [-78661726232, -253642365675, 49257581032, 82164792024, -12222960160, 8095550280, -25691483645, 1721565264], [-1380668878456, -5502982333375, 175043345032, 2055018552, -173479806368, -1072058776, -14667725513, -3461916272], [-977670001846, -3857600134296, 171247298894, 95216674518, -126880627292, 6483331314, -2738193970, -5975007516], [423210854009, 1741275616932, -49279739229, -1382755241, 50509498234, -3842273251, -36981879261, -10220562630], [-222883490624, -867794567661, -7306130496, -67679028928, -24363500032, -4339767872, -60394420947, 4985395584], [-2178527240676, -5783396301663, 176655759089, 71390667296, 197042741456, -5491589792, -5491589792, 10983179584], [319984991721, 1374941709668, 44303269491, 162394110951, 31652657370, 10482257229, -7273495565, -11772320358], [527295884530, 2060225788552, -83077316218, -36795244626, 66704275892, -4049163974, 34521099014, -1936389772], [-893057749200, -3492009441883, 166729282096, 90058196816, -120997477056, -1405413264, -8110314197, -26379435680], [-227823445413746, 1043818013872, 453948678260, -27013716288, -20837895044, 2077978176, 2077978176, -4155956352], [-107830521893534, 3350442332280, 397519921906, 118451594560, -87319598714, -9111661120, -9111661120, 18223322240], [-1130364001960, -4637475696753, 57019703384, -161035971096, -132634203104, -9806971656, 27115368473, 13289820720], [-23241808197524, 112770579633, 539876809465, -176396378288, 1959500680, 13568952176, 13568952176, -27137904352], [-1337196364264, -5477698317619, 96056940056, -143527133400, -161711693792, -12217625928, 60974794779, 2283312048], [275641617616046, -307268054736, -197856009132, -24723779392, 1872988956, 1901829184, 1901829184, -3803658368], [-60926488147788, 5107304012313, -297930248659, 12723386312, -173509960204, -978722024, -978722024, 1957444048], [-1000176353224, -4102971487589, 67372437560, -130989919224, -124164409952, -17405974440, 60593052205, -15118949904], [-743412343955, -3111807244492, -29395777889, -230064110429, -79461901246, -12348752159, 5743230367, 23556959170], [80569682807292, -2915379391561, -656620130453, -58609578872, 68936505620, 4508429144, 4508429144, -9016858288], [-1066694005368, -4256629244693, 187890221960, 131273246776, -132368201376, 20229205608, 22563240077, 22812003728], [160015251893, 711383919316, -11083998793, 49829300955, 27061032082, 17875234377, -92045447753, 36699569298], [1174620386552, 4506275855677, -281216937736, -267850163896, 157949864608, -21316017640, 60595124939, 8343492464], [-474965423543858, -1512967409264, -755266296964, 100451098176, 31171945684, -7727007552, -7727007552, 15454015104], [-96653564844628, -11442919106391, -21249568671, 136657286064, 377596651896, -10512098928, -10512098928, 21024197856], [363098388156, 1283966437392, -143315000076, -157948880508, 62547887928, 3585343788, 38313087540, 49346915544], [-815525613104, -3328975154705, 21546312656, -108228109392, -82637210176, 13953685648, -59647858111, 65429662880], [-113693440179042, 3767494558304, 1086801971368, 87460487296, -80614318792, -6727729792, -6727729792, 13455459584], [346922155234500, 881073085137, 1006394553773, -55330850536, 335598332, 4256219272, 4256219272, -8512438544], [-1151480359557, -4662727046740, 55682941209, -189986106891, -140058849906, -21234289497, -16672530791, -10897769394], [-362909329413412, 1051502795577, -1681592629767, 155334900864, -77757315648, -11948838528, -11948838528, 23897677056], [-132005876846, -656433094040, -115754217146, -225392858226, 3737596820, -1359617574, -36216299898, 52609266228], [1148260946865, 4946766051620, 110601677995, 463834190879, 112118766858, 18393301173, -65624849813, -65376969494], [371898836431966, -6216975201080, 290366500670, 231136431552, 225399815818, -17779725504, -17779725504, 35559451008], [-473608386863950, -11855096061336, 826439088534, -87408771840, 403225608210, 6723751680, 6723751680, -13447503360], [-71731615936, -543168451327, -95854709440, -115884132672, 22338607360, 31148071488, 68097655743, 114628229760], [-631154326650516, -2265068644753, -1273710625925, -289852756232, 12559875500, 22296365864, 22296365864, -44592731728], [-784694641393138, -1633715251056, 227169953724, -255158847424, 42933545364, 19627603648, 19627603648, -39255207296], [-700003866245, -3294209733780, -385892802087, -870598147339, -30584924722, -37642693721, -36415587111, 114132129102], [604757183337444, 2515950814727, 1390960926055, -102189608768, -43136446624, 7860739136, 7860739136, -15721478272], [-463441237834626, 3328583510792, 891294104878, -518609359424, -113367779110, 39893027648, 39893027648, -79786055296], [1306917844359, 5425513124380, -58093986531, 107582142633, 129785099718, -35800083741, -804867811, -125345765946], [-4968350027388, -19495496944112, 848544781676, 399005226940, -653110633176, 8136929940, -105094267540, -77374749400], [3036504299432, 11941583144057, -456696428888, -221224062696, 369530190304, -46891585528, 190913659615, -73645844528]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_72_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_72_11_b_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose lines below.
// The precision argument determines an initial guess on how many Fourier coefficients to use.
// This guess is increased enough to uniquely determine the newform.
function MakeNewformModFrm_72_11_b_b(:prec:=8)
    chi := MakeCharacter_72_b();
    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_72_11_b_b();".
// This may take a long time!  To see verbose output, uncomment the SetVerbose line below.
// The default sign is -1.  You can change this with the optional parameter "sign".
function MakeNewformModSym_72_11_b_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_72_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,11,sign)));
    Vf := Kernel([<5,R![1619965775150320252354560000, 0, 2340077207246733312000, 0, 643618525286400, 0, 48458880, 0, 1]>],Snew);
    return Vf;
end function;