
// Make newform 1050.3.f.c in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1050_f();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1050_f_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_1050_3_f_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_1050_3_f_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 := [69739201, -8701742, 21002899, 4021754, 4765612, 442438, 229961, 1474, 7600, 14, 103, -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], [-43640716670021836400283934, -318802697202801394837807, -27765130373466532370125, -1635592998788363776126285, -36430399774596190914310, -24193492971107383597753, 1923228388418524380623, -876689117601446842783, 10019123877835491302, -6083651291835521143, 392128266733045979, -123263485324786117], [-1838092903954916334438895, -587388760026044469925040, -904631032972096968422224, -178759842954027859325680, -48009258941143298532488, -5339499743496833485408, -1361584676095656827128, -182261081586826460528, -18454165661498903902, -2083185333447793936, -134114608273836392, -24280460053617088], [151002372998714947812646496505, -20929296682707593633327271992, -35335846019660968629987877022, -3753254696646455950781278656, -2390725121378167281451853993, 223776682672204235096323516, -115764395641859048152726716, 6989856336202081755196606, -1691949821640399306610901, 137965359060520615834218, -19661721884260722084800, 870434615881970501662], [2230068709179416, -42759904104131991, -4615659330484469, -5530500971596237, -480510667159236, -255131073706781, -2045621186539, -7700992137321, -19016500460, -103184081077, 2012568579, -958718783], [5658330747746351878, -1012034368291331301, -180817370957826635, -1555747296135356705, -140179083439640610, -81498625698911219, 246516127760419, -2891227107455349, 602434788466, -39749913778739, 851720091837, -397109320631], [-82177159186569453925937146247, 26804283133536654346546614466, 36238170969129129588544665232, 15859452697935593694875889196, 3165481303312438061806001293, 241865969125713739141124170, 109652132417521385473933360, 9622073376860387200747180, 1638844517269036590365857, 81145718752682366682358, 14092435823463248208082, 1425595836696379005232], [51081160874206482645502640890, 4657181835408061333061384984, 22637224673600899779077464483, 3494795868521851591438683226, 1462452102116231762072350358, 71780391763685510164526380, 42468146586181866049029865, 3106794269092375834407416, 594082871930616765858982, 31703744785534734998446, 4581533870192141943359, 479599577738276162044], [-301535343855974745875761142929, -34095696438471300916231012624, -33997940579994499818015511497, -12185598879260007507946308796, -3237621847048438120387772353, -649487792104519501263103812, -31011757701529485245679823, -26316498220073314131955402, -441638830945824481698849, -373771122968762467485370, 7071227722139188880729, -4064494901406269284530], [-125559989500555004928761983118, 279054187041523986390662976003, -12786422963717956367807939263, 29466418332641001110672152321, -1312860206232351853413466992, 1594353621457658439998973233, -107758569547000015016723303, 44569375117050885957261333, -1689480727374246126148660, 614650049165745341243881, -24909673939090560254427, 4996870264807970033459], [-37695005600102966351655342469, -41638296250866175510856043243, 10211156922368773869357314209, 35499390944691116110191991892, 5106708557942875782332028921, 2091465168597897250415570425, -16676233201020924642674755, 82032580996509421249270200, -160552294436965630401311, 1167950433688588177255661, -31661184705508755023301, 12114535344353879769274], [131065364304835669887379586707, -108185608722019779219114798960, 4047185815529059934062126334, -49625100550412998623053677493, -2595294633816151227096427689, -2977379569085116114114088218, 119795238669744901527476458, -101398587879224661405233373, 1806872436070400365299251, -1438248795267909007122842, 48630342634658011184448, -13638743814637698305053]];
    Rf_basisdens := [1, 25222592752147257350534910, 1582880229001140348195063, 30090553153311678019188147630, 27944424384218370, 9027254980906654590, 30090553153311678019188147630, 6018110630662335603837629526, 30090553153311678019188147630, 30090553153311678019188147630, 30090553153311678019188147630, 30090553153311678019188147630];
    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_1050_f();"
function MakeCharacter_1050_f()
    N := 1050;
    order := 2;
    char_gens := [701, 127, 451];
    v := [2, 2, 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_1050_f_Hecke();"
function MakeCharacter_1050_f_Hecke(Kf)
    N := 1050;
    order := 2;
    char_gens := [701, 127, 451];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 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 := 3;
    raw_aps := [[0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, -2, 1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 1, 1], [0, 0, 2, -1, 1, 0, 0, -1, -1, 0, 1, 1], [0, 0, -4, 0, 1, 0, 0, -1, 0, -1, 0, 0], [-1, 2, 0, 0, 0, 4, -1, 0, -1, 0, 0, 0], [3, 4, 0, 2, 0, 5, 1, 0, -1, 0, -1, 1], [0, 0, 8, -1, 4, 0, 0, 0, -1, -2, 2, 2], [5, -2, 0, -1, 0, -2, 0, 0, 1, 0, 2, -2], [0, 0, 0, -2, -2, 0, 0, 2, -2, -2, 2, 2], [-10, 3, 0, 1, 0, 6, 3, 0, 2, 0, 1, -1], [0, 0, -6, 1, -5, 0, 0, 3, 1, 3, -2, -2], [14, 4, 0, 6, 0, -16, 4, 0, -2, 0, -2, 2], [0, 0, 2, 5, -13, 0, 0, -1, 5, -1, -2, -2], [0, 0, -12, -3, -16, 0, 0, 4, -3, -2, 0, 0], [-2, -3, 0, -3, 0, 22, -5, 0, -2, 0, 3, -3], [23, 2, 0, 6, 0, 0, 7, 0, 1, 0, -4, 4], [0, 0, 16, 1, -21, 0, 0, -3, 1, -4, 5, 5], [-18, -1, 0, 2, 0, -6, 1, 0, -1, 0, 1, -1], [0, 0, -20, 2, 4, 0, 0, 0, 2, -6, -2, -2], [0, 0, -18, -1, 23, 0, 0, -3, -1, 0, 5, 5], [0, 0, 16, -13, 24, 0, 0, 4, -13, 8, 2, 2], [0, 0, 30, -1, 7, 0, 0, 1, -1, -6, 1, 1], [0, 0, 8, 3, 7, 0, 0, 5, 3, -3, 4, 4], [54, -10, 0, -8, 0, -26, -4, 0, 4, 0, -2, 2], [-21, 6, 0, 8, 0, 58, 4, 0, -4, 0, 0, 0], [9, -4, 0, 8, 0, -31, 3, 0, -5, 0, -7, 7], [-60, -13, 0, 0, 0, -18, 1, 0, 1, 0, 1, -1], [0, 0, -18, 3, -33, 0, 0, -1, 3, -5, 4, 4], [28, -8, 0, -4, 0, 16, 6, 0, 10, 0, -4, 4], [0, 0, 8, -1, -25, 0, 0, 1, -1, -1, 10, 10], [-43, 12, 0, -4, 0, -69, -3, 0, 1, 0, -1, 1], [40, 3, 0, -1, 0, 26, -1, 0, 0, 0, -7, 7], [0, 0, -12, 9, -34, 0, 0, 14, 9, 0, -4, -4], [34, -16, 0, -9, 0, 0, 4, 0, 13, 0, 8, -8], [0, 0, 54, 9, 29, 0, 0, 13, 9, -3, -4, -4], [0, 0, -14, -17, -3, 0, 0, 3, -17, 0, -3, -3], [110, 6, 0, -2, 0, 78, 0, 0, 2, 0, -4, 4], [0, 0, -100, -14, 43, 0, 0, 5, -14, 2, -3, -3], [10, 10, 0, -10, 0, -38, -12, 0, -2, 0, 14, -14], [23, -6, 0, 4, 0, -62, 4, 0, 0, 0, 8, -8], [49, -8, 0, -24, 0, 39, -7, 0, 17, 0, 7, -7], [0, 0, 64, -7, 10, 0, 0, -6, -7, 0, 10, 10], [12, -8, 0, -9, 0, 12, -4, 0, 5, 0, -4, 4], [0, 0, -36, -6, 5, 0, 0, 15, -6, 5, 10, 10], [0, 0, -14, 3, -37, 0, 0, 15, 3, 3, -4, -4], [0, 0, -24, 11, 64, 0, 0, 0, 11, 2, 0, 0], [-145, 4, 0, 2, 0, 59, -5, 0, -7, 0, 1, -1], [-90, -14, 0, -12, 0, 42, -4, 0, 8, 0, -6, 6], [0, 0, 108, 12, -9, 0, 0, 5, 12, 4, -17, -17], [0, 0, -98, 1, 61, 0, 0, 9, 1, 11, 0, 0], [0, 0, 36, 4, -100, 0, 0, -8, 4, -8, 12, 12], [143, -20, 0, -14, 0, -50, -15, 0, -1, 0, 0, 0], [0, 0, 108, 4, 26, 0, 0, -14, 4, 4, 0, 0], [0, 0, -76, 15, -65, 0, 0, -3, 15, 7, -22, -22], [76, 0, 0, 11, 0, 128, -4, 0, -15, 0, -2, 2], [99, -32, 0, -6, 0, -23, -15, 0, -9, 0, 7, -7], [0, 0, 44, -3, 2, 0, 0, 10, -3, 12, 14, 14], [0, 0, -122, -9, 21, 0, 0, -17, -9, 4, -5, -5], [0, 0, 112, 0, 77, 0, 0, 7, 0, -11, 6, 6], [0, 0, 102, -15, -5, 0, 0, 11, -15, 21, 4, 4], [0, 0, 12, 4, -59, 0, 0, -17, 4, 14, 15, 15], [-145, 8, 0, 22, 0, -61, 27, 0, 5, 0, -17, 17], [-62, -31, 0, -48, 0, 66, -23, 0, 25, 0, 3, -3], [20, 28, 0, 9, 0, -116, 0, 0, -9, 0, 2, -2], [-7, 2, 0, -20, 0, -22, -3, 0, 17, 0, 4, -4], [0, 0, -68, 23, -63, 0, 0, -29, 23, 2, 5, 5], [0, 0, -12, 22, 12, 0, 0, -32, 22, 0, -18, -18], [-103, -18, 0, 6, 0, -102, 9, 0, 3, 0, 2, -2], [0, 0, 20, -19, -30, 0, 0, -18, -19, -18, 12, 12], [-69, 42, 0, 24, 0, 36, -6, 0, -30, 0, 10, -10], [-114, -5, 0, -15, 0, 10, -21, 0, -6, 0, 9, -9], [0, 0, -30, 17, -95, 0, 0, 13, 17, 3, -32, -32], [173, -4, 0, 18, 0, 63, -11, 0, -29, 0, 5, -5], [0, 0, -64, 37, -222, 0, 0, -2, 37, -4, -16, -16], [-27, -32, 0, 24, 0, -39, -1, 0, -25, 0, 3, -3], [0, 0, 160, 18, -3, 0, 0, -9, 18, 2, -1, -1], [0, 0, 32, -18, -78, 0, 0, 2, -18, -4, -4, -4], [165, 4, 0, -23, 0, 188, -8, 0, 15, 0, -6, 6], [-392, -6, 0, 22, 0, 40, -2, 0, -24, 0, -4, 4], [0, 0, -88, 21, 98, 0, 0, -26, 21, 2, 10, 10], [0, 0, -48, -16, 143, 0, 0, 25, -16, 3, 14, 14], [-226, -26, 0, 4, 0, -6, -4, 0, -8, 0, -16, 16], [-123, 28, 0, 54, 0, -1, 1, 0, -53, 0, -1, 1], [-103, 32, 0, 39, 0, 82, 26, 0, -13, 0, -4, 4], [0, 0, -182, -35, 89, 0, 0, 11, -35, -4, -23, -23], [-88, -42, 0, -18, 0, 208, -14, 0, 4, 0, 10, -10], [0, 0, -80, 16, -270, 0, 0, 10, 16, -10, -10, -10], [0, 0, 86, -49, 77, 0, 0, 45, -49, 7, 0, 0], [-126, 7, 0, 5, 0, 174, -1, 0, -6, 0, 5, -5], [-13, 46, 0, 38, 0, -44, 3, 0, -35, 0, 18, -18], [46, -4, 0, 13, 0, 236, 24, 0, 11, 0, -16, 16], [0, 0, -100, -54, 146, 0, 0, 30, -54, 26, 22, 22], [0, 0, -118, -25, 145, 0, 0, -21, -25, -16, 3, 3], [0, 0, 156, -18, -100, 0, 0, -32, -18, -18, -4, -4], [0, 0, 92, -9, -162, 0, 0, 30, -9, -12, 6, 6], [-189, 26, 0, 8, 0, 152, 18, 0, 10, 0, 6, -6], [-230, -41, 0, -2, 0, -238, -11, 0, -9, 0, 13, -13], [293, 12, 0, 26, 0, -163, 11, 0, -15, 0, 1, -1], [0, 0, -72, -28, 26, 0, 0, 54, -28, 0, -4, -4], [-49, 0, 0, 50, 0, -35, 1, 0, -49, 0, -9, 9], [-74, 77, 0, 1, 0, -182, -13, 0, -14, 0, 15, -15], [0, 0, 72, -44, -15, 0, 0, -13, -44, 42, 27, 27], [0, 0, 70, -5, 231, 0, 0, 15, -5, 21, -18, -18], [0, 0, 248, 40, -164, 0, 0, -20, 40, -24, 22, 22], [421, -32, 0, -6, 0, -236, -9, 0, -3, 0, -16, 16], [0, 0, 8, 57, 58, 0, 0, -2, 57, -18, 22, 22], [0, 0, -52, -17, -293, 0, 0, -15, -17, 17, 24, 24], [-35, 32, 0, 53, 0, -80, 8, 0, -45, 0, -18, 18], [37, -8, 0, 32, 0, 189, 23, 0, -9, 0, 7, -7], [0, 0, 208, -2, 101, 0, 0, 43, -2, -1, 4, 4], [134, 37, 0, 61, 0, 314, 31, 0, -30, 0, -13, 13], [-147, 32, 0, 66, 0, 131, 33, 0, -33, 0, -25, 25], [0, 0, -40, -4, 80, 0, 0, 32, -4, -28, -8, -8], [0, 0, 124, 68, -36, 0, 0, -12, 68, 22, -14, -14], [-406, 12, 0, 28, 0, -96, 36, 0, 8, 0, -4, 4], [-8, -26, 0, -28, 0, -148, 10, 0, 38, 0, 24, -24], [0, 0, 88, 51, -83, 0, 0, 15, 51, -28, -9, -9], [-90, 58, 0, 72, 0, 232, 102, 0, 30, 0, -42, 42], [0, 0, -212, -8, -246, 0, 0, -38, -8, 26, -10, -10], [595, -34, 0, 34, 0, 128, 39, 0, 5, 0, 6, -6], [0, 0, -60, 40, -168, 0, 0, -64, 40, -34, 38, 38], [-204, 20, 0, 20, 0, -400, 30, 0, 10, 0, -10, 10], [36, 44, 0, -63, 0, 340, -52, 0, 11, 0, 6, -6], [0, 0, -188, 12, 58, 0, 0, 102, 12, 16, -4, -4], [0, 0, -64, 6, 207, 0, 0, -27, 6, 15, -18, -18], [0, 0, 160, -4, -120, 0, 0, -48, -4, -8, -8, -8], [124, -37, 0, 44, 0, -434, 29, 0, -15, 0, -27, 27], [-74, 34, 0, 56, 0, -250, 28, 0, -28, 0, 0, 0], [368, 86, 0, 78, 0, 228, 22, 0, -56, 0, -2, 2], [-229, 60, 0, -16, 0, -298, -22, 0, -6, 0, -6, 6], [0, 0, 64, -30, -230, 0, 0, 30, -30, -20, 2, 2], [0, 0, 80, -39, -54, 0, 0, -30, -39, -8, 52, 52], [0, 0, -276, 30, -6, 0, 0, -66, 30, -42, 42, 42], [0, 0, 100, 60, -29, 0, 0, 33, 60, 9, -80, -80], [0, 0, -90, 35, 207, 0, 0, -15, 35, 32, 29, 29], [65, 48, 0, 44, 0, -119, 31, 0, -13, 0, 15, -15], [0, 0, 276, -33, 70, 0, 0, 30, -33, -6, -8, -8], [230, -4, 0, 48, 0, -188, 44, 0, -4, 0, -48, 48], [-274, 33, 0, 69, 0, -122, 67, 0, -2, 0, -77, 77], [-163, -32, 0, -66, 0, 192, -1, 0, 65, 0, 14, -14], [0, 0, 184, 53, 127, 0, 0, -3, 53, -32, -31, -31], [0, 0, 398, 25, -137, 0, 0, 3, 25, -17, 68, 68], [0, 0, -108, 55, -14, 0, 0, -50, 55, -4, -48, -48], [0, 0, 88, 6, -98, 0, 0, -6, 6, -14, -52, -52], [0, 0, -140, -4, 184, 0, 0, -60, -4, -38, 2, 2], [-493, 16, 0, 34, 0, 10, -27, 0, -61, 0, 18, -18], [324, -20, 0, 3, 0, 44, -20, 0, -23, 0, -30, 30], [0, 0, 160, -4, 204, 0, 0, 84, -4, -14, -26, -26], [-204, -45, 0, -57, 0, 386, -61, 0, -4, 0, -23, 23], [0, 0, -32, 24, -226, 0, 0, -14, 24, 20, 34, 34], [-232, -58, 0, 66, 0, -28, 66, 0, 0, 0, -54, 54], [-283, 24, 0, -8, 0, -256, -37, 0, -29, 0, -32, 32], [-184, -61, 0, 7, 0, 18, 31, 0, 24, 0, 13, -13], [0, 0, -58, -95, 239, 0, 0, -19, -95, 16, 39, 39], [0, 0, -272, -57, 142, 0, 0, -2, -57, 40, -28, -28], [0, 0, -24, 0, 126, 0, 0, -22, 0, -2, 52, 52], [-28, -54, 0, -50, 0, -4, 62, 0, 112, 0, -20, 20], [241, 44, 0, 36, 0, 45, -17, 0, -53, 0, 25, -25], [250, 58, 0, 32, 0, -636, 2, 0, -30, 0, -22, 22], [0, 0, -390, 21, -81, 0, 0, 31, 21, 23, -70, -70], [527, 64, 0, 20, 0, -41, -9, 0, -29, 0, 39, -39], [0, 0, -248, -100, 36, 0, 0, -8, -100, 48, 24, 24], [-152, 23, 0, 59, 0, -402, -41, 0, -100, 0, 9, -9], [0, 0, 392, 19, -55, 0, 0, -61, 19, -26, 9, 9], [-189, 36, 0, 48, 0, 296, -16, 0, -64, 0, -36, 36], [0, 0, 278, 49, -41, 0, 0, -43, 49, 26, 15, 15], [629, -6, 0, -48, 0, 174, 21, 0, 69, 0, 26, -26], [0, 0, 272, -32, 151, 0, 0, -3, -32, 38, 33, 33], [155, -28, 0, -44, 0, -70, 9, 0, 53, 0, 58, -58], [-452, -10, 0, -137, 0, -212, -82, 0, 55, 0, 24, -24], [0, 0, 164, -94, -13, 0, 0, 25, -94, 57, -16, -16], [0, 0, -90, -33, -157, 0, 0, -31, -33, 38, -29, -29], [-548, -23, 0, -89, 0, 906, -13, 0, 76, 0, 59, -59], [76, -76, 0, -88, 0, 0, -98, 0, -10, 0, 10, -10], [0, 0, 232, -62, 63, 0, 0, -15, -62, 33, -24, -24], [0, 0, -132, 95, 42, 0, 0, 18, 95, 28, -32, -32], [188, 17, 0, 19, 0, -122, -37, 0, -56, 0, 7, -7], [0, 0, 512, -32, 188, 0, 0, -56, -32, 50, 34, 34], [339, 46, 0, -12, 0, 472, -42, 0, -30, 0, -22, 22], [0, 0, -132, 30, -192, 0, 0, 56, 30, 4, -8, -8], [301, -66, 0, 4, 0, 314, -55, 0, -59, 0, 36, -36], [0, 0, 232, 30, -160, 0, 0, 12, 30, 42, 2, 2], [467, 44, 0, 36, 0, 214, 110, 0, 74, 0, -34, 34], [0, 0, -464, 45, -132, 0, 0, 68, 45, -24, -36, -36], [315, -70, 0, 80, 0, -124, 54, 0, -26, 0, -78, 78], [0, 0, -146, 3, 85, 0, 0, -55, 3, 11, -42, -42], [0, 0, 120, -11, 110, 0, 0, -22, -11, 8, -32, -32], [139, -186, 0, -38, 0, -160, 23, 0, 61, 0, 0, 0], [-306, -85, 0, 65, 0, 206, -33, 0, -98, 0, 25, -25], [0, 0, 288, 94, -212, 0, 0, 72, 94, 30, -92, -92], [-195, -184, 0, -116, 0, 60, -41, 0, 75, 0, 6, -6], [0, 0, -392, -28, -118, 0, 0, -2, -28, 10, 72, 72], [253, -32, 0, -21, 0, -570, 14, 0, 35, 0, 60, -60], [341, -120, 0, -23, 0, 468, -60, 0, -37, 0, -30, 30], [0, 0, -98, -3, 31, 0, 0, -27, -3, -86, 35, 35], [0, 0, 164, 78, 124, 0, 0, 8, 78, -68, 26, 26], [-30, -28, 0, -14, 0, 76, -28, 0, -14, 0, -26, 26], [0, 0, 668, -12, 172, 0, 0, -8, -12, 28, -4, -4], [0, 0, -360, 4, 132, 0, 0, 56, 4, 58, 10, 10], [0, 0, 292, 30, -146, 0, 0, -58, 30, 12, -38, -38], [0, 0, 128, 8, 236, 0, 0, -24, 8, 52, 48, 48], [0, 0, 352, -82, 60, 0, 0, 52, -82, -18, 12, 12], [0, 0, -392, -237, 212, 0, 0, 20, -237, 26, 70, 70], [-774, -146, 0, -58, 0, 158, -68, 0, -10, 0, 62, -62], [-441, 0, 0, 70, 0, -145, 35, 0, -35, 0, 35, -35], [0, 0, -52, -3, 244, 0, 0, -92, -3, 2, 42, 42], [-33, -36, 0, -76, 0, -524, -68, 0, 8, 0, 32, -32], [0, 0, 178, 71, -263, 0, 0, 51, 71, 18, -71, -71], [448, 23, 0, -49, 0, 706, -61, 0, -12, 0, -11, 11], [0, 0, -84, -24, 40, 0, 0, 84, -24, -76, -96, -96], [0, 0, 154, 65, -57, 0, 0, 115, 65, 15, -78, -78], [0, 0, 36, 85, 51, 0, 0, 41, 85, 46, -29, -29], [-1182, 87, 0, -55, 0, 422, -13, 0, 42, 0, 49, -49], [0, 0, -122, -57, 217, 0, 0, 59, -57, 50, -33, -33], [-343, 94, 0, 146, 0, 214, 105, 0, -41, 0, -114, 114], [1077, -16, 0, -128, 0, -589, 9, 0, 137, 0, 53, -53], [151, -128, 0, -24, 0, 126, -22, 0, 2, 0, -30, 30], [0, 0, 444, 86, 57, 0, 0, -65, 86, -43, -46, -46], [483, 60, 0, 160, 0, -405, 63, 0, -97, 0, -57, 57], [500, -23, 0, 46, 0, 622, 105, 0, 59, 0, -37, 37], [0, 0, -2, -35, -123, 0, 0, 137, -35, 19, 46, 46], [624, -76, 0, -103, 0, 536, 36, 0, 139, 0, 22, -22], [0, 0, 138, 7, 293, 0, 0, 55, 7, 88, -99, -99], [977, -42, 0, -96, 0, 418, 1, 0, 97, 0, 36, -36], [0, 0, -44, -62, 253, 0, 0, -69, -62, -1, 12, 12], [-665, 30, 0, -100, 0, -508, -37, 0, 63, 0, -36, 36], [-337, -46, 0, 136, 0, -694, 72, 0, -64, 0, -48, 48], [0, 0, 264, -46, -302, 0, 0, -78, -46, -50, -4, -4], [-418, 48, 0, -11, 0, 1108, 4, 0, 15, 0, 44, -44], [-149, 16, 0, 68, 0, 519, 35, 0, -33, 0, 19, -19], [0, 0, 232, 97, -19, 0, 0, 75, 97, 71, -68, -68], [0, 0, 52, -20, 60, 0, 0, 16, -20, 86, -94, -94], [0, 0, -308, 126, -46, 0, 0, 50, 126, -18, -52, -52], [-511, 20, 0, -80, 0, -303, -17, 0, 63, 0, -1, 1], [-7, 130, 0, 60, 0, -62, 81, 0, 21, 0, -60, 60], [0, 0, 488, 178, -106, 0, 0, 2, 178, -32, -24, -24], [241, 68, 0, 28, 0, 324, 43, 0, 15, 0, -74, 74], [0, 0, -340, -54, 123, 0, 0, 113, -54, -25, -34, -34], [0, 0, -464, 19, 36, 0, 0, -88, 19, -52, 44, 44], [643, 120, 0, 60, 0, -318, -42, 0, -102, 0, -6, 6], [0, 0, -218, -23, 3, 0, 0, -3, -23, -30, 63, 63], [0, 0, -590, -61, -179, 0, 0, 41, -61, 49, 86, 86], [0, 0, -160, 143, -186, 0, 0, -78, 143, -64, -10, -10], [0, 0, 4, 96, 2, 0, 0, 138, 96, 0, -52, -52], [-338, 172, 0, -49, 0, 48, -76, 0, -27, 0, 92, -92], [864, 2, 0, 26, 0, -452, -82, 0, -108, 0, -38, 38], [646, -142, 0, -164, 0, -460, -30, 0, 134, 0, 62, -62], [0, 0, 388, -144, 494, 0, 0, -58, -144, -56, 72, 72], [-870, 134, 0, 136, 0, 70, 56, 0, -80, 0, 64, -64], [0, 0, 32, 64, 335, 0, 0, -27, 64, -24, 23, 23], [0, 0, -346, 93, 15, 0, 0, 53, 93, 38, -67, -67], [422, 42, 0, -44, 0, 294, -72, 0, -28, 0, -16, 16], [339, 16, 0, 48, 0, -840, 20, 0, -28, 0, -8, 8], [0, 0, 180, -97, 119, 0, 0, 145, -97, 89, -32, -32], [0, 0, 138, -109, -261, 0, 0, 9, -109, 98, -103, -103], [0, 0, -324, 11, 429, 0, 0, 63, 11, 2, 41, 41], [-800, 140, 0, 29, 0, -560, -4, 0, -33, 0, 48, -48], [901, -98, 0, -52, 0, 46, -15, 0, 37, 0, -82, 82], [0, 0, 196, -10, 78, 0, 0, -42, -10, 8, 122, 122], [0, 0, -600, -85, -276, 0, 0, 72, -85, -44, 70, 70], [0, 0, -54, 37, -49, 0, 0, 49, 37, 70, -9, -9], [0, 0, -560, 142, -426, 0, 0, -142, 142, 22, -32, -32], [-319, -12, 0, -36, 0, -413, -155, 0, -119, 0, 27, -27], [0, 0, -246, -187, -271, 0, 0, 31, -187, 2, 1, 1], [650, 39, 0, 134, 0, 302, 113, 0, -21, 0, 5, -5], [63, 16, 0, -2, 0, 113, 61, 0, 63, 0, 17, -17], [0, 0, 512, 105, 220, 0, 0, -52, 105, -112, -90, -90], [-436, -174, 0, -86, 0, 728, -58, 0, 28, 0, 30, -30], [0, 0, 476, -98, 134, 0, 0, 26, -98, -50, 84, 84], [-706, -105, 0, -55, 0, -546, 99, 0, 154, 0, 1, -1], [0, 0, 544, 188, -363, 0, 0, 15, 188, 12, -51, -51], [0, 0, -76, 126, 19, 0, 0, -139, 126, 5, 24, 24], [-775, -180, 0, -116, 0, 316, -149, 0, -33, 0, 168, -168], [-176, -76, 0, 57, 0, 36, 136, 0, 79, 0, -78, 78], [-373, 44, 0, 112, 0, -170, 122, 0, 10, 0, -10, 10], [0, 0, -454, 87, 31, 0, 0, 119, 87, -77, 14, 14], [0, 0, -326, 175, 111, 0, 0, -53, 175, -67, 14, 14], [-374, -62, 0, -56, 0, -1260, 2, 0, 58, 0, -22, 22], [0, 0, -506, 91, -395, 0, 0, -119, 91, 31, -154, -154], [0, 0, -500, 58, -309, 0, 0, 57, 58, -42, -3, -3], [0, 0, 160, -14, 441, 0, 0, -25, -14, -59, 82, 82], [829, 30, 0, 80, 0, 254, 185, 0, 105, 0, -48, 48], [503, 166, 0, 76, 0, -330, -52, 0, -128, 0, 28, -28], [581, -12, 0, 14, 0, 1015, -23, 0, -37, 0, 153, -153], [0, 0, 716, 112, 152, 0, 0, 28, 112, -38, 66, 66], [0, 0, -296, -110, 114, 0, 0, 106, -110, -34, -70, -70], [977, 36, 0, -22, 0, 1169, -13, 0, 9, 0, -59, 59], [0, 0, 80, -104, 116, 0, 0, 20, -104, -14, 42, 42], [-29, -64, 0, -108, 0, 153, 73, 0, 181, 0, 13, -13], [0, 0, 326, 37, 85, 0, 0, 49, 37, -87, 154, 154], [-1057, -178, 0, -176, 0, 692, -102, 0, 74, 0, 122, -122], [0, 0, -150, -111, 73, 0, 0, -45, -111, -22, -57, -57], [0, 0, -756, -21, 654, 0, 0, -110, -21, -62, 100, 100], [0, 0, -478, 229, -323, 0, 0, 75, 229, -98, -61, -61], [0, 0, -244, 202, -328, 0, 0, -156, 202, -132, 14, 14], [0, 0, 256, 26, -538, 0, 0, 50, 26, 82, 24, 24], [0, 0, 648, 1, -33, 0, 0, 97, 1, -86, 31, 31], [-954, -64, 0, -10, 0, 36, -20, 0, -10, 0, 24, -24], [-452, 45, 0, 135, 0, -222, 75, 0, -60, 0, -1, 1]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1050_f_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1050_3_f_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_1050_3_f_c(:prec:=12)
    chi := MakeCharacter_1050_f();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    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_1050_3_f_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_1050_3_f_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1050_f();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![1141308, 422940, 27217, -4780, -462, 8, 1]>,<23,R![-14928228, -1942260, 320689, 7740, -1294, 0, 1]>],Snew);
    return Vf;
end function;