
// Make newform 441.4.p.c in Magma, downloaded from the LMFDB on 20 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_441_p();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_441_p_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_p_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_441_4_p_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 := [810000, 0, -1762200, 0, 3242464, 0, -1200006, 0, 336765, 0, -27620, 0, 1647, 0, -48, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-278327304980712, 0, -1315137294000, 0, 2415597870280, 0, -2717580554397, 0, 234921068610, 0, -15525573175, 0, 461882826, 0, -10313805, 0], [4353170949761400, 0, -8010514076168368, 0, 2691078814742472, 0, -834373374448305, 0, 68992918331690, 0, -4183683881139, 0, 122400945426, 0, -2582250337, 0], [301359467694888, 0, 16812729687600, 0, -30881029845512, 0, 33064412041565, 0, -3003233534994, 0, 198479098895, 0, -6000144674, 0, 131851797, 0], [211548604260850200, 0, -226162470539390064, 0, 92682920898111656, 0, -12720550693019965, 0, 925727478351170, 0, -44140804007447, 0, 1199936429098, 0, -20174289101, 0], [0, 699777739755000, 0, -8010514076168368, 0, 2691078814742472, 0, -834373374448305, 0, 68992918331690, 0, -4183683881139, 0, 122400945426, 0, -2582250337], [-11959302579305400, 0, 22001675288833648, 0, -9221274840461992, 0, 2271828840408105, 0, -183212343919090, 0, 10574100606979, 0, -304531357386, 0, 6165622857, 0], [0, -4112177675462712, 0, -119568250371600, 0, 219618751797592, 0, -240064275625255, 0, 21358303256454, 0, -1411537509445, 0, 42257710318, 0, -937699527], [8357738104027800, 0, -15379250851652336, 0, 5321767682727944, 0, -1600807235036685, 0, 132112809948130, 0, -7979228432903, 0, 233254820202, 0, -4906655549, 0], [56141855905743000, 0, 242914084530530064, 0, -123451695584498456, 0, 46284369537850915, 0, -3918044005070270, 0, 241898414566697, 0, -7122898433398, 0, 151546793651, 0], [0, -69093405000, 0, 646432035208, 0, -265706935032, 0, 82382868455, 0, -6837155440, 0, 413081109, 0, -12085406, 0, 253797], [0, 505456539561487800, 0, -507004002338951568, 0, 176406493692653672, 0, -48919377548687305, 0, 4004343941493890, 0, -238669929280139, 0, 6952944162226, 0, -144886104737], [0, 362143867944097800, 0, 1025934682367273136, 0, -374719488978256744, 0, 121958132016661985, 0, -10139133031594330, 0, 618137711412403, 0, -18114452956802, 0, 383305735249], [0, -7657308044504568, 0, -163268228300400, 0, 299885332403048, 0, -328956825464915, 0, 29164366973226, 0, -1927428289955, 0, 57618445232, 0, -1280411313], [0, -944609526343891800, 0, 1738056090103156016, 0, -657910940475690664, 0, 180388670933343285, 0, -14764864792789530, 0, 876699628157143, 0, -25526553824562, 0, 530090206069]];
    Rf_basisdens := [1, 1, 24355954733376, 3653393210006400, 73067864200128, 10960179630019200, 3653393210006400, 1826696605003200, 730678642001280, 608898868334400, 10960179630019200, 49371246000, 27400449075048000, 54800898150096000, 91334830250160, 9133483025016000];
    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_p();"
function MakeCharacter_441_p()
    N := 441;
    order := 6;
    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_p_Hecke();"
function MakeCharacter_441_p_Hecke(Kf)
    N := 441;
    order := 6;
    char_gens := [344, 199];
    char_values := [[-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]];
    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, 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, 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], [0, 2, 0, 0, 0, 0, 2, 0, 3, 0, 0, 3, 0, 0, 0, -1], [8, 0, 1, -14, 1, -2, 0, 2, 0, 2, 2, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0, -2, 0, 1, 0, 0, -1, 0, 3, 2, -1], [48, 0, 2, -27, -6, 0, 0, -3, 0, 1, 0, 0, 0, 0, 0, 0], [0, -14, 0, 0, 0, 0, 0, 0, 17, 0, 0, 0, 3, 3, 1, 0], [0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 2, -4, 8, -1, 1], [-50, 0, 2, -44, 1, -7, 0, -1, 0, -2, 0, 0, 0, 0, 0, 0], [4, 0, 0, -155, 0, 8, 0, 1, 0, -1, -4, 0, 0, 0, 0, 0], [0, 68, 0, 0, 0, 0, 34, 0, 20, 0, 0, 10, -5, 0, 3, 3], [14, 0, -1, 0, -3, -10, 0, 0, 0, 0, -10, 0, 0, 0, 0, 0], [0, 8, 0, 0, 0, 0, 16, 0, 25, 0, 0, 50, -2, 2, -4, 8], [0, 26, 0, 0, 0, 0, 26, 0, -14, 0, 0, -14, 40, -20, 0, 3], [0, -56, 0, 0, 0, 0, 56, 0, 63, 0, 0, -63, 0, 17, 0, 0], [139, 0, -48, -61, 6, 0, 0, 3, 0, -24, 11, 0, 0, 0, 0, 0], [43, 0, 3, -24, 14, -5, 0, 14, 0, 3, 10, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 52, 0, 0, 0, 0, -1, 12, -24, -2, 2], [-163, 0, 25, -176, 28, -15, 0, -28, 0, -25, 0, 0, 0, 0, 0, 0], [-25, 0, 0, -252, 0, -50, 0, -35, 0, -48, 25, 0, 0, 0, 0, 0], [0, -20, 0, 0, 0, 0, -10, 0, 158, 0, 0, 79, 26, 0, -5, -5], [0, 52, 0, 0, 0, 0, 104, 0, 54, 0, 0, 108, 72, -72, 2, -4], [401, 0, 47, -794, 4, 29, 0, 8, 0, 94, -29, 0, 0, 0, 0, 0], [0, -6, 0, 0, 0, 0, 6, 0, 4, 0, 0, -4, 0, 7, 22, -11], [-67, 0, -2, 70, 96, 0, 0, 48, 0, -1, -23, 0, 0, 0, 0, 0], [0, -44, 0, 0, 0, 0, 0, 0, -43, 0, 0, 0, -39, -39, 14, 0], [-115, 0, -5, 156, 40, -1, 0, 40, 0, -5, 2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 82, 0, 0, 0, 0, -126, -13, 26, -1, 1], [-75, 0, 144, 0, 29, -27, 0, 0, 0, 0, -27, 0, 0, 0, 0, 0], [0, -66, 0, 0, 0, 0, -132, 0, -187, 0, 0, -374, -64, 64, -9, 18], [0, 164, 0, 0, 0, 0, 164, 0, 72, 0, 0, 72, -16, 8, 0, 18], [330, 0, -1, -544, 58, 25, 0, 116, 0, -2, -25, 0, 0, 0, 0, 0], [0, -452, 0, 0, 0, 0, 0, 0, -234, 0, 0, 0, -10, -10, -18, 0], [-353, 0, -29, 406, 81, 28, 0, 81, 0, -29, -56, 0, 0, 0, 0, 0], [464, 0, -74, 430, 50, -16, 0, -50, 0, 74, 0, 0, 0, 0, 0, 0], [-45, 0, 0, 275, 0, -90, 0, -97, 0, 120, 45, 0, 0, 0, 0, 0], [0, 284, 0, 0, 0, 0, 142, 0, 156, 0, 0, 78, 163, 0, 1, 1], [0, 260, 0, 0, 0, 0, 520, 0, -248, 0, 0, -496, -32, 32, 24, -48], [0, 470, 0, 0, 0, 0, 470, 0, -4, 0, 0, -4, -14, 7, 0, 21], [-486, 0, -99, 1020, 24, -105, 0, 48, 0, -198, 105, 0, 0, 0, 0, 0], [0, 694, 0, 0, 0, 0, 0, 0, -450, 0, 0, 0, 63, 63, -15, 0], [2223, 0, -26, -2113, 74, -36, 0, 74, 0, -26, 72, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -380, 0, 0, 0, 0, -676, 10, -20, -12, 12], [-56, 0, 42, -102, -44, 90, 0, 44, 0, -42, 0, 0, 0, 0, 0, 0], [-2044, 0, -46, 0, 27, -61, 0, 0, 0, 0, -61, 0, 0, 0, 0, 0], [367, 0, 141, -740, -3, -70, 0, -6, 0, 282, 70, 0, 0, 0, 0, 0], [0, 282, 0, 0, 0, 0, -282, 0, 57, 0, 0, -57, 0, 202, 30, -15], [-547, 0, 6, 284, -124, 0, 0, -62, 0, 3, 145, 0, 0, 0, 0, 0], [0, -236, 0, 0, 0, 0, 0, 0, -215, 0, 0, 0, -98, -98, -72, 0], [0, 0, 0, 0, 0, 0, -476, 0, 0, 0, 0, -273, 8, -16, 20, -20], [158, 0, 167, 363, 16, -221, 0, -16, 0, -167, 0, 0, 0, 0, 0, 0], [0, -960, 0, 0, 0, 0, -480, 0, 122, 0, 0, 61, -231, 0, 12, 12], [0, -390, 0, 0, 0, 0, -780, 0, -272, 0, 0, -544, 167, -167, -1, 2], [0, -358, 0, 0, 0, 0, -358, 0, -33, 0, 0, -33, 6, -3, 0, -13], [0, -316, 0, 0, 0, 0, 316, 0, -18, 0, 0, 18, 0, 105, -8, 4], [-3556, 0, -194, 1790, -66, 0, 0, -33, 0, -97, 90, 0, 0, 0, 0, 0], [-105, 0, -195, 144, -70, -109, 0, -70, 0, -195, 218, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 820, 0, 0, 0, 0, -642, -26, 52, -48, 48], [-158, 0, -237, -153, 47, -52, 0, -47, 0, 237, 0, 0, 0, 0, 0, 0], [0, -1348, 0, 0, 0, 0, -674, 0, 992, 0, 0, 496, 94, 0, -1, -1], [276, 0, 25, -694, -71, 96, 0, -142, 0, 50, -96, 0, 0, 0, 0, 0], [0, 82, 0, 0, 0, 0, -82, 0, 482, 0, 0, -482, 0, -91, 26, -13], [2572, 0, 380, -1215, 272, 0, 0, 136, 0, 190, -130, 0, 0, 0, 0, 0], [0, 1402, 0, 0, 0, 0, 0, 0, 80, 0, 0, 0, -38, -38, 97, 0], [-33, 0, 0, -3200, 0, -66, 0, 292, 0, -175, 33, 0, 0, 0, 0, 0], [-1801, 0, 284, 0, -48, 56, 0, 0, 0, 0, 56, 0, 0, 0, 0, 0], [0, 404, 0, 0, 0, 0, 404, 0, -780, 0, 0, -780, 132, -66, 0, 48], [562, 0, -140, -1188, -32, 128, 0, -64, 0, -280, -128, 0, 0, 0, 0, 0], [0, 1026, 0, 0, 0, 0, -1026, 0, 394, 0, 0, -394, 0, 217, -94, 47], [0, -152, 0, 0, 0, 0, 0, 0, 650, 0, 0, 0, 298, 298, 120, 0], [-3510, 0, 244, -3486, 41, -65, 0, -41, 0, -244, 0, 0, 0, 0, 0, 0], [-95, 0, 0, -306, 0, -190, 0, -176, 0, 153, 95, 0, 0, 0, 0, 0], [-614, 0, -643, 0, 52, -139, 0, 0, 0, 0, -139, 0, 0, 0, 0, 0], [0, -840, 0, 0, 0, 0, -1680, 0, 392, 0, 0, 784, -244, 244, 42, -84], [0, 482, 0, 0, 0, 0, 482, 0, 784, 0, 0, 784, -174, 87, 0, -175], [-3039, 0, -866, 1492, -412, 0, 0, -206, 0, -433, 357, 0, 0, 0, 0, 0], [0, -200, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, 138, 138, 226, 0], [5169, 0, 120, 5281, -36, -76, 0, 36, 0, -120, 0, 0, 0, 0, 0, 0], [0, 1292, 0, 0, 0, 0, 646, 0, -488, 0, 0, -244, -185, 0, -41, -41], [1462, 0, 429, 0, -11, -198, 0, 0, 0, 0, -198, 0, 0, 0, 0, 0], [0, -2806, 0, 0, 0, 0, -2806, 0, -574, 0, 0, -574, -518, 259, 0, -105], [1292, 0, 647, -2260, 162, 135, 0, 324, 0, 1294, -135, 0, 0, 0, 0, 0], [3650, 0, 446, -1960, -86, 0, 0, -43, 0, 223, -184, 0, 0, 0, 0, 0], [0, -344, 0, 0, 0, 0, 0, 0, 1517, 0, 0, 0, -209, -209, -116, 0], [0, 0, 0, 0, 0, 0, 664, 0, 0, 0, 0, 275, -408, 816, 22, -22], [-108, 0, 0, 2183, 0, -216, 0, -120, 0, -844, 108, 0, 0, 0, 0, 0], [0, -80, 0, 0, 0, 0, -40, 0, 772, 0, 0, 386, 116, 0, 36, 36], [406, 0, 15, 0, -512, 243, 0, 0, 0, 0, 243, 0, 0, 0, 0, 0], [0, 202, 0, 0, 0, 0, 404, 0, -466, 0, 0, -932, 249, -249, -3, 6], [0, 810, 0, 0, 0, 0, -810, 0, 125, 0, 0, -125, 0, -641, 26, -13], [-7388, 0, 562, 8096, 749, 41, 0, 749, 0, 562, -82, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1136, 0, 0, 0, 0, -319, 251, -502, -178, 178], [353, 0, 0, 1648, 0, 706, 0, 658, 0, 521, -353, 0, 0, 0, 0, 0], [0, -96, 0, 0, 0, 0, -48, 0, -2638, 0, 0, -1319, -258, 0, 18, 18], [0, 192, 0, 0, 0, 0, 384, 0, 68, 0, 0, 136, -925, 925, -68, 136], [0, 770, 0, 0, 0, 0, -770, 0, -1127, 0, 0, 1127, 0, -81, -98, 49], [-5320, 0, 138, 2613, -550, 0, 0, -275, 0, 69, 456, 0, 0, 0, 0, 0], [-312, 0, 0, 1223, 0, -624, 0, -715, 0, 195, 312, 0, 0, 0, 0, 0], [2854, 0, 876, 0, 361, -21, 0, 0, 0, 0, -21, 0, 0, 0, 0, 0], [0, 1880, 0, 0, 0, 0, 1880, 0, 3142, 0, 0, 3142, 538, -269, 0, -162], [0, -866, 0, 0, 0, 0, 866, 0, 379, 0, 0, -379, 0, -568, -250, 125], [0, -1628, 0, 0, 0, 0, 0, 0, -1755, 0, 0, 0, 232, 232, -122, 0], [3728, 0, -1275, -4019, -257, 34, 0, -257, 0, -1275, -68, 0, 0, 0, 0, 0], [1217, 0, 72, 509, 414, 294, 0, -414, 0, -72, 0, 0, 0, 0, 0, 0], [0, 1960, 0, 0, 0, 0, 980, 0, -2170, 0, 0, -1085, -955, 0, 28, 28], [0, 1588, 0, 0, 0, 0, 3176, 0, 675, 0, 0, 1350, 168, -168, 158, -316], [0, -100, 0, 0, 0, 0, -100, 0, -2400, 0, 0, -2400, 888, -444, 0, 90], [-149, 0, 454, -162, -230, 848, 0, -460, 0, 908, -848, 0, 0, 0, 0, 0], [-6177, 0, 716, 3416, 618, 0, 0, 309, 0, 358, 37, 0, 0, 0, 0, 0], [2145, 0, 924, -2285, 109, 249, 0, 109, 0, 924, -498, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1204, 0, 0, 0, 0, -2251, -394, 788, 74, -74], [-3050, 0, 353, -3227, 689, -512, 0, -689, 0, -353, 0, 0, 0, 0, 0, 0], [7541, 0, 573, 0, -291, 210, 0, 0, 0, 0, 210, 0, 0, 0, 0, 0], [0, -826, 0, 0, 0, 0, -826, 0, 357, 0, 0, 357, -2158, 1079, 0, 111], [-3106, 0, 257, 7284, 536, 1597, 0, 1072, 0, 514, -1597, 0, 0, 0, 0, 0], [0, -1792, 0, 0, 0, 0, 1792, 0, -63, 0, 0, 63, 0, 420, 196, -98], [0, 2500, 0, 0, 0, 0, 0, 0, -2598, 0, 0, 0, 377, 377, 72, 0], [0, 0, 0, 0, 0, 0, 28, 0, 0, 0, 0, 2502, -698, 1396, -120, 120], [12974, 0, -461, 13201, -283, 56, 0, 283, 0, 461, 0, 0, 0, 0, 0, 0], [365, 0, -1246, 0, -480, -22, 0, 0, 0, 0, -22, 0, 0, 0, 0, 0], [0, -790, 0, 0, 0, 0, -1580, 0, -360, 0, 0, -720, -1628, 1628, 87, -174], [0, 3680, 0, 0, 0, 0, 3680, 0, -3257, 0, 0, -3257, -642, 321, 0, -332], [7757, 0, 478, -3792, -504, 0, 0, -252, 0, 239, 677, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 6118, 0, 0, 0, 0, 2144, 216, -432, -5, 5], [-210, 0, 0, -7366, 0, -420, 0, -840, 0, -466, 210, 0, 0, 0, 0, 0], [0, 3046, 0, 0, 0, 0, 6092, 0, 354, 0, 0, 708, 1089, -1089, -11, 22], [-2137, 0, 74, 5104, 415, -931, 0, 830, 0, 148, 931, 0, 0, 0, 0, 0], [5180, 0, -1550, -2615, -426, 0, 0, -213, 0, -775, 376, 0, 0, 0, 0, 0], [-22839, 0, -345, 23482, 424, -219, 0, 424, 0, -345, 438, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -530, 0, 0, 0, 0, 4500, 667, -1334, 405, -405], [-1027, 0, 0, 12422, 0, -2054, 0, -999, 0, -1846, 1027, 0, 0, 0, 0, 0], [2910, 0, 1604, 0, -151, -121, 0, 0, 0, 0, -121, 0, 0, 0, 0, 0], [0, -1686, 0, 0, 0, 0, -3372, 0, 2293, 0, 0, 4586, 935, -935, -53, 106], [723, 0, -264, -1190, 128, -1460, 0, 256, 0, -528, 1460, 0, 0, 0, 0, 0], [0, -2482, 0, 0, 0, 0, 2482, 0, -1150, 0, 0, 1150, 0, 531, -214, 107], [-4469, 0, -750, -5589, 239, 881, 0, -239, 0, 750, 0, 0, 0, 0, 0, 0], [0, 8804, 0, 0, 0, 0, 4402, 0, 3352, 0, 0, 1676, 652, 0, 255, 255], [0, -3250, 0, 0, 0, 0, -3250, 0, 1876, 0, 0, 1876, 234, -117, 0, 295], [-9682, 0, -408, 20308, 472, 768, 0, 944, 0, -816, -768, 0, 0, 0, 0, 0], [0, -2708, 0, 0, 0, 0, 0, 0, 3150, 0, 0, 0, -251, -251, -182, 0], [-6010, 0, -714, 5632, -596, -218, 0, -596, 0, -714, 436, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -2090, 0, 0, 0, 0, 2243, -752, 1504, 429, -429], [6512, 0, 1123, 6883, 529, -900, 0, -529, 0, -1123, 0, 0, 0, 0, 0, 0], [0, 4060, 0, 0, 0, 0, 2030, 0, -7322, 0, 0, -3661, 53, 0, 21, 21], [140, 0, 135, 12, 146, -685, 0, 292, 0, 270, 685, 0, 0, 0, 0, 0], [0, -2046, 0, 0, 0, 0, 2046, 0, -1401, 0, 0, 1401, 0, -2201, 334, -167], [11855, 0, -2972, -5405, 1026, 0, 0, 513, 0, -1486, 19, 0, 0, 0, 0, 0], [0, 2206, 0, 0, 0, 0, 0, 0, 500, 0, 0, 0, -425, -425, 315, 0], [670, 0, 0, -4002, 0, 1340, 0, -86, 0, 2688, -670, 0, 0, 0, 0, 0], [0, -1848, 0, 0, 0, 0, -924, 0, 3556, 0, 0, 1778, -1050, 0, -196, -196], [9082, 0, -565, 0, -92, -613, 0, 0, 0, 0, -613, 0, 0, 0, 0, 0], [0, 2736, 0, 0, 0, 0, 5472, 0, -1215, 0, 0, -2430, 206, -206, -66, 132], [-4448, 0, 1717, 5101, 1569, 916, 0, 1569, 0, 1717, -1832, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -4754, 0, 0, 0, 0, 2375, 491, -982, 293, -293], [-101, 0, 0, -17516, 0, -202, 0, 1036, 0, 1133, 101, 0, 0, 0, 0, 0], [0, -1372, 0, 0, 0, 0, -2744, 0, 4753, 0, 0, 9506, 16, -16, 28, -56], [3253, 0, -958, -6450, 28, -54, 0, 56, 0, -1916, 54, 0, 0, 0, 0, 0], [0, 838, 0, 0, 0, 0, -838, 0, -1450, 0, 0, 1450, 0, 1262, 418, -209], [0, -362, 0, 0, 0, 0, 0, 0, 1166, 0, 0, 0, -89, -89, 487, 0], [0, 0, 0, 0, 0, 0, 7042, 0, 0, 0, 0, 1405, 511, -1022, -513, 513], [-3063, 0, -540, 0, -1225, 255, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0], [0, 1012, 0, 0, 0, 0, 2024, 0, 1549, 0, 0, 3098, -2823, 2823, -58, 116], [0, 2180, 0, 0, 0, 0, 2180, 0, 5515, 0, 0, 5515, 76, -38, 0, -658], [0, -4680, 0, 0, 0, 0, 4680, 0, 1580, 0, 0, -1580, 0, 598, 612, -306], [-13436, 0, 568, 11630, -1081, 725, 0, -1081, 0, 568, -1450, 0, 0, 0, 0, 0], [811, 0, 1059, -312, -84, 1207, 0, 84, 0, -1059, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_441_p_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_441_4_p_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_441_4_p_c(:prec:=16)
    chi := MakeCharacter_441_p();
    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_p_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_441_4_p_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_441_p();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<2,R![810000, 0, -1762200, 0, 3242464, 0, -1200006, 0, 336765, 0, -27620, 0, 1647, 0, -48, 0, 1]>],Snew);
    return Vf;
end function;