
// Make newform 272.4.o.f in Magma, downloaded from the LMFDB on 05 January 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_272_o();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_272_o_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_272_4_o_f();".
// 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_272_4_o_f();".
// 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 := [2704, 0, 1699337, 0, 4382607, 0, 1120191, 0, 112122, 0, 5319, 0, 119, 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], [-1462819625392, 0, -5240890807749, 0, -776715718098, 0, -35042935761, 0, -553258413, 0, -2958786, 0, -16553, 0], [-1244553232, -29043895248, -52342238181, 0, -12509813490, 0, -708095937, 0, -2543421, 0, 574494, 0, 9031, 0], [-1244553232, 29043895248, -52342238181, 0, -12509813490, 0, -708095937, 0, -2543421, 0, 574494, 0, 9031, 0], [480468824824, 0, 81386133429, 0, 12509813490, 0, 708095937, 0, 2543421, 0, -574494, 0, -9031, 0], [0, -9487413190220, 0, -26060390244033, 0, -6693378067758, 0, -670840961865, 0, -31833327273, 0, -712145454, 0, -5983429], [-2125260748364, -51529530090165, -44078757852480, -76569890579577, -14410751366271, -19003094129961, -1686473706255, -1893984144588, -89819078388, -89620518609, -2196992499, -1997695269, -19735339, -16718259], [2125260748364, -51529530090165, 44078757852480, -76569890579577, 14410751366271, -19003094129961, 1686473706255, -1893984144588, 89819078388, -89620518609, 2196992499, -1997695269, 19735339, -16718259], [21859444421360, 553556528507924, -100278228438336, 1681302766451415, -15301683043296, 436113015710646, -163613325720, 43968354527715, 56784667056, 2094008337087, 2586850656, 46939392582, 30952792, 394782247], [-21859444421360, 553556528507924, 100278228438336, 1681302766451415, 15301683043296, 436113015710646, 163613325720, 43968354527715, -56784667056, 2094008337087, -2586850656, 46939392582, -30952792, 394782247], [0, -1424787091162888, 0, -3581518823081679, 0, -903371091656622, 0, -89390253958059, 0, -4199517040215, 0, -93193189950, 0, -778104491], [0, -313807418169676, 0, -858631979860383, 0, -220556221085274, 0, -22119341247183, 0, -1050433671063, 0, -23515736826, 0, -197687963], [-10332452117624, -257557705863182, -48633301863731, -633026078177693, -12386311463292, -161046078537220, -1235688069941, -16088764865267, -58709091363, -762476943733, -1318184036, -17048541404, -11120005, -143212757], [-10332452117624, 257557705863182, -48633301863731, 633026078177693, -12386311463292, 161046078537220, -1235688069941, 16088764865267, -58709091363, 762476943733, -1318184036, 17048541404, -11120005, 143212757]];
    Rf_basisdens := [1, 53247141288, 29043895248, 29043895248, 14521947624, 377570638224, 1038319255116, 1038319255116, 4153277020464, 4153277020464, 2076638510232, 377570638224, 230737612248, 230737612248];
    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_272_o();"
function MakeCharacter_272_o()
    N := 272;
    order := 4;
    char_gens := [239, 69, 241];
    v := [4, 4, 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_272_o_Hecke();"
function MakeCharacter_272_o_Hecke(Kf)
    N := 272;
    order := 4;
    char_gens := [239, 69, 241];
    char_values := [[1, 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, -1, 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]];
    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, 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], [-1, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0, 0, 0], [6, 0, 0, 1, 0, 6, 0, 1, 0, 0, 0, 0, 0, 1], [-8, -1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [9, 0, -1, 1, -1, -4, 1, 1, 2, 0, -1, 1, 1, 0], [0, 0, -2, 2, 0, -3, -1, -1, -1, -1, 1, 1, -1, 1], [14, -1, 0, 4, -3, 14, 0, 1, 0, 1, 1, -3, 0, 1], [7, 0, -2, 0, -1, -7, 5, 0, 4, 0, 0, 1, 0, 0], [32, 1, 10, 0, -1, -32, -3, 0, -1, 0, 1, 1, 3, 0], [39, 1, -16, 0, -5, -39, -7, 0, -4, 0, 1, 5, 2, 0], [50, 1, 0, -16, -1, 50, 0, -18, 0, 4, -1, -1, 0, 2], [0, 0, 19, -19, 0, 23, 5, 5, 4, 4, -1, 5, -1, 1], [21, -5, -18, -18, -5, 0, -3, 3, 0, 0, 0, 0, 3, 3], [0, 0, 24, -24, 0, 79, 20, 20, -4, -4, 3, -9, -1, 1], [0, 0, -33, 33, 0, -17, 12, 12, -6, -6, 3, 5, 4, -4], [-87, -1, 0, -4, 1, -87, 0, -7, 0, -12, 1, 1, 0, 4], [3, -3, -17, -17, 3, 0, -10, 10, -13, 13, 0, 0, -4, -4], [241, 2, 34, 0, -6, -241, 20, 0, 5, 0, 2, 6, 8, 0], [-90, 1, 48, 0, -3, 90, 20, 0, -4, 0, 1, 3, -2, 0], [-89, -6, 0, 36, 4, -89, 0, 33, 0, 5, 6, 4, 0, 5], [0, 0, -13, 13, 0, -33, 10, 10, 10, 10, -1, -11, -2, 2], [-40, 9, -67, -67, 14, 0, 11, -11, -2, 2, 0, 0, -12, -12], [99, -5, -50, 0, -10, -99, 20, 0, 16, 0, -5, 10, -6, 0], [-124, 3, -7, -7, 28, 0, 4, -4, -24, 24, 0, 0, -4, -4], [-344, 4, -60, -60, -16, 0, 5, -5, 2, -2, 0, 0, -5, -5], [135, 3, -59, 0, 5, -135, -46, 0, -16, 0, 3, -5, -14, 0], [141, 3, 0, -88, 15, 141, 0, -49, 0, 8, -3, 15, 0, -12], [125, 7, 0, 150, 8, 125, 0, 36, 0, 36, -7, 8, 0, -2], [0, 0, -108, 108, 0, 968, 33, 33, 1, 1, -6, -10, -5, 5], [-449, 7, -193, 0, 15, 449, -8, 0, 10, 0, 7, -15, -8, 0], [759, 0, 229, 229, 21, 0, -8, 8, 4, -4, 0, 0, -14, -14], [690, -8, 65, 0, 6, -690, -11, 0, -54, 0, -8, -6, -17, 0], [-330, 28, -24, -24, 12, 0, -6, 6, -12, 12, 0, 0, -28, -28], [0, 0, -8, 8, 0, -586, -78, -78, 47, 47, -12, 16, 6, -6], [599, -13, -18, -18, -13, 0, 65, -65, -12, 12, 0, 0, 21, 21], [501, 15, 0, -141, -5, 501, 0, -53, 0, 42, -15, -5, 0, -45], [228, 1, -36, 0, -43, -228, -116, 0, 27, 0, 1, 43, 20, 0], [-763, 10, -62, 0, -3, 763, 75, 0, -36, 0, 10, 3, -38, 0], [0, 0, 180, -180, 0, 405, -22, -22, -13, -13, 9, 29, 12, -12], [220, -4, 0, 176, -14, 220, 0, 3, 0, -48, 4, -14, 0, -22], [-609, -39, -70, -70, -71, 0, -26, 26, 22, -22, 0, 0, 26, 26], [-673, -32, 0, 240, 22, -673, 0, -8, 0, -60, 32, 22, 0, 4], [-1406, 5, 0, -34, -10, -1406, 0, -69, 0, 16, -5, -10, 0, 38], [-585, -8, -312, 0, -26, 585, 79, 0, 41, 0, -8, 26, 33, 0], [-697, 15, 0, -7, 63, -697, 0, -122, 0, 22, -15, 63, 0, -2], [0, 0, 130, -130, 0, -463, 69, 69, 31, 31, 27, 109, 7, -7], [-749, 17, 0, -67, -17, -749, 0, -121, 0, 64, -17, -17, 0, 3], [0, 0, -57, 57, 0, -976, 39, 39, 120, 120, -27, -16, -14, 14], [525, -3, -262, 0, 50, -525, 22, 0, -56, 0, -3, -50, -2, 0], [-1427, 15, 330, 330, -45, 0, 72, -72, 62, -62, 0, 0, 40, 40], [-827, -12, 88, 0, -42, 827, 62, 0, 136, 0, -12, 42, 24, 0], [-779, -5, 77, 77, -83, 0, -29, 29, 91, -91, 0, 0, -1, -1], [0, 0, 139, -139, 0, 2051, -170, -170, 32, 32, 18, 11, 34, -34], [0, 0, 78, -78, 0, 3376, -200, -200, -35, -35, 42, -14, 20, -20], [-832, 8, -132, 0, 4, 832, 131, 0, -60, 0, 8, -4, -2, 0], [1595, -35, -38, -38, 45, 0, -48, 48, 66, -66, 0, 0, 16, 16], [-1843, -30, -242, 0, -55, 1843, 53, 0, -64, 0, -30, 55, 48, 0], [0, 0, 380, -380, 0, -1001, -45, -45, 102, 102, -39, -37, 0, 0], [-774, -4, 0, 317, -32, -774, 0, -31, 0, 140, 4, -32, 0, 17], [342, -6, 246, 246, -16, 0, 6, -6, -44, 44, 0, 0, -76, -76], [-3153, -23, 528, 528, -39, 0, -86, 86, -32, 32, 0, 0, -38, -38], [367, 14, 352, 0, 34, -367, 294, 0, 75, 0, 14, -34, -94, 0], [2167, 70, 0, -228, 100, 2167, 0, -118, 0, 24, -70, 100, 0, -76], [578, -59, 0, 238, -2, 578, 0, 155, 0, -20, 59, -2, 0, 78], [0, 0, 69, -69, 0, 3107, 47, 47, -66, -66, 7, 109, 29, -29], [-799, -14, 848, 0, -6, 799, -30, 0, 244, 0, -14, 6, 132, 0], [-307, 47, 0, -319, 9, -307, 0, 511, 0, -64, -47, 9, 0, -69], [0, 0, 336, -336, 0, -2491, 26, 26, -136, -136, -35, -7, -19, 19], [-505, 15, -270, -270, -115, 0, 61, -61, -78, 78, 0, 0, 6, 6], [0, 0, 96, -96, 0, 2917, -73, -73, 41, 41, -21, -35, -51, 51], [-86, 67, 0, 150, 179, -86, 0, 8, 0, 249, -67, 179, 0, -96], [1020, 51, -87, -87, 144, 0, 180, -180, -132, 132, 0, 0, -98, -98], [2844, -20, 341, 0, 16, -2844, -418, 0, 52, 0, -20, -16, 114, 0], [0, 0, -192, 192, 0, 2096, 372, 372, -13, -13, -38, -34, 0, 0], [0, 0, -381, 381, 0, 3326, -1, -1, -124, -124, -65, -130, -72, 72], [-1337, -15, 0, -8, -129, -1337, 0, -209, 0, 348, 15, -129, 0, 2], [-4527, 16, 0, -624, -42, -4527, 0, 174, 0, -48, -16, -42, 0, 80], [5892, 38, 16, 16, 148, 0, -86, 86, -218, 218, 0, 0, -53, -53], [-1711, -25, 0, -113, 23, -1711, 0, -438, 0, -180, 25, 23, 0, 34], [-3802, 25, -639, -639, 102, 0, 20, -20, 116, -116, 0, 0, -46, -46], [-3952, 85, 0, -624, -77, -3952, 0, 119, 0, 77, -85, -77, 0, -77], [0, 0, -561, 561, 0, -1332, -287, -287, 18, 18, -91, 4, 42, -42], [-889, -40, -14, 0, -76, 889, 238, 0, -199, 0, -40, 76, 142, 0], [105, 51, -67, -67, 25, 0, 300, -300, 9, -9, 0, 0, 42, 42], [3168, -74, 0, -322, 45, 3168, 0, 16, 0, -320, 74, 45, 0, 142], [0, 0, 175, -175, 0, 590, 57, 57, -30, -30, -25, -58, 36, -36], [0, 0, 512, -512, 0, 5861, -450, -450, -4, -4, -19, 109, 59, -59], [-3344, -4, -158, -158, 44, 0, 91, -91, 68, -68, 0, 0, -119, -119], [0, 0, -16, 16, 0, 4047, -52, -52, 7, 7, 23, 35, -38, 38], [5042, 101, -448, 0, 155, -5042, 263, 0, -83, 0, 101, -155, -107, 0], [-874, 87, 0, -646, 31, -874, 0, 410, 0, 197, -87, 31, 0, -50], [0, 0, 594, -594, 0, -1617, 401, 401, 27, 27, -69, -161, -15, 15], [-1498, -104, 0, -517, -194, -1498, 0, -358, 0, -396, 104, -194, 0, 214], [-936, 9, 0, 670, -79, -936, 0, 158, 0, -231, -9, -79, 0, -46], [6448, -44, 250, 250, -142, 0, 106, -106, -168, 168, 0, 0, 110, 110], [-1088, -131, 0, 108, -25, -1088, 0, 474, 0, 248, 131, -25, 0, -36], [-969, -111, 127, 127, -273, 0, 17, -17, -55, 55, 0, 0, 169, 169], [-955, 35, -2060, 0, 13, 955, -53, 0, -40, 0, 35, -13, 164, 0], [5477, -3, -29, 0, 109, -5477, -378, 0, -126, 0, -3, -109, -14, 0], [-1220, -169, -391, -391, -396, 0, 318, -318, 280, -280, 0, 0, 102, 102], [0, 0, -769, 769, 0, 3427, 391, 391, -224, -224, 59, 185, 101, -101], [0, 0, -166, 166, 0, 2175, 417, 417, -384, -384, 47, -3, -107, 107], [-4331, -113, 0, 63, -189, -4331, 0, -24, 0, -188, 113, -189, 0, -56], [9953, -118, 605, 605, -257, 0, -18, 18, 40, -40, 0, 0, 130, 130], [0, 0, 508, -508, 0, 295, 72, 72, 203, 203, 11, -197, 30, -30], [0, 0, 846, -846, 0, -4235, -101, -101, -8, -8, 85, 19, 189, -189], [1074, 110, 270, 270, -14, 0, -237, 237, -180, 180, 0, 0, 129, 129], [-5510, 165, 0, -868, 197, -5510, 0, 62, 0, -324, -165, 197, 0, 120], [-8, -63, 534, 0, -29, 8, 519, 0, 143, 0, -63, 29, 73, 0], [3226, -56, 424, 424, 88, 0, 94, -94, -164, 164, 0, 0, 24, 24], [1443, 65, 838, 0, -298, -1443, -938, 0, 324, 0, 65, 298, 40, 0], [5695, -3, 0, 915, -39, 5695, 0, -1081, 0, -82, 3, -39, 0, -65], [0, 0, -1326, 1326, 0, 9651, 530, 530, 153, 153, -95, 43, 78, -78], [-385, 109, 2058, 0, -72, 385, 268, 0, 268, 0, 109, 72, 192, 0], [164, 140, 851, 0, -114, -164, -492, 0, -78, 0, 140, 114, 272, 0], [2547, -11, -1462, -1462, 141, 0, 506, -506, -162, 162, 0, 0, -210, -210], [3014, 81, 0, -650, 56, 3014, 0, -9, 0, -128, -81, 56, 0, 4], [-12819, -81, 218, 218, 7, 0, -199, 199, 132, -132, 0, 0, -221, -221], [0, 0, -1010, 1010, 0, -1808, -115, -115, 328, 328, -176, 74, -36, 36], [2556, -8, 0, -2102, -149, 2556, 0, 76, 0, -140, 8, -149, 0, 172], [-2716, 39, -3254, 0, -64, 2716, -25, 0, -500, 0, 39, 64, 8, 0], [888, -240, -253, 0, -6, -888, -150, 0, 282, 0, -240, 6, -70, 0], [-3574, -64, 0, -1859, 32, -3574, 0, -211, 0, 352, 64, 32, 0, -19], [650, -231, 1809, 1809, -426, 0, 526, -526, 120, -120, 0, 0, 266, 266], [-3781, 176, 1818, 0, 279, 3781, -57, 0, -464, 0, 176, -279, -458, 0], [-6649, 148, -506, 0, 148, 6649, 404, 0, 429, 0, 148, -148, 292, 0], [633, -249, 938, 938, -25, 0, -169, 169, -192, 192, 0, 0, -23, -23], [0, 0, -42, 42, 0, 1730, 675, 675, 60, 60, -18, 464, 34, -34], [0, 0, -32, 32, 0, -4717, 844, 844, -29, -29, 175, -425, -274, 274], [3690, -53, 826, 0, 329, -3690, -765, 0, 23, 0, -53, -329, -143, 0], [556, 239, -1470, 0, 135, -556, 306, 0, 21, 0, 239, -135, -34, 0], [0, 0, -2153, 2153, 0, -3988, -111, -111, -396, -396, 69, 352, -18, 18], [-9913, 116, 697, 697, 673, 0, 316, -316, -72, 72, 0, 0, -324, -324], [-11291, 42, -1667, -1667, -157, 0, 60, -60, -128, 128, 0, 0, -168, -168], [0, 0, 1661, -1661, 0, 4132, 579, 579, -108, -108, -121, 220, 300, -300], [-930, 184, 435, 0, 324, 930, -357, 0, -1196, 0, 184, -324, -267, 0], [0, 0, -1518, 1518, 0, -6132, 265, 265, -220, -220, -80, 278, -52, 52], [739, 123, 0, -1862, -22, 739, 0, -444, 0, 536, -123, -22, 0, 98], [-6353, 117, 693, 0, 173, 6353, 577, 0, -206, 0, 117, -173, -297, 0], [30, -211, -1470, 0, 138, -30, -293, 0, 188, 0, -211, -138, -384, 0], [371, 2, 0, 2284, 228, 371, 0, -1139, 0, -175, -2, 228, 0, 77], [2964, 162, 0, 277, 90, 2964, 0, 396, 0, 466, -162, 90, 0, 220], [229, 49, -1270, -1270, -383, 0, -559, 559, -208, 208, 0, 0, 319, 319], [-3730, -43, 0, -2020, -151, -3730, 0, 704, 0, 251, 43, -151, 0, 568], [12765, -17, 1780, 0, 399, -12765, -193, 0, 160, 0, -17, -399, -130, 0], [-2993, 68, 0, -1856, 170, -2993, 0, -922, 0, 92, -68, 170, 0, -282], [0, 0, -113, 113, 0, 9097, 50, 50, -726, -726, 233, -845, -338, 338], [7318, -90, 1338, 1338, -18, 0, -571, 571, 544, -544, 0, 0, 511, 511], [10333, -1, 0, 1992, -29, 10333, 0, -433, 0, 312, 1, -29, 0, -64], [-3902, 7, 720, 0, -85, 3902, -72, 0, 128, 0, 7, 85, -240, 0], [-1841, 341, -37, -37, 831, 0, 17, -17, 121, -121, 0, 0, -203, -203], [-3856, -17, -1552, 0, -303, 3856, 633, 0, 397, 0, -17, 303, 215, 0], [2353, 93, 0, -1731, -75, 2353, 0, 411, 0, -840, -93, -75, 0, -253], [-9309, 44, 0, -2000, -504, -9309, 0, -506, 0, 495, -44, -504, 0, -126], [12071, -91, 1942, 1942, 89, 0, 37, -37, 44, -44, 0, 0, 203, 203], [-3290, 265, 0, 1576, 135, -3290, 0, -216, 0, 124, -265, 135, 0, 48], [0, 0, 218, -218, 0, 8046, 1166, 1166, 262, 262, -88, -1028, -95, 95], [-3325, 84, 0, -890, 29, -3325, 0, 131, 0, 540, -84, 29, 0, 50], [5436, 18, -1565, 0, -586, -5436, -913, 0, -516, 0, 18, 586, 73, 0], [-10320, -375, 1065, 1065, -238, 0, -985, 985, 318, -318, 0, 0, 206, 206], [0, 0, 1098, -1098, 0, 11927, -394, -394, -75, -75, -199, 327, -118, 118], [0, 0, -587, 587, 0, 2393, -871, -871, 630, 630, -39, 799, 443, -443], [0, 0, -2014, 2014, 0, 13141, 311, 311, 176, 176, 5, 71, -41, 41], [-2343, -10, -4318, 0, -174, 2343, 542, 0, 441, 0, -10, 174, 326, 0], [-2387, -118, -98, 0, -802, 2387, 754, 0, -1103, 0, -118, 802, -50, 0], [5979, -48, 0, -406, -555, 5979, 0, -1543, 0, -32, 48, -555, 0, 332]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_272_o_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_272_4_o_f();".
// 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_272_4_o_f(:prec:=14)
    chi := MakeCharacter_272_o();
    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_272_4_o_f();".
// 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_272_4_o_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_272_o();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<3,R![346112, 8246784, 98247744, -122689088, 79351072, 33003936, 6988144, -126400, 59408, 26400, 6044, -140, 18, 6, 1]>],Snew);
    return Vf;
end function;