
// Make newform 441.4.e.z in Magma, downloaded from the LMFDB on 23 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_441_e();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_441_e_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_441_4_e_z();".
// 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_441_4_e_z();".
// 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 := [6250000, 0, 22070000, 0, 74261084, 0, 12598332, 0, 1502189, 0, 91050, 0, 4007, 0, 74, 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], [2060425458941185, 0, 6595574220000, 0, 22188556375664, 0, 4077769899992, 0, 399577053316, 0, 21224761594, 0, 420756261, 0, 5955326, 0], [48588317482855240000, 0, 163490536811521715988, 0, 27333084737355121649, 0, 3315118047702508223, 0, 201417793651814725, 0, 8950261034338249, 0, 165523687535043, 0, 2249798084357, 0], [-1244227061134685320568, 0, 6198011310607830000, 0, 20851091776877154296, 0, 5545670366939508311, 0, 375491657481782674, 0, 19945391869847941, 0, 378608216872794, 0, 5596355476439, 0], [0, -4701473085998115583976, 0, 12526879742717490000, 0, 42142407637473355688, 0, 10456380827878555493, 0, 758910979981201222, 0, 40311885999197623, 0, 773166243923574, 0, 11310865459517], [-11287233145670329435880, 0, 90755432954299890000, 0, 305315651577077926568, 0, 71663640280722515861, 0, 5498200348095991942, 0, 292053786912774103, 0, 5641408644608886, 0, 81945585249437, 0], [819299223684428072230000, 0, 2756768003598295094681076, 0, 474549060694699086636098, 0, 55670660323382905812671, 0, 3368536871004748877200, 0, 147193283270968061173, 0, 2716062717018068436, 0, 36549057905883239, 0], [-1063284696474873437500, 0, -76073073971134978813188, 0, -12445292369887636979549, 0, -1509438606757895941523, 0, -90616156314394050925, 0, -4075230308964056149, 0, -75366198338390343, 0, -1035048282591857, 0], [0, -23741103212716721560232, 0, 87688158199022430000, 0, 294996853462313489816, 0, 73194665795149888451, 0, 5312376859868408554, 0, 282183201994383361, 0, 5412163707465018, 0, 79176058216619], [0, -21780492554335386764440, 0, 43051275387340830000, 0, 144831309468040223896, 0, 39176637776066606827, 0, 2608158317528460074, 0, 138540334159707041, 0, 2625734874661842, 0, 38872184755339], [0, -1566391769961532269496, 0, 4892409197285490000, 0, 16458839468079877288, 0, 4277010047478401233, 0, 296394883214191622, 0, 15743923935811223, 0, 300026796677634, 0, 4417491293917], [-1488079696206944407610000, 0, -5007028502862878323309932, 0, -865142366320131816159886, 0, -100600434716506560273097, 0, -6055965732126021373400, 0, -259282498216755770411, 0, -4765069144825024452, 0, -63275195548744273, 0], [0, -3091194738786765780610000, 0, -10401239765058335770397532, 0, -1761815992670299711407686, 0, -210342767559956131671197, 0, -12745643623835228145400, 0, -560339201436145870711, 0, -10345479671980724052, 0, -139708174970895173], [0, -15618270635381596228270000, 0, -52552200844460809781869524, 0, -8946142749733798407542702, 0, -1061656246809352152868679, 0, -64263840733386752590300, 0, -2813437067898512043877, 0, -51909972818273240664, 0, -699207242144433911], [0, 1030256822982238427810000, 0, 3466603523571558801590172, 0, 589712610118527035764906, 0, 70098339932879564514637, 0, 4247201545491490453400, 0, 186630777641743075931, 0, 3445959372421567092, 0, 46524892852974133], [0, -582060611643123437500, 0, -39835642226376958682898, 0, -6812770383049970560829, 0, -826293053591415900083, 0, -50245648889503936225, 0, -2230852239373189429, 0, -41256773136579303, 0, -560405796289847]];
    Rf_basisdens := [1, 156438029994849, 46253068953138052500, 104790953020229571744, 1309886912752869646800, 261977382550573929360, 65494345637643482340000, 1637358640941087058500, 1309886912752869646800, 523954765101147858720, 59540314216039529400, 32747172818821741170000, 818679320470543529250000, 818679320470543529250000, 37212696385024705875000, 270637791891088770000];
    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_441_e();"
function MakeCharacter_441_e()
    N := 441;
    order := 3;
    char_gens := [344, 199];
    v := [3, 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_441_e_Hecke();"
function MakeCharacter_441_e_Hecke(Kf)
    N := 441;
    order := 3;
    char_gens := [344, 199];
    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]];
    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 := 4;
    raw_aps := [[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, 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, 0, 0, 1, 0, 0, 7, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 3, 0, -2, 0, 0, -3, -2, 0], [0, 0, 0, 1, 0, 2, 1, 0, 0, 0, 0, -2, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 6, 0, 0, 0, 0, 0], [0, 0, 0, 0, 7, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, -9], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, -2, 0], [0, -24, 4, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [260, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -30, 0, 0, 0, 0, -2, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, 0, 34, 0, 0, -14], [0, 0, 0, -2, 0, 10, -2, 0, 0, 0, 0, -10, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 22, 0, 0, 0, 0, 0], [20, 0, -20, 0, 0, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -163, 0, 0, 0, 0, 0, 0, 0, 163, 0, 0, 9], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 23, -28, 0], [0, 28, -688, 0, 0, 0, 0, -28, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -52, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, -10, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -57, 0, 28, 0, 0, 57, 28, 0], [0, 0, 0, -91, 0, 20, -91, 0, 0, 0, 0, -20, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -26, 0, 34, 0, 0, 0, 0, 0], [0, 0, 0, 0, 199, 0, 0, 0, 0, 65, 0, 0, 0, 0, 0, 0], [-1180, 0, 1180, 0, 0, 0, 0, 44, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, -128, 0, 0, 32], [392, -32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -40, 0, 0, 0, 0, -60, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, -199, 0, 0, 25], [0, 0, 0, 0, 0, 0, 0, 0, -100, 0, -96, 0, 0, 100, -96, 0], [0, 0, 0, 0, 374, 0, 0, 0, 0, -98, 0, 0, 0, 0, 0, 0], [-1200, 0, 1200, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 79, 86, 0], [0, -152, 1252, 0, 0, 0, 0, 152, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, -138, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 125, 0, 0, 0, 0, 4, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 219, 0, 0, -427, 0, 0, 219], [0, 0, 0, 0, 0, 0, 0, 0, -291, 0, -58, 0, 0, 291, -58, 0], [0, 0, 0, 0, -345, 0, 0, 0, 0, 165, 0, 0, 0, 0, 0, 0], [-142, 0, 142, 0, 0, 0, 0, -148, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 158, 0, 0, 0, 0, 0, 0, 0, -158, 0, 0, 178], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -184, 20, 0], [980, -192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -520, 0, 20, 0, 0, 520, 20, 0], [0, 0, 0, 50, 0, -30, 50, 0, 0, 0, 0, 30, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -289, 0, -58, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1017, 0, 0, 0, 0, -103, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, -271], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 429, -96, 0], [0, 0, 0, -298, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 83, 0, 0, 0, 0, -70, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -199, 0, 0, 475, 0, 0, -199], [0, 0, 0, 263, 0, -200, 263, 0, 0, 0, 0, 200, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -138, 0, -310, 0, 0, 0, 0, 0], [782, 0, -782, 0, 0, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -677, 0, 0, 0, 0, 0, 0, 0, 677, 0, 0, -19], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 66, 54, 0], [0, 0, 0, 87, 0, -200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 134, 0, 154, 0, 0, -134, 154, 0], [0, 0, 0, 146, 0, 50, 146, 0, 0, 0, 0, -50, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 343, 0, 368, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1162, 0, 0, 0, 0, -274, 0, 0, 0, 0, 0, 0], [0, -168, 940, 0, 0, 0, 0, 168, 0, 0, 0, 0, 0, 0, 0, 0], [6064, -104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 141, 0, 0, 1691, 0, 0, 141], [0, 0, 0, 0, 0, 0, 0, 0, -421, 0, -210, 0, 0, 421, -210, 0], [0, 0, 0, 107, 0, -170, 107, 0, 0, 0, 0, 170, 0, 0, 0, 0], [0, 0, 0, 0, -1295, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 288, -428, 0], [0, -640, 3150, 0, 0, 0, 0, 640, 0, 0, 0, 0, 0, 0, 0, 0], [8164, 176, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 348, 0, 0, 0, 0, 64, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 957, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 351, 0, 146, 0, 0, 0, 0, 0], [0, 0, 0, 0, -615, 0, 0, 0, 0, 305, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 639, -280, 0], [0, 0, 0, -126, 0, 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2498, 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 143, 0, 0, 461, 0, 0, 143], [0, 0, 0, 0, 0, 0, 0, 0, -229, 0, 296, 0, 0, 229, 296, 0], [0, 0, 0, 0, 0, 0, 0, 0, 176, 0, 360, 0, 0, 0, 0, 0], [0, 0, 0, 0, -321, 0, 0, 0, 0, -159, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 968, 0, 0, 0, 0, 0, 0, 0, -968, 0, 0, 176], [0, 744, 8886, 0, 0, 0, 0, -744, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 441, 0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1728, 232, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 494, 0, 0, 0, 0, 330, 0, 0, 0, 0], [0, 0, 0, -886, 0, -150, -886, 0, 0, 0, 0, 150, 0, 0, 0, 0], [3720, 0, -3720, 0, 0, 0, 0, -740, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3019, 0, 0, 0, 0, 0, 0, 0, -3019, 0, 0, 803], [0, 164, -10724, 0, 0, 0, 0, -164, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 972, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 341, 0, 0, 0, 0, 220, 0, 0, 0, 0], [0, 0, 0, 307, 0, 430, 307, 0, 0, 0, 0, -430, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -1740, 0, -340, 0, 0, 0, 0, 0], [0, 260, 5210, 0, 0, 0, 0, -260, 0, 0, 0, 0, 0, 0, 0, 0], [-5372, -948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 698, 0, 0, -70, 0, 0, 698], [0, 0, 0, 430, 0, -134, 430, 0, 0, 0, 0, 134, 0, 0, 0, 0], [0, 0, 0, 0, -577, 0, 0, 0, 0, 719, 0, 0, 0, 0, 0, 0], [-5948, 0, 5948, 0, 0, 0, 0, 260, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -553, 1128, 0], [0, 0, 0, 718, 0, -602, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -737, 0, 0, 0, 0, -330, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1229, 0, 0, 2497, 0, 0, -1229], [0, 0, 0, 0, 0, 0, 0, 0, -451, 0, -944, 0, 0, 451, -944, 0], [0, 0, 0, 0, 0, 0, 0, 0, -412, 0, -432, 0, 0, 0, 0, 0], [15756, 0, -15756, 0, 0, 0, 0, -1076, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1121, 0, 0, 0, 0, 0, 0, 0, -1121, 0, 0, -161], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1080, -864, 0], [784, -1544, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -733, 0, 0, -3501, 0, 0, -733], [0, 0, 0, 0, 0, 0, 0, 0, 1058, 0, -622, 0, 0, -1058, -622, 0], [0, 0, 0, -1470, 0, -250, -1470, 0, 0, 0, 0, 250, 0, 0, 0, 0], [0, 0, 0, 0, -433, 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 2495, 0, 0, 0, 0, 0, 0, 0, -2495, 0, 0, 495], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -586, 0], [-536, -1124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1167, 0, 0, 0, 0, -20, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -333, 0, 0, -5059, 0, 0, -333], [0, 0, 0, 0, 0, 0, 0, 0, -356, 0, -264, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1297, 0, 0, 0, 0, 0, 0, 0, 1297, 0, 0, -459], [0, -20, 25500, 0, 0, 0, 0, 20, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -16, 0, 0, 0, 0, -460, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2914, 0, 214, 0, 0, -2914, 214, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1615, 0, -170, 0, 0, 0, 0, 0], [1452, 0, -1452, 0, 0, 0, 0, -2048, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -5815, 0, 0, 0, 0, 0, 0, 0, 5815, 0, 0, -11], [0, -632, -13096, 0, 0, 0, 0, 632, 0, 0, 0, 0, 0, 0, 0, 0], [-14436, -1484, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -259, 0, 0, 0, 0, 390, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -213, 0, -552, 0, 0, 213, -552, 0], [0, 0, 0, 651, 0, 316, 651, 0, 0, 0, 0, -316, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3188, 408, 0], [0, 0, 0, -845, 0, 948, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 244, 0, 0, 868, 0, 0, 244], [0, 0, 0, 0, 0, 0, 0, 0, 1040, 0, 1752, 0, 0, -1040, 1752, 0], [0, 0, 0, 0, 7806, 0, 0, 0, 0, 998, 0, 0, 0, 0, 0, 0], [-16984, 0, 16984, 0, 0, 0, 0, -756, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 6029, 0, 0, 0, 0, 0, 0, 0, -6029, 0, 0, 605], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, 774, 0], [0, 0, 0, 1914, 0, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -785, 0, 990, 0, 0, 785, 990, 0], [0, 0, 0, -365, 0, -642, -365, 0, 0, 0, 0, 642, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1138, 0, -1058, 0, 0, 0, 0, 0], [0, 0, 0, 0, 623, 0, 0, 0, 0, 565, 0, 0, 0, 0, 0, 0], [0, -524, 4804, 0, 0, 0, 0, 524, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 935, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-8628, 1228, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 546, 0, 0, 0, 0, 1042, 0, 0, 0, 0], [11884, 0, -11884, 0, 0, 0, 0, 1476, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -2895, 0, 0, 0, 0, 0, 0, 0, 2895, 0, 0, -1755], [0, -1364, -18040, 0, 0, 0, 0, 1364, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 189, 0, 0, 0, 0, -270, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2257, 0, 1292, 0, 0, -2257, 1292, 0], [0, 0, 0, -2009, 0, 740, -2009, 0, 0, 0, 0, -740, 0, 0, 0, 0], [0, 0, 0, 0, -2153, 0, 0, 0, 0, -1567, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3632, 0, 0, 0, 0, 0, 0, 0, -3632, 0, 0, -1112], [30864, -1024, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2156, 0, 0, 0, 0, -620, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, 0, 2185, 0, 0, 113], [0, 0, 0, -1060, 0, -580, -1060, 0, 0, 0, 0, 580, 0, 0, 0, 0], [-12616, 0, 12616, 0, 0, 0, 0, 804, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 111, -866, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_441_e_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_441_4_e_z();".
// 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_441_4_e_z(:prec:=16)
    chi := MakeCharacter_441_e();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    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_441_4_e_z();".
// 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_441_4_e_z( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_441_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![12544, 0, 3696, 0, 977, 0, 33, 0, 1]>,<5,R![1176490000, 0, 13171200, 0, 113156, 0, 384, 0, 1]>,<13,R![4900, 0, -5268, 0, 1]>],Snew);
    return Vf;
end function;