
// Make newform 10000.2.a.be in Magma, downloaded from the LMFDB on 01 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_10000_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_10000_2_a_be();".
// 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_10000_2_a_be();".
// 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, 16, -27, -35, 26, 20, -8, -3, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0], [-3, -1, 1, 0, 0, 0, 0, 0], [1, -15, -1, 17, -2, -4, 1, 0], [0, 4, -15, -1, 17, -2, -4, 1], [-4, 36, -5, -26, 5, 4, -1, 0], [0, -8, 51, -4, -43, 7, 8, -2], [-6, 1, 57, -7, -43, 7, 8, -2]];
    Rf_basisdens := [1, 1, 1, 3, 3, 3, 3, 3];
    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_10000_a();"
function MakeCharacter_10000_a()
    N := 10000;
    order := 1;
    char_gens := [8751, 2501, 9377];
    v := [1, 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_10000_a_Hecke(Kf)
    return MakeCharacter_10000_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]];
    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 := [[0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [-1, 1, 0, 1, 0, -1, 0, 1], [1, 1, 0, 1, -2, 0, 0, 0], [1, 0, 0, 0, 1, 0, 1, 0], [2, 0, -1, 1, 0, 1, 0, -1], [1, -2, -1, 0, 1, 0, -1, 0], [-5, 1, 0, 0, 1, -1, -1, 2], [3, -1, 1, 0, -1, -1, 0, -1], [2, 0, 2, -1, 0, -1, 1, -1], [-2, -1, 2, -2, 1, 1, 0, -1], [-1, -2, 1, -3, -1, 2, -2, -3], [-2, 0, 0, -2, 1, 2, 1, 0], [-4, -1, 0, -1, 1, 1, 0, -3], [0, 3, 1, -1, -1, 1, -1, -1], [1, 0, -1, 3, 1, -1, 0, 3], [6, 1, 1, 6, -2, -3, 3, 2], [2, -2, -1, 1, -1, 0, 4, -3], [0, 2, 2, 0, 1, -1, 1, 4], [-1, -3, -1, 1, 3, -1, -5, 0], [-1, -1, -1, -6, 0, 1, 0, 1], [-1, -1, 2, 5, -1, -3, 1, 5], [-6, 0, -4, -5, 1, 3, -4, -3], [-4, 0, -3, -6, 1, -2, -3, -1], [-3, -1, 1, 3, 2, -3, -2, 7], [-6, 0, -2, -3, 0, 2, 0, -7], [-6, 1, -1, -3, 0, 2, 0, -5], [-6, -2, -2, -2, 3, 0, 1, 1], [7, 2, 2, 8, -3, -1, 2, 4], [-1, -3, 2, -2, 4, -1, -1, 4], [-1, -2, -3, -7, -1, -1, -4, -6], [-4, 0, 0, 0, -1, -3, 3, 3], [1, 2, -3, -1, 0, -2, 3, -1], [2, 6, -3, 0, -2, -1, 1, -1], [1, 2, 0, 1, 1, -5, -5, 5], [-13, -4, -1, -5, 6, -1, -4, 5], [4, 5, -1, 1, -1, -2, -1, -1], [-6, 2, 0, 5, -4, 2, 1, 2], [8, 5, 5, 10, -3, -4, 4, 9], [5, 2, 0, -1, -1, -2, -2, -7], [1, 5, 0, -2, -5, 0, 5, -5], [6, -1, 2, -3, -3, -1, 6, -1], [-10, 6, -2, -1, -3, 4, 2, -1], [5, -2, 2, -1, -5, 3, 6, 2], [-2, 0, -3, -8, 0, -1, 1, -6], [7, -4, 4, 0, 3, -2, -3, 3], [0, -4, 4, 6, 1, 2, 4, 6], [-6, 2, 1, -1, -6, -3, -1, -2], [-9, 2, 0, -7, 8, -3, -8, 7], [3, -5, -1, 4, -2, 0, -4, -5], [5, -4, -1, 8, -3, 2, 4, -7], [3, -5, 0, 2, 0, 0, 5, 5], [-16, -3, -3, -7, 6, -1, -9, 4], [-3, 1, 3, -4, 1, 2, -9, -1], [-6, 5, -1, 1, -6, 3, 4, -6], [0, -7, -1, -4, 2, -4, -10, 1], [-3, -5, 2, -6, 5, 4, -4, -6], [-1, 4, 3, -3, -1, -4, -1, 7], [-10, -1, 2, -8, 2, -1, 6, 4], [-1, -1, -5, 7, 4, -2, 1, 3], [9, -6, 0, -3, -4, -2, 6, -6], [-6, -4, 2, -11, 0, -2, -5, -7], [2, -6, 1, 1, 2, 2, -2, 7], [0, 3, 5, 5, 0, -5, 5, -2], [7, -5, 7, 13, 0, -3, 10, 2], [3, 5, 1, 3, 0, -3, 3, -3], [9, -4, 4, 16, -3, -5, 6, 3], [-15, -3, -4, -17, 5, 3, -6, -4], [-19, 3, 1, -15, 4, -3, -12, 2], [9, 1, 1, 9, -2, 1, 13, -3], [2, 5, -2, 2, -4, 2, 7, -4], [-3, -2, 0, 5, 9, -3, -1, 8], [6, -4, -2, 12, 0, 2, 2, 3], [-12, 5, -1, -3, -2, 6, 5, -4], [-7, -3, -1, 3, 3, -4, -5, 5], [8, 6, 6, 13, -6, -7, 6, 2], [-7, -6, -6, -8, 3, 7, -6, -15], [-3, 2, -2, -1, 1, 6, -6, 6], [15, -2, -3, 12, -7, -2, 3, -1], [-18, -8, -6, -13, 3, 5, -1, -15], [-8, 3, -9, 3, -1, 2, 3, -8], [4, -2, 2, 3, -1, 9, 11, -1], [-6, 2, -1, -6, -1, 0, -3, 7], [-20, 6, -1, 3, 2, -3, -6, 13], [-11, -8, -1, -6, 2, 0, -13, -4], [2, 2, 6, -3, 1, 7, 3, 2], [-14, -1, -9, -22, -5, 8, 0, -20], [-7, -6, -4, 5, 7, 2, -7, 2], [12, -4, -1, 6, 7, -2, 2, 5], [-7, -5, 0, -10, 0, 2, 0, -10], [0, -6, -2, -7, 5, 9, -8, -6], [-4, -6, 1, -6, 3, 5, 4, -13], [7, -3, 3, 2, -4, 1, -1, -4], [-12, -3, -5, -14, 6, 0, -15, 5], [-18, 1, 2, -2, 8, 0, 3, 3], [14, 11, 5, 9, -8, 4, 7, 10], [4, -8, 0, -1, 1, 5, 5, -15], [-4, -2, 2, -2, 7, 3, -15, 1], [-2, -8, -2, -4, 6, 1, 4, -14], [10, 2, 3, -4, -5, 2, 4, -2], [-3, 6, -2, 11, -4, -3, 1, -6], [-2, 3, 0, 15, 3, 0, 8, -2], [-17, 3, -4, -17, -3, 5, -4, 0], [-10, 4, -5, 4, 7, 10, 5, 0], [-15, -9, 2, -2, 5, 4, -10, -2], [-8, 1, 0, -10, 4, -7, -10, 3], [-17, 2, 1, -19, 10, 0, -10, -2], [-4, 6, 8, 1, -2, 6, -6, -4], [4, -11, -6, -4, -3, 8, -3, -7], [3, -1, -7, -2, -6, 0, -11, -8], [16, 0, 3, 12, -9, -4, 16, -2], [-7, 2, -12, 7, 1, 4, 6, -5], [-10, 13, -5, -14, 1, 7, -3, -8], [-15, 3, 1, 2, -6, -3, 3, 2], [-7, -11, 6, -5, 7, 2, -2, 2], [5, 4, 2, 6, 3, -9, -7, 6], [-8, 6, 10, 4, -13, 1, 1, 4], [3, 4, 9, 6, -3, 2, 17, 8], [8, -5, -3, 1, -4, 5, -1, 4], [-4, -3, 5, 18, 1, 5, 5, 5], [-15, 14, -9, -1, 4, 3, -4, 4], [14, -6, -1, -9, -6, -2, -6, -12], [2, 0, 4, 18, 2, 6, -1, 13], [-13, 11, -1, -10, 3, -2, -3, 8], [-2, 3, -4, 10, -1, -8, 3, 17], [0, -5, 0, 1, -1, 9, -8, -10], [-6, 1, -2, -17, 5, 8, -9, 3], [22, -12, 4, 16, -3, -2, 2, -8], [-3, -7, 3, -10, 7, 3, -10, 7], [13, 0, -3, 3, 4, 3, -2, -6], [6, 1, 12, 6, -6, -4, 14, 8], [-15, 8, 0, -1, -6, 5, 0, 10], [18, -2, 7, 7, -3, 0, 17, 0], [9, 16, 8, 8, -7, 6, 9, 11], [-20, -2, -6, -9, 7, 6, -15, -4], [-3, -2, 7, -12, -4, 5, 3, 4], [-7, 3, -1, 6, 0, 1, -4, 19], [16, 15, 0, 21, -9, -6, 2, 7], [-25, 1, -11, -22, 2, 7, -6, -7], [0, 3, -6, 6, 4, -2, -3, 3], [-21, 0, -3, -25, 5, 9, -4, -16], [-2, 12, -8, -7, -11, 3, 7, -10], [-9, -9, 0, -15, 6, 0, 6, 6], [-3, 0, -4, -2, 2, 4, 0, 4], [9, -5, -4, 2, 4, -9, 5, -3], [-26, -4, -8, -2, 8, 3, -12, 3], [-5, -3, -4, -12, 4, -7, -21, 3], [-9, -10, 4, -2, 1, 4, -5, -7], [-5, -3, -1, 1, -5, -2, 5, -9], [30, 1, 8, 12, -10, -9, 10, -6], [3, 0, 8, 21, -10, 1, 4, -4], [12, 10, 1, 16, -3, 0, 4, -5], [-26, -15, -2, -18, 11, -6, -3, 0], [10, 13, 3, 3, -9, 0, 16, -4], [-11, -8, 1, 0, -4, 2, 8, 2], [-1, 0, -1, 6, 7, -10, -1, 15], [-5, -6, -11, -7, 4, 5, 4, -15], [25, 3, 7, 13, -7, -9, 7, 8], [15, 6, 2, -3, -2, -1, 1, 14], [2, 6, -7, 1, -8, 7, -14, 7], [-11, -14, -11, -19, 13, -3, -7, 0], [3, -5, 3, 17, -5, -2, 5, 13], [-17, 11, 0, 10, -7, 10, 5, 5], [18, 2, 1, 19, -7, 2, 18, -2], [-17, -3, -9, -24, -2, 5, -10, -23], [10, -3, 5, 9, -4, 0, 15, 10], [-9, 10, -1, -13, 1, -3, 12, 6], [20, 5, 0, 6, -1, -6, 12, 0], [-12, 9, -5, 5, -2, -10, -7, -1], [-19, 8, 9, 5, -14, 5, 4, 5], [-12, 11, -3, -7, -7, 4, -4, 4], [37, 0, 2, 34, -5, -11, 11, 9], [3, 15, -4, 12, -12, 4, 6, -8], [-3, -12, 0, 0, -7, 9, 2, 0], [10, 4, -4, 18, -3, -3, 3, 22], [-19, -10, -8, -18, 10, 4, -9, -6], [11, -14, -4, -9, 3, -3, 8, -13], [-4, 9, -6, -4, -9, -2, -4, 3], [2, 6, 4, 10, -4, -4, 15, 11], [41, 14, 9, 31, -12, -9, 19, 10], [18, -2, 11, 23, -1, -3, 3, 2], [31, -2, -4, 26, -2, -5, 8, 14], [-6, -4, 2, -11, 9, 8, 0, 10], [-16, 10, 0, -5, -10, 1, 10, 5], [0, -4, 4, 8, -8, -3, -6, 3], [-14, -2, -1, -19, 9, 11, -6, -18], [-18, -5, 1, -21, 8, 6, -14, 7], [-1, 2, 2, 0, 3, 1, -12, 6], [-5, 4, 9, 21, 12, -7, 7, 18], [21, -5, 8, -13, 0, 10, 0, -12], [26, -1, 12, 3, -9, -6, 1, -14], [5, -3, -3, -5, 1, -1, 11, -6], [-11, 5, -13, -10, 5, 14, 1, -16], [5, 2, 2, 13, -3, 2, -2, 6], [16, -12, -7, -1, -2, 9, -2, -24], [-20, 13, 9, -12, -6, -12, 7, 8], [4, -4, -12, 2, -6, 11, -1, -11], [16, -12, 4, 16, 4, 6, -1, -3], [-12, -3, -7, 2, -6, 10, 17, -4], [20, -3, 1, 24, 3, -1, 20, 4], [-23, 3, -1, 0, 14, 3, -18, 13], [-5, 3, -1, -14, 13, 0, 7, 15], [-4, -1, 0, 17, 7, 0, 5, 5], [6, 13, 1, 14, -10, -7, 6, 32], [-5, -4, 6, 14, 10, 7, -5, 2], [-18, -3, -12, -8, -1, 9, -18, -6], [-8, -5, -10, 7, 7, -2, -16, 4], [26, 3, -4, 4, -10, -2, -4, -3], [13, -8, 2, 26, -9, -1, 6, -6], [-10, 3, -5, -19, 0, 4, -19, -10], [-6, -3, -9, 7, 11, -3, -7, -3], [-11, 10, 3, -3, 10, -13, -5, 8], [34, -4, 19, 12, -5, -3, 20, 0], [42, -6, 2, 46, -6, 1, 23, 6], [-16, 11, 1, -18, 8, -3, -2, 12], [16, 16, 13, 27, -4, -9, 11, 19], [14, -7, 6, 2, -6, -8, 8, 7], [21, -4, -2, 17, 8, 3, -2, -1], [-25, 4, -1, -29, -1, -6, -14, 2], [5, 7, -6, 13, 1, -7, -3, 8], [-22, 6, -4, -21, -7, 12, 8, -23], [-3, -2, -5, 10, -2, -6, -3, 15], [-2, 2, 5, 15, -1, -11, 17, 8], [-2, 0, -7, 17, 8, -14, 3, 13], [-11, 19, 0, 9, -11, -3, -3, 2], [-2, 5, -1, 4, 3, -5, 16, 0], [-25, 10, 0, -19, 4, 14, 7, -5], [7, 1, 1, 18, -8, 13, 11, -20], [-7, 8, 7, 11, 4, -1, 21, 24], [5, 13, -11, -9, -1, 7, -6, -3], [-13, 1, -18, -6, 4, 0, -21, -16], [-17, -1, -3, -29, -3, 4, -14, -11], [4, 19, 13, 13, -3, -14, 14, 31], [6, -12, 1, 1, 1, 5, 23, -2], [-16, -5, -1, -4, -4, 11, 12, -4], [-12, 10, -8, 1, -4, 0, 4, -6], [-6, -11, 5, -3, 11, 13, -14, -6], [19, -7, 3, 27, 4, 1, -11, 1], [9, 20, 3, 6, -5, -14, 14, 21], [24, 4, 9, -14, -5, 2, 3, -6], [-15, 3, -9, -13, -6, 12, -12, -3], [1, -19, -10, -2, -1, 7, -1, -4], [1, 5, 4, -21, 5, 8, 7, 3], [-27, -1, -6, -24, 17, -8, -18, 23], [13, 2, 0, 15, 7, 1, -2, -5], [5, 14, -9, 19, -13, -6, -13, 10], [-17, -6, 7, 16, 2, -1, -4, 9], [2, 4, 1, -19, 0, 10, -4, -5], [-17, -3, 13, -1, 8, -1, 5, -1], [16, -5, -6, -8, 6, 7, -23, -19], [-2, -13, 12, 8, 6, -11, 6, 9], [-17, 14, -11, 12, -1, -3, -6, 23], [10, -9, 9, -2, 2, -8, 4, -12], [-9, 5, 2, -27, 1, 14, -14, -8], [-10, -9, 2, 12, 15, -14, 3, 21], [8, -8, 11, 0, 1, 7, 3, 12], [-17, 20, 3, 7, -2, 1, -17, 13], [-12, -1, 5, -5, -4, 2, -10, -13], [23, -7, 13, 31, -8, 2, 12, -9], [35, -8, 6, -11, -15, -3, 15, -7], [3, -25, -3, -2, 5, 6, -10, -28], [22, 8, -8, 14, -13, -3, 14, 12], [-37, -3, 3, -11, 15, 4, 5, 5], [-13, 7, -4, 10, 2, -4, -12, 0], [-22, 12, -5, 6, 6, 10, -10, 20], [-10, -3, -7, 25, 0, -5, -9, 11], [-22, 7, 1, -10, -14, -3, -2, -23], [25, 11, 7, 28, -14, -12, 14, 9], [-4, -4, 8, 5, 11, -7, 9, 15], [22, -5, 21, 28, -5, -3, 18, 7], [21, -11, 2, -18, 6, -10, 0, -16], [-16, 11, 5, 5, -12, 4, -12, 11], [7, -18, 1, -9, 7, -7, -4, -28], [5, -14, -3, -2, 10, 14, -10, 8], [-34, 3, -8, -30, 21, 7, -27, -16], [20, -8, 4, -4, -8, 1, -7, 3], [23, -15, 7, 11, 11, 0, -1, 9], [18, 8, 1, 30, 4, -18, 8, 12], [11, 3, 18, -5, -6, -9, 19, 1], [-54, -12, -1, -19, 7, 2, -5, -12], [14, -2, 2, 13, -6, 9, 11, -6], [-19, -21, -13, -13, 1, 0, -15, -26], [22, 7, -6, -3, -14, 18, 12, -37], [-6, -3, -14, -31, -4, 4, 1, -22], [5, 1, 13, 8, -2, 1, -16, 6], [-5, -1, 14, 1, -16, -1, 1, 17], [15, -24, 2, 3, 10, -6, 5, -17], [23, -18, -3, 21, -1, -13, -6, 12], [-8, -25, -12, -23, 6, 7, -3, -29], [-16, 1, 7, -10, 3, 4, 16, -11], [-1, 11, -9, 0, 5, 11, -10, -3], [7, -3, 11, -1, -13, -3, -13, -7], [-18, -6, -7, -8, 17, -9, -21, 11], [53, -15, 18, 15, -7, -2, 16, -11], [19, -8, -6, 0, 11, 13, 2, -7], [-24, -4, -4, -1, 13, 7, 13, -13], [0, -6, -2, -23, 4, 2, 11, -24], [-9, 19, -3, -8, -15, 17, 14, -23], [-3, -4, -5, -20, 9, -7, -15, 3], [31, 8, -2, 9, -7, -1, -12, 21], [12, 2, -1, 12, -3, -8, -7, 18], [1, 0, 14, 19, 5, 8, 17, 13], [4, -5, -4, 9, 10, -2, 5, 26], [16, -15, 1, -11, -10, 12, -2, -28], [49, 4, 7, 18, -8, -13, 7, -4], [11, -9, 7, 3, -9, 14, 11, -17], [7, -19, 5, -20, -10, 7, 2, -13], [7, -1, -6, -23, -4, -8, -16, -22], [7, 7, 1, -1, -14, -19, 1, 3], [-39, 24, 7, -2, -4, -11, -19, 21], [-48, 4, -9, -14, 10, 10, -4, 10], [27, 1, -7, -1, 3, -9, -11, 1], [38, 12, 15, 7, -12, -2, 20, 1], [-15, 12, 11, -16, 2, 0, 3, -5], [-17, 8, -11, -33, 0, 4, -20, -12], [-17, 13, -11, -22, -6, 13, -28, 3], [18, 7, -13, 36, -4, 9, 6, 19], [-6, 16, -12, 2, -16, 1, 4, -1], [-33, 19, -8, -19, 4, 1, -17, 16], [30, -20, -1, -9, -10, 3, -8, -27], [11, 0, -13, -32, -1, -9, -22, -20], [-26, 5, -6, -9, 0, 3, 17, -12], [17, 3, 0, 8, -10, 7, 0, 3], [-14, 10, 4, 6, -5, -8, 0, 34], [-30, -19, 2, -3, 8, -6, -19, 14], [-3, -21, 1, 6, 10, 5, -19, -15], [22, 1, -13, -17, 8, 10, -12, -17], [4, 11, 7, 29, -10, 3, 0, 33], [-57, 4, -13, -52, 3, 14, -12, -19], [-22, 5, -7, -9, 10, -14, -11, 26], [-1, -4, 14, 31, 12, -15, -4, 38], [10, -10, -5, 16, -1, -6, -18, 0], [-2, 0, -2, -25, -4, -7, -19, 8], [12, 0, 11, 21, 0, 7, 3, -8], [22, 3, 7, 3, -1, -14, 4, 5], [-15, -8, -10, -31, 14, 23, -17, -27], [28, 0, 3, -18, -3, -3, 14, -8], [-22, 7, 1, -35, 1, 7, -22, -28], [2, 1, -3, -32, -1, 17, -10, -40], [-17, -8, -1, -12, 10, 21, -10, -9], [-28, -3, -11, -18, 12, 7, -17, 8], [-36, 2, 4, -24, -5, 7, -26, -2], [-7, 9, 0, 0, -13, -5, 10, -5], [-19, 21, 4, -1, -19, -5, 9, -14], [7, -13, -9, -12, 10, 1, -5, -8], [1, 21, 6, 11, 8, 2, 3, 32], [17, 16, -8, 2, -13, 10, -9, -9], [-8, 22, 9, 5, -9, 8, -8, -2], [-10, 7, -13, -18, 9, 0, -16, 14], [8, 15, 1, 3, -10, -18, 8, 12], [-4, -12, 2, 8, -9, 4, 1, 10], [27, -2, 11, 38, -1, 7, 28, 7], [-17, -18, -6, -22, 3, 11, -15, -15], [8, 1, -4, -17, -1, -7, 11, -3], [48, 12, 26, 31, -20, -15, 20, 18], [26, -24, -2, 1, -7, -4, 19, -14], [-37, 1, 3, -6, 13, 11, 4, -9], [17, 10, 12, 13, 10, -13, 10, 17], [-31, 14, 2, -27, 0, 8, 13, -8], [-10, 3, -12, 12, -2, -17, -8, -6], [21, 1, 1, -19, 8, -8, -22, -3], [-45, 17, -6, -15, 15, 4, -11, 19], [20, -1, 21, 2, -12, -12, 1, 17], [26, 16, 15, -10, 3, 2, 18, 21], [-34, 1, -2, 12, 5, 7, 7, -17], [5, -4, -8, 38, 5, -6, 5, -2], [17, -9, -1, 11, -2, -11, 3, 10], [21, -19, -16, -5, 8, 8, 7, -7], [-3, 16, 1, 26, -7, 2, 3, 17], [-28, -17, 5, -15, 18, 4, -8, 0], [-9, 11, 3, -5, -6, 3, -6, -11], [-15, 22, 13, 29, -4, 1, -1, 6], [22, 1, 5, 18, -17, -25, 10, 0], [24, 35, 4, 20, -2, -11, 13, 19], [22, 15, 5, 3, -12, -2, 28, -7], [40, -8, 10, 34, -9, -20, 20, -5], [10, -24, -13, -20, 2, 7, 7, -32], [29, 0, 11, 17, 4, -9, -15, 7], [-61, -16, -12, -13, 17, -6, -18, 2], [-52, -5, -7, -9, 10, 1, -26, 21], [-17, 5, 0, -17, 3, 22, 6, -14], [-19, -16, -7, -14, 16, -3, 5, 5], [65, -3, 9, 65, -16, -21, 24, 16], [15, 15, -15, 9, -14, 1, 3, -15], [-47, -2, 0, -30, 3, 5, -17, 3], [-44, -1, -1, -7, 2, 8, -8, 13], [-5, 6, -6, -9, 0, 23, -5, -5], [37, -10, 2, 35, 2, 2, -6, -19], [-4, 4, 7, 28, -7, -8, 24, -12], [17, 4, 14, 0, -17, -11, 0, 18], [17, 25, -5, 32, -16, -22, -11, 25], [-19, -7, 6, 35, 9, -8, -7, 37], [0, -2, 7, -16, 6, 18, 11, -5], [-47, 1, -12, -51, 13, 11, -16, 11], [-8, -8, -9, 19, 12, -18, 2, 3], [10, 8, 15, -9, -9, 22, 12, 7], [11, 14, -7, -3, -1, 8, 6, -22], [32, 17, -5, 18, 1, -10, 15, 10], [25, 13, -15, 41, -11, 5, 5, 0], [2, 12, 1, 27, -19, -3, 8, 2], [13, -1, 13, 27, 7, -5, 27, 2], [3, -10, 2, 18, 25, -19, 0, 17], [-16, 19, -1, -19, -6, 18, 14, -27], [-31, 18, -2, 16, 15, 2, -13, 6], [20, 21, 11, 12, -12, 17, 13, 22], [25, 18, 20, 11, -20, -21, 31, 5], [22, -26, 11, 28, -13, -3, 23, -8], [-19, -6, 15, -5, 7, -9, -23, 24], [-15, 30, -2, 20, 2, -22, -9, 28], [-32, 10, -6, -46, 13, 0, -39, -5], [-39, -5, 9, -49, 4, -15, -17, 7], [-47, 0, 5, -52, 1, 17, -24, -20], [-4, -14, -19, -41, 3, -3, 8, -18], [31, -11, -1, -5, 0, -6, -5, -12], [-18, 6, 0, -5, 8, -5, -15, 20], [25, 14, 18, 28, -15, -11, 27, 4], [-5, 27, 15, 10, 7, -22, 8, 34], [-29, -15, 14, -8, 16, 17, -18, -4], [-14, -16, 12, 23, 12, -5, -3, 36], [-2, -7, -6, 4, 8, 7, 14, -7], [13, -3, 11, 24, -9, 20, 21, -17], [14, -8, 13, 2, -6, -4, 14, -15], [49, -8, 9, 36, -10, 7, 29, -22], [6, 5, 0, -5, 15, -21, -5, 25], [27, -9, 9, 15, -4, 19, 21, 0], [-24, -1, -2, -23, -4, 21, -14, -3], [-6, -2, 0, 17, -23, 3, 13, -2], [19, -19, -6, -6, 13, 13, 7, -12], [59, 4, 17, 29, -3, -1, 16, 19]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_10000_a_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_10000_2_a_be();".
// 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_10000_2_a_be(:prec:=8)
    chi := MakeCharacter_10000_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_10000_2_a_be();".
// 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_10000_2_a_be( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_10000_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![-29, -40, 71, 105, -19, -45, -4, 5, 1]>,<7,R![1, 45, 124, -25, -154, -35, 24, 10, 1]>,<11,R![2421, -3591, -3588, 1617, 970, -82, -58, 1, 1]>],Snew);
    return Vf;
end function;