
// Make newform 2169.2.a.e in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_2169_a();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_2169_2_a_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_2169_2_a_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 := [1, 0, -9, 1, 11, -3, -3, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0], [-1, 2, 5, -4, -2, 1, 0], [1, 3, 4, -4, -2, 1, 0], [2, -4, -3, 9, -2, -3, 1], [-2, -3, 7, 6, -5, -2, 1], [0, 8, -1, -11, 3, 3, -1]];
    Rf_basisdens := [1, 1, 1, 1, 1, 1, 1];
    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_2169_a();"
function MakeCharacter_2169_a()
    N := 2169;
    order := 1;
    char_gens := [965, 730];
    v := [1, 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;

function MakeCharacter_2169_a_Hecke(Kf)
    return MakeCharacter_2169_a();
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 := 2;
    raw_aps := [[1, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0], [1, 1, 1, 0, 0, 0, 1], [-2, 0, 1, 1, 0, 1, -1], [3, 1, 1, 0, 2, 1, 1], [1, 1, 2, -2, 2, 1, 1], [-1, 1, 2, 1, 1, 3, -1], [-3, 2, 1, 2, -1, -1, 0], [2, -1, 0, 1, -1, -2, -2], [2, -3, -1, 0, -3, -4, -2], [-3, 2, 1, 1, 2, 2, 1], [-2, 1, -3, 4, -2, 0, -2], [2, -3, 0, 3, 1, -3, -1], [5, -5, 0, -4, 0, -3, -2], [2, 5, 2, -1, 3, 1, 4], [-1, 1, -1, 1, 5, 4, 1], [4, 0, -3, -1, 2, 4, 0], [2, 3, 4, -1, 7, 5, 2], [6, 0, 1, 0, 5, 4, 5], [8, -4, -2, -1, -4, -3, -1], [-1, 1, 4, -2, -3, 4, 0], [0, -5, -3, 1, 0, -4, 0], [3, 2, 2, -2, 1, 0, -1], [-4, 9, 3, 4, 2, 2, -1], [2, 0, -4, 0, 3, -2, 1], [-1, 1, -1, -2, -4, 2, 2], [-5, 2, 2, 3, 0, -3, -4], [7, -4, -5, -2, 1, -2, 6], [3, -2, -3, 1, 0, -3, 2], [-4, 0, -3, 6, -1, 3, -2], [7, -5, -4, -3, 1, 1, 2], [-5, 7, 6, 3, 2, 4, -2], [-5, 0, -8, 4, -4, -7, 1], [-5, 1, 2, -1, -7, 0, -4], [-7, -2, 0, 1, -1, -4, -9], [-1, -6, -1, -3, -3, -5, -1], [-1, 5, 3, 7, 2, 2, -4], [-6, 9, -1, 0, 1, 3, 3], [3, 5, 6, -3, 9, 12, 9], [-6, 1, 6, -2, 1, 3, 1], [5, 9, 2, -6, -1, 0, 7], [2, 0, -5, 0, 2, 5, -4], [11, 9, 9, -1, 7, 5, 7], [-7, 3, 2, 7, 6, 0, -3], [6, -2, -1, -4, -3, -1, 1], [-12, 16, 6, 4, 6, 7, 4], [5, -2, -2, -6, -9, -9, -2], [-3, 2, 0, 3, -1, 2, -1], [-8, 10, 6, -3, 2, 1, 3], [6, -2, 2, 0, 5, 1, 0], [-1, -10, 2, 0, 5, -1, -6], [12, 2, -1, -4, -5, 1, 9], [-1, 0, 0, 0, 0, 0, 0], [10, -10, -4, -4, 5, -7, 1], [-8, -1, 0, 0, 1, 0, -9], [-3, -4, 1, 1, 1, 2, -9], [1, 5, 8, -1, 4, 2, 4], [0, -1, -7, 6, 0, 0, -8], [1, 1, 1, -8, 0, -6, 5], [13, -5, -4, -7, 6, -3, 1], [-5, 1, 2, 2, -1, -5, 4], [-4, -10, 2, -2, -1, -7, -6], [7, 1, 5, -1, -2, 6, -2], [0, -2, -12, 10, -7, -10, -6], [3, 8, 7, -7, -1, 6, 6], [7, 1, 6, 0, 1, 1, -2], [1, -5, 2, -3, 3, -4, -2], [0, -14, 2, -7, 1, 1, 3], [0, 1, 8, -6, -4, 5, 0], [5, -6, -6, -6, 2, 3, 2], [-1, 2, 13, 0, 6, 16, 1], [5, -6, -3, 11, 5, 3, 0], [-9, 1, -5, 10, 3, 4, 0], [6, -7, -4, -7, 8, 11, 3], [10, 4, -1, -6, 7, -1, 7], [11, -16, -2, -10, 4, -4, -1], [-2, 8, -4, 1, -7, -2, 2], [-7, -7, -3, -10, -5, -3, -1], [15, -12, -6, -6, -8, -2, 3], [-10, -7, -3, 10, -4, -3, -8], [2, -9, 7, 2, 0, 4, 1], [-6, 0, 1, 7, 5, 5, 4], [10, -4, -5, 7, -4, -7, -4], [4, 4, 8, -8, 12, 11, 3], [3, -14, -6, -1, 3, -4, -7], [-2, 11, -1, -1, 5, 13, 0], [0, 2, -6, 0, 0, 5, -11], [-15, 2, 9, 1, 0, 2, -4], [-18, 15, 8, -4, 0, 1, 2], [-1, -13, -8, 1, -2, -1, -12], [1, -13, -7, 4, -1, -9, -4], [5, -9, -6, -1, -7, -7, -10], [-18, 7, 1, 14, -5, 9, -6], [9, -3, 11, -1, 11, 6, -6], [1, 1, 8, -12, -8, 0, -5], [-4, 8, 6, 2, -7, 2, -2], [-14, -3, -2, -1, -4, -6, -15], [6, 11, 13, -9, 14, 10, 19], [11, 6, -7, 1, -2, -12, 0], [-4, -3, 9, 2, 2, 3, -7], [-12, -3, 4, 12, -1, 5, -7], [11, -17, 1, -1, -1, -3, 0], [-15, -1, -2, 6, -12, -10, 3], [-11, -7, -12, 5, -6, 1, -7], [0, -4, 17, -10, 0, -1, 1], [1, -10, -14, 7, -6, -20, -8], [2, 0, -4, -2, -8, -8, 6], [-11, -13, -5, 3, -4, -3, -4], [16, -2, 11, 1, 2, -2, 3], [6, -16, -7, 3, -7, -10, -7], [-1, 2, -1, 12, 2, 2, 6], [2, 11, -2, 4, 5, 14, 17], [-5, -1, -12, -1, -3, 1, -2], [6, 0, -2, -5, -3, 1, -7], [-3, -1, -5, -3, -7, -10, 6], [10, -8, 0, 0, 1, -11, -7], [16, 0, 5, -7, 0, 12, -5], [-11, -3, -12, 6, -10, -2, -8], [24, -16, -6, -2, -14, -14, 5], [7, -5, 3, 5, 3, 3, 8], [5, -1, 6, -14, 6, -10, 15], [-5, -1, 0, 0, 12, -1, 11], [-10, 10, -8, 4, -4, -1, -8], [7, 2, -3, 5, 10, 6, 7], [4, -16, -4, -8, -3, -7, -5], [2, 6, 7, -4, -8, -5, 5], [10, 20, 16, -12, 12, 13, 20], [14, 6, -5, 5, -1, -2, 3], [-12, 20, 10, -9, 8, 9, 12], [6, 5, -2, 1, -1, -6, 11], [-9, -5, -13, 15, -14, -9, -1], [5, -10, -16, 0, 5, -11, 0], [-10, 17, 4, 4, 6, 13, -11], [-8, -8, 2, 4, -5, -12, -11], [0, 3, -13, 5, -1, 13, 0], [-19, -12, -10, 9, -22, -21, -9], [5, 0, -3, 3, -2, 0, 7], [5, -16, 0, 2, -9, 2, -9], [-5, -1, 2, -5, 10, 11, 2], [3, -20, 3, -4, -11, -10, -9], [14, 3, -14, 3, 11, 3, 11], [-4, -5, 0, -13, -6, 2, 9], [-2, 8, 2, 0, -13, -5, -1], [4, 5, 9, -15, 7, -7, 12], [11, 10, 5, -11, 7, 14, 16], [-9, -5, -20, 5, -2, 0, -16], [6, 8, 21, 5, 8, 6, 0], [-2, 0, 1, -7, -16, -16, -9], [15, 12, 16, -2, 19, 14, 6], [-3, -8, 5, 5, -6, -5, 4], [21, -17, -9, -11, -6, -16, 11], [5, 0, -1, 3, -1, 6, 10], [-4, -11, -5, -1, -20, -13, -2], [8, 6, -6, -1, 10, 2, 9], [-4, 6, 10, -8, 9, -1, 21], [24, -9, -1, -17, 12, -7, 5], [0, -16, -11, 6, -20, -20, -3], [-2, 13, 7, -5, 15, -5, 10], [19, 17, 4, -11, 1, 11, 11], [8, 4, -10, 5, 2, -2, -7], [-3, 4, 5, 3, -1, 11, -12], [-6, 18, 24, 6, 4, 7, 8], [5, -11, -3, -1, 21, 9, 7], [-15, 4, 1, 13, 8, 4, 3], [-5, -9, -11, 20, -8, -20, -18], [9, -11, -12, 7, -14, -1, -12], [5, -14, 5, 1, -8, -8, -26], [-3, 22, -11, 18, -6, 5, 10], [14, -4, 4, -13, -6, -12, 18], [23, -16, -17, -5, -2, -14, 10], [-18, 8, -3, 3, -2, 12, 6], [15, -4, -4, -17, -9, -10, 1], [26, -4, -8, 4, -7, 1, 6], [6, 4, -3, 6, -4, -8, -9], [9, -13, -15, 5, -18, -25, -12], [-5, -9, 4, -12, 3, -3, 10], [9, 1, -5, 3, -4, 10, -6], [27, -7, 3, -8, 9, 3, -5], [-3, 7, -11, 16, 3, 4, -9], [-31, 2, -9, 0, -9, -5, 6], [2, -14, -11, -25, -12, -10, -3], [-21, 11, -3, 14, 3, 12, -7], [-13, -7, -12, -4, -7, -7, -3], [12, -8, -9, -11, -13, -13, 13], [-5, 2, -4, 12, -13, 2, -14], [-10, 10, 7, -8, -11, 3, -9], [-25, -7, -10, 2, -13, -5, -9], [11, -24, -6, -13, -24, -17, -2], [2, -2, 1, 5, -4, 1, -18], [-1, -10, 0, 9, -12, -16, -9], [-3, -29, -2, -3, 0, -10, -11], [-10, 3, 4, 7, 4, 13, -7], [1, 2, -2, -11, 4, -10, 11], [30, 1, -13, -13, 7, -7, 12], [-19, 3, 2, 13, 3, -1, -7], [-19, 19, -1, -10, -4, -2, 1], [-18, -8, 3, -1, 17, 6, -1], [18, -18, -23, -3, -8, -10, -3], [1, 7, 14, 2, 2, 11, -5], [-7, 22, -6, 10, 1, 9, 12], [32, -13, -8, -7, -4, 6, -3], [-6, 30, 1, 10, -5, 0, 9], [26, -18, 3, -14, -11, -22, -6], [1, 7, 9, -3, 5, 11, 2], [34, -11, 1, -3, 6, 8, 8], [0, -29, -8, -18, -8, -3, -1], [19, -2, 1, -8, 11, 19, 17], [-14, 12, -6, 2, -2, -2, -11], [19, -3, 7, 11, 11, 6, -1], [-2, 8, 9, 12, -2, 15, -7], [-29, 24, 12, 15, -3, 1, -6], [0, 18, 12, -2, 19, 21, -11], [7, -3, -21, 11, -16, -4, 3], [-5, -4, -11, 21, -7, -4, -28], [4, 5, 13, -18, 0, 14, 12], [-2, 0, 2, -5, 1, -8, 10], [-19, 1, -5, 0, -4, -4, -20], [26, -7, -15, -11, 15, 8, 16], [11, 3, 1, -4, -5, 1, -8], [-1, -8, -1, 1, -5, -26, -11], [15, 4, 4, 1, -10, 13, -16], [-1, -6, -12, 7, -19, -22, -10], [-5, -19, 5, -3, 0, -7, -6], [1, -6, 2, -1, 18, 14, 8], [-5, 23, 27, -10, 18, 15, 18], [21, 7, -4, 8, 7, -1, -1], [-35, -9, 9, 7, -13, -15, -7], [23, -3, -3, -14, -10, 2, 11], [-16, -23, -13, -3, -17, -15, -24], [24, 5, 25, -8, 9, 10, 13], [2, 4, 12, 1, 23, 17, 11], [-16, 21, 13, 13, -8, 5, -2], [-6, -16, 11, 4, 0, 20, -11], [-35, 2, 11, 8, -8, -6, 3], [14, 14, 13, -1, 19, 9, 23], [-8, 14, 6, 20, 4, 14, 6], [-5, 2, -3, -6, -6, 14, 16], [-2, -8, 20, -13, -4, -12, -1], [18, -24, -22, 1, -10, -23, 2], [6, 0, -11, 11, -10, 17, -18], [2, -16, 8, -3, 0, -1, -13], [29, -18, -12, -14, 4, -22, 10], [13, -14, 3, -9, 14, 5, 6], [-16, -1, 0, 7, -25, -9, -21], [-12, -11, -14, 3, -8, -3, 0], [15, -6, 8, -10, 13, -6, -4], [9, 1, -5, -3, 21, 15, 0], [-11, -28, -7, 6, -7, -23, -25], [18, -6, 8, -12, -16, 10, -4], [2, -17, 13, 2, 2, 3, 1], [-23, -28, -3, 19, -4, -23, -25], [-3, 22, 18, 4, 14, 19, 6], [23, -11, 0, -22, -1, -19, 5], [8, -13, -15, -6, 5, 12, -4], [0, 7, 12, -10, 6, -1, 26], [8, -25, -17, 0, -29, -23, -15], [-2, 28, 27, -17, 18, 19, 25], [-17, -3, 10, 16, 0, -4, -13], [13, -20, -7, 1, -10, 1, -10], [-11, 6, -7, 31, 14, 5, -5], [18, -34, -18, 0, -2, -27, 3], [-42, 23, 9, 17, 8, 29, -3], [25, -36, -29, 9, -26, -29, -7], [-18, -20, 3, 14, -6, -11, -20], [-30, 17, -16, 10, -13, -2, 11], [-24, 4, -2, -6, -5, -12, -17], [-21, -2, -7, 15, -14, -11, -9], [-14, 23, 5, 18, -4, 12, -2], [-32, 26, 26, -7, 13, 25, 10], [-32, 27, 6, 16, -1, 16, -2], [-25, -12, 11, -5, 3, 3, -11], [-30, -23, -8, 10, -21, -17, -26], [-16, 8, 10, 11, -9, -8, -25], [-2, 9, -3, 6, 10, 18, 1], [-12, 10, 16, -13, 1, 20, 14], [-37, -6, 12, -1, 2, 5, -4], [16, 14, 2, 6, 3, -2, 6], [-22, -1, -10, 10, -18, -12, -14], [24, -20, -16, -11, 4, -17, 0], [12, -4, -14, 1, -16, -9, 1], [-17, -2, 7, -9, 22, 9, -4], [-16, -7, 6, -1, -10, -4, 5], [0, -15, -11, 0, -38, -37, -9], [-9, -1, -18, 20, 14, 11, -3], [-8, -14, -13, -26, -17, 0, 7], [18, 0, 5, 12, 14, 15, -11], [-3, 14, 15, 24, 6, -3, -5], [-18, -17, -13, -15, -3, -6, -7], [-7, -1, 7, -7, 9, -5, 11], [25, -2, -13, -14, -1, -10, 15], [16, 9, 12, -29, 7, -13, 32], [-34, -26, -12, 9, 10, -1, -21], [-9, 26, 11, -1, 23, 20, 32], [-1, 10, -16, -1, -5, 3, -1], [-32, 20, 7, -8, 8, -5, 3], [-20, 25, -9, 17, 4, 4, 10], [-10, 33, -8, 12, -22, -8, 9], [-15, 9, 3, -17, -17, -9, 1], [-3, -5, 13, -19, -15, -2, -4], [6, -10, -15, -25, -14, -15, 9], [25, -6, 6, -12, -3, -2, 29], [-1, -11, -9, 15, -1, -27, -4], [0, -16, -34, 16, -2, -25, -3], [-14, -7, 3, 1, -23, -31, -7], [7, -8, 11, 9, -5, -18, -22], [-36, -8, 3, -1, -17, 3, -6], [-19, 9, -13, 0, -2, -19, 2], [14, 7, -12, 10, -4, -19, 0], [5, 20, 30, -3, 36, 32, -6], [1, -5, 10, -2, -16, 8, -4], [-47, 17, 24, -3, -7, 0, -17], [6, -2, -3, -8, -1, 15, 19], [1, -16, -4, 1, -14, -26, 6], [6, 2, -12, 10, -5, 0, 16], [18, -28, -10, -40, -5, -10, 12], [-22, 10, 2, 18, 13, 22, -14], [5, 29, 3, 12, 7, -1, 5], [24, 13, 13, -3, 5, 27, 4], [10, 16, 12, -10, 12, -10, 24], [-15, -6, 5, 1, -7, -8, -8], [-4, 2, 25, 0, 11, 16, -14], [-14, 11, 6, 30, -3, -14, -5], [-8, 6, -1, -13, 6, -15, 2], [33, -34, -4, 5, 3, -1, 3], [-45, 5, -12, -3, -12, -4, -16], [-9, 2, -14, 3, -31, -17, -5], [-46, 7, 11, -8, -3, -1, -5], [-33, -4, 1, -2, 6, 13, 5], [6, -9, 9, 1, 14, 16, -10], [-7, -29, 11, -15, 20, 11, -6], [19, 7, 33, -18, 26, 19, 26], [0, 21, 12, 23, 10, 22, 23], [27, 4, 1, -27, -1, 13, 1], [-34, 10, 11, 1, -19, -25, -7], [10, 2, -10, -6, 20, -7, 14], [-24, 16, -6, -10, -8, 3, 7], [7, 0, -12, -5, 8, -10, 12], [-25, 3, -17, 6, -12, -9, 0], [11, 5, 20, -4, 10, 23, 6], [-12, 43, -3, 5, 13, 21, 10], [-29, 0, 15, 2, -16, -18, -19], [20, 3, 29, -11, 2, 9, 15], [-17, -27, 11, 2, -6, -9, -17], [5, 3, -14, 10, -6, 12, -15], [9, -18, -17, 6, -15, -11, 2], [-19, -4, -4, 23, -18, -6, -21], [16, 22, 8, 10, 8, 21, 12], [-5, 9, 1, -22, -1, -7, 5], [-20, -1, -4, 25, -6, -9, -17], [37, 33, 30, -20, 23, 18, 39], [-12, -14, 4, -16, 0, -17, -17], [10, -11, -19, 7, 4, -16, 16], [-9, 1, 28, -5, 15, 26, 1], [40, 18, 2, -17, 9, 23, 6], [-8, 21, -11, 15, 6, 8, 6], [-24, -4, 2, 8, 13, -12, 2], [10, 2, -11, -16, -14, 11, -2], [7, 6, -6, -16, 8, 27, -1], [5, 10, 11, 0, 34, 20, -2], [-1, 12, -20, 10, -24, 4, 13], [-14, -10, -12, 6, -26, -1, -14], [-23, -11, -12, 23, -10, 0, -32], [-45, 4, 4, 18, -12, 0, 7], [28, 0, -28, -2, 20, 22, 11], [-7, 34, 37, 12, -3, 0, 14], [13, -32, 18, -12, 21, 17, -14], [6, -10, -18, 5, -5, -19, -2], [15, 30, 27, -8, 0, 21, 19], [19, -31, 8, 5, 5, 28, -22], [-25, 13, -1, 7, -2, 36, -5], [-34, -19, -2, -15, -14, -14, -7], [2, 16, -2, -1, 6, -18, 15], [0, 17, 19, 3, 12, -5, 19], [26, -7, 3, -17, 18, 23, 9], [-17, 33, 13, -6, 19, 1, 5], [-7, 12, 19, 4, 6, 14, -18], [38, -11, -19, -29, 4, -22, -7], [11, -6, -15, -10, -9, 1, 21], [-27, 36, -10, 17, 16, 27, 24], [17, -36, -34, -5, -15, -14, 2], [-47, 43, 17, 1, 2, 17, -6], [-20, 0, -15, 13, -33, 8, -17], [3, 33, 37, -15, 36, 47, 17], [18, 10, -4, -22, -8, -8, -6], [-15, -9, -19, -15, 0, -6, -12], [33, -55, 3, -7, -2, -19, -12], [-9, -15, 17, 16, 0, 14, -13], [20, 0, -13, -18, 4, 3, 3], [-3, -30, -4, -17, 14, 9, 5], [13, 22, 0, -18, 6, 17, 25], [-2, 37, 7, 22, 11, 18, 22], [10, 4, 21, -21, 2, -2, 7], [5, -37, -6, -16, -14, -8, -19], [21, 0, -13, 13, 8, -9, -15], [6, 24, -33, 16, 7, 9, 16], [-5, -1, -12, -11, -20, 5, -15], [2, 58, 47, -18, 36, 43, 35], [-3, 29, 2, 18, 19, 16, 9], [-10, 3, -28, 1, -27, -40, -8], [19, 6, -9, 8, -11, 2, -4], [12, 9, 17, -14, -12, 13, -7], [16, -10, -26, -6, -11, 10, 13], [23, 25, 4, -2, 17, 29, 24], [2, -12, -12, -12, -9, -17, -25], [-3, -9, 7, -8, 9, 11, 13], [-6, 5, 24, -2, -5, 20, 11], [-81, 7, 2, 23, -15, 11, -20], [39, -18, 15, -21, 24, -4, 14], [-13, -6, -26, 25, -5, 4, -21], [27, -8, 8, -34, -1, 8, 4], [-11, -2, -19, -14, 0, -8, 20], [-30, -13, -25, 21, 4, -27, 10], [3, 14, 8, -3, 11, 6, -4], [-10, 12, 19, 4, 0, 26, -11], [24, 26, -4, 15, 2, 11, -7], [30, -8, 25, 4, 13, 23, -13], [16, 3, 34, -15, 20, 35, -5], [-4, -18, -18, -5, -47, -16, -9], [-43, 8, 0, 24, 2, -21, 6], [15, 3, 9, -8, 16, -8, -3], [-16, 0, 12, 12, -4, -24, 12], [-11, -47, -16, -3, -9, -20, -32], [15, 26, 27, -19, 39, 37, 42], [5, -2, -4, 8, 15, 8, -10], [-5, -21, -17, -19, 7, -18, 5], [75, -16, -26, -9, 6, -6, 22], [10, -12, -25, 11, -9, -4, -4], [18, -38, -32, 14, -33, -50, -23], [8, 8, 1, 2, 1, 7, 28], [0, -20, -4, -21, -3, 2, 7]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_2169_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_2169_2_a_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_2169_2_a_e(:prec:=7)
    chi := MakeCharacter_2169_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(2999) - 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_2169_2_a_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_2169_2_a_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_2169_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![1, 3, -6, -10, 14, 0, -4, 1]>],Snew);
    return Vf;
end function;