
// Make newform 1050.3.q.b in Magma, downloaded from the LMFDB on 10 May 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1050_q();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1050_q_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_q_b();".
// 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_q_b();".
// 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 := [6561, 0, 0, 0, -2511, 0, 0, 0, 880, 0, 0, 0, -31, 0, 0, 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, 0, 32689, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [11129, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [-77841, 0, 0, 0, 27280, 0, 0, 0, -880, 0, 0, 0, 31, 0, 0, 0], [-2006289, 0, 0, 0, 703120, 0, 0, 0, -27280, 0, 0, 0, 799, 0, 0, 0], [0, 0, 16849, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0], [0, -318897, 0, -169461, 0, 111760, 0, 0, 0, -4180, 0, 0, 0, 127, 0, -9], [0, -318897, 0, 169461, 0, 111760, 0, 0, 0, -4180, 0, 0, 0, 127, 0, 9], [0, -77841, 0, -74307, 0, 27280, 0, 0, 0, -880, 0, 0, 0, 31, 0, -3], [0, 0, -6561, 0, 0, 0, 25498, 0, 0, 0, -880, 0, 0, 0, 31, 0], [0, 77841, 0, -74307, 0, -27280, 0, 0, 0, 880, 0, 0, 0, -31, 0, -3], [0, 1121931, 0, -6737013, 0, -4023360, 0, 2361040, 0, 150480, 0, -85360, 0, -5301, 0, 2683], [0, 10358361, 0, -636417, 0, 0, 0, 2361040, 0, 0, 0, -85360, 0, 729, 0, 3007], [0, 0, -1509111, 0, 0, 0, 528880, 0, 0, 0, -19360, 0, 0, 0, 601, 0], [0, -787320, 0, 2910249, 0, 3059760, 0, -1019920, 0, -105600, 0, 35200, 0, 3720, 0, -1159], [0, 7943427, 0, -262440, 0, 0, 0, 1019920, 0, 0, 0, -35200, 0, 243, 0, 1240]];
    Rf_basisdens := [1, 55440, 3080, 71280, 498960, 7920, 374220, 374220, 71280, 112266, 71280, 13471920, 13471920, 641520, 4490640, 4490640];
    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_q();"
function MakeCharacter_1050_q()
    N := 1050;
    order := 6;
    char_gens := [701, 127, 451];
    v := [6, 3, 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_q_Hecke();"
function MakeCharacter_1050_q_Hecke(Kf)
    N := 1050;
    order := 6;
    char_gens := [701, 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, -1, 0, 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, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0], [0, -1, 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, 0], [0, 0, 0, 0, 0, 0, 0, -2, -2, 0, 0, 0, 0, 0, 0, 1], [-1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, -1, 0, -1, 0], [0, -2, -2, 0, 0, 0, 0, 4, 2, 1, 0, 6, 0, 0, 0, 0], [0, 2, -5, 0, -5, 0, 0, -1, 0, 2, 0, -2, 0, 0, 0, -3], [-12, 0, 0, -6, 0, 2, 8, 0, 0, 0, 0, 0, -7, 0, -1, 0], [0, 15, -2, 0, -1, 0, 0, 0, 2, 0, 0, -5, 0, 0, 0, -2], [3, 0, 0, 0, 0, 1, -7, 0, 0, 0, -4, 0, 4, -1, -8, 0], [8, 0, 0, -8, 0, 0, -8, 0, 0, 0, -2, 0, -4, 4, -2, 0], [0, 6, -10, 0, -5, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0], [-1, 0, 0, -2, 0, 8, 6, 0, 0, 0, -7, 0, 5, 8, 0, 0], [0, 0, -4, 0, -8, 0, 0, -10, 8, -14, 0, 8, 0, 0, 0, 16], [0, 7, 0, 0, -10, 0, 0, -10, -13, -14, 0, -5, 0, 0, 0, -13], [0, -11, -2, 0, 2, 0, 0, 4, 18, 11, 0, -5, 0, 0, 0, 9], [-26, 0, 0, 26, 0, 0, 24, 0, 0, 0, -21, 0, 12, -5, -21, 0], [-34, 0, 0, -17, 0, -10, 2, 0, 0, 0, 0, 0, 8, 0, -10, 0], [0, 30, 0, 0, 0, 0, 0, -21, -6, -30, 0, -18, 0, 0, 0, -3], [-8, 0, 0, 0, 0, -12, -4, 0, 0, 0, 4, 0, -4, 12, 8, 0], [0, 7, -24, 0, -24, 0, 0, 0, 0, 7, 0, -10, 0, 0, 0, -10], [0, 0, 0, -36, 0, -12, 7, 0, 0, 0, -2, 0, 6, -24, -1, 0], [0, 32, 1, 0, 0, 0, 0, 20, 7, -16, 0, 33, 0, 0, 0, 0], [56, 0, 0, 28, 0, 1, 21, 0, 0, 0, 0, 0, -10, 0, -11, 0], [0, -48, 3, 0, 0, 0, 0, 0, -26, 24, 0, 26, 0, 0, 0, 0], [-16, 0, 0, 16, 0, 0, 10, 0, 0, 0, -7, 0, 5, 37, -7, 0], [0, 60, 0, 0, -8, 0, 0, 20, 13, -120, 0, 10, 0, 0, 0, 13], [0, 33, -12, 0, -6, 0, 0, 0, -9, 0, 0, -7, 0, 0, 0, 9], [0, 0, 0, 0, 0, -10, 0, 0, 0, 0, -18, 0, -16, -5, 18, 0], [0, 0, -13, 0, -26, 0, 0, -51, -28, 19, 0, -28, 0, 0, 0, -56], [0, 0, -2, 0, -4, 0, 0, 78, 1, -26, 0, 1, 0, 0, 0, 2], [-88, 0, 0, -44, 0, -6, -20, 0, 0, 0, 0, 0, -32, 0, 52, 0], [0, -5, -3, 0, 3, 0, 0, -55, -28, 5, 0, -41, 0, 0, 0, -14], [32, 0, 0, 64, 0, -10, 67, 0, 0, 0, -37, 0, 97, -10, 0, 0], [0, 0, 0, 27, 0, 8, 80, 0, 0, 0, -26, 0, 67, 16, -13, 0], [138, 0, 0, 138, 0, -8, 0, 0, 0, 0, -17, 0, 43, -4, 17, 0], [0, 38, 5, 0, 5, 0, 0, -6, 0, 38, 0, 40, 0, 0, 0, 34], [0, 60, -60, 0, -30, 0, 0, 0, -9, 0, 0, -23, 0, 0, 0, 9], [0, -50, -14, 0, 0, 0, 0, -11, -13, 25, 0, -9, 0, 0, 0, 0], [0, 23, 0, 0, 9, 0, 0, -158, -26, -46, 0, -79, 0, 0, 0, -26], [-65, 0, 0, -65, 0, 2, 0, 0, 0, 0, 14, 0, 61, 1, -14, 0], [13, 0, 0, 26, 0, -31, -20, 0, 0, 0, -16, 0, -56, -31, 0, 0], [0, 0, 0, -94, 0, 5, 176, 0, 0, 0, -42, 0, 155, 10, -21, 0], [0, 39, -19, 0, 19, 0, 0, -36, -8, -39, 0, -32, 0, 0, 0, -4], [0, 0, -10, 0, -20, 0, 0, 148, 2, 28, 0, 2, 0, 0, 0, 4], [26, 0, 0, -26, 0, 0, -62, 0, 0, 0, -7, 0, -31, -40, -7, 0], [100, 0, 0, 0, 0, 28, 60, 0, 0, 0, 3, 0, -3, -28, 6, 0], [0, -68, -52, 0, 0, 0, 0, 77, -3, 34, 0, 157, 0, 0, 0, 0], [0, 37, -13, 0, -13, 0, 0, -85, 0, 37, 0, 97, 0, 0, 0, 12], [72, 0, 0, 36, 0, -7, 44, 0, 0, 0, 0, 0, -72, 0, 28, 0], [0, 91, 48, 0, 24, 0, 0, 0, 35, 0, 0, -66, 0, 0, 0, -35], [-85, 0, 0, 0, 0, -11, 73, 0, 0, 0, -26, 0, 26, 11, -52, 0], [4, 0, 0, -4, 0, 0, 12, 0, 0, 0, -22, 0, 6, -75, -22, 0], [24, 0, 0, 48, 0, -1, -34, 0, 0, 0, -77, 0, -145, -1, 0, 0], [0, 167, 0, 0, 22, 0, 0, -56, -9, -334, 0, -28, 0, 0, 0, -9], [0, -245, 17, 0, -17, 0, 0, 187, 36, 245, 0, 169, 0, 0, 0, 18], [40, 0, 0, -40, 0, 0, -118, 0, 0, 0, 33, 0, -59, 25, 33, 0], [-108, 0, 0, -54, 0, 46, 9, 0, 0, 0, 0, 0, 27, 0, -36, 0], [0, -162, 31, 0, -31, 0, 0, -276, -76, 162, 0, -238, 0, 0, 0, -38], [159, 0, 0, 0, 0, 30, 130, 0, 0, 0, 21, 0, -21, -30, 42, 0], [0, 28, -38, 0, -38, 0, 0, 29, 0, 28, 0, 14, 0, 0, 0, 43], [0, -80, 60, 0, 0, 0, 0, 62, 64, 40, 0, 60, 0, 0, 0, 0], [0, -32, 70, 0, 0, 0, 0, -56, -82, 16, 0, -30, 0, 0, 0, 0], [-44, 0, 0, 44, 0, 0, -104, 0, 0, 0, -34, 0, -52, -68, -34, 0], [0, 165, 0, 0, 25, 0, 0, -112, -42, -330, 0, -56, 0, 0, 0, -42], [0, 61, 54, 0, 27, 0, 0, 0, 6, 0, 0, 35, 0, 0, 0, -6], [0, 0, 0, -144, 0, -48, -76, 0, 0, 0, -70, 0, -111, -96, -35, 0], [0, 0, 53, 0, 106, 0, 0, 156, -14, 13, 0, -14, 0, 0, 0, -28], [0, -250, -37, 0, 37, 0, 0, -92, 86, 250, 0, -135, 0, 0, 0, 43], [-67, 0, 0, -134, 0, -51, 8, 0, 0, 0, 38, 0, 54, -51, 0, 0], [0, 104, 69, 0, 69, 0, 0, -27, 0, 104, 0, -42, 0, 0, 0, -69], [0, 0, 0, -203, 0, 26, 13, 0, 0, 0, -26, 0, 0, 52, -13, 0], [0, -62, 54, 0, 54, 0, 0, -205, 0, -62, 0, 117, 0, 0, 0, -88], [0, -132, -58, 0, -29, 0, 0, 0, 34, 0, 0, 62, 0, 0, 0, -34], [-54, 0, 0, 0, 0, -26, 169, 0, 0, 0, -75, 0, 75, 26, -150, 0], [0, 47, 0, 0, -41, 0, 0, 62, 166, -94, 0, 31, 0, 0, 0, 166], [-227, 0, 0, -227, 0, 96, 0, 0, 0, 0, -35, 0, 210, 48, 35, 0], [0, 3, 0, 0, 51, 0, 0, 284, -6, -6, 0, 142, 0, 0, 0, -6], [0, 0, 0, -332, 0, -19, -23, 0, 0, 0, -6, 0, -26, -38, -3, 0], [-31, 0, 0, 31, 0, 0, -272, 0, 0, 0, -48, 0, -136, 30, -48, 0], [225, 0, 0, 450, 0, 18, -15, 0, 0, 0, 71, 0, 41, 18, 0, 0], [-38, 0, 0, 0, 0, 19, 226, 0, 0, 0, 0, 0, 0, -19, 0, 0], [-83, 0, 0, -83, 0, -6, 0, 0, 0, 0, -78, 0, -75, -3, 78, 0], [0, 10, -19, 0, 0, 0, 0, 20, 10, -5, 0, 30, 0, 0, 0, 0], [312, 0, 0, 156, 0, 16, 8, 0, 0, 0, 0, 0, 35, 0, -43, 0], [0, 76, 40, 0, 20, 0, 0, 0, -70, 0, 0, 318, 0, 0, 0, 70], [-260, 0, 0, 0, 0, -33, 291, 0, 0, 0, 31, 0, -31, 33, 62, 0], [0, 312, 10, 0, 5, 0, 0, 0, 4, 0, 0, -318, 0, 0, 0, -4], [215, 0, 0, 430, 0, 25, 133, 0, 0, 0, -4, 0, 262, 25, 0, 0], [0, 0, -24, 0, -48, 0, 0, 115, 5, 250, 0, 5, 0, 0, 0, 10], [0, -17, 0, 0, -15, 0, 0, 202, 132, 34, 0, 101, 0, 0, 0, 132], [-114, 0, 0, 114, 0, 0, -224, 0, 0, 0, 89, 0, -112, 1, 89, 0], [0, -230, -44, 0, 44, 0, 0, -268, 56, 230, 0, -296, 0, 0, 0, 28], [384, 0, 0, 0, 0, -34, 180, 0, 0, 0, -56, 0, 56, 34, -112, 0], [0, 0, 0, -228, 0, 6, 160, 0, 0, 0, -190, 0, 65, 12, -95, 0], [0, 148, -22, 0, 0, 0, 0, -56, -24, -74, 0, -88, 0, 0, 0, 0], [24, 0, 0, 12, 0, -10, 20, 0, 0, 0, 0, 0, -90, 0, 70, 0], [10, 0, 0, -10, 0, 0, -540, 0, 0, 0, 160, 0, -270, 32, 160, 0], [0, 170, 0, 0, 0, 0, 0, 376, -48, -340, 0, 188, 0, 0, 0, -48], [0, 0, 0, -113, 0, -4, -260, 0, 0, 0, 272, 0, -124, -8, 136, 0], [0, 0, -30, 0, -60, 0, 0, 141, -62, -74, 0, -62, 0, 0, 0, -124], [0, 263, 47, 0, -47, 0, 0, -177, 236, -263, 0, -295, 0, 0, 0, 118], [0, 287, -50, 0, -50, 0, 0, 193, 0, 287, 0, -42, 0, 0, 0, 151], [0, 0, 0, -56, 0, -1, -179, 0, 0, 0, 158, 0, -100, -2, 79, 0], [104, 0, 0, 104, 0, 16, 0, 0, 0, 0, 81, 0, 285, 8, -81, 0], [0, 70, -84, 0, -84, 0, 0, -124, 0, 70, 0, 204, 0, 0, 0, 80], [0, -192, 42, 0, 0, 0, 0, 16, 136, 96, 0, -104, 0, 0, 0, 0], [0, -225, 0, 0, 67, 0, 0, -22, -24, 450, 0, -11, 0, 0, 0, -24], [-200, 0, 0, -200, 0, -74, 0, 0, 0, 0, -3, 0, 360, -37, 3, 0], [-397, 0, 0, -794, 0, 86, 74, 0, 0, 0, -22, 0, 126, 86, 0, 0], [0, 182, 0, 0, -112, 0, 0, -26, -127, -364, 0, -13, 0, 0, 0, -127], [0, 135, 51, 0, -51, 0, 0, -52, -220, -135, 0, 58, 0, 0, 0, -110], [0, 0, -24, 0, -48, 0, 0, 278, 46, 162, 0, 46, 0, 0, 0, 92], [-8, 0, 0, 8, 0, 0, -556, 0, 0, 0, 0, 0, -278, -74, 0, 0], [60, 0, 0, 0, 0, -64, 167, 0, 0, 0, -17, 0, 17, 64, -34, 0], [-246, 0, 0, -246, 0, -4, 0, 0, 0, 0, -16, 0, 258, -2, 16, 0], [0, -728, 20, 0, 0, 0, 0, -103, -213, 364, 0, 7, 0, 0, 0, 0], [0, 4, -81, 0, -81, 0, 0, -258, 0, 4, 0, 131, 0, 0, 0, -127], [0, 344, -86, 0, -43, 0, 0, 0, 101, 0, 0, 137, 0, 0, 0, -101], [467, 0, 0, 0, 0, 62, 3, 0, 0, 0, 17, 0, -17, -62, 34, 0], [-126, 0, 0, 126, 0, 0, -32, 0, 0, 0, 72, 0, -16, 187, 72, 0], [0, 0, 6, 0, 12, 0, 0, -422, -90, -171, 0, -90, 0, 0, 0, -180], [0, -34, 0, 0, -108, 0, 0, 264, 192, 68, 0, 132, 0, 0, 0, 192], [0, 438, 39, 0, -39, 0, 0, 36, -62, -438, 0, 67, 0, 0, 0, -31], [-64, 0, 0, -32, 0, -108, -26, 0, 0, 0, 0, 0, 201, 0, -175, 0], [85, 0, 0, 0, 0, -34, -24, 0, 0, 0, 111, 0, -111, 34, 222, 0], [0, 0, 0, -478, 0, 9, 28, 0, 0, 0, 164, 0, 110, 18, 82, 0], [-762, 0, 0, -381, 0, 56, -11, 0, 0, 0, 0, 0, 62, 0, -51, 0], [0, -268, -132, 0, 0, 0, 0, 28, 213, 134, 0, -157, 0, 0, 0, 0], [0, -121, 0, 0, -120, 0, 0, 252, -76, 242, 0, 126, 0, 0, 0, -76], [-384, 0, 0, -384, 0, 148, 0, 0, 0, 0, 15, 0, -116, 74, -15, 0], [0, 0, -60, 0, -120, 0, 0, 192, 92, -446, 0, 92, 0, 0, 0, 184], [0, 0, 0, 304, 0, 88, -306, 0, 0, 0, -50, 0, -331, 176, -25, 0], [0, 0, -49, 0, -98, 0, 0, 10, 170, -496, 0, 170, 0, 0, 0, 340], [-546, 0, 0, -273, 0, -104, 326, 0, 0, 0, 0, 0, -467, 0, 141, 0], [243, 0, 0, 486, 0, 69, -112, 0, 0, 0, 300, 0, 76, 69, 0, 0], [0, -39, -69, 0, -69, 0, 0, 19, 0, -39, 0, -157, 0, 0, 0, -138], [0, 304, -2, 0, -2, 0, 0, -270, 0, 304, 0, 279, 0, 0, 0, 9], [0, -544, -204, 0, 0, 0, 0, -126, 206, 272, 0, -458, 0, 0, 0, 0], [140, 0, 0, 140, 0, -92, 0, 0, 0, 0, 104, 0, 336, -46, -104, 0], [-280, 0, 0, -560, 0, 242, 74, 0, 0, 0, 21, 0, 169, 242, 0, 0], [0, 0, 0, 69, 0, 8, -124, 0, 0, 0, 322, 0, 37, 16, 161, 0], [0, 232, -30, 0, 30, 0, 0, 494, 102, -232, 0, 443, 0, 0, 0, 51], [0, 0, 24, 0, 48, 0, 0, 48, 26, -726, 0, 26, 0, 0, 0, 52], [116, 0, 0, -116, 0, 0, -716, 0, 0, 0, 218, 0, -358, 143, 218, 0], [261, 0, 0, 522, 0, 55, -231, 0, 0, 0, 122, 0, -340, 55, 0, 0], [0, -272, 94, 0, 0, 0, 0, 30, 156, 136, 0, -96, 0, 0, 0, 0], [0, -105, -77, 0, -77, 0, 0, -221, 0, -105, 0, 35, 0, 0, 0, -186], [-476, 0, 0, -238, 0, -70, 246, 0, 0, 0, 0, 0, -52, 0, -194, 0], [0, -580, -130, 0, -65, 0, 0, 0, -75, 0, 0, 590, 0, 0, 0, 75], [0, 17, -8, 0, -4, 0, 0, 0, -106, 0, 0, -464, 0, 0, 0, 106], [-27, 0, 0, -54, 0, -63, 143, 0, 0, 0, -4, 0, 282, -63, 0, 0], [0, 0, -40, 0, -80, 0, 0, -290, 107, -92, 0, 107, 0, 0, 0, 214], [0, 234, 0, 0, 286, 0, 0, -344, -170, -468, 0, -172, 0, 0, 0, -170], [0, 268, -8, 0, 8, 0, 0, -214, 230, -268, 0, -329, 0, 0, 0, 115], [440, 0, 0, 0, 0, 80, -86, 0, 0, 0, 58, 0, -58, -80, 116, 0], [0, 0, 0, -648, 0, 100, 548, 0, 0, 0, -124, 0, 486, 200, -62, 0], [-442, 0, 0, -221, 0, 58, -48, 0, 0, 0, 0, 0, 263, 0, -215, 0], [0, -446, 17, 0, 0, 0, 0, -44, -328, 223, 0, 240, 0, 0, 0, 0], [-39, 0, 0, 39, 0, 0, -546, 0, 0, 0, 248, 0, -273, -135, 248, 0], [0, 311, 242, 0, 121, 0, 0, 0, -32, 0, 0, -109, 0, 0, 0, 32], [0, 0, 25, 0, 50, 0, 0, -333, -97, -828, 0, -97, 0, 0, 0, -194], [0, 0, -96, 0, -192, 0, 0, -53, -243, -486, 0, -243, 0, 0, 0, -486], [942, 0, 0, 471, 0, 18, 79, 0, 0, 0, 0, 0, 102, 0, -181, 0], [0, -375, -180, 0, 180, 0, 0, 174, 66, 375, 0, 141, 0, 0, 0, 33], [0, 404, -75, 0, -75, 0, 0, 312, 0, 404, 0, 41, 0, 0, 0, 353], [-184, 0, 0, -184, 0, 0, 0, 0, 0, 0, 130, 0, 211, 0, -130, 0], [0, -262, 5, 0, 5, 0, 0, -508, 0, -262, 0, 414, 0, 0, 0, -94], [-805, 0, 0, 0, 0, -71, -246, 0, 0, 0, -2, 0, 2, 71, -4, 0], [0, -249, 0, 0, -245, 0, 0, -838, -142, 498, 0, -419, 0, 0, 0, -142], [-367, 0, 0, -367, 0, 30, 0, 0, 0, 0, 214, 0, 247, 15, -214, 0], [-358, 0, 0, -716, 0, 35, -42, 0, 0, 0, 304, 0, 220, 35, 0, 0], [0, 0, 0, 481, 0, -92, 817, 0, 0, 0, -414, 0, 610, -184, -207, 0], [0, -236, 151, 0, -151, 0, 0, 288, -68, 236, 0, 322, 0, 0, 0, -34], [-186, 0, 0, 186, 0, 0, -352, 0, 0, 0, -173, 0, -176, 88, -173, 0], [290, 0, 0, 580, 0, -178, -60, 0, 0, 0, -184, 0, -304, -178, 0, 0], [-476, 0, 0, 0, 0, 46, 914, 0, 0, 0, -242, 0, 242, -46, -484, 0], [-967, 0, 0, -967, 0, 132, 0, 0, 0, 0, -61, 0, 194, 66, 61, 0], [0, -592, 252, 0, 0, 0, 0, 234, -19, 296, 0, 487, 0, 0, 0, 0], [-646, 0, 0, -323, 0, 9, -80, 0, 0, 0, 0, 0, -32, 0, 112, 0], [0, -718, -100, 0, -50, 0, 0, 0, 124, 0, 0, -492, 0, 0, 0, -124], [103, 0, 0, 206, 0, -41, -559, 0, 0, 0, 48, 0, -1070, -41, 0, 0], [0, 0, 193, 0, 386, 0, 0, -174, 44, -93, 0, 44, 0, 0, 0, 88], [0, -28, 0, 0, 9, 0, 0, -538, -115, 56, 0, -269, 0, 0, 0, -115], [0, -422, 73, 0, -73, 0, 0, -88, -174, 422, 0, -1, 0, 0, 0, -87], [-1, 0, 0, 1, 0, 0, 1044, 0, 0, 0, -393, 0, 522, 22, -393, 0], [0, 726, 93, 0, -93, 0, 0, 274, -136, -726, 0, 342, 0, 0, 0, -68], [0, 154, 378, 0, 378, 0, 0, -109, 0, 154, 0, -3, 0, 0, 0, -112], [0, 0, 0, -643, 0, 77, -16, 0, 0, 0, 320, 0, 144, 154, 160, 0], [246, 0, 0, -246, 0, 0, 260, 0, 0, 0, -61, 0, 130, -203, -61, 0], [0, -298, 0, 0, 125, 0, 0, 852, 26, 596, 0, 426, 0, 0, 0, 26], [0, 0, -27, 0, -54, 0, 0, -212, -77, -1604, 0, -77, 0, 0, 0, -154], [0, 0, 0, 694, 0, -112, -1186, 0, 0, 0, 482, 0, -945, -224, 241, 0], [518, 0, 0, 259, 0, 241, -73, 0, 0, 0, 0, 0, -243, 0, 316, 0], [0, -316, 20, 0, -20, 0, 0, -654, -168, 316, 0, -570, 0, 0, 0, -84], [0, -251, 25, 0, 25, 0, 0, -321, 0, -251, 0, -247, 0, 0, 0, -568], [202, 0, 0, 202, 0, 138, 0, 0, 0, 0, -198, 0, 74, 69, 198, 0], [0, -115, 250, 0, 125, 0, 0, 0, 236, 0, 0, -348, 0, 0, 0, -236], [0, -330, 446, 0, 0, 0, 0, -302, -75, 165, 0, -529, 0, 0, 0, 0], [0, -687, 0, 0, 277, 0, 0, -22, -50, 1374, 0, -11, 0, 0, 0, -50], [-948, 0, 0, -948, 0, -210, 0, 0, 0, 0, -99, 0, -575, -105, 99, 0], [196, 0, 0, 392, 0, -70, 528, 0, 0, 0, -457, 0, 599, -70, 0, 0], [0, 265, 0, 0, 321, 0, 0, 648, 94, -530, 0, 324, 0, 0, 0, 94], [553, 0, 0, -553, 0, 0, -220, 0, 0, 0, 232, 0, -110, -7, 232, 0], [866, 0, 0, 1732, 0, 47, -78, 0, 0, 0, -5, 0, -161, 47, 0, 0], [0, -417, 198, 0, 198, 0, 0, -78, 0, -417, 0, 235, 0, 0, 0, 157], [-864, 0, 0, -432, 0, -80, 176, 0, 0, 0, 0, 0, -511, 0, 335, 0], [0, 903, 84, 0, 42, 0, 0, 0, -75, 0, 0, -73, 0, 0, 0, 75], [-1086, 0, 0, 0, 0, 80, 276, 0, 0, 0, -34, 0, 34, -80, -68, 0], [212, 0, 0, -212, 0, 0, 542, 0, 0, 0, -77, 0, 271, -98, -77, 0], [0, -993, 16, 0, 8, 0, 0, 0, -150, 0, 0, 20, 0, 0, 0, 150], [-90, 0, 0, -180, 0, -301, -35, 0, 0, 0, -25, 0, -95, -301, 0, 0], [0, 0, 48, 0, 96, 0, 0, -370, -133, 354, 0, -133, 0, 0, 0, -266], [0, -207, 0, 0, -364, 0, 0, 346, -27, 414, 0, 173, 0, 0, 0, -27], [437, 0, 0, -437, 0, 0, 78, 0, 0, 0, 301, 0, 39, 30, 301, 0], [790, 0, 0, 395, 0, 102, -500, 0, 0, 0, 0, 0, 354, 0, 146, 0], [0, -116, 18, 0, -18, 0, 0, -111, -650, 116, 0, 214, 0, 0, 0, -325], [-194, 0, 0, 194, 0, 0, -1072, 0, 0, 0, 14, 0, -536, -146, 14, 0], [0, 87, 18, 0, 9, 0, 0, 0, -158, 0, 0, 559, 0, 0, 0, 158], [0, 0, 176, 0, 352, 0, 0, 86, 6, -904, 0, 6, 0, 0, 0, 12], [0, 0, 0, -277, 0, -39, -350, 0, 0, 0, -196, 0, -448, -78, -98, 0], [48, 0, 0, 96, 0, 102, -155, 0, 0, 0, -379, 0, -689, 102, 0, 0], [0, 0, 0, -326, 0, 20, 740, 0, 0, 0, -832, 0, 324, 40, -416, 0], [0, -388, 72, 0, 36, 0, 0, 0, -116, 0, 0, -172, 0, 0, 0, 116], [0, 60, -345, 0, 0, 0, 0, 44, -61, -30, 0, 149, 0, 0, 0, 0], [-673, 0, 0, 0, 0, -76, -304, 0, 0, 0, 48, 0, -48, 76, 96, 0], [0, -608, 0, 0, -136, 0, 0, -724, -114, 1216, 0, -362, 0, 0, 0, -114], [-515, 0, 0, -515, 0, 4, 0, 0, 0, 0, -177, 0, 51, 2, 177, 0], [0, -602, 0, 0, 140, 0, 0, -256, -376, 1204, 0, -128, 0, 0, 0, -376], [0, 0, 0, 1098, 0, 96, 362, 0, 0, 0, -376, 0, 174, 192, -188, 0], [0, 1207, -8, 0, 8, 0, 0, -840, -52, -1207, 0, -814, 0, 0, 0, -26], [178, 0, 0, -178, 0, 0, 1064, 0, 0, 0, -280, 0, 532, 62, -280, 0], [-156, 0, 0, 0, 0, 128, -768, 0, 0, 0, 378, 0, -378, -128, 756, 0], [-489, 0, 0, -489, 0, -298, 0, 0, 0, 0, 150, 0, -133, -149, -150, 0], [0, -208, -16, 0, 0, 0, 0, 86, 305, 104, 0, -133, 0, 0, 0, 0], [0, -194, 237, 0, 237, 0, 0, 784, 0, -194, 0, -433, 0, 0, 0, 351], [84, 0, 0, 42, 0, -17, 572, 0, 0, 0, 0, 0, -394, 0, -178, 0], [0, 1182, -58, 0, -29, 0, 0, 0, 15, 0, 0, 497, 0, 0, 0, -15], [241, 0, 0, 0, 0, -175, -707, 0, 0, 0, 54, 0, -54, 175, 108, 0], [291, 0, 0, 582, 0, 151, 113, 0, 0, 0, -274, 0, -48, 151, 0, 0], [0, 200, -215, 0, 215, 0, 0, -424, -354, -200, 0, -247, 0, 0, 0, -177], [-104, 0, 0, -52, 0, -96, -452, 0, 0, 0, 0, 0, 514, 0, -62, 0], [0, 16, -162, 0, -162, 0, 0, -646, 0, 16, 0, 419, 0, 0, 0, -227], [0, 0, 0, 77, 0, -226, -36, 0, 0, 0, 428, 0, 178, -452, 214, 0], [0, 322, 39, 0, 0, 0, 0, 185, 170, -161, 0, 200, 0, 0, 0, 0], [-60, 0, 0, -30, 0, 167, -210, 0, 0, 0, 0, 0, -183, 0, 393, 0], [0, -544, 132, 0, 0, 0, 0, 342, -310, 272, 0, 994, 0, 0, 0, 0], [412, 0, 0, -412, 0, 0, -116, 0, 0, 0, 69, 0, -58, 335, 69, 0], [-558, 0, 0, -558, 0, -120, 0, 0, 0, 0, 293, 0, -57, -60, -293, 0], [0, 0, -136, 0, -272, 0, 0, 1181, 321, 569, 0, 321, 0, 0, 0, 642], [0, 0, 81, 0, 162, 0, 0, -50, -112, 978, 0, -112, 0, 0, 0, -224], [472, 0, 0, 236, 0, -220, 634, 0, 0, 0, 0, 0, -182, 0, -452, 0], [0, -567, -91, 0, 91, 0, 0, -185, -768, 567, 0, 199, 0, 0, 0, -384], [-167, 0, 0, -334, 0, -112, -326, 0, 0, 0, 236, 0, -416, -112, 0, 0], [0, 716, -21, 0, -21, 0, 0, 543, 0, 716, 0, -484, 0, 0, 0, 59], [0, 0, 0, -220, 0, 24, -648, 0, 0, 0, 636, 0, -330, 48, 318, 0], [-1120, 0, 0, -1120, 0, -4, 0, 0, 0, 0, 44, 0, -340, -2, -44, 0], [0, 138, 188, 0, 188, 0, 0, -414, 0, 138, 0, 451, 0, 0, 0, 37], [0, 354, -288, 0, 0, 0, 0, 162, -265, -177, 0, 589, 0, 0, 0, 0], [0, 231, 0, 0, -369, 0, 0, -348, -20, -462, 0, -174, 0, 0, 0, -20], [0, 780, -28, 0, 28, 0, 0, 455, 822, -780, 0, 44, 0, 0, 0, 411], [0, 0, -313, 0, -626, 0, 0, -377, 238, -839, 0, 238, 0, 0, 0, 476], [-70, 0, 0, 70, 0, 0, 668, 0, 0, 0, -178, 0, 334, 3, -178, 0], [0, 486, -177, 0, 0, 0, 0, 38, -182, -243, 0, 258, 0, 0, 0, 0], [0, -759, -295, 0, -295, 0, 0, 453, 0, -759, 0, -729, 0, 0, 0, -276], [-280, 0, 0, -140, 0, 252, 413, 0, 0, 0, 0, 0, -234, 0, -179, 0], [-52, 0, 0, 0, 0, 7, -333, 0, 0, 0, -259, 0, 259, -7, -518, 0], [-27, 0, 0, -54, 0, 364, -594, 0, 0, 0, 349, 0, -839, 364, 0, 0], [0, 0, 92, 0, 184, 0, 0, -236, -108, -1268, 0, -108, 0, 0, 0, -216], [0, -257, 277, 0, -277, 0, 0, 875, 348, 257, 0, 701, 0, 0, 0, 174], [350, 0, 0, 175, 0, 88, -700, 0, 0, 0, 0, 0, 672, 0, 28, 0], [0, 514, -74, 0, 74, 0, 0, 1534, 524, -514, 0, 1272, 0, 0, 0, 262], [0, -410, -377, 0, -377, 0, 0, -394, 0, -410, 0, 554, 0, 0, 0, 160], [0, 0, 0, -486, 0, -120, 210, 0, 0, 0, -630, 0, -105, -240, -315, 0], [0, -1320, 105, 0, 0, 0, 0, -70, -256, 660, 0, 116, 0, 0, 0, 0], [0, 276, 0, 0, -272, 0, 0, 834, 391, -552, 0, 417, 0, 0, 0, 391], [0, -1203, -542, 0, -271, 0, 0, 0, -298, 0, 0, 1201, 0, 0, 0, 298], [1437, 0, 0, 1437, 0, -30, 0, 0, 0, 0, 234, 0, 416, -15, -234, 0], [0, 0, 0, 269, 0, 116, -1120, 0, 0, 0, -260, 0, -1250, 232, -130, 0], [-820, 0, 0, -410, 0, 202, 94, 0, 0, 0, 0, 0, 280, 0, -374, 0], [0, 117, 156, 0, 156, 0, 0, -247, 0, 117, 0, 670, 0, 0, 0, 423], [1772, 0, 0, 1772, 0, -92, 0, 0, 0, 0, -191, 0, -74, -46, 191, 0], [0, 1654, 104, 0, 0, 0, 0, -363, -531, -827, 0, -195, 0, 0, 0, 0], [-544, 0, 0, -1088, 0, 45, 516, 0, 0, 0, -218, 0, 814, 45, 0, 0], [0, 244, 0, 0, -516, 0, 0, 464, 1, -488, 0, 232, 0, 0, 0, 1], [0, 0, 0, -567, 0, 82, -331, 0, 0, 0, 650, 0, -6, 164, 325, 0], [0, 359, -180, 0, 180, 0, 0, 444, 72, -359, 0, 408, 0, 0, 0, 36], [0, 0, 126, 0, 252, 0, 0, -770, 7, -287, 0, 7, 0, 0, 0, 14], [-110, 0, 0, 110, 0, 0, -132, 0, 0, 0, 93, 0, -66, -194, 93, 0], [-123, 0, 0, -246, 0, 171, 459, 0, 0, 0, -666, 0, 252, 171, 0, 0], [-1627, 0, 0, -1627, 0, 356, 0, 0, 0, 0, 239, 0, -494, 178, -239, 0], [0, 450, -334, 0, -334, 0, 0, 978, 0, 450, 0, -352, 0, 0, 0, 626], [0, 1188, 372, 0, 186, 0, 0, 0, -240, 0, 0, 396, 0, 0, 0, 240], [496, 0, 0, 992, 0, -247, -296, 0, 0, 0, 435, 0, -157, -247, 0, 0], [0, 0, -385, 0, -770, 0, 0, 128, 68, -554, 0, 68, 0, 0, 0, 136], [1082, 0, 0, -1082, 0, 0, 1224, 0, 0, 0, -324, 0, 612, 212, -324, 0], [-2116, 0, 0, -1058, 0, 96, -624, 0, 0, 0, 0, 0, 16, 0, 608, 0], [0, -1228, -218, 0, 0, 0, 0, -618, -334, 614, 0, -902, 0, 0, 0, 0], [-144, 0, 0, -72, 0, 217, -524, 0, 0, 0, 0, 0, 633, 0, -109, 0], [0, -444, 70, 0, 0, 0, 0, 899, 513, 222, 0, 1285, 0, 0, 0, 0], [0, 69, 0, 0, 249, 0, 0, 1552, 210, -138, 0, 776, 0, 0, 0, 210], [0, -195, -114, 0, -57, 0, 0, 0, 236, 0, 0, 775, 0, 0, 0, -236], [-398, 0, 0, -398, 0, -48, 0, 0, 0, 0, -251, 0, -614, -24, 251, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1050_q_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1050_3_q_b();".
// 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_q_b(:prec:=16)
    chi := MakeCharacter_1050_q();
    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_q_b();".
// 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_q_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1050_q();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<11,R![31684, -16376, 15940, 2440, 1954, 16, 58, 4, 1]>],Snew);
    return Vf;
end function;