
// Make newform 475.2.l.c in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_475_l();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_475_l_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_475_2_l_c();".
// 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_475_2_l_c();".
// 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 := [1, 0, 15, -16, 198, -132, 437, -138, 582, -156, 438, -93, 231, -51, 72, -14, 15, -3, 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], [-2601214274036, 1348014480151, -34340446173148, 22913565282806, -73622429378663, 24300805314434, -101945748763594, 27960663596715, -77292885590832, 16563882463922, -41495881520992, 9051939676612, -12964718137852, 2458535955743, -2732196133634, 523927730528, -176902925324, -2362215094], [1249494973861, -4173984429332, -6310322562086, -24543770185394, -21178028146029, -53683022385418, -41806244150830, -45248146421483, -32654560143716, -25750669196294, -19595360087749, -6799863255329, -6148599460869, -1289873408104, -1446829381050, 51093388053, -88297854546, -17485732004], [2036474776337, 4174852913747, 6559174797101, 25432415690738, 24440209046322, 51736757215426, 44701878155230, 44417859093215, 39943209775688, 25358952088733, 23929992121897, 7321752947336, 7658100229362, 1576807416328, 1646328025947, 77458832787, 67213359096, 31170269891], [9924998536452, -25239051620405, -18574098462028, -65671130584969, -71368680699863, -150604628667508, -140150638887798, -139987308514533, -107347453764758, -91399807598455, -61173284253370, -33578770190668, -16935494273702, -9048902407408, -3440777225226, -1207986331145, 22583410048, -150661038729], [-2451247768033, 23094455322128, 15495186910162, 52866415784337, 63296274710146, 128192309299746, 117052142258774, 143914939792586, 86539068699317, 108555610980184, 44506175702300, 52145226330891, 8550245559592, 16364383205847, 840321900394, 3183507161538, -484705722592, 271722740134], [-139873473393, 1344049384007, 907619400199, 3507803893486, 2591457050228, 11453985494683, 5750184114669, 12178339879671, 4204775784857, 8811394522903, 2401081552594, 3667695351382, 517821809207, 1054848843451, 84439865154, 163974948404, -18779546977, 14393251623], [-2743148781339, 1289655835611, -36148782515349, 22920186337367, -64199831043919, 8235247858388, -84690957416629, -8530715161662, -56855271575000, -17195400090500, -28551737645641, -11452733474463, -6588252818956, -4366731414611, -1021310336031, -988488698886, 144550753822, -99295558576], [271722740134, 2451247768033, -19018614220118, -19842750752306, 934686762195, -99163676407834, -9449471861188, -154549880397266, 14227694965402, -128927816160221, 10458949198508, -69776390534762, 10622726640063, -22408105306426, 3199654083801, -4644440262270, 892333940472, -330462497810], [-759862203949, -422383778863, -30581574139987, 54155545522772, -109625290547904, 135207369075700, -141640168905788, 199076210749085, -126748060068652, 156613392824897, -73041253362959, 85618508403902, -30567017722290, 26906316005605, -7682766129021, 5639724390405, -1203461029533, 335323421585], [671726483761, -15266507142983, 8766054588512, -3857061703044, -10070536517332, 22431948273852, -10254441293754, 58786967689962, -19086289356322, 53548739509621, -11980132322574, 32807739705559, -7678713505092, 10956780516730, -2179007028305, 2467349014493, -512091105045, 169369527342], [2362215094, -332082681947, 1383447706561, -34378241614652, 23381283871418, -73934241771071, 25333093310512, -102271734446566, 29335472781423, -77661391145496, 17598532675094, -41715567524734, 9597611363326, -13085191107646, 2628615442511, -2765267144950, 559360956938, -183989570606], [422383778863, 19183641080752, -41997750259588, -40827425833998, -34905558154432, -190419614219925, -94215226604123, -315491742629666, -38074889008853, -259778391966703, -14951323436645, -144961151389929, 11846656395794, -47027312555307, 4998346464881, -10194472029702, 1944263190262, -759862203949], [-12113076116529, -27211156260656, -9094600892191, -280065299810173, 84122081916376, -600411869161108, 67175092224633, -753304634763705, 104668494106942, -551278539461887, 66417646782434, -280006541552455, 46214882705029, -85919693699728, 13589938568817, -17453288335442, 3351021374386, -1201752794172], [1723605145714, -893491525826, 73511199022292, -325915380884067, 383847702402056, -717045289804293, 442503520486495, -1001370170259860, 429588085896622, -759490348933525, 241220082848977, -410622346773594, 113987266569107, -128615472664470, 29428427601899, -27296401124421, 5655888876310, -1764752036203], [-3751600650469, -5869106089249, -46549600863206, -309405458804505, 76344756009802, -778255161948012, 32966933367212, -1075352377560484, 131095657717169, -826652550605570, 94451845877099, -439743089812689, 74281026654601, -138437780054349, 22542369486988, -29025194492163, 5675262379841, -2009357177810], [2187209095662, -620019744989, 83122854265979, -354767905666813, 454020967394587, -790741872567937, 559762487588955, -1163466071525892, 552412980832141, -904040446392028, 321726275203346, -501373370047309, 150026353889968, -158773504414729, 39022236800535, -34139016228998, 7176985755886, -2169011193168]];
    Rf_basisdens := [1, 1, 2269131592089, 6807394776267, 6807394776267, 6807394776267, 6807394776267, 358283935593, 2269131592089, 6807394776267, 6807394776267, 2269131592089, 2269131592089, 6807394776267, 6807394776267, 6807394776267, 6807394776267, 6807394776267];
    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_475_l();"
function MakeCharacter_475_l()
    N := 475;
    order := 9;
    char_gens := [77, 401];
    v := [9, 7];
    // 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_475_l_Hecke();"
function MakeCharacter_475_l_Hecke(Kf)
    N := 475;
    order := 9;
    char_gens := [77, 401];
    char_values := [[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, 1, 0, 0, -1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0], [0, 0, 0, 0, 0, -1, -1, 0, -1, 0, 0, 1, 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, 1, 0, -1, 0, 0, 0, -1, 1, 0, -1, 0, 0, 0, 0], [0, -2, 0, 1, -1, -2, 1, 1, 0, 0, -1, 1, 2, 1, -2, -1, -1, -1], [2, 1, 2, 1, -1, 1, 2, 2, 1, 1, -1, 0, -1, 0, 0, 0, 0, 0], [-1, -1, 0, -1, -1, 0, 0, -1, -1, 0, 1, -1, 0, -1, 0, 1, 1, 0], [0, 2, 1, 0, 1, 1, -2, -2, -1, -1, 0, 0, 0, 1, 1, 1, -1, 2], [0, -1, -2, 0, -1, 1, 2, 2, -1, 0, -1, 0, 1, 1, 1, 0, -1, 0], [0, 0, -2, -1, -2, -3, 0, 0, -2, 2, 0, 2, 2, 0, -2, -2, 0, -2], [0, -3, 1, 1, 0, -1, -1, -1, -2, -1, 0, 0, 0, 1, -1, 2, -2, 1], [-4, 0, 0, -1, 1, -3, -3, 0, 0, -2, 2, 2, 1, 3, -1, 1, -2, -2], [-2, 0, -1, 0, 0, -1, 2, 2, -1, 2, 0, 1, 0, -1, 0, -2, -1, -2], [0, 0, -3, 1, 2, -4, -1, -3, -2, -2, -1, 0, -1, 0, -2, 0, -3, 0], [-3, -3, -3, 2, 2, -1, 3, 0, 0, 1, 0, 1, 1, 0, -1, -3, -1, 0], [0, -1, 1, 0, -1, 2, -1, 1, 2, -3, -1, 0, 4, 0, 1, 0, 0, -1], [0, 0, -2, 0, 3, 0, 0, 1, 1, 0, 0, 1, 0, 2, -2, 1, 0, -1], [1, -2, 1, 0, -2, 3, 0, 4, 1, 2, -2, 0, 0, -3, 1, -1, 3, -2], [0, 1, -1, -3, -1, -3, 0, 0, -2, 0, 0, 2, 0, 0, -2, -1, -7, -2], [-4, 1, -3, -4, 1, 3, -2, -2, 2, -1, 3, -1, 3, 4, 2, 0, -3, 0], [0, 4, -1, -6, 0, 4, -4, 0, 0, 1, 4, -2, -6, -1, 2, 4, 1, 2], [-4, 2, -3, -3, 0, 0, 0, -2, -2, -1, 2, 1, -3, -3, 1, 0, -1, 3], [0, -1, 2, -1, -2, 2, -1, 2, 7, 1, 2, -3, 0, 0, 2, 1, -1, -2], [-3, 2, 1, -1, -1, -2, 1, 1, 1, 2, 1, 2, -1, 3, 0, -4, 0, -3], [0, 0, 3, 0, -2, 0, 0, 0, 0, 0, -3, 0, 3, -3, 1, -1, 0, 3], [2, 2, 0, 2, -2, 0, 0, 1, 0, 2, -2, 1, -2, -3, 0, 2, 0, 0], [2, -2, 2, -2, 2, 1, 0, -3, 0, 2, 4, -3, 2, 3, 1, -3, 0, -2], [0, 0, -7, -3, -3, 0, 5, 0, -3, 3, 3, 1, 0, 5, 0, 0, 0, 0], [-2, -4, -3, 2, 0, -7, 1, -4, -5, 0, 2, 3, 2, 2, -5, 0, -3, 0], [0, 0, 0, -1, -1, -1, -6, 2, 0, 0, 0, 4, 0, 6, -5, 3, -3, -4], [-1, -4, 5, 2, 2, -4, 5, 1, 3, -4, -2, 2, 2, 7, 0, -6, 0, -7], [-3, 0, -4, 0, 3, 0, 0, -1, -1, 0, 2, -1, -2, 1, 0, -1, 3, 4], [3, 1, 0, 0, 1, -4, 3, 0, -1, 3, 1, 0, -4, 0, -7, -3, 0, -3], [-2, 3, -1, -2, 3, -1, -1, 0, 2, 3, 2, -1, 3, 4, 0, -1, 0, -3], [4, 0, -2, -4, 0, 7, 2, 5, 5, -1, 0, -6, -4, -2, 1, -2, 6, -4], [3, 0, 0, -3, 1, 1, -5, 1, 0, -4, 4, 0, 2, 5, 0, 0, -5, 0], [6, 0, 6, 0, 6, 3, -5, 0, 2, -6, 0, -1, 0, -6, 2, 0, 6, 0], [-5, -1, -5, -1, 1, -4, -4, 0, -3, 0, 1, 3, 1, -1, -1, 1, 4, 2], [1, 0, 0, 0, 0, 1, 1, -1, -1, 1, 4, 0, -1, -11, 4, -1, 11, 3], [-5, 4, 2, 4, 3, 0, 0, -1, -1, 0, -2, -1, -2, -7, 4, -2, 5, -1], [-6, -2, -6, -3, 3, -7, -6, -4, -6, 1, 4, 2, 2, 0, -1, 0, 6, 1], [-7, -4, -6, 1, -2, -11, 7, 0, -5, 6, 0, 9, 6, 0, -9, -6, 0, -5], [-1, 0, 0, 3, 2, -5, -3, -2, 0, 1, -1, 1, 4, 3, 1, 3, 0, -1], [7, -5, 5, 2, 0, 11, 5, 5, 3, -5, -5, -7, 2, 5, 4, -5, 2, -1], [0, 2, 0, -1, -1, -2, 3, -2, -2, 1, 1, -2, 0, 3, -2, 0, 0, 2], [-6, 2, 6, 8, -1, 1, 6, 0, 2, -1, 0, -2, -1, 0, 2, 6, -8, 2], [5, -2, 3, -2, -5, 0, 0, -1, -1, 0, 3, -1, -1, 2, 5, 9, -5, 6], [-1, -6, -5, 0, -9, -7, 2, -2, -5, 9, 6, 3, 6, 1, -5, 0, -5, 0], [2, 0, 0, -3, -2, 5, -6, -4, 0, -1, 1, -3, 2, 6, -3, 1, -5, 3], [0, 0, 0, 1, -1, 1, -3, -3, 0, 2, -2, -2, 4, 3, 0, 13, 10, 2], [3, -1, 0, 2, -4, -9, 10, -4, -6, 4, -1, 3, -1, -3, -6, 0, 0, 0], [6, -5, 6, 8, -8, 2, 6, 3, 4, 2, -6, -1, 5, 5, -2, -5, -6, -3], [3, 4, -2, 1, 1, -5, -2, -3, -5, 4, -1, 7, 1, -3, 0, 5, 0, 0], [1, -4, -4, 0, -4, -5, 5, -2, -1, 3, 4, 0, 1, 7, -7, -1, -7, -2], [-2, -6, -12, 4, -2, -6, 2, 0, -4, 8, 0, 1, 8, 0, -1, -12, -4, -4], [2, -2, 10, 1, 0, -1, 1, 0, 7, -10, -2, -3, 1, 10, -4, -1, -8, -4], [1, 2, 1, -4, 0, 9, -12, 0, 7, -7, 2, -8, -4, 1, 1, 12, 0, 1], [0, -3, -2, 3, -4, -1, 1, 3, 1, 4, 0, -3, 0, 0, 1, 0, -2, 0], [8, -3, 8, -1, 1, 14, 5, 6, 9, -3, -2, -3, 3, 5, 5, -5, -5, 2], [8, -1, 3, 0, -1, -2, 5, 3, -2, 3, 4, 0, -2, 2, -5, -8, -2, -3], [-5, -1, -7, -1, 8, 0, 0, -5, -5, 0, -4, -5, 5, 2, 4, -2, 5, 5], [5, 6, 5, 1, -1, 2, 6, 7, 2, 1, 0, 5, -6, 7, 0, -7, -6, 5], [-13, 3, -7, 1, 0, 1, -10, -2, -1, 4, 3, 0, 1, -7, 1, 10, -6, 3], [0, 4, 12, 8, 4, 1, -5, 1, 8, -8, -4, -7, 0, 2, 1, 7, -7, -1], [0, 0, 2, 0, 1, 0, 0, 0, -1, -1, 0, -4, -1, 0, 4, 2, 9, -1], [-11, 1, -7, -10, -4, -5, -7, -2, -1, 1, 10, 4, -4, -3, 0, -4, 0, -4], [-9, 1, -9, 2, -2, 0, 4, 2, 2, -4, -6, 0, -1, 6, -2, -6, -4, -2], [-2, -2, -7, 6, 4, 2, 14, 2, 5, -4, -4, -8, -4, 2, 5, 0, -7, 0], [3, -6, 4, 5, -8, 10, 0, 14, 2, 8, 1, 6, 1, -3, 2, 0, 4, 0], [0, 1, 8, -5, -2, 0, -1, 0, -1, 5, 2, 2, 0, -5, 0, -4, 4, 0], [1, 6, 1, -3, 3, 0, -6, 2, 3, -4, -1, -1, -6, -1, -3, 1, 6, -4], [-3, 1, 0, 1, 8, 0, 0, 2, 2, 0, -5, 2, 4, -3, -4, -8, 3, -13], [9, 3, 3, 1, 1, 8, 3, 3, 3, 3, -1, -8, 1, -5, 0, 6, 0, 5], [0, 4, 4, -3, -3, -1, -6, -1, -2, 3, 3, 2, 0, -2, -1, 4, -4, 1], [6, 0, 0, 0, 1, -5, -8, 0, 0, -1, 1, 2, -5, 8, 1, 0, -8, -2], [-3, -1, 3, 3, 0, -6, -7, -6, 4, -6, -1, 1, 3, 3, -5, 7, -6, 1], [-6, -1, 10, 7, 3, 2, 6, 0, 1, -2, 0, -4, -2, 0, 4, 10, -3, 1], [3, 4, -1, 4, -4, 0, 0, 0, 0, 0, 2, 0, -6, 4, -1, 12, -3, 9], [6, 1, 13, 1, -1, 0, 0, 0, 0, 0, -1, 0, 0, -7, 3, -8, -6, -3], [-11, 1, -8, 0, 2, -3, 11, 0, -4, -3, 0, 0, -3, 0, 0, -8, -2, -4], [3, 0, 0, -3, -8, 13, -8, 1, 0, 5, -5, -7, 6, 8, 2, 2, -6, 7], [5, -8, 7, 2, 0, 18, 2, -4, 12, -5, -8, -15, 2, 7, 3, -2, -2, 7], [-6, -2, -8, 3, 12, -1, -8, -2, 1, -2, -3, -2, 12, 2, 0, 2, 0, -2], [0, 10, 1, 0, 10, 9, -1, 4, 8, 1, 6, 0, -11, -2, 6, 0, 2, -3], [8, -2, 12, -2, -11, 0, 0, -5, -5, 0, 0, -5, 2, -4, -2, 9, -8, 8], [-16, 1, -8, -9, 6, 0, -8, -10, -4, 1, 9, -6, 6, 5, 0, -8, 0, 4], [0, 6, -1, -2, -1, 3, 6, 3, 7, 2, 1, -5, 0, -2, 3, -8, 8, -3], [-2, 0, 0, 3, 1, -4, -3, -3, 0, 2, -2, -4, 4, 3, 9, 3, 0, 4], [-2, 9, -9, -8, -4, 19, -10, 13, 8, 4, -1, 3, -1, 2, 8, 0, -9, 0], [0, -7, 2, 4, 8, 4, 6, 4, 2, -4, -8, -10, 0, 2, 4, -4, 4, -4], [10, -8, 10, 10, -10, -11, -1, 2, -4, 1, -9, 6, 8, -10, -7, 10, 1, -1], [-4, -3, -9, 0, -3, -16, 5, -11, -11, 5, 10, 0, -2, -8, -10, 4, 8, 6], [0, -6, -9, 3, 1, -2, 6, -2, -12, -3, -1, 1, 0, 4, -2, -2, 2, 2], [2, -4, -2, 8, 0, 0, -5, 8, 4, 0, -4, -2, 8, -2, -2, 5, 4, -10], [11, 1, 5, 1, 7, 13, -1, -4, 11, -7, -2, -9, -2, -11, 11, 0, 5, 0], [5, -2, -6, 3, -2, -10, -5, 0, -6, 4, 0, 8, 4, 0, -8, -6, -9, -6], [-5, -7, -1, 0, -7, 2, -4, -1, 7, -4, 5, 0, 11, 2, -2, 5, -2, -4], [0, -11, 0, -1, 1, 1, 2, 6, 5, -5, -4, 1, 11, 1, -4, -1, -2, -3], [4, 1, 5, -4, -2, 8, -4, 0, 0, 1, 0, 3, 1, 0, -3, 5, -14, 0], [-2, -3, -7, -3, 5, -18, 2, 0, -11, -2, 0, 13, -2, 0, -13, -7, -6, -11], [6, 3, 4, 0, 3, 2, 2, 2, 8, -1, -8, 0, -2, -17, -6, -6, 17, -8], [1, 1, -1, -3, 2, 2, -1, -4, -3, 1, 3, -3, 2, -5, 0, 2, 0, 5], [0, 9, -8, -3, 2, 1, 4, 1, 4, 3, -2, -4, 0, 3, 1, -1, 1, -1], [-7, 0, 0, -1, 3, -8, 9, -9, 0, -4, 4, -5, 1, -9, 9, -9, 0, 5], [5, 0, 0, 3, 7, 2, -8, -9, 0, -4, 4, -9, -8, 8, 7, 11, 3, 9], [0, -9, -9, -5, -10, -2, 8, -2, -4, 5, 10, -3, 0, 8, -2, 0, 0, 2], [0, -1, 3, -1, 7, 0, 0, 0, 0, 0, 8, 0, -7, -3, 10, 5, 0, 2], [-13, -5, -21, 0, -5, -6, 8, -3, -7, -1, 7, 0, 6, -5, -2, 13, 5, 4], [6, 4, 2, -1, -10, 6, -6, 0, 5, 6, 0, 5, 6, 0, -5, 2, -15, 5], [0, -4, 7, 2, 3, -4, 11, -4, 6, -2, -3, -6, 0, 6, -4, -5, 5, 4], [-5, 0, 0, 1, 6, 7, -2, 9, 0, -5, 5, 0, -13, 2, 2, -1, -3, 0], [11, 15, 1, -7, -6, -1, -5, 6, -6, 6, -8, 11, -8, -11, -6, 0, 1, 0], [1, 0, 3, 0, 6, 0, -1, 0, -2, -6, 0, 0, -6, 0, 0, 3, -9, -2], [8, 4, 8, -5, 5, 6, -6, 8, 7, -10, -5, 1, -4, -6, -1, 6, 6, 0], [-9, 12, -9, 0, 12, 2, 0, -1, -2, -6, 0, 0, -6, -10, 7, 9, 10, 5], [-1, -7, -3, 11, 1, 0, 12, 13, -2, -1, -4, 4, -4, 1, -2, 0, -3, 0], [-7, -8, -10, 9, 0, -11, -11, -5, -7, 3, -8, 9, 9, -10, -2, 11, 3, 3], [-8, 0, 0, 3, -3, 3, -4, -3, 0, 6, -6, -6, 6, 4, 6, 7, 3, 6], [0, -4, 13, 5, 3, -3, -17, -3, -4, -5, -3, -2, 0, -1, -3, 16, -16, 3], [-9, 2, 6, -5, -4, -6, 6, -11, -4, 2, 5, -1, -4, 2, 0, -15, 0, -2], [13, -1, -1, 0, -1, 8, 14, 7, 3, -4, -11, 0, 5, -9, 6, -13, 9, -2], [-6, 1, -6, 4, -4, 9, 3, 1, -2, 5, 1, 3, -1, 4, 11, -4, -3, 14], [0, -7, 2, -2, -5, -4, -4, -4, 0, 2, 5, 8, 0, -4, -4, 0, 0, 4], [-3, 0, 0, 12, 7, -3, 12, 8, 0, 5, -5, 2, -3, -12, 7, -6, 6, -2], [0, -3, -6, -6, -2, -1, 3, -1, -3, 6, 2, -4, 0, 9, -1, 6, -6, 1], [5, 4, 3, 4, -1, 0, 0, -1, -1, 0, -7, -1, 3, 2, 4, -5, -5, 3], [-7, 16, -9, -2, 1, -8, -9, -5, -8, 16, 2, 11, 1, -9, 0, 2, 0, 0], [13, 1, 18, -1, 0, 10, -4, 3, -4, -3, 1, -3, -1, 18, 7, 4, -5, 4], [-8, 5, 3, -7, -6, -10, 3, -13, -4, 6, 2, -2, 2, 8, -4, 0, 3, 0], [4, -1, 4, -3, 3, -3, -5, -7, -5, -4, -1, -2, 1, 1, 2, -1, 5, 0], [-8, 0, -1, 0, -1, 0, 0, 3, 3, 0, 1, 3, -1, -7, -2, 4, 8, 2], [18, -1, 11, -1, -4, 0, 0, 4, 4, 0, 2, 4, -1, 7, 2, -10, -18, -3], [5, -4, -1, 0, -5, 11, -5, 0, 4, 9, 0, -2, 9, 0, 2, -1, 4, 4], [9, 5, -2, 0, 0, 4, -10, -2, 0, -4, 5, -2, 0, -2, 2, 10, 11, 4], [-6, 0, 0, 4, -6, -4, 11, 10, 0, 10, -10, 7, 10, -11, 0, -1, 10, -7], [2, 6, -4, -11, 0, -10, -2, 0, -2, -6, 0, 2, -6, 0, -2, -4, -4, -2], [3, 0, -5, 6, -5, 9, -5, -2, 2, 0, -6, -13, -5, -4, 0, 8, 0, 7], [8, -7, 8, 1, -1, -13, -2, 1, -6, 4, 3, 7, 7, -4, -7, 4, 2, 0], [-8, 0, 0, -6, -6, -13, -1, -13, 0, 0, 0, 2, 10, 1, -4, 3, 2, -2], [-2, 9, -2, -4, 4, -4, 2, -11, -13, -2, 2, 2, -9, -7, 9, 7, -2, 11], [2, 2, -1, 6, -5, -4, -1, 14, 4, 2, -6, 14, -5, -25, 0, 3, 0, -8], [-6, 10, 5, 0, 10, -8, -11, -10, -8, 0, 13, 0, -10, -6, 2, 6, 6, 10], [2, 3, 4, -4, -3, 5, 4, 1, -5, 3, 4, 1, -3, 15, 0, -2, 0, 10], [-3, 2, -5, -8, 1, 25, 3, 0, 8, -3, 0, -11, -3, 0, 11, -5, -8, 8], [0, 4, 14, 6, 4, -5, 4, -5, -2, -6, -4, 5, 0, 9, -5, 5, -5, 5], [-14, -3, -6, 5, 0, -15, -6, -3, -5, -17, -3, 10, 5, -6, -5, 6, -8, -2], [-7, -4, -15, -4, -4, 0, 0, -2, -2, 0, 11, -2, -7, 8, -5, 0, 7, -7], [1, 8, 4, 8, 13, 0, 0, 8, 8, 0, -4, 8, -4, -3, 10, 4, -1, 2], [3, -8, -3, 0, -8, -6, 6, -3, 8, -2, 4, 0, 10, 15, -17, -3, -15, -11], [12, -8, 12, 6, -6, -1, 7, 0, 7, 0, -6, -7, 8, 3, -8, -3, -7, -15], [6, 7, -5, -9, 0, 7, 1, -4, 7, -2, 7, -7, -9, -5, 0, -1, 11, 4], [0, 0, -6, -7, -2, -6, -3, -6, -7, 7, 2, 3, 0, -16, -6, -13, 13, 6], [8, 12, 9, 3, -3, 18, -8, 0, 6, -9, 0, 2, -9, 0, -2, 9, -15, 6], [7, -5, 13, -6, 3, -4, 13, -3, -2, -5, 6, 3, 3, 6, 0, -6, 0, -2], [-3, -1, 2, 1, -5, -9, 13, -2, -7, 5, 0, 5, 0, 3, -7, 0, 2, 0], [7, 0, 0, -4, -1, 8, -1, 5, 0, -3, 3, 0, -19, 1, -3, 7, 6, 0], [0, -3, -5, -4, 6, 14, 5, 14, 10, 4, -6, -7, 0, -8, 14, -13, 13, -14], [5, -5, -5, -5, 5, 0, 0, -6, -6, 0, 0, -6, 5, 10, 8, 2, -5, 1], [-4, 6, 7, 0, 8, -10, 7, -19, -11, 6, 0, 2, 8, -5, 0, -11, 0, 1], [-1, 8, 18, 10, 7, 3, 1, 0, 9, -15, 0, -7, -15, 0, 7, 18, 0, 9], [-16, 2, 5, 11, 0, -17, -2, -3, -9, 13, 2, 13, 11, 5, -4, 2, -21, -1], [-8, 14, 9, -9, 0, 21, -14, -4, 11, -3, 14, -16, -9, 9, 5, 14, -17, 9], [-2, 4, -1, 4, 11, 0, 0, 5, 5, 0, -13, 5, 9, -1, -3, -6, 2, -9], [-16, 3, 0, 3, 9, 0, 0, -1, -1, 0, 4, -1, -7, -16, 4, -6, 16, 4], [-15, 2, -15, -9, 9, -15, -2, -11, -15, -17, -8, 4, -2, -1, 0, 1, 2, 4], [13, -7, 25, 10, 12, -2, 0, -3, 2, -12, -3, -6, -3, -13, 2, 0, 25, 0], [8, 6, 11, -16, 0, 4, 3, 15, -4, 2, 6, 0, -16, 11, 4, -3, -3, -11], [-6, -1, 10, 9, -9, -1, 6, 0, -3, 10, 0, 6, 10, 0, -6, 10, 1, -3]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_475_l_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_475_2_l_c();".
// 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_475_2_l_c(:prec:=18)
    chi := MakeCharacter_475_l();
    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_475_2_l_c();".
// 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_475_2_l_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_475_l();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![1, 6, 30, 84, 0, -270, 397, 591, 18, -1130, 804, -354, 268, -66, 33, -19, 6, -3, 1]>],Snew);
    return Vf;
end function;