
// Make newform 5.20.b.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_5_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_5_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_5_20_b_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_5_20_b_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 := [32429098232548950016, 0, 10607307647230976, 0, 160513523376, 0, 726881, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0, 0, 0], [0, 947168012636830720, 0, 20083149107568, 0, 111026445, 0, 173], [726881, 0, 4, 0, 0, 0, 0, 0], [15034918824126539505664, -324881951467425186816, 431776354413212928, -4679503473675312, 1808281798512, -19390777353, 1840496, -24489], [-54668859249162963460096, 3822609063572486667264, -1696999713707676672, -14399254905804432, -7233127194048, -173282696883, -7361984, -254739], [-36463112405104365338624, 324881951467425186816, -4841151702138678528, 4679503473675312, -40236733980912, 19390777353, -75460336, 24489], [114808534545669121482752, 3903274099116368632832, 3424105131360528384, 56254457429641584, 14466254388096, 233244460461, 14723968, 294733]];
    Rf_basisdens := [1, 1, 1505285197258752, 1, 3763212993146880, 7526425986293760, 3763212993146880, 7526425986293760];
    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_5_b();"
function MakeCharacter_5_b()
    N := 5;
    order := 2;
    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_5_b_Hecke();"
function MakeCharacter_5_b_Hecke(Kf)
    N := 5;
    order := 2;
    char_gens := [2];
    char_values := [[-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 := 20;
    raw_aps := [[0, 1, 0, 0, 0, 0, 0, 0], [0, -1, 1, 0, 0, 0, 0, 0], [18375, 94, 27, -2, 1, 0, 0, 0], [0, -30616, 322, -1, 2, 1, 0, 0], [-422446908, 462, -154, -358, 552, 0, -372, 154], [0, -2594783, -337345, 1051, -4340, 68, 0, 1119], [0, -67282226, 5212914, 7446, -32232, 1224, 0, 8670], [568398547580, -10026, 3342, -2724542, -39936, 0, -19884, -3342], [0, 2372966902, -32886096, -267675, 961470, 54615, 0, -213060], [-23527787543130, 4145916, -1381972, 94661300, 7593984, 0, -697848, 1381972], [9014375835872, 7538148, -2512716, -116458820, 19518360, 0, 4442064, 2512716], [0, -310999080351, -15941339241, -12944049, 59191044, -3707424, 0, -16651473], [-414283678607238, -100322985, 33440995, 888631729, -218857566, 0, -18211596, -33440995], [0, 2464856493413, 10380791911, -21680494, 75693596, 5514190, 0, -16166304], [0, 1726140963416, 87173371058, 117420763, -351324142, -59179455, 0, 58241308], [0, -20425881248321, -78489932271, -481245867, 2131758852, -103387692, 0, -584633559], [32456004097251540, -4537909902, 1512636634, -26947931882, -9811139904, 0, -735320100, -1512636634], [-72861695344153258, -3751274601, 1250424867, -32361154967, -5621672442, 0, 1880876760, -1250424867], [0, -57036762632819, -2035417736185, -1527263570, 2874188932, 1617432674, 0, 90169104], [-327125950075365768, -7083580608, 2361193536, -477858165936, -23998997736, 0, -9831836520, -2361193536], [0, 534468205048404, -5032854950484, -6285488880, 28639789248, -1748916864, 0, -8034405744], [491886511388732720, -25177492548, 8392497516, -340189147964, -47964744360, 0, 2390240736, -8392497516], [0, 306559976658421, -36093084535137, 27030707790, -120710308860, 6293738850, 0, 33324446640], [265017637704615210, 268064209044, -89354736348, -609354529668, 501606971904, 0, -34521446184, 89354736348], [0, 4390030698345722, -2475407522666, -145344523462, 554882220632, 13247936608, 0, -132096586854], [3816542629706525502, 22984163508, -7661387836, 7608518218652, 392721240672, 0, 346752913656, 7661387836], [0, -4352833311745898, -197950908998608, -115103276387, 594097094014, -66841994233, 0, -181945270620], [0, 6164885900403863, 299573811009665, 314734351588, -1265184761416, 3123677532, 0, 317858029120], [-1754764542192658810, -552215952621, 184071984207, -21485305398563, -1601537994330, 0, -497106089088, -184071984207], [0, 14665021403378924, -474893321130124, 211631912980, -1064365466896, 108918907488, 0, 320550820468], [0, 67151358778311582, -755933614896696, -3315030752487, 13303722319566, -21799654809, 0, -3336830407296], [-26053320532486227828, 4969664132694, -1656554710898, 118475136223906, 9478852798416, 0, -460475466972, 1656554710898], [0, 217106662866776818, -1000892937129522, 4286781254046, -16703131339080, -221996838552, 0, 4064784415494], [69088716198960561860, -2485129160610, 828376386870, -104433401322294, -2960925687192, 0, 2009332634028, -828376386870], [112518940631464797150, -587323571565, 195774523855, 170566477025293, -7196398572402, 0, -6021751429272, -195774523855], [-202464461490923833048, -17401746568356, 5800582189452, -773932965993996, -24835627758576, 0, 9967865378136, -5800582189452], [0, 367723327464559039, -9192777475097191, -3199410182879, 16202322021100, -1702340644792, 0, -4901750827671], [0, 637627076007005211, 14706369438379293, 22966536772620, -87155278594248, -2355434248116, 0, 20611102524504], [0, 142226307828885514, -27660328014168108, 18888562685169, -90453136267530, 7449442763427, 0, 26338005448596], [0, -115824039356931821, 29399864006034549, -43022351401587, 148686634415340, 11701385595504, 0, -31320965806083], [249510614122271912220, -97504046460198, 32501348820066, -985983317165058, -144717275275704, 0, 50290817644692, -32501348820066], [1347752448638994179822, -174650855892660, 58216951964220, 553690801157860, -358335553547040, 0, -9033841761720, -58216951964220], [1617174501526759797312, 66646364217816, -22215454739272, 5552849618701928, 47469881748048, 0, -85822846687584, 22215454739272], [0, -3213480801707016338, -5731428885293950, 8485004979166, -62045502126968, 14052741105152, 0, 22537746084318], [0, 1393232921023573303, -15660537956771751, -56226607178043, 289494560465412, -32294065876620, 0, -88520673054663], [726079648233957246200, 714826993126608, -238275664375536, -7240199256774720, 1371178768660920, 0, -58475217592296, 238275664375536], [-1199561957393346026308, 816297749564238, -272099249854746, -3288191627282678, 1724590112667792, 0, 91994613539316, 272099249854746], [0, 13465638057573069026, -67209766923742628, 635247358452269, -2801549723653498, 130280144922211, 0, 765527503374480], [0, -10994806638170922989, -57044076842978763, 781054603064292, -3070778646751992, -26719882752588, 0, 754334720311704], [12470703452635039233470, 650297298345444, -216765766115148, 13464304580302444, 1235349181616448, 0, -65245415074440, 216765766115148], [0, 2754735563125630988, 216364398572255156, 113065896554296, -96344196908128, -177959694654528, 0, -64893798100232], [25705684890551073369360, 1853374583499756, -617791527833252, -9430273389755756, 3313256334029496, 0, -393492832970016, 617791527833252], [-32366275296741387177838, -2949522203080125, 983174067693375, 29209902444604645, -4850572189243830, 0, 1048472216916420, -983174067693375], [-9928274946622006472748, 940926513556062, -313642171185354, -75510787285123926, 363946614890424, 0, -1517906412221700, 313642171185354], [0, 28674652498203554320, -447071242537318464, -835756829237808, 3633839293191408, -145405988120088, 0, -981162817357896], [0, -8722621957028160964, 1053978279707426198, 1434820783443475, -6568175540418838, 414446203322469, 0, 1849266986765944], [22029797320503453119430, -686356230092625, 228785410030875, 120600121914134481, 896619726265782, 0, 2269332186451032, -228785410030875], [23408896558830073016432, -1669493228811372, 556497742937124, 89624578868276140, 1041958289737320, 0, 4380944747360064, -556497742937124], [0, -133863225670677676771, 4189361658511343419, -4514056868895949, 17890261537556276, 82982969013760, 0, -4431073899882189], [44448186260206286182122, -5475627884667381, 1825209294889127, 147511056770163437, -17712642766246158, 0, -6761386996911396, -1825209294889127], [0, 118122326787999285319, 879350627941606769, -3506042783232452, 12972382628771704, 525894252079052, 0, -2980148531153400], [0, -89041374588317149019, -3122125537964407149, 3447805497872883, -10672481424292524, -1559370283599504, 0, 1888435214273379], [0, -73595348581193967879, -8665335843776586189, 8664074625814626, -31666924967883012, -1494686767687746, 0, 7169387858126880], [-194246933582108159983608, 7081607277736332, -2360535759245444, -281428158689067452, 8943978048410928, 0, -5219236507061736, 2360535759245444], [0, -231899470258361904202, -12302033761268122550, 5222559640443050, -25553463264794200, 2331612351511000, 0, 7554171991954050], [0, 684976251336170106721, 12283333790164095183, 3104073834435843, -6774061466240676, -2821116935751348, 0, 282956898684495], [-585293696136817716909628, -6765794655599646, 2255264885199882, 29334753058009350, -42062960950516560, 0, -28531371639317268, -2255264885199882], [0, -1201010080559053610624, 17561359822609089680, 27085879777462360, -105429785219185712, -1456866945331864, 0, 25629012832130496], [0, 80481513070975108421, -19226513618175741145, -34311711064286630, 122993263096713116, 7126790580216702, 0, -27184920484069928], [-16178119868345745535450, 126783735802735860, -42261245267578620, 1096776898276468444, 206711918410799904, 0, -46855553194671816, 42261245267578620], [0, -101473457511462642220, -1543537168871276596, -12175844508611708, 25377363429683312, 11663007302381760, 0, -512837206229948], [458878245687060217646040, -161426185200850716, 53808728400283572, 304921423216647948, -357633990000043824, 0, -34781619598342392, -53808728400283572], [0, -2155973746493490277258, -45238680783528750368, -18791050273175239, 80371671284050910, -2603735095674977, 0, -21394785368850216], [0, -229016362716413956067, -16861531035156127717, 57006632111205763, -208413668172194924, -9806430136314064, 0, 47200201974891699], [-102015993321399758452780, 41251050663956334, -13750350221318778, -4533889018868755622, 92651481727879032, 0, 10149380399966364, 13750350221318778], [0, -1972272483241038478418, 13707523438063398792, -20533283606274327, 43143278381985726, 19494928021555791, 0, -1038355584718536], [-238602991549326480967890, 255534901452940107, -85178300484313369, -3193245697517157355, 534518762636285022, 0, 23448959730404808, 85178300484313369], [0, -4233596705211064792827, 62364964275586218315, 64802714208963423, -264976912059978324, 2883027612062316, 0, 67685741821025739], [2135728188297283245864402, 154890240711762444, -51630080237254148, -7464994939058559644, 171633047570447616, 0, -138147433853077272, 51630080237254148], [-1203928818332973132465910, -107344963644281577, 35781654548093859, -4421603683056659183, 8704380662675730, 0, 223394307951238884, -35781654548093859], [-2320343445795177238225620, -51035257598624598, 17011752532874866, 12744744580474922446, -100956852625730088, 0, 1113662571519108, -17011752532874866], [-2273446859766257569847218, -154753638832970685, 51584546277656895, 2523049313001683389, -450737174708000706, 0, -141229897042059336, -51584546277656895], [-4678181429755425746974128, 107339470487165124, -35779823495721708, -2403351076634967684, 295966441644405576, 0, 81287500670075328, 35779823495721708], [0, 597612612980909568282, -235387111833566088954, 131581759964645682, -325111381834490328, -100607829012046200, 0, 30973930952599482], [-2711315504900500597246840, 150056711014496796, -50018903671498932, -10085127643899808076, 268150317145056336, 0, -31963104883937256, 50018903671498932], [0, -9227540624265500394557, 89860752072802369389, -99915973242184536, 255088699599675888, 72287596684531128, 0, -27628376557653408], [-5782289258212289303802750, -817904903164212933, 272634967721404311, 33087283608811732461, -1052140527697521414, 0, 583669278630904452, -272634967721404311], [0, 20217303013174544910878, 63094369567513528450, -248751494642466742, 1039641820297946504, -22317920864039768, 0, -271069415506506510], [8452597393135942479981942, -1277568849299610012, 425856283099870004, -30728758961104682068, -2147081566364031648, 0, 408056132235188376, -425856283099870004], [0, -17386744122195522811136, -9057695294701655542, 240750975060454387, -1101180334975296398, 69088217366739425, 0, 309839192427193812], [0, 4740188121640922561263, -638921086383443541663, -78426933962174520, 312840336450181200, 433699699258440, 0, -77993234262916080], [1679347288790001907401120, 1764059443965846048, -588019814655282016, -32783313990013104544, 3222881484543335040, 0, -305237403388357056, 588019814655282016], [0, 25215518768561906588076, -252193040606218745370, 1334561681787036435, -5267744362429757142, -35251182359194299, 0, 1299310499427842136], [2825883515999098313400612, 1394455742976778746, -464818580992259582, 55782233577627208174, 1239118811322389664, 0, -1549792674631167828, 464818580992259582], [-29737640219750005222324900, 3596233678196064354, -1198744559398688118, -3507559856118030986, 7648959308784687384, 0, 456491952392558676, 1198744559398688118], [0, 24232496927404962748534, 167293677711611064960, 411442178962437429, -1203705201021260754, -221031757414244481, 0, 190410421548192948], [15117103076205091448721990, -4446828644032048260, 1482276214677349420, 14885040175808596276, -9334344622003741056, 0, -440687333939644536, -1482276214677349420], [-16566433641019083949089318, -1807917277925905344, 602639092641968448, 31312976198067062016, -4442455089491049504, 0, -826620533639238816, -602639092641968448], [0, -51451996633283232095565, 819853425305126861853, 1387069093565944176, -5173783817023177104, -187246278620299800, 0, 1199822814945644376], [-27518530736753118627077338, 1814283792284905404, -604761264094968468, -28571167985541029964, 2922064402739534496, 0, -706503181830276312, 604761264094968468], [0, 31066588081860814303103, 982662754368526358929, -72778875663271888, -367375473611451088, 329245488132269320, 0, 256466612468997432], [0, -88744347514836593004205, -1650268725151768865659, -2783213811355223603, 11771584294585335068, -319364524582220328, 0, -3102578335937443931], [0, 88108641395551818364691, -3689240355054931294555, -944128330167940868, 5048768983346516600, -636127831337376564, 0, -1580256161505317432], [108263027179159020042458730, -2268119513289454233, 756039837763151411, 247181458357469082881, -5077737939026117358, 0, -541498912447208892, -756039837763151411], [-21129454552510911070265068, -12123006078947427162, 4041002026315809054, -26481010242966167582, -23670067709197332792, 0, 575944448697521532, -4041002026315809054], [0, 1106989074297344040324, -490344943537686709284, 4750694817018582468, -16556181006790068816, -1223299130642130528, 0, 3527395686376451940], [0, -139732177009831511588099, 7056282566441518539183, 1814982930749467098, -7739272621107874980, 239670449055003294, 0, 2054653379804470392], [0, 97470138131721074828236, -10325789871572592636, 4224384894803156676, -15994161203558567232, -451689187827029736, 0, 3772695706976126940], [227495133481889661616237800, -8544451755023166216, 2848150585007722072, 93929253729112263352, -16682444210610110088, 0, 406459299436222344, -2848150585007722072], [49389557313316592067287402, 16699689620924867811, -5566563206974955937, 193873610155382491957, 35621990118293888082, 0, 2222610876444152460, 5566563206974955937], [0, -72214691575102183754504, -1744640548031380700062, -4981829942278009757, 18233587005213709666, 846866381949164681, 0, -4134963560328845076], [0, -161415425335104118921281, -1425016537951976158431, -1350605020806249987, 9760658141781150996, -2179119029278075524, 0, -3529724050084325511], [0, 170077918992097448519104, -12953402711135933830704, 3436384134557011788, -14320148383725166944, 287305922748559896, 0, 3723690057305571684], [1017920381574655845926180, -9862308289377891702, 3287436096459297234, -245037754424346907362, -12668906592786546336, 0, 7055709985969237068, -3287436096459297234], [71455286761074086897350472, 11895643370921802300, -3965214456973934100, 125712439797323750356, 11051674832616923376, 0, -12739611909226681224, 3965214456973934100], [86292279361425911644255362, -17870588241593470557, 5956862747197823519, -752522364132991598683, -29259694463571061638, 0, 6481482019615879476, -5956862747197823519], [0, 199453048294057843744297, 4116282464836120541795, 1873271672215691626, -11261212048693367108, 1884062679915300302, 0, 3757334352130991928], [0, 479518361530316126441992, 7798013344776128832978, 6622879866959966367, -25447763437107504942, -521878015366180263, 0, 6101001851593786104], [0, 208709715216518324110933, 4882696326217278994443, -527484247533742737, 6561530878429355868, -2225796944147192460, 0, -2753281191680935197], [478608947497375426404564540, -35188010361191539950, 11729336787063846650, 904216728485883265478, -72068904097357332744, 0, -1692883374974252844, -11729336787063846650], [-158236488532819497682067458, 25238850583567388391, -8412950194522462797, 268003885724878148841, 57827099536510370046, 0, 7349398369375593264, 8412950194522462797], [0, 57008301083902794447026, 20639703744264367681822, 3294789260356530194, -14629387756223135368, 725115357398507296, 0, 4019904617755037490], [0, 467144107935839432115323, -5991190987653020923483, -28068735165827610695, 101735224508071651268, 5269858077619395756, 0, -22798877088208214939], [0, 4560907337000516697841, 10345563330879533481267, -33573972080067192546, 126328369318991592756, 3983759500638588714, 0, -29590212579428603832], [-301888676387118593274929188, -7747114424014537722, 2582371474671512574, -165027887934520592558, -13315464085884948288, 0, 2178764762144127156, -2582371474671512574], [-500893870625835921527228298, 49106010162400519995, -16368670054133506665, 334250416167489392949, 93036779779574116854, 0, -5175240545226923136, 16368670054133506665], [-933586790515039328237645410, 9724462269281525772, -3241487423093841924, 1558908504504911811108, 24873572412834278496, 0, 5424647874271226952, 3241487423093841924], [831374368757285929742908080, 66225113418304247436, -22075037806101415812, -1760022432445803963276, 127280028117869415480, 0, -5170198718739079392, 22075037806101415812], [0, -378259907464155122380108, -4301676122074880602562, 37769384557689551267, -151348378134693133558, 135419951967464245, 0, 37904804509657015512], [0, 858864645461923427151835, -6357854914369888131907, -41036375529087997379, 171859935317051703580, -3857216600349857032, 0, -44893592129437854411], [-1007295231176186200399176340, -177341574104428768974, 59113858034809589658, 219321850205308403782, -331919713171689037656, 0, 22763435037168500292, -59113858034809589658], [0, 1826435921208206646589328, -10939157202195257827750, 58664191215097682935, -239490770280488024158, 2417002710048646209, 0, 61081193925146329144], [1067887599672701568773547152, 40204582277896151856, -13401527425965383952, -326042633141949530384, 85077769546331502096, 0, 4668604990539198384, 13401527425965383952], [0, -2368113867431133490339335, -6027536406657238351857, -25432854566867665281, 101971052131141604916, -119816931835471896, 0, -25552671498703137177], [127863979145703380814237642, -20609600424859927524, 6869866808286642508, 5519222407124851267348, -3902703098565124032, 0, 37316497751154731016, -6869866808286642508], [-1823752275957782723263539070, -86565106185611065920, 28855035395203688640, 21715419255122187136, -226255633080856905888, 0, -53125420709634774048, -28855035395203688640], [0, -468277077378385825766837, 3573047828407205355045, 22972919145689298585, -117465145324226826636, 12786734370734816148, 0, 35759653516424114733], [0, -2244511406695077188796419, -22565276472137799529369, -100986924811853352074, 389886631911634052692, 7030533667889677802, 0, -93956391143963674272], [0, 1292306569459588855161109, 59845681048331202499803, -22255151671170111705, 36975771242160004908, 26022417721260220956, 0, 3767266050090109251], [-176616692433886457823559110, -57785883251621508576, 19261961083873836192, 1758728492262859176096, -60721737852280781856, 0, 54850028650962235296, -19261961083873836192], [-2760581651188948788558425308, -229811946870817510218, 76603982290272503406, 3624340495502076742386, -475697975721285090024, 0, -16074081979650069588, -76603982290272503406], [823972919927669108962983582, 44402572494750898767, -14800857498250299589, -7895001604041810909535, 14667847227855475710, 0, -74137297761646321824, 14800857498250299589], [0, -5886317067956299757688398, 12767370731404431629228, 28162288438767086929, -67745357869976998154, -22451897942545674781, 0, 5710390496221412148], [0, 2786504774518551974169937, -115439547894287783358525, 81200766005110221174, -289943222409325134300, -17429920805557875198, 0, 63770845199552345976], [-965092671146587844494770730, 197562867463856556279, -65854289154618852093, 890077518984375117513, 271454839350293616102, 0, -123670895577419496456, 65854289154618852093], [420670461671654793627786360, 317496949000899561732, -105832316333633187244, 2839712185700010153452, 696248262692435583504, 0, 61254364690636460040, 105832316333633187244], [0, -560052994897211210149441, -65597657993733781235903, 31386219936899813381, -188801907638111897836, 31628513945256322156, 0, 63014733882156135537], [0, -3705417135278307526097486, -14364266520061873400370, 65587306882562750262, -133839764146080565416, -64254731692085217816, 0, 1332575190477532446], [3430973800395542422654098740, -620603430235088795982, 206867810078362931994, -4668866785375083205802, -1064453161662470006784, 0, 176753698807707585180, -206867810078362931994], [0, -2210934720099211021774268, -41973593058906732508242, 56038939469928511599, -276287661125306814918, 26065951622796384261, 0, 82104891092724895860], [0, 11332395042319529525768023, 78724131636852429082289, 99599911542908763217, -424660659113465507204, 13130506470915227168, 0, 112730418013823990385], [4399819220936241121647825522, 678567816037549444023, -226189272012516481341, 4759003353499857082305, 1311912597031814357610, 0, -45223035043284530436, 226189272012516481341], [0, -2707293129306172846770897, 71859296606397535129761, -218663230075066008264, 720985068438060100752, 76833925931101966152, 0, -141829304143964042112], [0, -7567888495292897846706224, -153137103700454278621206, 150710877045044650479, -541521207831241677006, -30661150174468462455, 0, 120049726870576188024], [0, 5013013577782345588672463, 171504419961366293477353, -306879209510661942964, 1285404001804791699896, -28943581881071964020, 0, -335822791391733906984], [-922546789914871944788657808, -554170131168707386212, 184723377056235795404, 5856937818290484174884, -1316289230776648910856, 0, -207948968439234138432, -184723377056235795404], [3492905598925470276142042280, -58993840032408609192, 19664613344136203064, 16269667004733529205592, 249750937207403199288, 0, 367738617272220417672, -19664613344136203064], [-1118083001340625626744849630, -986014098280415960421, 328671366093471986807, -15040403824887467548915, -1317192401763360873606, 0, 654835794797471047236, -328671366093471986807], [0, -13012679102237743317108468, -447635922266344663867836, -209208137297276128872, 584669126576857503504, 126081711306123505992, 0, -83126425991152622880], [4516072453249487836708610262, 160325732568904546380, -53441910856301515460, 10547258577140012410468, 683581286314596743328, 0, 362929821176787650568, 53441910856301515460], [0, 2856660040562941360242085, 98196643750096957645599, -722245005031159314930, 2560463917600553841492, 164258051262041709114, 0, -557986953769117605816], [0, 8272893071365643261043602, 103816062233327968578638, 273133042225148186854, -1358181232400214188872, 132824531749810720728, 0, 405957573974958907582], [0, -4962210657437395603616414, 267210274595848530443708, 628401234292544735353, -2161853590253656292906, -175875673458261324253, 0, 452525560834283411100], [-24643380900056666935236071868, 896222526061240458522, -298740842020413486174, 33754289103302094602382, 1722801338267106744192, 0, -69643713855374172852, 298740842020413486174], [0, -3882573183880662635319838, -387486080873077073092162, 202792054167739175722, -1099700779340601657208, 144266281334822477160, 0, 347058335502561652882], [0, 28021868787743707799030764, 673114225618357761304806, 187085141695833347355, -538107099159331330038, -105116733812001029691, 0, 81968407883832317664], [-23472977714774736536909099488, 1739132613496413738144, -579710871165471246048, -42926202103816943914976, 3667484971156544821344, 0, 189219744163717345056, 579710871165471246048], [0, 6426191221911030422722595, -621715095136225994283635, -263930544142064358079, 1480884489186231354836, -212581156308986961260, 0, -476511700451051319339]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_5_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


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