
// Make newform 525.3.s.h in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_525_s();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_525_s_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_525_3_s_h();".
// 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_525_3_s_h();".
// 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 := [10000, 0, -28000, 0, 64300, 0, -35080, 0, 13621, 0, -2542, 0, 343, 0, -22, 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], [1162228000, 0, -13938000, 0, 31891800, 0, -17251573, 0, 6085386, 0, -972969, 0, 70156, 0, -3243, 0], [-107196000, 0, 245765100, 0, -160507590, 0, 49729797, 0, -8714814, 0, 952781, 0, -57414, 0, 2097, 0], [-14205490000, 0, 9068677900, 0, -5048799890, 0, 476316679, 0, -31499288, 0, -13023473, 0, 1089782, 0, -86391, 0], [411726170000, 0, 40289506000, 0, -92187176600, 0, 77297768001, 0, -17590557882, 0, 2812486753, 0, -190524872, 0, 9374291, 0], [-30551903500, 0, 360875734400, 0, -183317921405, 0, 77131205568, 0, -14560759471, 0, 2033326684, 0, -131308181, 0, 6119178, 0], [62550453500, 0, 83443297550, 0, -75410643205, 0, 37675335571, 0, -7533395317, 0, 1071617318, 0, -69896422, 0, 3255576, 0], [116147058000, 0, -1391895892850, 0, 696907060140, 0, -293224368384, 0, 54583447073, 0, -7729957392, 0, 499185228, 0, -23640839, 0], [0, 1505969628000, 0, -896995494300, 0, 347196076720, 0, -93939460491, 0, 15788353442, 0, -1863758843, 0, 115310592, 0, -4776241], [0, 3668496441000, 0, 314711354000, 0, -720096969400, 0, 632989616059, 0, -137404223538, 0, 21969033677, 0, -1471847198, 0, 73224919], [0, 157094974000, 0, -360875734400, 0, 183317921405, 0, -77131205568, 0, 14560759471, 0, -2033326684, 0, 131308181, 0, -6119178], [0, -19091613416000, 0, -2802829493500, 0, 1651261681150, 0, -1857250226079, 0, 386625669928, 0, -65222132237, 0, 4362137888, 0, -226365739], [0, -271918500, 0, 2643813450, 0, -1631568855, 0, 686484288, 0, -131482211, 0, 18097044, 0, -1168671, 0, 53598], [0, -2845044101000, 0, -234132342000, 0, 535722616200, 0, -478394080057, 0, 102223107774, 0, -16344060171, 0, 1090797454, 0, -54476337], [0, -750541216000, 0, 1723148574100, 0, -982088475474, 0, 362617097947, 0, -67088899600, 0, 8812748265, 0, -562043572, 0, 25018339]];
    Rf_basisdens := [1, 1, 298803000, 117007000, 2457147000, 253086141000, 126543070500, 18077581500, 126543070500, 180775815000, 2530861410000, 126543070500, 2530861410000, 585035000, 506172282000, 101234456400];
    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_525_s();"
function MakeCharacter_525_s()
    N := 525;
    order := 6;
    char_gens := [176, 127, 451];
    v := [6, 3, 5];
    // 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_525_s_Hecke();"
function MakeCharacter_525_s_Hecke(Kf)
    N := 525;
    order := 6;
    char_gens := [176, 127, 451];
    char_values := [[1, 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, 1, 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 := 3;
    raw_aps := [[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, -1, 0, 0, 2, 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, 1, -3, 2, 1, -1, 0, -1], [6, 0, 0, -1, 2, 0, -7, 1, -1, 0, 0, 0, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0, 0, 0, 0, -4, 0, 2, 0, -2, -1, 3], [0, -4, 0, 0, 0, 0, 0, 0, 0, -1, 3, 8, -1, -7, 0, 0], [0, 0, 4, -2, 4, 2, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 16, -3, 4, -12, 4, -6], [10, 0, -4, 0, 5, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0], [-10, 0, 1, 1, 0, 2, -12, 4, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 26, 8, 4, -22, 4, -1], [-2, 0, 5, 6, -3, 3, -2, -3, 10, 0, 0, 0, 0, 0, 0, 0], [0, 5, 0, 0, 0, 0, 0, 0, 0, 5, 5, -5, 10, -44, 2, -7], [0, -2, 0, 0, 0, 0, 0, 0, 0, 0, -6, 1, 1, -7, 3, -2], [0, 3, 0, 0, 0, 0, 0, 0, 0, -5, 23, 0, 5, -5, -12, 0], [25, 0, 5, -14, 0, -28, -2, -1, -4, 0, 0, 0, 0, 0, 0, 0], [-66, 0, -6, 4, -10, -4, 40, 0, 2, 0, 0, 0, 0, 0, 0, 0], [0, 5, 0, 0, 0, 0, 0, 0, 0, -1, 49, 0, 1, -1, 9, 0], [32, 0, 4, 0, 5, -28, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0], [0, -11, 0, 0, 0, 0, 0, 0, 0, -7, 31, 22, -7, -69, 3, -6], [-1, 0, 6, -5, -6, -5, 58, -12, 3, 0, 0, 0, 0, 0, 0, 0], [0, -12, 0, 0, 0, 0, 0, 0, 0, -5, -13, -12, 0, 4, 9, 14], [-47, 0, -11, 10, -11, -10, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -14, 0, 0, 0, 0, 0, 0, 0, -10, 22, -14, 0, -16, -12, -2], [-41, 0, 21, -2, 0, -4, -24, -21, 0, 0, 0, 0, 0, 0, 0, 0], [0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 4, -11, 1, 3, -23, 11], [0, 0, 0, 0, 0, 0, 0, 0, 0, -34, -18, 30, -17, 1, -17, 20], [24, 0, 9, -15, 4, 0, -26, 2, 7, 0, 0, 0, 0, 0, 0, 0], [0, 20, 0, 0, 0, 0, 0, 0, 0, -4, -4, -20, -8, 8, 10, -6], [0, 68, 0, 0, 0, 0, 0, 0, 0, -2, -2, -68, -4, -20, 11, -9], [43, 0, -14, 13, 28, -13, -29, 0, -21, 0, 0, 0, 0, 0, 0, 0], [0, -42, 0, 0, 0, 0, 0, 0, 0, 17, -107, 0, -17, 17, 30, 0], [-59, 0, -5, 58, -2, 29, 60, -2, -10, 0, 0, 0, 0, 0, 0, 0], [16, 0, 4, -20, -4, -20, 78, -8, -6, 0, 0, 0, 0, 0, 0, 0], [50, 0, 30, 58, 0, 0, -50, 0, 30, 0, 0, 0, 0, 0, 0, 0], [0, -23, 0, 0, 0, 0, 0, 0, 0, -3, -9, 46, -3, 15, -24, 48], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 100, -48, 0, -100, 0, 2], [0, -25, 0, 0, 0, 0, 0, 0, 0, -30, -118, -25, 0, 44, -22, 8], [0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 36, -17, 33, 3, 27, -30], [55, 0, 25, -39, -12, 0, -49, -6, 31, 0, 0, 0, 0, 0, 0, 0], [-7, 0, 1, 50, -14, 25, -36, -14, 2, 0, 0, 0, 0, 0, 0, 0], [-26, 0, 20, 6, -20, 6, -10, -40, 28, 0, 0, 0, 0, 0, 0, 0], [0, -45, 0, 0, 0, 0, 0, 0, 0, -11, -15, 0, 11, -11, 29, 0], [0, 71, 0, 0, 0, 0, 0, 0, 0, -20, -20, -71, -40, 54, 4, 16], [-76, 0, -30, 42, 0, 84, -6, 14, 16, 0, 0, 0, 0, 0, 0, 0], [-18, 0, -11, 0, 16, 51, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0], [0, -14, 0, 0, 0, 0, 0, 0, 0, -64, 24, -14, 0, -44, -32, 32], [0, 14, 0, 0, 0, 0, 0, 0, 0, -25, 23, -28, -25, -71, -34, 68], [-175, 0, -26, -19, -12, 19, 84, 0, -7, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -20, 174, 78, -10, -184, -10, -20], [220, 0, 28, 0, -10, -6, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0], [37, 0, -7, 17, 0, 34, 43, 28, -21, 0, 0, 0, 0, 0, 0, 0], [2, 0, -33, -2, 43, -1, -2, 43, -66, 0, 0, 0, 0, 0, 0, 0], [0, -64, 0, 0, 0, 0, 0, 0, 0, 0, -48, 32, 5, -53, -1, -2], [0, -76, 0, 0, 0, 0, 0, 0, 0, 6, -226, 0, -6, 6, 4, 0], [6, 0, 0, -26, 0, -52, -2, -44, 44, 0, 0, 0, 0, 0, 0, 0], [-12, 0, 28, -20, -36, 20, 14, 0, 32, 0, 0, 0, 0, 0, 0, 0], [0, 123, 0, 0, 0, 0, 0, 0, 0, -13, 183, 0, 13, -13, -19, 0], [-66, 0, 45, 0, -24, -49, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0], [0, 17, 0, 0, 0, 0, 0, 0, 0, 67, -1, -34, 67, 69, 65, -130], [0, -43, 0, 0, 0, 0, 0, 0, 0, 51, -117, -43, 0, 84, 5, -46], [0, -79, 0, 0, 0, 0, 0, 0, 0, -9, 11, -79, 0, -10, -16, -7], [-21, 0, 37, -36, 0, -72, -36, -57, 20, 0, 0, 0, 0, 0, 0, 0], [0, -50, 0, 0, 0, 0, 0, 0, 0, 0, 54, 25, -25, 79, -57, 41], [0, 0, 0, 0, 0, 0, 0, 0, 0, 110, 24, 0, 55, 31, 55, -118], [6, 0, -6, 0, 6, 0, -203, 12, -94, 0, 0, 0, 0, 0, 0, 0], [0, 21, 0, 0, 0, 0, 0, 0, 0, 39, 39, -21, 78, -16, -4, -35], [0, -116, 0, 0, 0, 0, 0, 0, 0, -16, -54, 0, 16, -16, -26, 0], [104, 0, 20, -96, -48, -48, -112, -48, 40, 0, 0, 0, 0, 0, 0, 0], [0, -56, 0, 0, 0, 0, 0, 0, 0, -21, -71, 112, -21, 121, -4, 8], [13, 0, -29, 16, 29, 16, -336, 58, -94, 0, 0, 0, 0, 0, 0, 0], [0, -4, 0, 0, 0, 0, 0, 0, 0, 82, -26, 8, 82, 134, 13, -26], [0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 302, -19, 15, -287, 15, -7], [-163, 0, 34, 0, 44, 56, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0], [0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 142, 11, -19, 161, 51, -16], [361, 0, -9, -18, 54, 0, -388, 27, -36, 0, 0, 0, 0, 0, 0, 0], [0, 62, 0, 0, 0, 0, 0, 0, 0, 0, 72, -31, 83, -11, 87, -85], [-153, 0, -20, 173, 20, 173, 87, 40, 29, 0, 0, 0, 0, 0, 0, 0], [-34, 0, 23, 73, 0, 146, 142, -30, 7, 0, 0, 0, 0, 0, 0, 0], [-52, 0, 53, 118, -118, 59, -14, -118, 106, 0, 0, 0, 0, 0, 0, 0], [259, 0, 77, 0, 12, 119, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0], [138, 0, -32, 54, 16, 0, -146, 8, -40, 0, 0, 0, 0, 0, 0, 0], [0, 29, 0, 0, 0, 0, 0, 0, 0, 103, 175, 29, 0, -36, 98, -5], [68, 0, -38, 2, -74, -2, 4, 0, 18, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -48, -178, 42, -24, 154, -24, -78], [-28, 0, 81, 0, 34, -13, 0, -34, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -46, -126, -29, -23, 103, -23, 5], [-52, 0, -28, 124, 103, 62, -20, 103, -56, 0, 0, 0, 0, 0, 0, 0], [0, -54, 0, 0, 0, 0, 0, 0, 0, -42, -42, 54, -84, -140, 65, -23], [0, 48, 0, 0, 0, 0, 0, 0, 0, 0, -334, -24, 36, -370, 28, -32], [-58, 0, -10, 2, 0, 4, -116, 62, -52, 0, 0, 0, 0, 0, 0, 0], [0, -29, 0, 0, 0, 0, 0, 0, 0, 53, -415, 0, -53, 53, -19, 0], [280, 0, -46, 0, -54, 78, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0], [-11, 0, -52, 63, 52, 63, 44, 104, 49, 0, 0, 0, 0, 0, 0, 0], [0, -20, 0, 0, 0, 0, 0, 0, 0, 2, -334, -20, 0, 168, 56, 54], [-240, 0, -22, 118, -42, -118, 200, 0, 10, 0, 0, 0, 0, 0, 0, 0], [95, 0, -3, -23, 0, -46, -29, 78, -75, 0, 0, 0, 0, 0, 0, 0], [0, 254, 0, 0, 0, 0, 0, 0, 0, 0, 58, -127, 45, 13, -15, -15], [-1, 0, 72, -71, -72, -71, 36, -144, 169, 0, 0, 0, 0, 0, 0, 0], [0, -28, 0, 0, 0, 0, 0, 0, 0, -28, -28, 28, -56, -406, -68, 96], [0, -13, 0, 0, 0, 0, 0, 0, 0, -11, 241, 0, 11, -11, 130, 0], [0, 36, 0, 0, 0, 0, 0, 0, 0, 20, -136, -72, 20, 292, 22, -44], [-4, 0, -21, 25, 21, 25, -15, 42, -85, 0, 0, 0, 0, 0, 0, 0], [-252, 0, 133, 87, -112, 0, 308, -56, 189, 0, 0, 0, 0, 0, 0, 0], [0, -51, 0, 0, 0, 0, 0, 0, 0, -15, -101, 102, -15, 187, 53, -106], [0, 60, 0, 0, 0, 0, 0, 0, 0, 19, 359, 60, 0, -170, -11, -30], [0, 208, 0, 0, 0, 0, 0, 0, 0, 0, -188, -104, -103, -85, -133, 118], [-502, 0, -22, 194, 92, 0, 456, 46, -68, 0, 0, 0, 0, 0, 0, 0], [95, 0, 1, -282, -26, -141, 92, -26, 2, 0, 0, 0, 0, 0, 0, 0], [0, 56, 0, 0, 0, 0, 0, 0, 0, 0, -36, -28, -86, 50, -148, 117], [0, 37, 0, 0, 0, 0, 0, 0, 0, 21, -17, 0, -21, 21, -34, 0], [0, -96, 0, 0, 0, 0, 0, 0, 0, 4, 4, 96, 8, 578, -72, 68], [-61, 0, 0, 140, 0, 280, 157, 62, -62, 0, 0, 0, 0, 0, 0, 0], [-74, 0, 0, 0, 8, 36, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0], [-102, 0, 58, -11, -90, 0, 147, -45, 103, 0, 0, 0, 0, 0, 0, 0], [0, 101, 0, 0, 0, 0, 0, 0, 0, -17, -185, 101, 0, 84, -10, 7], [0, 67, 0, 0, 0, 0, 0, 0, 0, -78, 154, -134, -78, -386, 20, -40], [0, 0, 0, 0, 0, 0, 0, 0, 0, 24, -310, -183, 12, 322, 12, 114], [624, 0, 66, 0, 40, -126, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0], [140, 0, -83, -115, 0, -230, -238, 148, -65, 0, 0, 0, 0, 0, 0, 0], [0, 195, 0, 0, 0, 0, 0, 0, 0, 83, 83, -195, 166, -6, 108, -191], [0, 146, 0, 0, 0, 0, 0, 0, 0, 0, -58, -73, -94, 36, 94, 0], [0, 98, 0, 0, 0, 0, 0, 0, 0, 11, 277, 0, -11, 11, -16, 0], [267, 0, -100, 21, -178, -21, -34, 0, 39, 0, 0, 0, 0, 0, 0, 0], [142, 0, -246, 0, 9, -30, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0], [134, 0, 100, -234, -100, -234, 182, -200, 170, 0, 0, 0, 0, 0, 0, 0], [-222, 0, -196, 82, -24, -82, 164, 0, -86, 0, 0, 0, 0, 0, 0, 0], [0, 16, 0, 0, 0, 0, 0, 0, 0, -98, -82, 16, 0, -8, -45, 53], [0, 200, 0, 0, 0, 0, 0, 0, 0, 0, 214, -100, -64, 278, 26, 19], [-599, 0, 4, 224, 108, 0, 545, 54, -50, 0, 0, 0, 0, 0, 0, 0], [0, 219, 0, 0, 0, 0, 0, 0, 0, 24, 24, -219, 48, 164, -48, 24], [107, 0, -8, -99, 8, -99, -170, 16, -227, 0, 0, 0, 0, 0, 0, 0], [0, -294, 0, 0, 0, 0, 0, 0, 0, -32, -32, 294, -64, -420, -18, 50], [172, 0, -23, 37, -141, -37, 3, 0, 59, 0, 0, 0, 0, 0, 0, 0], [-219, 0, 176, -8, -274, -4, 446, -274, 352, 0, 0, 0, 0, 0, 0, 0], [0, -47, 0, 0, 0, 0, 0, 0, 0, -4, 374, 94, -4, -752, 90, -180], [0, -116, 0, 0, 0, 0, 0, 0, 0, -98, -82, 232, -98, 66, -24, 48], [0, 98, 0, 0, 0, 0, 0, 0, 0, 11, 471, 98, 0, -230, 53, 42], [273, 0, -69, -143, 100, 0, -323, 50, -119, 0, 0, 0, 0, 0, 0, 0], [-406, 0, -57, 118, 26, 59, 694, 26, -114, 0, 0, 0, 0, 0, 0, 0], [-163, 0, 73, 90, -73, 90, -592, -146, 16, 0, 0, 0, 0, 0, 0, 0], [0, -24, 0, 0, 0, 0, 0, 0, 0, 16, 864, 0, -16, 16, 8, 0], [0, 320, 0, 0, 0, 0, 0, 0, 0, 24, 24, -320, 48, -484, 94, -118], [440, 0, -101, -125, 0, -250, 96, 94, 7, 0, 0, 0, 0, 0, 0, 0], [170, 0, 4, 32, 145, 16, -372, 145, 8, 0, 0, 0, 0, 0, 0, 0], [0, -122, 0, 0, 0, 0, 0, 0, 0, -142, -370, -122, 0, 114, -135, 7], [0, 24, 0, 0, 0, 0, 0, 0, 0, 333, 273, -48, 333, -213, 136, -272], [4, 0, 250, 146, 54, -146, 44, 0, 98, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 98, 132, -113, 49, -83, 49, -30], [0, 0, 0, 0, 0, 0, 0, 0, 0, 226, -240, 219, 113, 353, 113, -318], [-220, 0, -7, -78, 72, -39, 518, 72, -14, 0, 0, 0, 0, 0, 0, 0], [0, 181, 0, 0, 0, 0, 0, 0, 0, -3, -3, -181, -6, -12, -190, 193], [0, -272, 0, 0, 0, 0, 0, 0, 0, 0, -370, 136, 119, -489, -159, 20], [0, -63, 0, 0, 0, 0, 0, 0, 0, 23, -147, 0, -23, 23, -11, 0], [-50, 0, 68, 0, 117, 204, 0, -117, 0, 0, 0, 0, 0, 0, 0, 0], [63, 0, -38, -25, 38, -25, -444, 76, 165, 0, 0, 0, 0, 0, 0, 0], [570, 0, 31, -51, -95, 51, -263, 0, 63, 0, 0, 0, 0, 0, 0, 0], [0, -67, 0, 0, 0, 0, 0, 0, 0, 109, 25, -67, 0, 42, 208, 99], [-161, 0, 111, -86, 0, -172, -148, -185, 74, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -418, -210, 78, -209, 1, -209, 318], [0, -114, 0, 0, 0, 0, 0, 0, 0, -28, -28, 114, -56, 952, -4, 32], [0, -51, 0, 0, 0, 0, 0, 0, 0, 87, 87, 51, 174, -418, 214, -301], [295, 0, 88, -125, -34, 125, -193, 0, 61, 0, 0, 0, 0, 0, 0, 0], [0, 24, 0, 0, 0, 0, 0, 0, 0, 41, -257, 0, -41, 41, -90, 0], [0, -143, 0, 0, 0, 0, 0, 0, 0, -52, -48, 286, -52, 44, -110, 220], [468, 0, -237, 65, 204, 0, -570, 102, -339, 0, 0, 0, 0, 0, 0, 0], [0, 17, 0, 0, 0, 0, 0, 0, 0, 97, 45, -34, 97, 7, -105, 210]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_525_s_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_525_3_s_h();".
// 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_525_3_s_h(:prec:=16)
    chi := MakeCharacter_525_s();
    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_525_3_s_h();".
// 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_525_3_s_h( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_525_s();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<2,R![10000, 0, -28000, 0, 64300, 0, -35080, 0, 13621, 0, -2542, 0, 343, 0, -22, 0, 1]>,<11,R![196, -4340, 96982, 18970, 10183, -1880, 337, -20, 1]>,<13,R![1230957225, 0, -47028060, 0, 420414, 0, -1164, 0, 1]>],Snew);
    return Vf;
end function;