
// Make newform 1620.4.i.x in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1620_i();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1620_i_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_1620_4_i_x();".
// 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_1620_4_i_x();".
// 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 := [366645904, 0, 243888288, 0, 28918584, 0, 1381040, 0, 30777, 0, 306, 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], [-45652500136, 0, -18065389388, 0, -1330336354, 0, -35790499, 0, -383792, 0, -1291, 0], [83013902159528, 0, 38122728094324, 0, 3452478375842, 0, 112247897357, 0, 1398025756, 0, 5102693, 0], [423568473640, 0, 393573716612, 0, 34081870402, 0, 1045133377, 0, 12522644, 0, 44857, 0], [-136972654160, 0, 581554032092, 0, 69043953676, 0, 2466092659, 0, 32147810, 0, 119695, 0], [-153225963267016, 0, -80864075604908, 0, -7244547031114, 0, -234983924419, 0, -2947200752, 0, -10810771, 0], [-233206555680, -573920985812, 0, -175329177676, 0, -15279946733, 0, -500676503, 0, -6338239, 0, -23357], [2200478058477616776, -591211552618868408, 1161288989762083788, -80772383343930664, 104038939913828154, -2317989495878582, 3374604138581259, 8571410900578, 42324749999472, 678724169054, 155253482331, 3422391862], [397387549637660536, 188670337960980496, 182493499387528988, 31285410315898988, 16527013985155654, 1885300499238244, 537330684647959, 47646796509679, 6692349293972, 498195552242, 24426591391, 1657489291], [30414334249720200, 8074723128389056, 28260560721324660, -6715236806064652, 2447248704215610, -646208074534496, 75045802135485, -20179270104191, 899188452420, -242242649518, 3220956885, -867417539], [19670642863917600, -184512033378602152, -83516974548732120, 2175231711636604, -9915402187410360, 2027571824356622, -354155566758990, 90300640751687, -4616746994100, 1275959537596, -17189398950, 4899606623], [-39118394749034728, -44222535099900360, -15479744401063724, -16698652541954460, -1139929302661042, -1375919491743090, -30667912249627, -42548567539275, -328861002416, -516891193560, -1106223043, -1866498795]];
    Rf_basisdens := [1, 1027615680, 1103659240320, 8489686464, 18394320672, 1103659240320, 466413111360, 31699300700471040, 10566433566823680, 1219203873095040, 5283216783411840, 1761072261137280];
    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_1620_i();"
function MakeCharacter_1620_i()
    N := 1620;
    order := 3;
    char_gens := [811, 1541, 1297];
    v := [3, 2, 3];
    // 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_1620_i_Hecke();"
function MakeCharacter_1620_i_Hecke(Kf)
    N := 1620;
    order := 3;
    char_gens := [811, 1541, 1297];
    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], [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 := 4;
    raw_aps := [[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, -5, 0, 0, 0, 0, 0], [-2, 0, -1, 0, 0, 0, -2, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 1, -1, 0], [0, 0, 0, 0, 1, -1, -14, -1, -2, 0, 1, -1], [2, 3, 5, 0, 0, 1, 0, 0, 0, 0, 0, 0], [-19, 2, 0, -3, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 2, 5, 2, -7, 0, -1, -1], [-28, 4, 0, 0, 0, 0, -28, -3, 0, -2, -3, -4], [0, 0, 0, 1, -2, -6, -54, -6, 5, -1, -2, 5], [-82, -1, -5, 4, -2, 5, 0, 0, 0, 0, 0, 0], [0, 0, 0, -4, 0, -10, 52, -10, -2, 4, 0, 3], [26, 1, 7, 0, 0, 0, 26, -9, -7, 2, -5, -1], [-77, 4, -10, 0, 0, 0, -77, 3, 10, 2, 8, -4], [169, 6, 8, 6, 5, -7, 0, 0, 0, 0, 0, 0], [0, 0, 0, 5, -2, 10, 168, 10, 16, -5, -2, 13], [-6, 0, -2, 0, 0, 0, -6, -14, 2, -4, 12, 0], [0, 0, 0, -10, -2, 2, 24, 2, -24, 10, -2, 12], [202, 14, -12, -17, -13, -5, 0, 0, 0, 0, 0, 0], [-150, 31, 49, 4, 16, 7, 0, 0, 0, 0, 0, 0], [156, -26, -4, 0, 0, 0, 156, 32, 4, 6, -4, 26], [-48, -17, -23, 0, 0, 0, -48, 5, 23, -16, 5, 17], [-20, -10, -14, 4, 7, 25, 0, 0, 0, 0, 0, 0], [198, -19, -27, 0, 0, 0, 198, 13, 27, -16, 4, 19], [-262, 0, 22, 0, 0, 0, -262, 11, -22, 18, -19, 0], [0, 0, 0, 14, 11, -13, 186, -13, -4, -14, 11, 61], [460, -14, 4, 14, -4, 12, 0, 0, 0, 0, 0, 0], [-206, 33, -55, 4, -11, -6, 0, 0, 0, 0, 0, 0], [0, 0, 0, -20, -24, -9, 424, -9, 27, 20, -24, -5], [622, 68, 33, -28, -32, -4, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 0, -40, 356, -40, -86, -3, 0, -23], [-764, 4, 26, 0, 0, 0, -764, 20, -26, -8, -30, -4], [0, 0, 0, 1, 9, -12, 129, -12, 50, -1, 9, 104], [0, 0, 0, 8, 14, 20, 1090, 20, 2, -8, 14, -46], [-404, -67, -47, 0, 0, 0, -404, 24, 47, -3, 22, 67], [0, 0, 0, 28, 21, -40, -232, -40, 43, -28, 21, 118], [-60, 55, 55, 48, 49, -13, 0, 0, 0, 0, 0, 0], [0, 0, 0, 2, -21, 1, 1296, 1, 59, -2, -21, 35], [-715, -39, 71, 0, 0, 0, -715, 14, -71, 18, 39, 39], [-160, 49, 42, -9, -28, 112, 0, 0, 0, 0, 0, 0], [62, 103, 25, 8, -19, 70, 0, 0, 0, 0, 0, 0], [-1130, 18, -106, 0, 0, 0, -1130, 31, 106, -3, 31, -18], [0, 0, 0, -32, 4, 37, -866, 37, -77, 32, 4, 135], [1815, -9, -11, -46, 1, -8, 0, 0, 0, 0, 0, 0], [710, 118, 20, 22, 28, 26, 0, 0, 0, 0, 0, 0], [0, 0, 0, -7, 17, -26, -49, -26, 22, 7, 17, 212], [-512, -110, -136, 0, 0, 0, -512, 2, 136, -88, 54, 110], [-486, -3, -5, 0, 0, 0, -486, -21, 5, 6, -11, 3], [0, 0, 0, -40, -60, -80, -112, -80, 44, 40, -60, 180], [2566, -75, -135, 16, -64, -23, 0, 0, 0, 0, 0, 0], [0, 0, 0, -38, 20, -40, 1644, -40, -124, 38, 20, 34], [-152, 3, -37, 0, 0, 0, -152, 28, 37, -14, -55, -3], [1312, 145, 186, 54, 7, -19, 0, 0, 0, 0, 0, 0], [0, 0, 0, -52, -52, -134, 1602, -134, -210, 52, -52, -90], [-1215, -43, -1, 0, 0, 0, -1215, 94, 1, -20, -77, 43], [2394, 86, 90, 2, 17, -65, 0, 0, 0, 0, 0, 0], [-342, 178, 130, -8, 58, -104, 0, 0, 0, 0, 0, 0], [-300, 34, 71, 0, 0, 0, -300, 84, -71, 28, 35, -34], [-1396, 269, 230, 0, 0, 0, -1396, -49, -230, -72, -3, -269], [0, 0, 0, -6, -58, 56, -398, 56, 74, 6, -58, 340], [0, 0, 0, 22, -7, -137, 1961, -137, -18, -22, -7, 124], [1166, 31, -63, 30, 39, 111, 0, 0, 0, 0, 0, 0], [0, 0, 0, 87, -25, 53, -412, 53, 206, -87, -25, -138], [4766, -92, -130, 0, 0, 0, 4766, 90, 130, 68, 24, 92], [-3391, 104, -66, 0, 0, 0, -3391, -37, 66, 66, 37, -104], [-1360, -261, 113, 0, 0, 0, -1360, 18, -113, 107, -122, 261], [0, 0, 0, -68, 82, 122, 3398, 122, 152, 68, 82, 164], [0, 0, 0, -134, -33, 241, 182, 241, 17, 134, -33, 49], [-652, 9, -79, 0, 0, 0, -652, 178, 79, 72, -37, -9], [-2998, -351, -49, 0, 0, 0, -2998, -77, 49, 128, -86, 351], [236, -118, -330, 1, 21, -33, 0, 0, 0, 0, 0, 0], [-604, -86, 144, 0, 0, 0, -604, -64, -144, -110, -56, 86], [0, 0, 0, 92, -40, -121, -3906, -121, -213, -92, -40, -189], [-3195, 171, 331, 24, -29, 32, 0, 0, 0, 0, 0, 0], [0, 0, 0, 82, 33, -42, 1291, -42, 237, -82, 33, 159], [982, 4, 34, 0, 0, 0, 982, 112, -34, -216, 54, -4], [2996, 228, 340, 40, 102, -202, 0, 0, 0, 0, 0, 0], [0, 0, 0, -72, -37, 123, 3108, 123, -440, 72, -37, -269], [0, 0, 0, 50, -195, 210, 1123, 210, -1, -50, -195, -65], [0, 0, 0, 92, 12, -200, -2424, -200, 350, -92, 12, 68], [-3214, 295, -19, 0, 0, 0, -3214, -140, 19, -60, 5, -295], [306, 8, 44, 33, -65, -129, 0, 0, 0, 0, 0, 0], [-4100, -76, -424, 28, -50, 66, 0, 0, 0, 0, 0, 0], [-4220, -427, -639, 0, 0, 0, -4220, 48, 639, 81, -30, 427], [3914, -731, -323, 0, 0, 0, 3914, 57, 323, -8, 67, 731], [4504, -161, 60, -60, 40, -268, 0, 0, 0, 0, 0, 0], [-2672, 215, 9, 0, 0, 0, -2672, -123, -9, -108, 24, -215], [-1752, 124, -312, 0, 0, 0, -1752, -69, 312, 102, -21, -124], [0, 0, 0, -182, 81, -175, -4606, -175, 140, 182, 81, 43], [-6794, -315, -199, 58, -9, 169, 0, 0, 0, 0, 0, 0], [4534, 52, -234, 0, 0, 0, 4534, 55, 234, 111, -49, -52], [806, -249, -58, -92, -197, 143, 0, 0, 0, 0, 0, 0], [0, 0, 0, -193, -26, -342, -3928, -342, -316, 193, -26, -373], [0, 0, 0, 89, 283, -340, -693, -340, -336, -89, 283, -86], [-7212, -330, -374, 40, -102, 338, 0, 0, 0, 0, 0, 0], [0, 0, 0, 152, 96, -4, -3602, -4, 268, -152, 96, -36], [-5780, 673, 850, -272, -77, 157, 0, 0, 0, 0, 0, 0], [-7282, 200, 584, -120, 40, 30, 0, 0, 0, 0, 0, 0], [5506, -407, -467, -352, -149, 80, 0, 0, 0, 0, 0, 0], [-3510, -300, -490, 0, 0, 0, -3510, 166, 490, 296, -68, 300], [261, 291, 177, 126, 267, 30, 0, 0, 0, 0, 0, 0], [0, 0, 0, 80, -7, 177, -9556, 177, 61, -80, -7, 437], [-1152, 237, 300, 0, 0, 0, -1152, 394, -300, 28, 62, -237], [0, 0, 0, 135, -36, 216, 3224, 216, -241, -135, -36, -379], [-270, -203, -307, 100, -42, 157, 0, 0, 0, 0, 0, 0], [8576, 167, 137, 0, 0, 0, 8576, 181, -137, -88, -203, -167], [2020, -364, -194, 288, 336, 26, 0, 0, 0, 0, 0, 0], [0, 0, 0, -259, 45, 281, -2930, 281, -632, 259, 45, -362], [-5403, 410, -26, 0, 0, 0, -5403, 218, 26, 228, 56, -410], [0, 0, 0, 94, -81, -21, 5352, -21, -949, -94, -81, -647], [-6162, -219, 478, 424, 391, -143, 0, 0, 0, 0, 0, 0], [0, 0, 0, 184, -226, -98, -5332, -98, 840, -184, -226, 282], [6377, -239, -443, 0, 0, 0, 6377, -202, 443, -416, -61, 239], [10804, -1023, -557, 265, -102, -108, 0, 0, 0, 0, 0, 0], [-756, 840, 32, 0, 0, 0, -756, 297, -32, 192, 17, -840], [0, 0, 0, 290, 163, 707, -11766, 707, 621, -290, 163, -193], [-5924, 388, 428, -130, 94, 270, 0, 0, 0, 0, 0, 0], [0, 0, 0, -236, -170, 186, 2206, 186, 692, 236, -170, 1096], [16672, -39, -360, 0, 0, 0, 16672, 37, 360, 48, 227, 39], [0, 0, 0, 12, -125, -66, 7496, -66, 239, -12, -125, -899], [6608, 970, 464, 0, 0, 0, 6608, 216, -464, -4, 172, -970], [-1171, 939, 405, 0, 0, 0, -1171, -564, -405, -182, 207, -939], [-18578, -264, -144, 140, 48, -270, 0, 0, 0, 0, 0, 0], [-383, -399, -411, 0, 0, 0, -383, 222, 411, -432, 147, 399], [1860, 286, -1028, 254, -185, 379, 0, 0, 0, 0, 0, 0], [-128, 1232, 882, 0, 0, 0, -128, -240, -882, 72, 26, -1232], [-12394, 1012, 1238, -439, -265, 299, 0, 0, 0, 0, 0, 0], [-1170, -307, 522, 0, 0, 0, -1170, 247, -522, -220, 83, 307], [0, 0, 0, -464, -10, -248, -13244, -248, -666, 464, -10, -1162], [1668, -1063, -1029, 85, 338, -458, 0, 0, 0, 0, 0, 0], [0, 0, 0, -90, -113, -27, -9144, -27, 359, 90, -113, 1123], [0, 0, 0, -280, -58, -212, 6230, -212, 986, 280, -58, -42], [4062, -151, -538, -368, -33, 217, 0, 0, 0, 0, 0, 0], [0, 0, 0, 408, 144, 422, 10496, 422, -98, -408, 144, -921], [0, 0, 0, 210, 277, 188, 4516, 188, -827, -210, 277, -1707], [-244, -493, 203, -516, -72, -239, 0, 0, 0, 0, 0, 0], [0, 0, 0, -344, -143, 445, 6178, 445, 415, 344, -143, -89], [0, 0, 0, -572, -2, 14, -7854, 14, -1500, 572, -2, -756], [6012, -153, -344, -96, 302, 486, 0, 0, 0, 0, 0, 0], [9712, -25, 1213, 87, -134, 418, 0, 0, 0, 0, 0, 0], [10384, 1628, 518, 0, 0, 0, 10384, 243, -518, -178, 269, -1628], [0, 0, 0, 238, -90, -414, -12264, -414, -482, -238, -90, -476], [-11582, -90, 1040, 708, 338, -184, 0, 0, 0, 0, 0, 0], [3086, -33, -65, 272, 39, 70, 0, 0, 0, 0, 0, 0], [908, 446, -508, 0, 0, 0, 908, 379, 508, -49, -527, -446], [8290, 979, -309, 0, 0, 0, 8290, -663, 309, 156, -204, -979], [-12594, 1406, 1078, 0, 0, 0, -12594, -152, -1078, 28, 138, -1406], [0, 0, 0, 343, -252, -492, 360, -492, -97, -343, -252, -99], [5987, -666, 520, 156, -284, -335, 0, 0, 0, 0, 0, 0], [0, 0, 0, 8, -305, -379, 5226, -379, 578, -8, -305, -551], [-244, 470, 1546, 152, -315, -25, 0, 0, 0, 0, 0, 0], [-15156, -219, 231, -152, -497, 253, 0, 0, 0, 0, 0, 0], [0, 0, 0, -746, -166, -189, -13535, -189, -200, 746, -166, -606], [-22770, -156, -304, 0, 0, 0, -22770, -316, 304, -222, 350, 156], [1876, 1616, 124, 0, 0, 0, 1876, -445, -124, -11, -31, -1616], [-120, -643, -513, -197, -208, -26, 0, 0, 0, 0, 0, 0], [2152, -70, 330, 0, 0, 0, 2152, -1427, -330, 84, -169, 70], [352, -218, 214, 380, 298, 1172, 0, 0, 0, 0, 0, 0], [0, 0, 0, -20, -156, 540, -2156, 540, -72, 20, -156, -2142], [4878, -178, -248, 0, 0, 0, 4878, -878, 248, 154, 480, 178], [6366, -1650, -744, 148, 436, -136, 0, 0, 0, 0, 0, 0], [0, 0, 0, 96, 481, -939, 15248, -939, -601, -96, 481, 277], [5312, 655, 606, -387, 476, -848, 0, 0, 0, 0, 0, 0], [0, 0, 0, 460, 154, -710, 18674, -710, 688, -460, 154, -272], [15124, -1887, 129, 0, 0, 0, 15124, 37, -129, -150, -277, 1887], [15108, -569, -799, -341, 426, 592, 0, 0, 0, 0, 0, 0], [996, 1274, 1689, 0, 0, 0, 996, 178, -1689, 452, 83, -1274], [1469, 602, -334, -504, 376, 6, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1186, 479, -1197, -2675, -1197, -584, -1186, 479, 394], [-2796, 993, 2092, 0, 0, 0, -2796, -256, -2092, -541, 260, -993], [0, 0, 0, 284, 175, 368, 26130, 368, -315, -284, 175, -543], [0, 0, 0, -229, -655, 123, 14756, 123, 208, 229, -655, -1120], [28866, 338, -1660, 0, 0, 0, 28866, -446, 1660, -448, 782, -338], [0, 0, 0, -610, -154, 964, -12226, 964, 112, 610, -154, 744], [0, 0, 0, -356, 892, -150, -5720, -150, 1166, 356, 892, -5], [-15891, -455, -859, 0, 0, 0, -15891, 114, 859, 304, -37, 455], [-2582, 898, 34, 350, 137, -465, 0, 0, 0, 0, 0, 0], [-16124, -366, 404, -228, -958, 22, 0, 0, 0, 0, 0, 0], [-3734, 543, 229, 0, 0, 0, -3734, 118, -229, -1184, 435, -543], [-14524, -2567, -2665, 0, 0, 0, -14524, 69, 2665, 122, -543, 2567], [25408, 1559, -722, 0, 0, 0, 25408, -83, 722, -222, 783, -1559], [0, 0, 0, -628, -755, 1364, -17004, 1364, -429, 628, -755, 236], [8814, 1256, 1130, 940, 710, -208, 0, 0, 0, 0, 0, 0], [0, 0, 0, 74, 432, 19, -13953, 19, 866, -74, 432, 2644], [-18248, 264, 514, 0, 0, 0, -18248, 175, -514, 1302, -579, -264], [-7086, 1325, 12, -128, -529, -917, 0, 0, 0, 0, 0, 0], [28686, -1121, -1081, 0, 0, 0, 28686, 455, 1081, -396, 7, 1121], [0, 0, 0, -44, 516, -554, 5179, -554, 402, 44, 516, 902], [10546, 464, -408, 924, 160, -298, 0, 0, 0, 0, 0, 0], [-15202, 286, -1242, -624, -148, -810, 0, 0, 0, 0, 0, 0], [-5326, -3123, -367, 0, 0, 0, -5326, -147, 367, 532, -301, 3123], [10104, 2164, 2164, -242, -130, 406, 0, 0, 0, 0, 0, 0], [-31316, 2878, 996, 0, 0, 0, -31316, -343, -996, -542, -371, -2878], [15904, 427, 187, -200, -89, 955, 0, 0, 0, 0, 0, 0], [0, 0, 0, -284, 94, 1043, 41940, 1043, 1041, 284, 94, 1539], [0, 0, 0, -204, -470, 232, 9789, 232, 2402, 204, -470, 1498], [21596, 1170, 1793, 0, 0, 0, 21596, 1236, -1793, 356, -263, -1170], [-20478, 2153, 491, 0, 0, 0, -20478, -283, -491, -1288, -60, -2153], [-10459, -147, -945, -266, 279, -1056, 0, 0, 0, 0, 0, 0], [0, 0, 0, 646, -493, 465, 19924, 465, -2078, -646, -493, -572], [-38132, -2043, -745, 0, 0, 0, -38132, -632, 745, 25, 162, 2043], [0, 0, 0, 348, 247, 1084, -9444, 1084, -2275, -348, 247, -328], [6325, -360, -2764, 0, 0, 0, 6325, -696, 2764, 324, 488, 360], [-1188, 1104, -1150, -264, -164, 1260, 0, 0, 0, 0, 0, 0], [8035, 439, 1805, 914, 949, 336, 0, 0, 0, 0, 0, 0], [322, -841, -747, 737, 192, 1172, 0, 0, 0, 0, 0, 0], [0, 0, 0, -556, -274, -786, -10924, -786, 1804, 556, -274, 2562], [-48208, 168, -304, 0, 0, 0, -48208, -38, 304, 452, -110, -168], [0, 0, 0, 1260, 620, -380, 7056, -380, 1796, -1260, 620, 2200], [19322, 1434, -518, -592, -520, -14, 0, 0, 0, 0, 0, 0], [0, 0, 0, -642, -425, -269, 34534, -269, -836, 642, -425, -1290], [20522, -1335, 36, 0, 0, 0, 20522, -25, -36, 160, -185, 1335], [18590, 888, 830, 0, 0, 0, 18590, -122, -830, 728, -1268, -888], [0, 0, 0, 445, -383, -847, -8454, -847, -366, -445, -383, -1274], [-28307, 656, 1496, 0, 0, 0, -28307, -594, -1496, 552, -1030, -656], [0, 0, 0, -22, 884, -468, 19516, -468, 1852, 22, 884, 1470], [14592, 2138, 686, 0, 0, 0, 14592, 1001, -686, 776, -729, -2138], [17533, -1599, -1873, -172, -251, -1926, 0, 0, 0, 0, 0, 0], [0, 0, 0, -64, 60, -70, 7102, -70, -662, 64, 60, 2222], [0, 0, 0, -1420, 17, -22, 21582, -22, -507, 1420, 17, 2383], [0, 0, 0, 421, 200, 832, 5146, 832, -1215, -421, 200, 1203], [0, 0, 0, 504, 944, -1406, 26824, -1406, -1590, -504, 944, -2685], [-32874, 989, 1824, 604, 293, -635, 0, 0, 0, 0, 0, 0], [0, 0, 0, 894, 687, 1203, -25236, 1203, 261, -894, 687, -1019], [-23466, 543, -437, 0, 0, 0, -23466, -816, 437, -668, 687, -543], [-37442, -2156, 1184, 0, 0, 0, -37442, 200, -1184, -980, 1008, 2156], [5528, 1564, 2242, -64, 192, -1504, 0, 0, 0, 0, 0, 0], [-22830, -1578, 443, 0, 0, 0, -22830, 728, -443, -330, 472, 1578], [-14644, 2207, -1672, 0, 0, 0, -14644, -501, 1672, -356, 137, -2207], [0, 0, 0, -12, -843, -456, 5888, -456, -361, 12, -843, 1732], [-15023, 2478, -456, -685, -203, 98, 0, 0, 0, 0, 0, 0], [0, 0, 0, 978, -632, -272, 7980, -272, -1250, -978, -632, -194], [0, 0, 0, 832, -79, -579, 748, -579, 2188, -832, -79, 149], [10064, -808, -580, 0, 0, 0, 10064, -788, 580, -36, -1000, 808], [-41147, 627, -1035, 0, 0, 0, -41147, 1516, 1035, -1020, 1085, -627], [0, 0, 0, 8, -124, -870, 6601, -870, -742, -8, -124, 1138], [-22392, -1649, -893, 528, -946, 2379, 0, 0, 0, 0, 0, 0], [0, 0, 0, -740, 133, 811, -12004, 811, 586, 740, 133, 629], [33734, 1220, 3564, 393, -385, 1915, 0, 0, 0, 0, 0, 0], [32214, -3075, -1609, 0, 0, 0, 32214, -185, 1609, -1634, 301, 3075], [9037, 1099, -3537, 692, -713, 452, 0, 0, 0, 0, 0, 0], [0, 0, 0, 578, 270, 1706, -17718, 1706, 2965, -578, 270, 1064], [7180, 1410, -312, -1144, -422, -166, 0, 0, 0, 0, 0, 0], [0, 0, 0, 44, -562, 1536, 7574, 1536, 1438, -44, -562, 2242], [-16428, 68, 784, 0, 0, 0, -16428, 1413, -784, 555, -857, -68], [26266, -1478, -2109, 1430, 108, 212, 0, 0, 0, 0, 0, 0], [0, 0, 0, 448, 1129, -25, 43740, -25, -18, -448, 1129, -2571], [0, 0, 0, -739, -777, -746, -12223, -746, -892, 739, -777, 2270], [9392, -1629, -4209, -800, 993, 135, 0, 0, 0, 0, 0, 0], [0, 0, 0, 60, -618, 1263, 9506, 1263, 3249, -60, -618, 2313], [-12632, -2403, -2662, 300, 524, -394, 0, 0, 0, 0, 0, 0], [0, 0, 0, -632, 451, -2527, -6384, -2527, 3021, 632, 451, -403], [-7911, 160, 1116, 0, 0, 0, -7911, 1522, -1116, 752, -1246, -160], [-58549, -3650, -3384, 0, 0, 0, -58549, -2169, 3384, -242, -201, 3650], [37228, -669, -1336, 272, -161, -2187, 0, 0, 0, 0, 0, 0], [36486, 1109, 1691, -836, -687, 2560, 0, 0, 0, 0, 0, 0], [-32392, 2508, 2376, 0, 0, 0, -32392, -1162, -2376, -194, 1330, -2508], [-15059, 3160, -2758, -1570, 1, -549, 0, 0, 0, 0, 0, 0], [-15198, -1187, -1767, 1204, 74, -1271, 0, 0, 0, 0, 0, 0], [16798, 308, 3531, 0, 0, 0, 16798, -330, -3531, -582, 134, -308], [-19482, 1271, 3779, 0, 0, 0, -19482, -33, -3779, 612, 701, -1271], [0, 0, 0, 140, 893, 1382, 39966, 1382, 1301, -140, 893, 1377], [-21470, 1011, 574, -1096, 661, 2627, 0, 0, 0, 0, 0, 0], [0, 0, 0, -224, -552, -813, -22574, -813, -3861, 224, -552, -2361], [9107, -844, -2706, 0, 0, 0, 9107, 536, 2706, 217, 1435, 844], [-5034, -1190, 622, -560, -54, -1084, 0, 0, 0, 0, 0, 0], [-24100, 1173, -646, 0, 0, 0, -24100, 1426, 646, 1472, -1124, -1173], [0, 0, 0, -2108, -112, 256, -21152, 256, 108, 2108, -112, 668], [0, 0, 0, -142, -207, -910, 21139, -910, 175, 142, -207, 2397], [0, 0, 0, 1344, 1563, 1380, 35288, 1380, 2585, -1344, 1563, 749], [43996, 2210, 2878, 1056, 1178, -1706, 0, 0, 0, 0, 0, 0], [12816, 404, 1014, 0, 0, 0, 12816, -2204, -1014, -1240, 1754, -404], [0, 0, 0, 783, 72, 504, -35434, 504, -399, -783, 72, -1463], [0, 0, 0, 360, -820, -1510, -15062, -1510, 1826, -360, -820, 850], [-39940, -1519, 779, -1806, -869, 147, 0, 0, 0, 0, 0, 0], [0, 0, 0, -830, -742, -1848, 18994, -1848, -1454, 830, -742, -2408], [-12316, -287, 305, 0, 0, 0, -12316, 2062, -305, 1200, -1217, 287], [-7705, 387, -1073, 670, -507, 2822, 0, 0, 0, 0, 0, 0], [-44, 3585, 388, 0, 0, 0, -44, 1617, -388, -1048, -221, -3585], [0, 0, 0, -934, 282, 703, 17853, 703, 1592, 934, 282, 1990], [0, 0, 0, -386, -52, 250, 6898, 250, 216, 386, -52, -2026], [11265, 555, 1589, 0, 0, 0, 11265, -2228, -1589, -272, -515, -555], [-13378, -1314, -2796, 0, 0, 0, -13378, -1012, 2796, -596, -1196, 1314], [0, 0, 0, 16, -565, -1613, 33010, -1613, 447, -16, -565, -1447], [-35912, -932, -686, -85, 617, 3375, 0, 0, 0, 0, 0, 0], [-6514, -2193, -3619, 1144, -1190, 413, 0, 0, 0, 0, 0, 0], [0, 0, 0, -218, -423, 2393, -3075, 2393, 340, 218, -423, 3302], [28938, -1205, -3637, 0, 0, 0, 28938, 1126, 3637, -1069, 202, 1205], [17716, -1286, -3578, -1236, -690, 692, 0, 0, 0, 0, 0, 0], [52946, 1216, 840, 0, 0, 0, 52946, -2135, -840, -1582, 1577, -1216], [-17410, -3744, -2862, 1032, 656, -950, 0, 0, 0, 0, 0, 0], [0, 0, 0, -1868, -856, -121, -23340, -121, -3421, 1868, -856, 459], [0, 0, 0, 841, -1137, 1317, -16784, 1317, -4386, -841, -1137, -1750], [-13392, 2052, -2193, 0, 0, 0, -13392, -1052, 2193, -1420, -373, -2052], [0, 0, 0, -486, 1225, 1319, 28250, 1319, 1842, 486, 1225, -1438], [-896, 711, 1143, 0, 0, 0, -896, -1188, -1143, -1557, 1142, -711], [6756, -2879, -4975, 0, 0, 0, 6756, 1179, 4975, 1872, -382, 2879], [-77324, 2679, 2204, 565, -648, 364, 0, 0, 0, 0, 0, 0], [-22886, 3456, 3236, 0, 0, 0, -22886, -956, -3236, -1190, -414, -3456], [0, 0, 0, -1472, -306, 1772, -6982, 1772, 5666, 1472, -306, 1180], [20989, 3098, 5240, 1542, 1157, 365, 0, 0, 0, 0, 0, 0], [-65290, -3939, -4087, -715, -366, 526, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1620_i_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1620_4_i_x();".
// 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_1620_4_i_x(:prec:=12)
    chi := MakeCharacter_1620_i();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(1999) - 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_1620_4_i_x();".
// 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_1620_4_i_x( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1620_i();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<7,R![108966010000, 200199048000, 345480783600, 46178285440, 9518654844, 281425968, 98836980, 4143240, 465309, 7612, 807, 12, 1]>,<11,R![2430225018940410000, -107765874298656000, 15223470471794700, 274593035828160, 39988229062761, 400272788160, 39574013994, 421485120, 27242307, 120960, 5826, 0, 1]>],Snew);
    return Vf;
end function;