
// Make newform 880.2.cd.b in Magma, downloaded from the LMFDB on 02 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_880_cd();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_880_cd_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_880_2_cd_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_880_2_cd_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 := [390625, -312500, 125000, 31250, -68125, 35000, -4950, -5840, 4281, -1168, -198, 280, -109, 10, 8, -4, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1109367578125, 707288171875, -54789125000, -277256700625, 191129006250, -29147729875, -30960547040, 22289040321, -4744531588, -1901194743, 1703116855, -365600344, -45934140, 62145978, -13142014, 173441], [99028437500, -57565062500, 5407137500, 23893596250, -16071339500, 2411632875, 2623356290, -1876537138, 398644474, 158401924, -131891470, 30481492, 3514030, -5312684, 1031322, -21238], [-8784171875, 15859887500, -5027700000, -3424503750, 4220205775, -1586565400, -309377742, 534321368, -200880675, -5866616, 39604938, -16605168, 633079, 1540234, -640840, 58612], [-271245109375, 97063578125, 10770128125, -50615852500, 16326131375, 4743600935, -6077157222, 1487549773, 476012770, -452531811, 125727763, 39797322, -21315936, 3100799, 1774345, -735828], [-738595781250, 123710843750, 78663153125, -139631729375, 66667234875, 15417937500, -18358921190, 8086129638, 1107185451, -1747012574, 646173570, 99411308, -104135105, 28931559, 6651203, -6436462], [253811312500, -675650121875, 244346778125, 71434294375, -147166398525, 59532330775, 4504407497, -16251927790, 6847316866, -318901558, -1033880073, 514416451, -47371799, -30900230, 16036663, -1813699], [2335828906250, -1575069015625, 402720334375, 310719346875, -407980597500, 138592034650, 14780863650, -46008612561, 19777365238, -1358970702, -3144183820, 1551164359, -239198055, -108888223, 69998414, -9454026], [366095625000, -287147937500, 52739012500, 88030975000, -72450964500, 19150239500, 8117024920, -8636503984, 2671684507, 295614832, -598314760, 205573956, -11443860, -19918312, 7259596, -969684], [5258500000, -3323250000, -212568750, 1206855000, -720909000, 12227655, 150929055, -78889896, 5034933, 11601558, -5755200, 343314, 559035, -192528, 15849, 21389], [-108288437500, 131409812500, -79856606250, -5996100000, 32306575625, -19391223250, 1980111930, 3433219114, -2272524372, 408479678, 202510460, -155734626, 39239060, 4983902, -4964066, 1267564], [180205890625, -300208500000, 188507294375, 2344699375, -70251605125, 45018452990, -5703551281, -7413427073, 5218292551, -1140800617, -429594336, 355492069, -90545788, -9577834, 11186483, -2839981], [1200271796875, -892621906250, 125995012500, 236437243125, -203940796150, 57858516725, 18925191190, -22636798568, 8006276989, 266887489, -1475055870, 599323112, -59283170, -40809799, 21134817, -3163593], [12354453125, 43761500000, -27763968750, 201352500, 12423128275, -7654208150, 850633370, 1531471046, -976889383, 166999817, 99884340, -75328514, 14416640, 2637478, -2891274, 616596], [-710165312500, 698223968750, -215325906250, -142917407500, 163213233750, -60054203300, -7755610170, 17990657188, -7456607214, 296779546, 1144685990, -535817707, 71121680, 32507734, -16936892, 3495548]];
    Rf_basisdens := [1, 1, 130247390625, 11840671875, 11840671875, 130247390625, 651236953125, 130247390625, 651236953125, 59203359375, 1058921875, 59203359375, 130247390625, 130247390625, 11840671875, 59203359375];
    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_880_cd();"
function MakeCharacter_880_cd()
    N := 880;
    order := 10;
    char_gens := [111, 661, 177, 321];
    v := [10, 10, 5, 4];
    // 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_880_cd_Hecke();"
function MakeCharacter_880_cd_Hecke(Kf)
    N := 880;
    order := 10;
    char_gens := [111, 661, 177, 321];
    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], [0, 0, 0, 0, 1, 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 := 2;
    raw_aps := [[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, 0, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [1, -1, 0, 1, 0, 1, 0, -1, -1, 0, 2, 1, 1, -1, 0, 0], [1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 1, 0, 1, -1, -1, 0], [0, -1, 0, 1, 0, -1, 1, -1, -1, -1, 1, 0, 0, 0, -1, 0], [0, 0, 0, -1, 0, 0, -1, 1, 1, 1, 0, 0, -1, 0, 1, 1], [0, 1, 1, 0, -1, 0, 0, -1, 1, 2, -1, -1, 0, 0, 1, 0], [-1, -1, 0, 0, 0, -2, -3, 0, 0, -1, -1, -1, -1, 1, -1, 1], [0, -1, 0, 0, 2, 0, 0, 0, 0, -4, 0, -4, 0, 0, 0, -1], [3, -2, 1, 2, 3, -2, -2, 1, -1, 3, 1, -1, 0, 0, -1, -1], [-1, 0, 0, -1, 0, -3, -6, 1, 1, 0, -4, -1, -7, 1, 0, 1], [3, 0, 0, 0, 0, 0, 2, 0, 0, 3, 2, -1, 2, -2, -2, 0], [0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 2, 0, 0, 0, 0, 0], [1, -1, 1, 0, -1, 0, 2, -1, -1, 1, 3, 1, -2, -2, 1, 0], [-1, 1, 1, -1, -1, -1, -5, 0, 0, 0, 0, -1, 0, 0, 0, -1], [1, 0, 0, 1, 3, -1, -2, 1, -1, -1, 0, 0, -1, 1, 0, 1], [2, 0, -1, -2, 1, 2, 1, -1, 1, 2, -2, 2, -1, 1, 2, -1], [-2, -2, 0, 0, 0, 3, 1, 0, 0, -2, -1, -2, -2, 2, -2, 2], [6, 0, 1, -1, 3, 1, 2, -2, 2, 5, -1, 6, 1, -1, 1, -2], [-1, 1, 0, -1, 0, 1, 1, 1, 1, 0, 0, -1, 0, 1, 0, 0], [-4, 3, -2, -3, -4, 3, 3, -1, 1, 3, -1, 2, 0, 0, 1, 2], [0, 0, 2, 0, -2, 4, 2, -2, -2, 0, 1, 0, 3, -2, 0, -2], [-3, 0, 0, 0, -5, 0, 0, 0, 0, 0, 0, -5, 0, 0, 0, 0], [1, -3, -1, 3, 1, -4, 4, -2, -2, -2, 2, 1, -3, 0, -2, 1], [1, -1, 1, 1, 1, -1, -1, 0, 0, -4, 0, -1, 0, 0, 0, -1], [0, 2, 0, 0, 0, -6, -4, 0, 0, 0, -6, 0, -4, 0, 0, -2], [0, 2, -2, 0, 2, 0, -9, 2, 2, 0, -11, 0, -3, 2, 0, 0], [-7, 0, 1, 1, 3, -1, -1, 0, 0, 0, 0, 3, 0, 0, 0, 0], [1, 3, -3, 0, 3, 0, 5, 3, 3, 1, 2, 1, -4, 2, 1, 0], [0, 0, -2, -1, 2, -1, -3, 3, 3, 1, 3, 0, 0, 2, 1, 3], [-3, -3, 2, 2, -3, -2, 1, 0, 0, -3, 3, -6, 3, -3, -3, -3], [0, 0, -1, 1, 1, 13, 0, 0, 0, -1, 6, 0, 6, 1, -1, 0], [0, -2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, -2], [0, 0, -2, -2, 0, 2, 0, 0, 0, 0, -2, 0, -2, 2, 2, 0], [-8, 1, 1, 0, -1, 0, 5, -1, 1, -6, 4, -2, 5, -5, -4, 0], [1, -1, 1, 0, -1, 0, -4, -1, -1, 1, -3, 1, 14, -2, 1, 0], [-2, 2, 2, -2, -2, 1, 10, 0, 0, 0, 0, -2, 3, 0, 0, -2], [1, -1, -1, 1, 1, 5, -3, 0, 0, 0, 0, 1, 4, 0, 0, 1], [3, 4, -4, 0, 4, 0, -9, 4, 4, 3, -13, 3, -13, 1, 3, 0], [-8, 1, 1, 0, -1, 0, 2, -1, 1, -6, 1, -3, 2, -2, -1, 0], [-6, 0, 2, 0, -2, 0, 2, -2, 2, 0, 0, -6, 2, -2, 0, -2], [2, -4, 0, 2, -4, -2, -4, 2, -2, -10, 0, -8, -2, 2, 0, -2], [0, 0, 2, 2, -2, 6, 4, -4, -4, -2, 12, 0, 16, -2, -2, -4], [-2, 1, 3, -3, -3, -3, -2, 0, 0, 1, -11, -2, 1, -1, 1, -1], [5, 3, -2, -2, 2, 2, -1, 0, 0, 3, -3, 5, -3, 3, 3, 3], [-4, -1, -1, 1, -4, -1, -1, 2, -2, 4, 2, 1, 0, 0, -2, 1], [1, 5, -5, 0, 5, 0, -6, 5, 5, 1, -11, 1, -6, 4, 1, 0], [0, 2, 0, 0, 0, 9, -4, 0, 0, 0, 9, 0, -4, 0, 0, -2], [-13, 2, 3, -2, -13, 2, 2, -5, 5, 5, -5, -3, 0, 0, 5, -3], [3, -3, -3, 3, 3, -6, -12, 0, 0, 0, 0, 3, -9, 0, 0, 3], [13, -4, -4, 0, 4, 0, -1, 4, -4, 5, 3, 5, -1, 1, -3, 0], [0, 0, -4, -4, -3, 4, 4, 0, 0, 0, 0, -3, 0, 0, 0, 0], [-2, 2, 2, -2, -2, 2, 2, -4, 4, 6, -4, -2, 0, 0, 4, -2], [-3, 3, 0, -3, 0, 5, -9, 3, 3, 0, 2, -3, -12, 3, 0, 0], [-2, -6, -4, 4, 4, -2, -8, 0, 0, -6, -10, -2, -6, 6, -6, 6], [-14, 0, 7, 2, -13, -2, 5, -5, 5, -8, 2, -14, 7, -7, -2, -5], [-3, -1, 0, -3, -8, 3, 6, -3, 3, -2, 0, -5, 3, -3, 0, -4], [-1, 4, 1, -4, -1, -10, -12, 3, 3, 3, -3, -1, -12, 0, 3, -1], [-5, 0, 2, 2, -2, -2, 0, 0, 0, -2, 2, -5, 2, -2, -2, 0], [0, 2, -2, 0, 2, 0, 6, 2, 2, 0, 4, 0, 8, 2, 0, 0], [1, 4, 0, 1, 0, 9, 14, -1, -1, 0, 10, 1, 15, -1, 0, -5], [0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 14, 0, 0, 0, 0, 0], [2, 1, 1, 0, -1, 0, 5, -1, 1, 4, 4, 4, 5, -5, -4, 0], [0, 0, 4, -3, -4, -12, 1, -1, -1, 3, -6, 0, -5, -4, 3, -1], [-5, 3, 5, -3, -5, -5, 5, -2, -2, -2, 2, -5, 2, 0, -2, -5], [5, -1, 3, 3, 14, -3, -2, 0, 0, -1, 1, 13, 1, -1, -1, -1], [-1, 0, 0, -1, 0, -16, -14, 1, 1, 0, -17, -1, -15, 1, 0, 1], [0, 0, 2, 2, -2, -17, 4, -4, -4, -2, 5, 0, 9, -2, -2, -4], [-3, -1, -1, 0, 1, 0, 2, 1, -1, -5, 3, -23, 2, -2, -3, 0], [-3, -5, -2, 2, 2, -5, -10, 0, 0, -5, 6, -3, -5, 5, -5, 5], [-1, 1, 0, -1, 10, 1, 2, -1, 1, 0, 0, -1, 1, -1, 0, 0], [-5, 1, 0, -5, 0, 7, 10, 5, 5, 0, 2, -5, 5, 5, 0, 4], [2, -4, -6, 6, 6, 8, 4, 0, 0, -4, 6, 2, -4, 4, -4, 4], [11, 0, 7, 5, 17, -5, 2, -2, 2, 19, 5, 11, 7, -7, -5, -2], [-1, 3, 1, -3, -1, -1, 5, 2, 2, 2, -2, -1, -2, 0, 2, -1], [-1, -1, 0, -1, 12, 1, 2, -1, 1, -10, 0, -11, 1, -1, 0, -2], [2, -5, -7, 7, 7, 5, 0, 0, 0, -5, 11, 2, -5, 5, -5, 5], [-1, 0, 8, 2, -2, -2, 6, -6, 6, 4, 2, -1, 8, -8, -2, -6], [4, -8, 2, 8, 4, -8, -8, 6, -6, -8, 6, -2, 0, 0, -6, -2], [3, -1, 3, 3, -14, -3, -2, 0, 0, -1, 1, -15, 1, -1, -1, -1], [6, -1, -1, 0, 1, 0, -1, 1, -1, 4, 0, 14, -1, 1, 0, 0], [-2, 5, 0, -5, -2, 5, 5, -5, 5, -3, -5, 0, 0, 0, 5, 0], [-5, 4, 0, -5, 0, 12, 12, 5, 5, 0, 7, -5, 7, 5, 0, 1], [2, 2, 6, 6, -2, -6, -8, 0, 0, 2, -2, 0, -2, 2, 2, 2], [-6, -4, 4, 0, -4, 0, -7, -4, -4, -6, -3, -6, -7, 2, -6, 0], [3, -4, -2, 4, 3, -4, -4, 6, -6, -11, 6, 2, 0, 0, -6, 2], [0, 0, 1, 3, -1, -11, 4, -4, -4, -3, -2, 0, 2, -1, -3, -4], [-12, 0, 6, 6, -20, -6, -6, 0, 0, 0, 0, -20, 0, 0, 0, 0], [-5, -2, 3, -3, -3, 7, 5, 0, 0, -2, 14, -5, -2, 2, -2, 2], [0, 0, -2, -4, 2, 6, -6, 6, 6, 4, -10, 0, -16, 2, 4, 6], [-22, 0, -1, 3, -17, -3, -4, 4, -4, -21, 3, -22, -1, 1, -3, 4], [2, 0, 0, 0, 0, 0, 8, 0, 0, 2, 8, 2, 8, -2, 2, 0], [3, -5, 0, 3, -22, -3, -6, 3, -3, -25, 0, -22, -3, 3, 0, -2], [5, -5, 0, 5, 0, -5, -10, 5, -5, -5, 0, 0, -5, 5, 0, 0], [10, 1, -1, 0, 1, 0, 1, 1, 1, 10, 0, 10, -11, -9, 10, 0], [15, 3, 3, 0, -3, 0, 4, -3, 3, 21, 1, -7, 4, -4, -1, 0], [0, 0, 0, 0, -9, 0, 0, 0, 0, -7, 0, -7, 0, 0, 0, 0], [0, 0, -2, 2, 2, -1, 0, 0, 0, -2, -7, 0, -7, 2, -2, 0], [-7, 4, -7, -4, -7, 4, 4, 3, -3, -5, 3, 7, 0, 0, -3, 7], [8, 4, -4, 0, 4, 0, 11, 4, 4, 8, 7, 8, 4, -4, 8, 0], [4, -5, 0, 4, 0, -12, -14, -4, -4, 0, -8, 4, -10, -4, 0, 1], [0, 2, 0, -2, 0, -5, -1, 2, 2, 2, -2, 0, -7, 0, 2, 0], [1, -8, -8, 0, 8, 0, -6, 8, -8, -15, 2, 6, -6, 6, -2, 0], [-10, 0, 2, 2, 10, -2, -2, 0, 0, 0, 0, 10, 0, 0, 0, 0], [0, 0, 8, 1, -8, 12, 9, -9, -9, -1, 2, 0, 11, -8, -1, -9], [2, 0, 0, 2, 0, 5, 4, -2, -2, 0, 7, 2, 6, -2, 0, -2], [3, 5, 2, -2, -2, -11, -6, 0, 0, 5, -4, 3, 5, -5, 5, -5], [2, 0, 2, -4, 0, 4, 6, -6, 6, 6, -4, 2, 2, -2, 4, -6], [-2, 2, 0, -2, 2, 2, 4, -2, 2, -5, 0, -7, 2, -2, 0, 0], [0, -2, 0, 2, 0, 8, -2, -2, -2, -2, 2, 0, 10, 0, -2, 0], [-2, 1, -1, 0, 1, 0, 19, 1, 1, -2, 18, -2, 15, 3, -2, 0], [-1, 7, 8, -8, -8, 5, 12, 0, 0, 7, -4, -1, 7, -7, 7, -7], [-8, 3, 3, 0, -3, 0, -4, -3, 3, -2, -7, 3, -4, 4, 7, 0], [3, 3, 0, 3, -4, -3, -6, 3, -3, 8, 0, 11, -3, 3, 0, 6], [-25, 6, 6, 0, -6, 0, 6, -6, 6, -13, 0, 3, 6, -6, 0, 0], [0, 0, -4, -4, 4, 22, -8, 8, 8, 4, -19, 0, -27, 4, 4, 8], [-1, 3, 1, -3, -1, 7, 7, 2, 2, 2, -2, -1, 6, 0, 2, -1], [-3, -3, 0, -3, 0, 3, -18, 3, 3, 0, 0, -3, -21, 3, 0, 6], [1, -1, -2, -2, -19, 2, 3, 0, 0, -1, 1, -20, 1, -1, -1, -1], [-7, 4, 1, 1, -1, -1, -5, 0, 0, 4, -4, 3, -4, 4, 4, 4], [5, -2, -5, 2, 5, 11, 10, 3, 3, 3, -3, 5, 3, 0, 3, 5], [0, 0, 0, -3, 0, -13, -3, 3, 3, 3, 1, 0, -2, 0, 3, 3], [4, 2, -2, 2, 2, -22, -20, 0, 0, 2, -8, 4, 2, -2, 2, -2], [-12, 10, -7, -10, -12, 10, 10, -3, 3, 2, -3, 7, 0, 0, 3, 7], [-2, -3, -3, 0, 3, 0, -7, 3, -3, -8, -4, -2, -7, 7, 4, 0], [2, 0, 6, -3, -12, 3, 9, -9, 9, -3, -3, 2, 6, -6, 3, -9], [-1, 4, 0, -1, -6, 1, 2, -1, 1, 4, 0, 3, 1, -1, 0, 3], [-3, -1, 2, -2, -2, -4, -5, 0, 0, -1, -27, -3, -1, 1, -1, 1], [-2, 1, 0, -2, 0, 4, 10, 2, 2, 0, 2, -2, 8, 2, 0, 1], [-10, -2, 5, 2, -10, -2, -2, -3, 3, 8, -3, -5, 0, 0, 3, -5], [0, 0, -5, 4, 5, 4, -1, 1, 1, -4, 10, 0, 9, 5, -4, 1], [5, -7, -7, 0, 7, 0, -6, 7, -7, -9, 1, 9, -6, 6, -1, 0], [-3, 6, 3, -6, -3, 16, -4, 3, 3, 3, -3, -3, 16, 0, 3, -3], [-19, -2, 4, 2, -19, -2, -2, -2, 2, -31, -2, -4, 0, 0, 2, -4], [-12, 0, 6, 6, 4, -6, -6, 0, 0, 0, 0, 4, 0, 0, 0, 0], [-2, -2, 2, 0, -2, 0, 12, -2, -2, -2, 14, -2, 10, 0, -2, 0], [0, 0, 2, 6, -2, 5, 8, -8, -8, -6, -3, 0, 5, -2, -6, -8], [0, 0, -9, 1, 9, -3, -8, 8, 8, -1, -27, 0, -35, 9, -1, 8], [18, 0, 0, 2, -3, -2, -2, 2, -2, -5, 2, 18, 0, 0, -2, 2], [-17, 1, 1, 0, -1, 0, -1, -1, 1, -15, -2, -35, -1, 1, 2, 0], [4, -6, 0, 4, -10, -4, -8, 4, -4, -18, 0, -14, -4, 4, 0, -2], [2, -3, -2, 3, 2, 3, -5, -1, -1, -1, 1, 2, 2, 0, -1, 2], [2, -4, -2, 4, 2, -1, 4, -2, -2, -2, 2, 2, -1, 0, -2, 2], [-2, 1, 0, -2, -28, 2, 4, -2, 2, 12, 0, 10, 2, -2, 0, -1], [-14, -3, -3, 0, 3, 0, 7, 3, -3, -20, 10, -14, 7, -7, -10, 0], [0, 0, -4, 4, 4, 12, 0, 0, 0, -4, 28, 0, 28, 4, -4, 0], [0, 3, 3, -3, -3, -6, -3, 0, 0, 3, 15, 0, 3, -3, 3, -3], [13, 1, 0, 0, 15, 0, -1, 0, 0, 1, -1, 16, -1, 1, 1, 1], [0, 0, -4, 8, 4, -6, 4, -4, -4, -8, 10, 0, 14, 4, -8, -4], [5, -5, 5, 0, -5, 0, -12, -5, -5, 5, -7, 5, 22, -10, 5, 0], [-11, 6, -8, -8, 7, 8, 2, 0, 0, 6, -6, 13, -6, 6, 6, 6], [-4, -2, 2, 0, -2, 0, 33, -2, -2, -4, 35, -4, 23, 2, -4, 0], [6, -3, 0, 6, 0, -12, -8, -6, -6, 0, -6, 6, -2, -6, 0, -3], [0, 0, 12, -8, -12, 13, 4, -4, -4, 8, 11, 0, 15, -12, 8, -4], [19, 6, -1, -6, 19, 6, 6, -5, 5, 13, -5, 1, 0, 0, 5, 1], [10, 0, -2, -5, -16, 5, 3, -3, 3, -13, -5, 10, -2, 2, 5, -3], [6, 0, 4, 6, -15, -6, -2, 2, -2, -17, 6, 6, 4, -4, -6, 2], [1, 0, -1, 0, 1, 11, -4, 1, 1, 1, -1, 1, 9, 0, 1, 1], [-8, 0, -7, -1, 11, 1, -6, 6, -6, 5, -1, -8, -7, 7, 1, 6], [4, 0, -4, 4, 4, 3, 3, 0, 0, 0, -7, 4, 0, 0, 0, 0], [3, -9, 0, 3, 0, 13, 3, -3, -3, 0, 16, 3, 6, -3, 0, 6], [0, -5, -5, 5, 5, 3, -2, 0, 0, -5, 3, 0, -5, 5, -5, 5], [10, 4, 4, 0, -4, 0, 0, -4, 4, 18, -4, 20, 0, 0, 4, 0], [8, -8, -8, 8, 8, -16, -22, 0, 0, 0, 0, 8, -24, 0, 0, 8], [-4, 8, 0, -4, 0, -6, 14, 4, 4, 0, -10, -4, 10, 4, 0, -4], [25, 10, -1, -1, 17, 1, -9, 0, 0, 10, -10, 27, -10, 10, 10, 10], [0, 1, 0, 0, 0, 18, -8, 0, 0, 0, 18, 0, -8, 0, 0, -1]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_880_cd_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_880_2_cd_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_880_2_cd_b(:prec:=16)
    chi := MakeCharacter_880_cd();
    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_880_2_cd_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_880_2_cd_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_880_cd();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![1, 0, 1, 0, 6, 0, -4, 0, 1]>],Snew);
    return Vf;
end function;