
// Make newform 855.2.bs.b in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_855_bs();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_855_bs_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_855_2_bs_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_855_2_bs_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 := [361, -513, 1698, -1359, 4032, -3126, 5113, -2616, 3333, -1294, 1521, -405, 448, -75, 96, -8, 12, 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, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-12713186363580574958, 8340705133450433900, -38566636741667052372, 28965642747827808589, -68799337664864459525, 32949301580318741461, -51490846595808251984, 16118541568209638063, -26540269945879200040, 5395265824707751653, -8643822113053672298, 755780565816668612, -2034802237447217245, 57114523551811041, -278387493146710423, -15475762038850846, -24539850127465139, -136164871502623], [475150684820058216, -1311641429597997762, 1371327034244450974, -2894326577431631545, 2855869998225035874, -2885622013327482014, 2134926077072574208, -1753639286959150144, 1061204782303381103, -708615722180805182, 323224172461819959, -187990470308389149, 67530840922095229, -35512529776538063, 7968889393851538, -3880691063159639, 493873766181026, -305669388244104], [404864180772791181, -2254140586374967780, -1688955502281513037, -14654463655353182629, 334980033043877088, -18735117324885579084, -1330055455523271005, -12852323826200522587, -919186295759062923, -5560668611293666895, -572552850128153362, -1561503944080813321, -137185723270135532, -281280084655676041, -26620230113148110, -29794953034609280, -1373794800955595, -1365784748015119], [493048294033457959, -295783394958964866, 64961915754704282, -3545056974834059758, -9147619551356222821, -3934463089251384906, -11751859908284275637, -4902948356330822309, -8300163261066130960, -2686511759690626909, -3483310009562670896, -1125695673074276557, -949632376970040009, -239619579371269457, -150164748846224617, -37546508097269062, -13405536058427852, -1373794800955595], [7301259660632472688, -2744800892072834308, 17863733309230704777, -26501304396415488623, 22149232909835934805, -31837869359996258159, 12469640235719854456, -21323954668151248570, 4616558327094384365, -9149472805995407940, 887747573331774484, -2638706167903118716, 77946254382002165, -509501528649318297, -9894754734681145, -60510905073974959, -2486336156102819, -3821497981088482], [-151343951920955937, 863592253357928114, 1105601423219833441, 2451076154668245918, -1228840703424601042, 4594839716514566120, -1689557919382324352, 3325712759262419545, -994555984625719282, 1678726496821583217, -345073317370623531, 522129842732713859, -63202986460316137, 118386971389321838, -6648964002104809, 15300608831715646, 305669388244104, 1316206883158056], [-791795258602032720, -2524946775203921152, 1088798398418223410, 2036234158376448173, 2218844617339251399, 8365658335605219288, 2915707886574672496, 8844406095767234201, 2367273831481700889, 5114203147106148517, 1157179500078806039, 1872955328631131189, 380877728603667745, 433874328606196583, 69138387783314911, 61247608976156191, 8457548837445544, 4263268715769470], [-197333589053007138, -171974561020272844, -640580280306084166, -567458240342481703, -871890492989000946, -697344780135723768, -705854963648750474, -521090564283915070, -370055452165070628, -247925063622357167, -131895294695077462, -80012426739975022, -31523850998316788, -16482913440421588, -4687402177384319, -2128850997697097, -400329673137974, -116934812256397], [5284901620360032954, -2679740142811021208, 15717515903286395077, -8268649772449030736, 29102676427842391179, -5834921042750809410, 20443213806190380140, 814973947936715863, 11195319724831197969, 1962960094436407709, 3763965626999821126, 1262057723734120030, 1028457065358737192, 361776262948934794, 154272805835837465, 64753023529443092, 17994909435137720, 4785929688950203], [6094047996318719285, -15503997389545927664, 2614293290552294073, -42524480716536293605, 14641160425862497394, -50251521538706392489, 11814910314894911588, -31375345171161971747, 6224701970246744260, -13414255907811757605, 1887987830399360111, -3703626960967606784, 373992166879518313, -728701165601510295, 38324000046280303, -83367742292924762, 828266836359098, -6194705453707877], [-5866741202393917305, 9109842231458219395, -17079528084795008093, 18849342455135910337, -35714722354143733911, 32005685555634494898, -33019415996230257943, 20640804020965884865, -17690009620923466737, 10050176092564259657, -6262533437436660725, 2857108775199131491, -1367584144063781320, 657167974186164952, -184902616685114542, 79443562791874058, -9292642129044856, 8415587854105225], [-1539040006392778670, 1395261592587705390, -9763977054580481212, 6882580583148933140, -15153265303606054867, 15545822622834614619, -13432434608124080822, 14068418847027606016, -5365068533892409309, 7883943549687395069, -1370228569579215353, 2883803329965441389, -36989056033591371, 700622882286377995, 24600531892327463, 103244537509470671, 10088384386922551, 8457548837445544], [4765747833043009508, -6190538917553550213, 15986074699460918557, -16578850159503713636, 42647826050912606095, -34655897913289925196, 41328594684758717876, -21958967702593121845, 22544880002101140796, -10588073804621455064, 8066371995986638622, -2848046794500608741, 1795113360355580223, -650986737024112972, 248401446998221342, -74982329495166347, 14221624195347986, -8702267306092864], [3038027215331986225, 1549544633237936880, 5179825944812452655, 5642744191066007318, 15082307772616356863, 9407594722210800561, 11023215142405520527, 11004238169890989343, 7408350296766830060, 6800238937711305587, 2749933033529787568, 2854220356524044600, 913074583440009309, 736415055005889445, 150728459807936648, 117577913852272742, 21543491457388642, 9292642129044856], [-380413025158626443, 435487443612750998, -837284802272031468, 1379062922698433023, -2158348756640158619, 2008185379160806393, -1802618050547274896, 1244593416258686864, -959223616419207394, 554156872867621638, -317553566740250921, 147431058119218739, -70368354475407094, 30340466650154259, -9141301869341992, 3303505876934864, -588887179277519, 316478299376213], [-11104061301097034995, 19825858771860031108, -28423311584312662812, 42899194197704035433, -56810286570525635647, 67330488050959221206, -51113768682332337226, 45153108522930576424, -26056201587940490639, 22001645173958880027, -8805655803798270706, 6599826966823468927, -1743300156274298741, 1503924491838736770, -214598336312124923, 192044400084805108, -4499256512921017, 17924896300275019]];
    Rf_basisdens := [1, 1, 2363313751376612913, 787771250458870971, 2363313751376612913, 2363313751376612913, 2363313751376612913, 787771250458870971, 2363313751376612913, 63873344631800349, 2363313751376612913, 2363313751376612913, 2363313751376612913, 2363313751376612913, 2363313751376612913, 2363313751376612913, 63873344631800349, 2363313751376612913];
    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_855_bs();"
function MakeCharacter_855_bs()
    N := 855;
    order := 9;
    char_gens := [191, 172, 496];
    v := [9, 9, 5];
    // 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_855_bs_Hecke();"
function MakeCharacter_855_bs_Hecke(Kf)
    N := 855;
    order := 9;
    char_gens := [191, 172, 496];
    char_values := [[1, 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, 1, 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 := 2;
    raw_aps := [[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, 1, 0, 1, 0, 0, 0, 0, 0], [-1, 0, -1, 0, 1, 0, -1, 0, 0, -1, 1, 1, -1, 1, 1, 0, 1, 1], [-1, 0, 0, 0, 0, 1, -1, 0, -1, -1, 1, 1, 0, 0, -1, 1, 1, -1], [-2, -1, 1, -1, -1, 1, 0, -1, -1, -1, 2, 1, 2, 1, -1, 0, -1, -1], [1, -1, -1, 0, 2, 1, -1, 0, 1, -1, 1, 1, -1, 0, 0, 0, 2, 0], [0, 0, 1, -1, 2, 0, 0, -1, 1, -1, 0, 0, -2, 0, 2, 0, 1, 1], [-1, -1, 3, -1, 1, 0, 0, 1, -2, -3, 5, 2, 1, 1, 0, 1, 1, 1], [-1, 2, 0, 0, 0, 0, -2, 2, -3, -1, 2, 3, -1, 0, 0, 2, 0, 3], [0, 0, -1, 0, -1, 0, 0, -5, -1, -1, 2, 0, 1, -1, -1, 0, 2, 1], [-3, 1, 0, 1, 2, 2, 0, 0, 0, 1, 1, -2, -1, 2, 0, 2, 0, -1], [0, -2, 0, 0, -2, -2, 1, -2, -1, 0, -3, 0, 0, -2, 0, 1, 0, 0], [-2, 0, -1, 0, 2, 0, 0, -3, -1, -4, 1, 2, -3, 0, 1, -1, 2, 3], [3, -1, 3, -1, 0, -3, 3, 3, 5, 2, -2, -5, -3, 0, 1, -1, -3, -2], [-3, 0, -3, 0, -1, 0, 0, -3, 1, 2, -2, -1, -3, 0, 0, 0, 0, 0], [1, 0, 3, -1, -2, -1, 3, 0, 1, 3, -3, -5, -1, -1, -1, 0, -6, -3], [-1, 0, 3, -3, 0, 0, 0, -1, 1, 1, -1, 2, -1, -2, -3, 3, -1, -1], [1, -4, 0, -3, 0, -2, 0, 4, 4, -1, 2, 1, -3, 0, 3, -4, 0, 1], [-5, 1, -1, -1, 2, 1, -3, -1, -1, -2, 1, 4, -1, -1, -1, 1, 1, 2], [0, 0, 0, 2, 3, 0, -4, 3, -1, 0, 1, 0, 0, -2, 0, 3, 0, 0], [0, 0, -3, 2, 1, 0, -1, 1, -1, -1, 3, 0, 0, -2, 0, -3, -1, 0], [-1, 0, -2, 1, 1, 2, -1, -2, -4, -1, -3, 1, -1, 0, 0, -2, 2, 1], [0, -3, 4, -1, -1, -4, 2, 2, -2, -2, 0, 2, 2, -4, -3, 2, -3, -4], [-3, -2, 2, -1, -5, 1, 2, 0, -3, 2, -2, -3, 8, -1, 2, 0, -4, -3], [2, 1, -2, -2, -1, -3, -1, -1, 1, 1, 0, -1, -3, -3, 1, -3, 3, 2], [2, 1, 0, 0, 0, -4, 3, -1, -2, -2, 2, 1, 0, 1, 4, -5, 1, 3], [-1, 0, -2, -2, 1, 0, -1, 2, -2, 1, -5, 1, -1, -3, -3, 0, 0, -1], [-3, 0, 0, 0, 0, 0, -3, 2, -6, -4, -6, 5, -10, 0, -3, 3, 2, 2], [0, -2, 8, -2, -5, 0, 4, 0, -3, -5, 0, 2, 2, 0, 0, 0, -4, -3], [5, 2, 0, 0, 2, -1, -2, 4, -2, -2, -2, 2, -7, -1, 2, -2, 1, 0], [3, 5, 3, 1, -3, -4, 3, 3, 3, 3, -3, -1, -1, 1, 4, 0, -6, 0], [1, 1, -3, 0, -2, 0, 0, 4, -2, 0, 3, -1, 4, -1, -1, 0, 1, 1], [6, -2, 3, -3, -3, -2, 5, 2, 2, 2, -4, -2, -1, -2, -2, -1, -5, -3], [-1, -3, -4, -2, 6, -3, -4, 6, 4, 1, 0, 0, 0, -1, 0, 3, 1, 0], [-9, 3, -3, 3, 0, -3, -2, 0, -2, -1, 1, 5, -1, -1, -2, -1, 2, 4], [2, 6, -5, 5, -1, -5, 1, -3, 9, 6, -11, -4, -5, -6, 2, -2, -3, 2], [4, 3, 0, 0, 2, 2, -1, 5, 1, -1, -1, 2, 0, -3, -2, 5, 2, -1], [-3, 1, -4, 3, -6, 0, 0, -1, -7, -1, 3, 1, -1, -5, 2, -3, 3, 3], [0, 2, -1, -3, 1, -5, -1, 0, 0, -1, 1, 5, 0, -3, 1, 0, 2, 7], [-5, -1, 0, 0, 1, 1, 0, -5, 1, -7, -1, 4, -7, 2, -1, -1, 4, 0], [3, 5, 2, -2, 0, 0, 3, 2, 7, 0, 0, -3, -2, 0, 2, 5, -2, -1], [3, 1, -1, 1, -4, -3, 3, 0, 3, 0, -4, 1, 3, 1, -4, 1, -3, 1], [-3, 0, 1, 2, -4, 0, 1, -4, 0, 0, 1, 0, 0, -2, 0, 3, 0, 0], [2, 0, -2, 4, -4, 7, 2, -2, 0, 4, -4, -2, 4, 5, 5, -7, 0, -4], [-8, 1, -2, 3, 0, -1, -4, -2, -2, -1, -3, 5, -2, 0, -3, 1, 2, 3], [3, 0, 1, 2, 4, 2, 1, -2, 3, 1, -1, -2, 10, 2, 3, 0, -2, 0], [-2, 0, -2, -4, 3, 4, 1, -8, 12, 4, -4, -3, 0, 0, 2, -2, -2, 0], [-4, 7, -9, 7, 3, 3, -3, 0, 6, 6, -3, -3, 0, 1, 2, 1, 3, 3], [2, -5, -1, -5, 2, -5, 4, 0, 9, 1, 1, -1, 8, 1, -6, 1, -4, 0], [-6, -5, 3, -5, 7, 5, 1, -12, 10, -2, 8, 0, 6, 5, -2, 2, 1, -2], [-6, 1, 0, 0, 9, 2, -1, -5, 2, 1, -2, 3, 8, -1, -2, 3, 3, -1], [5, 4, -1, 4, 2, -2, 5, 3, 6, 6, -9, -6, 0, -2, 4, 0, -2, 1], [-2, 5, -3, 6, 2, 0, 0, -2, 3, 1, -1, -4, -2, 2, 1, -6, -1, -1], [-8, 2, -1, -5, 0, 0, -5, -3, 8, -1, -2, 6, 0, 0, 5, 2, 1, 5], [9, -3, 2, -1, 7, -3, -3, 7, -5, 0, 10, 0, 0, -2, 0, 5, 0, 0], [8, -1, -1, 1, -4, -1, 6, -4, -7, -1, -6, 0, 0, -2, 0, -4, -1, 0], [-10, -7, 3, -2, 9, 2, -1, 0, -8, -8, 8, 5, 0, 7, 2, -2, 4, 1], [-1, -5, 0, 0, 1, -4, 7, -8, 1, -7, -1, 0, -7, -2, 4, -2, 0, 7], [1, -2, 9, -6, 0, 0, 0, 7, 4, 4, 2, 1, 7, -3, -4, 6, -6, -6], [13, -1, 3, 1, 6, 2, 3, 4, 13, 3, -3, -9, -1, 1, 2, 0, -6, -9], [2, 4, 0, 0, -5, -3, 1, 1, 3, 1, -3, -1, -7, 1, 3, -4, -1, 1], [5, 2, 9, -1, -5, 2, 2, -5, -9, -1, 7, 0, 0, 3, 0, -3, -1, 0], [-5, 0, -10, 2, 11, 3, -5, -2, 0, -4, -3, 5, -11, 3, 3, -3, 9, 4], [0, 2, -5, 0, 0, 0, -6, 1, -9, 0, 6, 6, 5, 0, 0, 2, 5, 1], [-6, 4, -7, 6, 9, -4, -6, 6, 1, 1, -7, -1, 0, -4, 4, 2, 1, 7], [8, 3, 0, 0, -6, 2, -4, 12, -12, -2, 12, 4, 4, 2, -2, 0, 4, -4], [-3, 2, -1, -3, 1, 3, -2, 1, 5, 6, 1, -1, 7, -2, -5, 5, -3, -2], [16, -1, -2, 1, -10, -1, 6, 4, 4, 8, -6, -10, 2, 1, 8, -8, -4, -2], [-6, 0, 7, -2, 7, -4, -6, 3, -4, -6, 1, 6, -7, 6, 6, 4, -7, 6], [-5, 0, 0, 0, 10, 2, 3, -8, 3, -3, -3, -4, 4, 1, -2, 1, -4, 3], [-4, -1, 2, -1, 4, 0, 2, -10, -4, 2, -2, 0, 6, -1, -1, 0, -4, 1], [-6, -5, 2, -2, 3, 2, -6, 1, -8, -8, 7, 8, 0, 2, -5, 3, 9, -2], [4, 0, 11, -3, 3, -2, 4, -3, 4, -3, 7, -4, -3, 2, 2, 2, -4, 3], [-1, 3, -6, 3, 0, 5, 0, 0, 4, 7, -7, -8, -3, -3, 8, -3, 0, -1], [-3, 6, -3, 5, -6, 6, -3, -6, -7, -1, 9, 0, 0, 1, 0, -4, -1, 0], [-1, 1, 1, 2, 0, -13, -2, 6, -2, -4, 5, 6, -5, 0, -2, 1, -1, 7], [-5, 3, 0, 2, 11, -1, 0, -16, -5, 0, 0, 3, -3, 2, 2, 0, 0, 5], [0, 5, 0, 3, -1, -2, 0, 1, 0, 0, 0, 5, -8, 3, 3, 0, 0, 7], [-3, -5, -4, 0, 0, -1, -10, 3, 0, 1, 6, 9, 4, 0, 0, -5, 4, 5], [-3, -4, 0, -4, -5, -8, 1, 0, -4, 2, -7, -4, -6, -6, -2, -6, -1, -2], [2, -1, -7, 3, -1, -1, 1, -1, -3, -1, -13, 0, 0, -4, 0, -1, -1, 0], [-3, 0, 5, 1, -3, -3, 4, 0, -1, -1, 1, 1, 7, -3, 0, 1, -3, -5], [-3, -4, -8, 1, 6, 0, 0, 4, 3, -3, 10, 5, 4, -6, 5, -1, 8, 8], [-6, 3, 1, -3, -2, -6, 1, -5, -6, 1, -1, -5, 3, -3, -8, 0, -2, -8], [-4, -6, 0, -3, 14, 1, -4, 3, -4, -4, 1, 4, 0, 1, -6, 3, 8, 0], [3, 0, -3, 7, -8, 10, 3, -3, -3, 2, 1, -3, 8, 4, 4, -10, 4, -2], [-10, -1, 11, -1, -3, 4, -4, 0, -2, -10, 7, 9, 8, 7, -3, 7, 4, -1], [-4, 0, -4, 6, 3, -6, -1, 3, -5, -2, 0, 2, -2, 0, 5, -5, 1, 5], [4, 0, 6, -11, 4, 4, 4, -11, -2, -2, -2, -4, -4, 2, 2, -4, 0, 2], [7, 7, 0, 0, -10, 4, 0, 7, 2, 7, -2, 2, -5, 1, -4, 3, 2, 0], [-1, -3, -10, -1, -3, 0, 0, -4, 1, 4, -7, 0, -4, -5, 2, 1, 3, 3], [1, 0, -3, -1, -4, 3, 1, -2, -3, -1, 3, -1, 4, -1, -1, -3, 5, 1], [0, -2, -2, -2, 6, -2, -6, 6, 2, 2, 3, 0, 0, 0, 0, 8, 2, 0], [-2, -2, -10, 1, 1, -1, -1, -1, -3, -4, -5, 3, -9, 2, 2, -2, 2, 12], [1, -4, 0, 0, 0, -3, 2, 6, -12, -10, 9, 8, -7, 0, 0, -4, 0, 8], [7, -6, 4, -10, 8, 0, 0, 0, 10, 2, -9, -8, 0, -4, -4, 10, -7, -7], [6, 0, 0, 0, -6, -2, 1, 5, -6, -6, 6, 2, -6, 0, 2, -2, 2, 1], [-1, 7, -3, 7, 0, 2, -3, -1, 8, 5, -3, -2, 3, 0, -7, 7, 3, -5], [11, -1, 12, -3, 0, -7, 13, 6, 11, 3, -5, -16, -8, 0, 3, -1, -12, -4], [-10, 2, -6, -3, -5, 0, 0, -9, 1, 6, -5, -4, -9, -2, -5, 3, -2, -2], [-5, -9, 10, -9, -5, 1, 5, -10, -5, -5, 15, 5, 10, 1, -9, 0, 4, -10], [0, 0, 9, -4, -7, 0, 0, -6, 6, -5, 23, 0, 7, 3, 3, 0, -4, 5], [-6, -1, 8, -1, 4, 3, -7, 0, -10, -5, 9, 2, -5, 11, -8, 11, 7, -3], [-7, 8, -10, 8, 17, 7, -13, 0, 9, 1, 16, 8, 8, 3, 4, 3, 13, 9], [-3, 0, -1, 2, -5, 5, -3, -3, 4, 5, -1, 3, 5, -4, -4, -5, -7, -5], [-1, 3, 0, 2, 1, -1, 0, -2, -1, 0, 0, 2, -8, 2, -1, 0, 0, 4], [6, 3, -4, 1, 3, 0, 0, -4, 1, -2, -8, 0, -4, -2, -2, -1, 3, 3], [-1, -5, -14, 0, 0, 13, -13, -2, -10, 5, 7, 8, 14, 0, 0, -5, 14, -6], [-10, 0, -2, 2, -5, -6, -10, 11, -16, -4, -3, 10, 5, -1, -1, 6, -4, 4], [2, 0, 5, 0, -4, -1, 4, 0, 5, 3, -7, -11, 2, 0, -1, 0, -4, -8], [3, -6, 13, -8, -8, 8, -5, 11, -5, 6, 13, 2, 19, 6, -2, 2, -3, -16], [-3, 6, -8, 6, 0, -4, 0, -3, 9, -6, 3, 6, 0, 0, -6, 6, 8, -2], [20, 4, 0, 0, 1, -8, -1, 21, 11, 15, -11, -4, 5, -5, 8, -3, -4, -1], [4, -4, -5, -3, 14, 0, 0, 4, 14, 0, 0, 3, 4, 9, 1, 3, 4, 4], [-12, 1, -1, -2, 0, 2, -12, 0, 0, 0, 11, 12, 11, -1, 0, 0, 0, 1], [-4, 3, 3, 2, -10, 3, 7, -10, -1, -2, 9, 0, 0, 1, 0, -11, -2, 0], [-8, 3, 11, 3, 1, 3, -4, 0, -10, -9, 10, 7, -1, 13, -10, 13, 4, -2], [-2, 0, 5, -7, -2, 4, -2, -4, -6, -11, 18, 2, 2, 14, 14, -4, 4, 11], [5, 11, 0, 2, -21, -4, 7, -5, 7, 7, -2, -7, 2, -4, 11, -9, -5, 0], [-3, 6, 4, -2, -11, 0, 0, 8, -7, 4, 7, -2, 8, 8, -8, 2, -5, -5], [-1, 6, 0, 0, 2, 4, -5, 4, -4, -4, 4, 5, 2, 4, -4, 0, 5, -5], [-4, 0, 6, 1, 3, 0, -4, 11, -9, -2, -8, 4, -3, -3, -3, 0, -8, 2], [-4, 9, -6, 9, 4, 5, -8, 0, -8, 3, 1, 0, -11, 1, 4, 1, 8, 3], [4, 0, 2, -9, -3, 4, 4, 2, 5, 3, 2, -4, 3, -3, -3, -4, -1, -3], [1, -3, 1, -4, -1, -1, 1, 1, 1, 1, -1, -3, -9, -4, -15, 0, -2, -11], [-18, -2, -4, 3, 13, 11, -17, 2, -13, -13, 11, 13, 1, 11, -2, 5, 15, 4], [7, 0, -2, 0, -2, 0, 9, -2, 3, 3, 7, 0, 0, 0, 0, -10, 3, 0], [-17, -5, -5, 6, 13, -6, -4, 2, 2, 4, -7, 2, -3, 5, -1, 1, -2, 3], [5, 0, 0, 0, 13, 10, 2, 3, 8, 1, -8, -7, 6, -2, -10, 12, -7, 2], [-13, 4, -11, 2, 12, -2, -11, -14, -13, -11, 11, 17, -16, 2, 2, 0, 22, 14], [6, -4, 6, -8, -9, -4, 6, 9, 6, 6, -6, -12, 10, -8, 5, 0, -12, -1], [-15, 5, -12, 13, 0, 1, -12, 3, 2, 5, -8, 7, -6, 0, -13, 5, 12, -5], [-1, -12, 10, -11, 3, -12, 6, 3, 4, -6, 16, 0, 0, -1, 0, 6, -6, 0], [-12, 13, -7, 13, -4, -1, 1, 0, 4, 5, -9, -3, -1, -4, 3, -4, -1, 2], [2, 4, 2, 10, 0, -1, 4, 12, 3, 4, -6, -8, -14, 0, -10, 4, -2, -6], [5, -4, -3, 4, 15, 6, -3, -3, 0, 0, 3, 0, -8, 6, -4, 8, -1, 3], [11, 4, 0, 0, -6, 7, 3, 8, 4, 10, -4, 1, 0, 2, -7, 5, 1, 3], [-8, 3, 5, 3, -30, -8, 6, 0, -24, -11, -19, 17, -13, -3, -5, -3, -6, 6], [-8, -1, 0, 0, -5, 3, -8, 0, -5, 2, 5, -1, 2, 3, -3, 0, -1, -8], [7, 11, -6, 1, 11, -2, -2, -3, 4, 4, -1, -4, -9, -2, 11, -10, -2, 6], [4, -4, -8, -8, 7, 0, 0, 15, 5, -2, 13, 6, 15, -1, -4, 8, 8, 8], [10, 4, -5, -5, 3, -5, -1, 6, 4, 4, -10, -4, -11, -5, 4, -9, -2, 5], [5, -5, 3, 6, 0, -11, 5, 0, -12, -6, 6, 1, 0, 0, -6, -5, -3, 4], [13, 0, 14, -6, -20, 7, 13, 6, 2, 10, 2, -13, 20, -1, -1, -7, -11, -10], [-14, 4, -2, -2, -13, 4, -2, -13, -2, -1, 4, 0, 0, 6, 0, -1, -1, 0], [-4, 2, 6, -1, -6, -3, 6, -4, -4, 6, -6, -7, -11, -1, 0, 0, -12, 3], [7, 0, -2, 0, 21, 0, -2, -12, 7, -2, 2, -2, -1, 0, 7, 0, 4, -2], [14, 6, -9, 9, -3, 0, 0, 6, 9, 12, -20, -9, 6, -13, 3, -9, -6, -6], [3, -1, 0, 0, 4, -7, 1, 2, 4, -6, -4, 8, -6, 0, 7, -7, 8, 1], [9, -3, -2, -2, 5, -3, -9, 5, -13, 0, 2, 0, 0, -1, 0, 3, 0, 0], [11, 0, 14, -4, -15, -8, 11, 7, -10, 17, -29, -11, 15, -6, -6, 8, -20, -17], [7, -1, -6, -3, 0, 5, -8, 9, -4, 2, 13, 6, 6, 0, 3, -1, 6, 0], [-12, -6, -2, 2, 22, 3, -9, 9, -7, -7, -2, 7, 3, 3, -6, 8, 11, 2], [0, 2, 2, 7, -7, -7, -7, 16, -16, 0, -11, 7, -11, -2, 2, -2, 0, -2], [12, 6, -11, 6, 0, -13, -2, 0, 8, 8, -8, -5, 0, -14, 1, -14, 2, 3], [-1, 0, -13, 20, 9, -2, -1, 1, 6, 1, -5, 1, -9, 6, 6, 2, 11, -1], [5, 0, 2, -2, -10, -2, 2, 13, 5, 2, -2, -2, -13, -2, 6, 0, -4, -3], [4, -8, 10, -2, -2, 11, 8, 6, -2, -2, -4, 2, 4, 11, -8, 6, 3, -10], [16, 8, 14, 5, 0, -1, 7, 2, 10, 12, -3, -19, 7, 0, -5, 8, -14, -5], [-15, 1, 1, 0, -13, 1, 9, -13, 5, -6, -6, 0, 0, 1, 0, -9, -6, 0], [-4, -4, 5, -10, 12, -4, -6, 12, 13, 3, 18, 0, 0, 6, 0, -4, 3, 0], [-5, 11, 1, 4, -7, -7, 1, 1, -5, 1, -1, 0, -13, 4, 4, 0, -2, 5], [-5, 2, 1, -3, 10, -5, 1, -16, -5, 1, -1, 3, -16, -3, -6, 0, -2, 8], [5, -1, 0, 0, -20, -8, 4, 1, -6, -1, 6, -1, -15, -3, 8, -5, -1, 4], [1, -6, 1, -5, 1, 5, 2, -4, 8, 4, -34, -4, -30, 6, 5, -5, -2, -3], [2, -6, -3, -11, -8, -6, 0, -8, -16, -6, 15, 0, 0, 5, 0, -7, -6, 0], [-14, -11, -7, -2, 0, 0, 2, -10, -18, -9, -7, 7, -6, 0, 2, -11, 7, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_855_bs_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_855_2_bs_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_855_2_bs_b(:prec:=18)
    chi := MakeCharacter_855_bs();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_855_2_bs_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_855_2_bs_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_855_bs();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![361, -342, 444, 36, 750, 1890, 553, -357, 282, 52, -30, 96, 70, -24, -15, 5, 6, 3, 1]>],Snew);
    return Vf;
end function;