
// Make newform 363.3.g.e in Magma, downloaded from the LMFDB on 20 January 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_363_g();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_363_g_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_363_3_g_e();".
// 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_363_3_g_e();".
// 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 := [234256, 42592, -120032, -66352, 38888, -52208, -19216, 24464, 17908, -5968, -304, 460, -22, 44, -8, -2, 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], [-5412462616, 0, 0, 0, 0, -769016, 0, 0, 0, 0, 88738, 0, 0, 0, 0, 137], [-848358104, -1441224312, 434695888, 240293768, -140832892, 189071272, 1029858830, -88596376, -64853822, 21613112, 1100936, 1716957, 79673, -159346, 28972, 7243], [-2280833544, -3932404784, 1168691568, 646036248, -378633012, 508323192, 2811322800, -238193736, -174361242, 58107432, 2959896, 4679840, 214203, -428406, 77892, 19473], [4589075040, 1599223120, -1829941080, 662863464, 349224400, -1004105040, -483415900, 331279960, -33165339, -18506020, 3793930, -1723920, 574640, 14068, -48975, 6530], [-177917432, -959736976, 91164304, 50394344, -29535436, 39651976, 216398952, -18580408, -13601126, 4532696, 230888, 361966, 16709, -33418, 6076, 1519], [41207537360, 0, 0, 0, 0, -9465209584, 0, 0, 0, 0, -33296042, 0, 0, 0, 0, -35393], [206598331104, 71996388112, -82383218808, 29873570296, 15721943440, -45204409104, -21763191340, 14914091896, -1499190370, -833133652, 170801218, -77610192, 25870064, 631662, -2204835, 293978], [4009642824, 21610785680, -2054527728, -1135714008, 665626452, -893618232, -4872904036, 418738056, 306522282, -102151272, -5203416, -8139472, -376563, 753126, -136932, -34233], [-5117187592, 0, 0, 0, 0, 1175369008, 0, 0, 0, 0, 4141592, 0, 0, 0, 0, 4429], [143833184, 98068080, 182455120, -77589952, 3507168, -20117096, -27826480, -72784692, 18505960, 1833404, -2018832, 189112, -159983, 20262, 8596, -3684], [334100123808, 116428831024, -133225875816, -5088775096, 25424712880, -73102229808, -35194306180, 24118297192, -2585014876, -1347300604, 276210886, -125507184, 41835728, 870212, -3565545, 475406], [-228011672064, -79458612992, 90922009728, 3410591252, -17351479040, 49889720064, 24018885440, -16459895936, 1781711389, 919485632, -188504288, 85654272, -28551424, -555036, 2433360, -324448], [3231795776, 2203497120, 4111290888, -1743372928, 78802752, -452012144, -625234720, -1639358272, 415811440, 41194856, -45361248, 4249168, -3601949, 455268, 193144, -82776], [51059502560, -143894961760, -79543109360, 46619128840, -24442571016, -23036236880, 29327565520, 21468199940, -7154468240, -234441140, 551450300, -26373710, 52747420, -9590440, -2258559, 1198805], [17429285280, -49118894880, -27152233680, 15913552920, -8357035321, -7863475440, 10011035760, 7328222220, -2442195120, -77765199, 188238900, -9002730, 18005460, -3273720, -768446, 409215]];
    Rf_basisdens := [1, 3125878184, 1562939092, 3125878184, 1322486924, 240452168, 3125878184, 34384660024, 3125878184, 284170744, 240452168, 34384660024, 17192330012, 3125878184, 34384660024, 8596165006];
    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_363_g();"
function MakeCharacter_363_g()
    N := 363;
    order := 10;
    char_gens := [122, 244];
    v := [10, 7];
    // 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_363_g_Hecke();"
function MakeCharacter_363_g_Hecke( : Kf := false)
    N := 363;
    order := 10;
    char_gens := [122, 244];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, -1, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := ISA(Type(Kf), Fld), 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 := 3;
    raw_aps := [[0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 0, 0, -3, 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, -1, -6, 0, 0, 1, 0, 0, -6, 0, -1, 6, 0, -1, -6], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -2, 0, 0, 0], [0, 0, 4, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-23, -5, 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, -4, -8], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 0, -18, 0, 0], [16, 2, 0, 0, -16, -16, 0, 2, -2, 0, 16, 0, 0, -2, 0, 0], [0, 0, -6, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -12, 0, 0, -2, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -25, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, -11, 0, 0], [-10, -42, 0, 0, 10, 10, 0, -42, 42, 0, -10, 0, 0, 42, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -11, -2, 0, 0, 0], [-34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 71, 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, -10, -4], [0, 0, -5, -24, 0, 0, 5, 0, 0, -24, 0, -5, 24, 0, -5, -24], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 16, 0, 0, 0], [76, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, 0, 0, -42, 0, 0], [0, 0, -14, -16, 0, 0, 14, 0, 0, -16, 0, -14, 16, 0, -14, -16], [-68, 42, 0, 0, 68, 68, 0, 42, -42, 0, -68, 0, 0, -42, 0, 0], [0, 0, 12, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 13, 0, 0, -34, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -52, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, -40, 0, 0, 0], [0, 0, 0, 0, 0, 0, 22, 0, 0, -12, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 50, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, -50], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 48, 0, 0, 0], [0, 0, -15, 76, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 190, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, 0, 0, -52, 0, 0], [0, 0, 6, -4, 0, 0, -6, 0, 0, -4, 0, 6, 4, 0, 6, -4], [0, 0, 12, -28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 50, 0, 0, -50, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -44, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0], [-91, 27, 0, 0, 91, 91, 0, 27, -27, 0, -91, 0, 0, -27, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, -36, 0, 0, 0], [0, 0, 0, 0, 0, 0, 2, 0, 0, -8, 0, 0, 0, 0, 0, 0], [50, -164, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -18, 22, 0, 0, 18, 0, 0, 22, 0, -18, -22, 0, -18, 22], [0, 0, 0, 0, 0, -110, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 70], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 230, 0, 0, 40, 0, 0], [0, 0, 62, -4, 0, 0, -62, 0, 0, -4, 0, 62, 4, 0, 62, -4], [0, 0, -30, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 32, 0, 0, -76, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 232, 0, 0, -96, 0, 0], [272, 38, 0, 0, -272, -272, 0, 38, -38, 0, 272, 0, 0, -38, 0, 0], [0, 0, 0, 0, 0, 0, 18, 0, 0, 8, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 257, 0, 0, -49, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 76], [0, 0, -11, -66, 0, 0, 11, 0, 0, -66, 0, -11, 66, 0, -11, -66], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 70, -42, 0, 0, 0], [0, 0, 54, 26, 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, -32, 80], [0, 0, 0, 0, 0, 0, 42, 0, 0, -90, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 47, 0, 0, -147, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 58, 0, 0, -184, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 349, 0, 0, 59, 0, 0], [188, -24, 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, -58, -8], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 176, 0, 0, 0], [0, 0, 57, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 112, 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, 16, -212], [-110, 144, 0, 0, 110, 110, 0, 144, -144, 0, -110, 0, 0, -144, 0, 0], [0, 0, 0, 0, 0, 0, -67, 0, 0, 54, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -212, 0, 0, 276, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 139, 0, 0, 111, 0, 0], [83, 291, 0, 0, -83, -83, 0, 291, -291, 0, 83, 0, 0, -291, 0, 0], [32, 262, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 260, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -18, -164, 0, 0, 18, 0, 0, -164, 0, -18, 164, 0, -18, -164], [-128, -132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 244, 0, 0, 126, 0, 0, 0, 0, 0, 0, 0], [0, 0, -94, -172, 0, 0, 94, 0, 0, -172, 0, -94, 172, 0, -94, -172], [274, -132, 0, 0, -274, -274, 0, -132, 132, 0, 274, 0, 0, 132, 0, 0], [0, 0, 0, 0, 0, 0, -71, 0, 0, -12, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 248, 0, 0, -360, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -254, 0, 0, 76, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -94, 96, 0, 0, 0], [0, 0, 0, 0, 0, 0, -32, 0, 0, -8, 0, 0, 0, 0, 0, 0], [152, -118, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -406, 0, 0, 62, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -96, 0, 0, 0], [0, 0, 0, 0, 0, 58, 0, 0, -376, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -108, 70], [388, 240, 0, 0, -388, -388, 0, 240, -240, 0, 388, 0, 0, -240, 0, 0], [0, 0, 98, -52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 251, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [68, -314, 0, 0, -68, -68, 0, -314, 314, 0, 68, 0, 0, 314, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -44, -34, 0, 0, 0], [0, 0, -67, 170, 0, 0, 67, 0, 0, 170, 0, -67, -170, 0, -67, 170], [0, 0, -120, -134, 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, -144], [0, 0, 0, -190, 0, 0, 0, 0, 0, -190, 0, 0, 190, 0, 0, -190], [0, 0, 126, 122, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 58, 0, 0, 226, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -158, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 0], [194, 222, 0, 0, -194, -194, 0, 222, -222, 0, 194, 0, 0, -222, 0, 0], [0, 0, 0, 0, 0, 0, 22, 0, 0, -202, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 869, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 62, -24], [0, 0, -53, 164, 0, 0, 53, 0, 0, 164, 0, -53, -164, 0, -53, 164], [0, 0, 115, 70, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [64, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 406, 0, 0, 108, 0, 0, 0, 0, 0, 0, 0], [88, 158, 0, 0, -88, -88, 0, 158, -158, 0, 88, 0, 0, -158, 0, 0], [0, 0, 0, 0, 0, -580, 0, 0, -118, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 46, 0, 0, 236, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 823, 0, 0, -57, 0, 0], [155, -105, 0, 0, -155, -155, 0, -105, 105, 0, 155, 0, 0, 105, 0, 0], [0, 0, 0, 0, 0, 0, 36, 0, 0, 38, 0, 0, 0, 0, 0, 0], [-250, 336, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -42, 224, 0, 0, 42, 0, 0, 224, 0, -42, -224, 0, -42, 224], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -156, 0, 0, 0], [16, -496, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 326, 0, 0, 300, 0, 0], [0, 0, -124, -148, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -458, 0, 0, -444, 0, 0, 0, 0, 0, 0, 0, 0], [-415, -41, 0, 0, 415, 415, 0, -41, 41, 0, -415, 0, 0, 41, 0, 0], [122, -48, 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, 91, 174], [0, 0, -38, -314, 0, 0, 38, 0, 0, -314, 0, -38, 314, 0, -38, -314], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 52, 0, 0, 0], [0, 0, 0, 0, 0, -980, 0, 0, -210, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 560, 0, 0, -274, 0, 0], [0, 0, 62, -170, 0, 0, -62, 0, 0, -170, 0, 62, 170, 0, 62, -170], [0, 0, 0, 0, 0, 0, 108, 0, 0, -184, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -301, 0, 0, 363, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -56, 30, 0, 0, 0], [0, 0, 0, 0, -493, 0, 0, -219, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -26, -292, 0, 0, 0], [0, 0, 12, -174, 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, 82, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -682, 0, 0, -212, 0, 0], [0, 0, 114, 264, 0, 0, -114, 0, 0, 264, 0, 114, -264, 0, 114, 264], [58, 368, 0, 0, -58, -58, 0, 368, -368, 0, 58, 0, 0, -368, 0, 0], [0, 0, 0, 0, 0, 791, 0, 0, -235, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 13, -278, 0, 0, 0], [0, 0, 0, 0, 0, 0, -90, 0, 0, 380, 0, 0, 0, 0, 0, 0], [-4, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -13, 0, 0, 819, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -31, -326, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [454, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -854, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 160, 20], [0, 0, 0, 0, 178, 0, 0, 356, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 43, 0, 0, 123, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 89, 220, 0, 0, 0], [0, 0, 0, 0, -1102, 0, 0, -192, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 228, -60, 0, 0, -228, 0, 0, -60, 0, 228, 60, 0, 228, -60], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 276, 0, 0, 0], [-1256, 156, 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, -114, 12], [0, 0, 0, 0, 0, 0, 83, 0, 0, 72, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1040, 0, 0, 144, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -500, 0, 0, 110, 0, 0], [-805, -159, 0, 0, 805, 805, 0, -159, 159, 0, -805, 0, 0, 159, 0, 0], [176, -498, 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, -83, 374]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_363_g_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_363_3_g_e();".
// 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_363_3_g_e(:prec:=16)
    chi := MakeCharacter_363_g();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    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_363_3_g_e();".
// 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_363_3_g_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_363_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<2,R![22667121, 0, -5913162, 0, 1214055, 0, -231012, 0, 42669, 0, -3348, 0, 255, 0, -18, 0, 1]>],Snew);
    return Vf;
end function;