
// Make newform 300.7.b.e in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_300_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_300_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_300_7_b_e();".
// 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_300_7_b_e();".
// 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 := [276002078881, 0, 554332708870, 0, 107459649193, 0, 7924637994, 0, 291565644, 0, 5921226, 0, 67561, 0, 406, 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, 0, 0, 0, 0, 0, 0, 0], [20195725327289917161405865, 0, -5454385878624956099514485, 0, -1742982712345100421316515, 0, -128113849378167809763685, 0, -3967655518433443573320, 0, -60044417409487298285, 0, -440214851499970685, 0, -1252675619533905, 0], [547634181856412916324023336407, 0, 383973264428424358342327595306, 0, 59901282440813916831739208637, 0, 3622130802609414194683427709, 0, 103984881564544350154621806, 0, 1527170924255254647520581, 0, 11107392155378242951258, 0, 31736063694062753024, 0], [93868688450966908693407260047569890, 244470983511236446047346109891489537, 40470710844905815877538566094329895, 3593482852885531974081521079385400, 696374256365419137315089286319465, -3604448905638560183559861792588282, -232418845852522540232926083462245, -287610340205400478326841618523699, -12773852861458423760049154352680, -9040866925696791145677560368287, -260263887583518326478912157555, -138707651633089086973906598842, -2338560529860861779924474115, -1035686605692988441365818296, -7780178617160314676540495, -3012719447587828789270107], [0, -58849894218717041894095, 0, -16591860818105470592750, 0, -1480343766796965103980, 0, -66393637913186876010, 0, -1662969825829102230, 0, -23236663947043680, 0, -167875593922015, 0, -486211813880], [0, -2382591543257389678583579113890263, 0, -947083013722382916200647460384800, 0, -86544324077021574068942699578482, 0, -3304999948767333487061555576499, 0, -64596336226093644451150015287, 0, -685600712213175091229136642, 0, -3773172436919745381719696, 0, -8446080604119162947707], [11390824855059171831720517183787033310, 1711296884578655122331422769240426759, -4952051047432827714108272047539953695, 25154379970198723818570647555697800, 373918854257820423649796233173217135, -25231142339469921284919032548117974, 64433245017226425596418242519346445, -2013272381437803348287891329665893, 2607597527340420969943694257191080, -63286068479877538019742922578009, 46528159100931097802629512430955, -970953561431623608817346191894, 386794989900464062337694718315, -7249806239850919089560728072, 1220652722921200865822871495, -21089036133114801524890749], [-469343442254834543467036300237849450, -934478804089023323659886265151355634, -202353554224529079387692830471649475, -289780463277686405493663667319295200, -3481871281827095686575446431597325, -34373291483134157416481903253198276, 1162094229262612701164630417311225, -1738104703556189342692854187198682, 63869264307292118800245771763400, -44062307852776747834946002606266, 1301319437917591632394560787775, -589301829302952492901286327956, 11692802649304308899622370575, -3971621907543227543628408528, 38900893085801573382702475, -10626095479476524269607026], [-74209332895502126344760410345176728, 286533907198152937801623007671910926, 97118248255275987902846545613888075, 85708324581963455040345218912123266, 17972657146337429317121047472933005, 7444387602976715275940023550563366, 1043827462606262690215784516655425, 306985150885386773979698324478840, 28377858439365959685403199832830, 6735025054474025215027980643814, 401319103042277050452628932925, 79999887965139103135716644514, 2866364727271310786718752285, 483440840876400339664349206, 8172021689111499901863175, 1160950726707374904349396], [-62977140915549025757055245811329200, 125562431117140170261915042989151663, -110866039584470066748309720286928985, 35376876499261365083822913936497188, -17788269463023239530334633119457795, 2611186129819162887825507986334088, -1115381693941368164853063574543235, 71355120482066181477650657313885, -33346165318641344044947859811350, 614081537973666039112923962087, -507619445614834563329665982935, -4590071253317354640350504808, -3799267219395341023767751395, -101900478540801379572010862, -11090220911272616538907805, -432315283487123800024697], [-1512678329724899558245211081174814490, 347406134463336002277807629845800921, 516683535549176092289287392785662405, 5106528264626808594747424691758200, 147100026326454067188213445614917835, -5122111602749532892427172021046506, 10254454433049594805506488798805345, -408709430818200679727617036849467, 316954415226691255526872034080680, -12847547736516492680699691049671, 4897053371667867631006631516055, -197110873373337123594498850986, 36975306710439700062178916615, -1471765176511088837730373368, 108664403041570876377635395, -4281232899203756700541731], [-40154171386880948300671577242230380, 476701088360877806455967600460713025, -526834615263962176050622252088563105, -11316307149087990491695029787600550, -89310122681744577225245994304239395, -7449001575092327342938426965612800, -5433800007036629874990759756940555, -448813803294025725789217890792225, -156794212834655951505649979099710, -11752202900657953744977887985475, -2325496542929057790894255814655, -157681677172392736962084103800, -17130531112728644644740758755, -1064837417785909402381700750, -49614706112040849420449765, -2872732494330105422337425], [2534454588176106534721996021284387030, -8239318422577600333824607369519715284, 1092709192812457028693541284546907165, -912210832580697498466058384806071950, 18802104921866316707507410730625555, -12241733663389676477720698691103876, -6275308838018108586289004253480615, 1842808213892655253740551424648243, -344894027259377441521327167522360, 86303269787698820233404008419509, -7027124964754994814930628253985, 1543813936944695923697572830444, -63141134306243268057960801105, 12552130837313785244734225547, -210064822663328496266593365, 38621716132010300388046999], [384652331398753226780113806015869020, 770504778861131861041546752836838021, 356766195332922674393994896057897360, 171890245877787822558506091695005066, 48025787388147498999657341998402060, 13703937253197606286264638190612216, 2676502409725422718568685519545060, 531861177627854663050200203796855, 75350590868310131393487225845840, 11059582103221618616604298775549, 1121108009951699278355707140460, 125829257559031222042371436704, 8376473489178525101110912400, 738637508375777572950767686, 24688662332713887135233680, 1750881111307411096993471], [108264494404123304388849243448123076, -1278875625984502740535483137607907229, -721071111774514151856315343316339255, -315199382500744180142091475124391154, -125255436974419435859488089250105405, -31708858603014344609163884708930404, -7521454932249155255422328790251405, -1534157489142273741164718113138655, -213549929713387870876456378765370, -38835991976754381546661578027521, -3128134749013611891799513680505, -528539358998143546702239590436, -22863260567271266218178263325, -3663908640781027292288138254, -65958749490263849224176115, -10148247187067742801760699], [161307161574723095183885895977531308, -974155083208118342643003783917418954, 648120940098750638102534532899561585, -334674493988842995397583690280242384, 101943758827159786951020484417201075, -34467705295006766527931202938398334, 5807984797544210789216039069511335, -1605455947988923281436364650923120, 160484166186408010449696825344330, -38764147547654218075875694294126, 2325065319078530429713593939235, -503110294015546348103595136146, 16975567670992457461267169255, -3331254711036269026663617914, 49204727400048386840823205, -8832391294113673920747854]];
    Rf_basisdens := [1, 13405479504740354225931, 170638348615839968941875699, 7171711375237525619466790028075280, 746389613731502352582, 7606104451701358776243354967320, 7171711375237525619466790028075280, 3585855687618762809733395014037640, 358585568761876280973339501403764, 119528522920625426991113167134588, 1132375480300661939915808951801360, 717171137523752561946679002807528, 8068175297142216321900138781584690, 358585568761876280973339501403764, 717171137523752561946679002807528, 358585568761876280973339501403764];
    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_300_b();"
function MakeCharacter_300_b()
    N := 300;
    order := 2;
    char_gens := [151, 101, 277];
    v := [2, 1, 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_300_b_Hecke();"
function MakeCharacter_300_b_Hecke(Kf)
    N := 300;
    order := 2;
    char_gens := [151, 101, 277];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 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 := 7;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1, 0], [0, 0, 0, -4, -17, -2, 0, 2, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 2, -73, 4, 0, -1, 4, 0, 0, 0, 0, -4, 0, 0, 0], [1906, 1, 0, 0, 0, 0, 0, 0, 3, 3, 0, 3, 0, -6, -3, 0], [0, 0, -9, -42, 3, 0, 0, 3, 0, 0, -2, 0, -3, 0, 0, 0], [-8, 7, 0, 0, 0, 0, 0, 0, -16, -9, 0, 19, 0, -11, -29, -3], [4391, 5, 0, 0, 0, 0, 0, 0, -24, 0, 0, 12, 0, 0, 12, -12], [0, 0, 0, -28, -209, 78, 0, -58, 0, 0, 0, 0, -23, 0, 0, 0], [-27, -17, 0, 0, 0, 0, 0, 0, 82, 14, 0, 0, 0, 46, 40, -12], [0, 0, 0, -1006, -353, -62, 0, -199, 0, 0, 0, 0, -41, 0, 0, 0], [0, 0, -57, 206, -29, 0, 2, -29, 0, 0, 40, 0, 29, 0, 0, 0], [0, 0, -9, 591, 18, 0, -15, 18, 0, 0, -94, 0, -18, 0, 0, 0], [93, -58, 0, 0, 0, 0, 0, 0, 120, -33, 0, 84, 0, 24, 214, 92], [-16961, 85, 0, 0, 0, 0, 0, 0, -32, 52, 0, 94, 0, -104, -10, -42], [0, 0, 0, 1042, -1011, 276, 0, 433, 0, 0, 0, 0, 137, 0, 0, 0], [23, -10, 0, 0, 0, 0, 0, 0, -325, 105, 0, 73, 0, 56, -243, -36], [0, 0, 0, -8820, -611, -186, 0, 342, 0, 0, 0, 0, 510, 0, 0, 0], [-88484, 453, 0, 0, 0, 0, 0, 0, 69, -27, 0, -75, 0, 54, -21, 48], [0, 0, 240, 8904, -515, 0, 148, -515, 0, 0, 40, 0, 515, 0, 0, 0], [-614, 278, 0, 0, 0, 0, 0, 0, 248, -564, 0, 832, 0, -392, -816, -164], [0, 0, 0, 5088, 3099, -452, 0, -1392, 0, 0, 0, 0, -792, 0, 0, 0], [708, -329, 0, 0, 0, 0, 0, 0, -220, 335, 0, -199, 0, 307, 845, 351], [0, 0, 0, -30972, 6175, 2175, 0, -678, 0, 0, 0, 0, 1008, 0, 0, 0], [0, 0, 164, -3556, -151, 0, 168, -151, 0, 0, 600, 0, 151, 0, 0, 0], [620125, 1193, 0, 0, 0, 0, 0, 0, 486, -138, 0, -450, 0, 276, -174, 312], [0, 0, -146, 26259, -1368, 0, 3, -1368, 0, 0, 120, 0, 1368, 0, 0, 0], [0, 0, 0, 5936, -12245, -2859, 0, 4232, 0, 0, 0, 0, 1516, 0, 0, 0], [-1236, 118, 0, 0, 0, 0, 0, 0, 657, -686, 0, 2381, 0, 98, -1481, -334], [0, 0, -1308, -28235, 1982, 0, -17, 1982, 0, 0, -1254, 0, -1982, 0, 0, 0], [-1114070, 2541, 0, 0, 0, 0, 0, 0, -57, -369, 0, -525, 0, 738, 213, 156], [-173, -1240, 0, 0, 0, 0, 0, 0, 1790, 1089, 0, 1327, 0, 2491, 1455, -11], [656595, 1397, 0, 0, 0, 0, 0, 0, -532, 200, 0, 566, 0, -400, 166, -366], [0, 0, 0, 13904, -53763, -1144, 0, -3676, 0, 0, 0, 0, -2111, 0, 0, 0], [0, 0, 0, -62210, -41387, -982, 0, -1241, 0, 0, 0, 0, 2075, 0, 0, 0], [0, 0, 1885, 1930, -161, 0, 102, -161, 0, 0, 64, 0, 161, 0, 0, 0], [0, 0, -2871, 110507, -5524, 0, -585, -5524, 0, 0, 452, 0, 5524, 0, 0, 0], [-1845, 2814, 0, 0, 0, 0, 0, 0, -4784, -2011, 0, -84, 0, -4304, -7150, -1324], [-1426280, -618, 0, 0, 0, 0, 0, 0, -2048, -584, 0, 148, 0, 1168, 1316, -732], [3479, -2084, 0, 0, 0, 0, 0, 0, 675, 1487, 0, -233, 0, 2130, 5595, 2038], [0, 0, 0, 15768, -11657, 144, 0, -1116, 0, 0, 0, 0, -1122, 0, 0, 0], [0, 0, 29, 23091, 690, 0, -243, 690, 0, 0, -3910, 0, -690, 0, 0, 0], [4167204, 165, 0, 0, 0, 0, 0, 0, 2317, 3313, 0, 3811, 0, -6626, -2815, -498], [-4416687, 2295, 0, 0, 0, 0, 0, 0, -2008, 1100, 0, 2654, 0, -2200, 454, -1554], [0, 0, 0, 221168, 28265, 14687, 0, 17432, 0, 0, 0, 0, -1952, 0, 0, 0], [0, 0, 1522, 91900, -6241, 0, 388, -6241, 0, 0, 3356, 0, 6241, 0, 0, 0], [7163456, -8100, 0, 0, 0, 0, 0, 0, -5506, 122, 0, 2936, 0, -244, 2692, -2814], [0, 0, 9320, -133513, 7172, 0, -945, 7172, 0, 0, -368, 0, -7172, 0, 0, 0], [656, 2142, 0, 0, 0, 0, 0, 0, 1754, -4514, 0, -1092, 0, -5798, 1552, 1514], [3915913, -7797, 0, 0, 0, 0, 0, 0, 10048, 5644, 0, 3442, 0, -11288, -7846, 2202], [-734, 964, 0, 0, 0, 0, 0, 0, -4069, 4558, 0, -10563, 0, 1200, -2409, -3128], [0, 0, -5506, -268453, 8388, 0, 1903, 8388, 0, 0, 9708, 0, -8388, 0, 0, 0], [0, 0, 2083, -157254, 9927, 0, 1572, 9927, 0, 0, -5810, 0, -9927, 0, 0, 0], [-1539, 8088, 0, 0, 0, 0, 0, 0, -11650, -2841, 0, -15335, 0, -12783, -11335, -3393], [-474727, -987, 0, 0, 0, 0, 0, 0, 2802, -4194, 0, -7692, 0, 8388, 696, 3498], [0, 0, 0, 174128, -230431, -1400, 0, -13300, 0, 0, 0, 0, -12797, 0, 0, 0], [-9899, 6963, 0, 0, 0, 0, 0, 0, 9886, -6602, 0, -9866, 0, -8796, -4782, -5130], [0, 0, 0, 438534, -330075, 34466, 0, -2061, 0, 0, 0, 0, -19131, 0, 0, 0], [0, 0, -13073, -664595, 30640, 0, 1989, 30640, 0, 0, 4208, 0, -30640, 0, 0, 0], [0, 0, 0, -482058, -567001, -32100, 0, -50733, 0, 0, 0, 0, -1053, 0, 0, 0], [7665, -14866, 0, 0, 0, 0, 0, 0, 1969, 19099, 0, 5683, 0, 28016, 15583, 1716], [0, 0, 0, 266064, -329697, -36400, 0, 3768, 0, 0, 0, 0, -9516, 0, 0, 0], [0, 0, 17859, -82063, 12770, 0, -1293, 12770, 0, 0, -18254, 0, -12770, 0, 0, 0], [6763185, 11783, 0, 0, 0, 0, 0, 0, -3880, -2236, 0, -1414, 0, 4472, 3058, -822], [0, 0, 0, 529156, -573725, -29714, 0, 42970, 0, 0, 0, 0, -4144, 0, 0, 0], [0, 0, -20008, 496024, -22625, 0, -4356, -22625, 0, 0, -1448, 0, 22625, 0, 0, 0], [35595966, -7982, 0, 0, 0, 0, 0, 0, 22534, 15418, 0, 11860, 0, -30836, -18976, 3558], [0, 0, 6234, 341793, -24182, 0, -5849, -24182, 0, 0, 20310, 0, 24182, 0, 0, 0], [4254, -18858, 0, 0, 0, 0, 0, 0, 58082, 3572, 0, 11468, 0, 27946, 56820, 9770], [0, 0, 0, -717004, -1055279, 16377, 0, 20426, 0, 0, 0, 0, 38386, 0, 0, 0], [0, 0, 0, -339684, -333591, 164450, 0, 22674, 0, 0, 0, 0, 23601, 0, 0, 0], [33630940, 14149, 0, 0, 0, 0, 0, 0, -17415, -36447, 0, -45963, 0, 72894, 26931, 9516], [0, 0, 39291, -324342, 10187, 0, 3878, 10187, 0, 0, 10384, 0, -10187, 0, 0, 0], [4195, -2028, 0, 0, 0, 0, 0, 0, -54626, 29137, 0, -15383, 0, 15513, -34779, -11457], [0, 0, 0, 1210288, -540629, 172756, 0, 17116, 0, 0, 0, 0, -43297, 0, 0, 0], [698, 26526, 0, 0, 0, 0, 0, 0, -93084, -11864, 0, 2330, 0, -46070, -84706, -6982], [9518103, 46349, 0, 0, 0, 0, 0, 0, -36188, 18400, 0, 45694, 0, -36800, 8894, -27294], [-5909, -280, 0, 0, 0, 0, 0, 0, -1386, -14857, 0, 48652, 0, -4054, -17818, 4614], [-17573781, -17479, 0, 0, 0, 0, 0, 0, -28096, 1772, 0, 16706, 0, -3544, 13162, -14934], [31885, -16726, 0, 0, 0, 0, 0, 0, -41773, 9659, 0, 45065, 0, 13976, 2521, 19476], [0, 0, 0, -1722928, -315479, -7292, 0, -18520, 0, 0, 0, 0, 64072, 0, 0, 0], [42884206, 59229, 0, 0, 0, 0, 0, 0, 28071, -20925, 0, -45423, 0, 41850, -3573, 24498], [0, 0, -22962, 643964, -45329, 0, -15208, -45329, 0, 0, 41008, 0, 45329, 0, 0, 0], [26029, -34181, 0, 0, 0, 0, 0, 0, -12918, 13266, 0, 94524, 0, 44890, 15668, 23472], [0, 0, 0, 1881780, -986491, -99066, 0, 116322, 0, 0, 0, 0, -29940, 0, 0, 0], [25346, -4681, 0, 0, 0, 0, 0, 0, 76196, -18539, 0, -46803, 0, -14921, 102605, 24283], [0, 0, 0, -1528004, -252523, 161301, 0, 53542, 0, 0, 0, 0, 85976, 0, 0, 0], [0, 0, 13130, 335444, -6231, 0, -13244, -6231, 0, 0, -13124, 0, 6231, 0, 0, 0], [-45496, 2438, 0, 0, 0, 0, 0, 0, 7830, -810, 0, 51468, 0, 18686, -59600, -23562], [0, 0, 0, -1529428, -221541, -56893, 0, -121066, 0, 0, 0, 0, 13282, 0, 0, 0], [-15008, -46902, 0, 0, 0, 0, 0, 0, 114667, 24474, 0, 57719, 0, 90094, 80941, 3710], [3621792, 91813, 0, 0, 0, 0, 0, 0, 26005, 27949, 0, 28921, 0, -55898, -26977, -972], [0, 0, -14407, 294242, -17101, 0, 19266, -17101, 0, 0, -9676, 0, 17101, 0, 0, 0], [-40818, 21545, 0, 0, 0, 0, 0, 0, 137468, -75353, 0, 15189, 0, -49585, 49337, 6495], [-75832, -8654, 0, 0, 0, 0, 0, 0, 73552, 39258, 0, -19006, 0, 70526, -24894, -53218], [0, 0, 0, -1038874, -928629, -287076, 0, -188197, 0, 0, 0, 0, -35129, 0, 0, 0], [70053366, -65520, 0, 0, 0, 0, 0, 0, 37868, 48188, 0, 53348, 0, -96376, -43028, -5160], [0, 0, 0, -2108298, -448537, -28992, 0, -36093, 0, 0, 0, 0, 72807, 0, 0, 0], [0, 0, -83089, 539187, -32314, 0, -25075, -32314, 0, 0, 31402, 0, 32314, 0, 0, 0], [0, 0, -43802, 373232, 25015, 0, -4306, 25015, 0, 0, -93710, 0, -25015, 0, 0, 0], [97051, -42593, 0, 0, 0, 0, 0, 0, -14298, 77492, 0, -133340, 0, 54110, 148728, 31076], [50292331, 58535, 0, 0, 0, 0, 0, 0, -69974, -8570, 0, 22132, 0, 17140, 39272, -30702], [0, 0, 0, 1628000, -911111, -138264, 0, 144392, 0, 0, 0, 0, -7670, 0, 0, 0], [0, 0, 67294, -1384380, 91761, 0, 17826, 91761, 0, 0, -63958, 0, -91761, 0, 0, 0], [0, 0, 70954, -3452431, 190830, 0, 11683, 190830, 0, 0, -49550, 0, -190830, 0, 0, 0], [-1868, 46530, 0, 0, 0, 0, 0, 0, -94488, -80346, 0, 88770, 0, -109034, -114198, 15974], [-54071213, -122119, 0, 0, 0, 0, 0, 0, 66688, -49004, 0, -106850, 0, 98008, -8842, 57846], [0, 0, 0, -1529964, 3033527, 216831, 0, 40482, 0, 0, 0, 0, 80616, 0, 0, 0], [0, 0, 0, 3401412, -481373, -270102, 0, 326382, 0, 0, 0, 0, -5733, 0, 0, 0], [0, 0, -27020, -2578957, 90676, 0, -36493, 90676, 0, 0, 113432, 0, -90676, 0, 0, 0], [-112863974, -74811, 0, 0, 0, 0, 0, 0, 116583, 49143, 0, 15423, 0, -98286, -82863, 33720], [-70483827, 33613, 0, 0, 0, 0, 0, 0, 40358, 26774, 0, 19982, 0, -53548, -33566, 6792], [177995, -6809, 0, 0, 0, 0, 0, 0, -175910, 5932, 0, -75272, 0, -75818, 90644, 89436], [0, 0, 0, 4122230, -60789, -9516, 0, 535547, 0, 0, 0, 0, 51385, 0, 0, 0], [0, 0, 141087, 675706, -93949, 0, 27652, -93949, 0, 0, 112190, 0, 93949, 0, 0, 0], [0, 0, 39237, -2575601, 148656, 0, 40931, 148656, 0, 0, -76004, 0, -148656, 0, 0, 0], [38179, -118346, 0, 0, 0, 0, 0, 0, -40912, 267157, 0, -151692, 0, 292008, 90762, -55316], [-43304741, -75623, 0, 0, 0, 0, 0, 0, -109640, 73156, 0, 164554, 0, -146312, 18242, -91398], [0, 0, 0, 3935840, -274947, 83484, 0, 317792, 0, 0, 0, 0, -31580, 0, 0, 0], [0, 0, 5065, 1169523, -1780, 0, 32699, -1780, 0, 0, -151424, 0, 1780, 0, 0, 0], [0, 0, -40760, -5114220, 238257, 0, -44130, 238257, 0, 0, 73110, 0, -238257, 0, 0, 0], [-64195885, 26043, 0, 0, 0, 0, 0, 0, -39930, 76674, 0, 134976, 0, -153348, -18372, -58302], [119505, 16478, 0, 0, 0, 0, 0, 0, -508326, 83637, 0, 45825, 0, -42651, -279011, 9695], [-104424266, -255590, 0, 0, 0, 0, 0, 0, -158730, -51630, 0, 1920, 0, 103260, 105180, -53550], [156610, 72252, 0, 0, 0, 0, 0, 0, -230166, 37678, 0, -424078, 0, -167844, 59714, 23340], [0, 0, 0, -2062604, 4012527, 514899, 0, 59338, 0, 0, 0, 0, 110666, 0, 0, 0], [0, 0, 0, 5715916, 750197, 14346, 0, -334718, 0, 0, 0, 0, -377629, 0, 0, 0], [-244726284, -85295, 0, 0, 0, 0, 0, 0, -48059, 33661, 0, 74521, 0, -67322, 7199, -40860], [0, 0, 167449, 3527014, -52441, 0, -47210, -52441, 0, 0, -238636, 0, 52441, 0, 0, 0], [-77109791, -37331, 0, 0, 0, 0, 0, 0, 270562, 108514, 0, 27490, 0, -217028, -189538, 81024], [0, 0, 0, 213896, 1007593, 57684, 0, 398168, 0, 0, 0, 0, 156991, 0, 0, 0], [-129884, 45266, 0, 0, 0, 0, 0, 0, 313036, -16434, 0, -280822, 0, -11174, 132626, -79358], [-212736530, 12140, 0, 0, 0, 0, 0, 0, 389496, 50112, 0, -119580, 0, -100224, -219804, 169692], [0, 0, 22635, -7506719, 402538, 0, -34749, 402538, 0, 0, -33422, 0, -402538, 0, 0, 0], [0, 0, 0, -937830, 6360311, -1195602, 0, 18429, 0, 0, 0, 0, 46755, 0, 0, 0], [0, 0, 35095, 672301, -21714, 0, -55981, -21714, 0, 0, 17094, 0, 21714, 0, 0, 0], [-326140, 145992, 0, 0, 0, 0, 0, 0, 151776, -281240, 0, 383570, 0, -196538, -405058, -95446], [16635837, -92009, 0, 0, 0, 0, 0, 0, -154252, -138424, 0, -130510, 0, 276848, 146338, -7914], [-313853, -13518, 0, 0, 0, 0, 0, 0, 551794, -209541, 0, 503669, 0, 72433, -30515, -45397], [0, 0, 0, -3171612, 5023907, 380731, 0, 108186, 0, 0, 0, 0, 177228, 0, 0, 0], [0, 0, -241262, -721740, 125947, 0, -14198, 125947, 0, 0, -188646, 0, -125947, 0, 0, 0], [-237560959, 85385, 0, 0, 0, 0, 0, 0, -34054, 43826, 0, 82766, 0, -87652, -4886, -38940], [-158404, 39534, 0, 0, 0, 0, 0, 0, -224760, -87598, 0, 503458, 0, -23898, -486398, -55170], [0, 0, 0, 728124, -922313, -895218, 0, 840570, 0, 0, 0, 0, 319899, 0, 0, 0], [0, 0, 427580, 1166069, -70774, 0, 61995, -70774, 0, 0, -20506, 0, 70774, 0, 0, 0], [-67365638, 116181, 0, 0, 0, 0, 0, 0, -101889, -203361, 0, -254097, 0, 406722, 152625, 50736], [0, 0, 83103, 2692470, -174861, 0, 118770, -174861, 0, 0, -2960, 0, 174861, 0, 0, 0], [0, 0, 0, -5046200, 4903541, 1837148, 0, 449104, 0, 0, 0, 0, 397385, 0, 0, 0], [359065, -472047, 0, 0, 0, 0, 0, 0, 620106, 373740, 0, 31158, 0, 715408, 1109550, 228686], [0, 0, 0, -10769058, 1500345, 1495910, 0, -233433, 0, 0, 0, 0, 351447, 0, 0, 0], [0, 0, -99377, 3302386, -280761, 0, -63268, -280761, 0, 0, 306190, 0, 280761, 0, 0, 0], [0, 0, 0, 10746822, 8126273, 307338, 0, -530133, 0, 0, 0, 0, -668673, 0, 0, 0], [318977, 6918, 0, 0, 0, 0, 0, 0, -612489, 265835, 0, -561695, 0, -36948, 2353, 23112], [-696047586, 364537, 0, 0, 0, 0, 0, 0, -59981, -63509, 0, -65273, 0, 127018, 61745, 1764], [-150133, -193375, 0, 0, 0, 0, 0, 0, 794166, -55662, 0, 440376, 0, 337298, 444448, 49452], [0, 0, 0, -7229260, 8996277, -751030, 0, -389614, 0, 0, 0, 0, 138880, 0, 0, 0], [-65036, 240769, 0, 0, 0, 0, 0, 0, -930648, -131471, 0, 273419, 0, -394371, -973553, -87167], [0, 0, -37510, -12022840, 533627, 0, 21216, 533627, 0, 0, 133532, 0, -533627, 0, 0, 0], [0, 0, 349240, 13599283, -597276, 0, 27839, -597276, 0, 0, -205404, 0, 597276, 0, 0, 0], [0, 0, 0, 11675996, -137843, -1319499, 0, 1528502, 0, 0, 0, 0, 150376, 0, 0, 0], [-550172, 208912, 0, 0, 0, 0, 0, 0, 427317, -241956, 0, 62727, 0, -159260, -414463, -258564], [0, 0, 23502, 1436913, -70430, 0, -55661, -70430, 0, 0, 40146, 0, 70430, 0, 0, 0], [0, 0, 253289, -1275586, 137707, 0, 76094, 137707, 0, 0, -223468, 0, -137707, 0, 0, 0], [-480848471, -169355, 0, 0, 0, 0, 0, 0, -116534, -24146, 0, 22048, 0, 48292, 70340, -46194], [0, 0, 0, -7812668, 2952477, 2112018, 0, 1226782, 0, 0, 0, 0, 836687, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_300_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_300_7_b_e();".
// 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_300_7_b_e(:prec:=16)
    chi := MakeCharacter_300_b();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 7));
    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_300_7_b_e();".
// 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_300_7_b_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_300_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,7,sign)));
    Vf := Kernel([<7,R![113320643614501228096, 0, 8114052473491936, 0, 112122973716, 0, 571876, 0, 1]>],Snew);
    return Vf;
end function;