
// Make newform 10000.2.a.bl in Magma, downloaded from the LMFDB on 16 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_bl();".
// 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_bl();".
// 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 := [-5, 10, 25, -45, 1, 23, -6, -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, 0, 1, 0, 0, 0, 0, 0], [6, -3, -29, 16, 15, -8, -2, 1], [-7, 12, 42, -37, -22, 17, 3, -2], [-10, 3, 57, -31, -30, 16, 4, -2], [-11, 19, 66, -54, -36, 25, 5, -3], [22, -25, -133, 100, 72, -49, -10, 6]];
    Rf_basisdens := [1, 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_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, -1, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 1, 0, 0], [0, -1, 0, 0, -1, 1, 0, 1], [1, -1, -1, 1, -2, 0, 0, 1], [0, -1, 0, 2, 1, 2, 1, -2], [-1, 1, -1, 1, 1, 0, 1, -3], [-2, -1, -1, 2, 1, 1, 2, -3], [-2, -1, 1, 3, 0, 3, 2, -2], [4, -1, 0, 2, 0, 0, 1, 0], [-1, 1, 1, -1, 1, 1, 3, -2], [-1, -1, -1, -2, -3, 0, 0, 3], [-2, 3, -3, -3, 0, -2, 2, 1], [1, 1, 3, -1, 1, -1, -3, 1], [3, -3, 1, 1, 0, -1, -1, 1], [3, -2, -1, 3, 1, 2, 4, -3], [-1, -4, 2, 3, 0, 1, -2, -4], [0, -3, 1, -4, -1, 0, 2, 3], [2, 2, -1, -4, -4, -2, 2, 5], [4, -3, -3, -4, -4, 1, -3, 6], [8, -6, 2, 0, -2, 1, -3, 5], [6, 3, -1, -1, 3, 1, 2, 1], [2, -2, 1, -5, 0, -4, -3, 7], [-2, -1, 1, 2, 3, 2, 7, 0], [0, -2, -6, -4, -6, -1, 3, 4], [-4, 4, 2, 1, 0, -2, 4, -4], [7, 1, -4, -3, -2, -1, -1, 2], [-12, 3, 1, 0, 6, 2, 8, -8], [1, 0, 1, 6, 0, -2, 1, -7], [6, -4, -2, 5, -1, 3, 1, 8], [5, 2, 1, 0, 1, -2, 4, -2], [0, 2, -1, -7, 0, -4, 4, 0], [5, -2, 4, 5, 5, 0, 6, -8], [-2, 5, 2, 2, 1, 0, 0, 3], [7, 2, -1, -3, -4, -2, -6, 11], [9, 3, 6, 0, 1, -2, -9, 8], [5, -4, 3, -2, -2, 1, -3, 3], [-4, 0, 2, -2, 0, 2, 9, -3], [5, 4, 1, -6, 4, -3, -4, 0], [3, 5, 3, -8, 4, -4, -5, 3], [-8, -4, -7, 6, -5, 3, 2, 0], [15, -1, -1, 3, -1, -1, -7, 5], [4, 5, 7, 0, 6, 2, 1, -7], [3, -2, -1, -2, 0, -2, 3, 8], [0, 1, -2, -1, 5, 0, -2, -2], [-5, -1, -3, -4, 4, 2, 6, 0], [0, 1, 1, 3, 0, -2, -5, -7], [6, 1, 2, 5, 1, -2, -4, 3], [-11, -1, 2, 2, 0, -2, 0, 2], [6, 5, -4, -3, 2, -5, -1, 1], [-1, -1, 3, 4, -1, -4, 0, -10], [0, -7, 0, 1, 3, -3, 3, 3], [11, -2, -4, -1, 0, -1, -6, 11], [-2, 6, -7, 2, 2, 1, -1, -4], [5, -4, -4, 1, -2, -5, -5, -1], [5, 3, 0, -1, -4, 5, -3, 7], [-2, -8, 1, 5, 1, 1, 9, -9], [-3, 11, -1, -6, 1, 2, -3, 1], [7, -6, 4, 11, 3, -3, 2, 0], [12, -5, -2, -1, 0, -1, -8, 12], [11, 4, -4, 0, -6, 2, 2, 7], [12, -2, 6, 1, 0, -2, -7, -2], [-8, 4, 4, 5, 5, 6, 3, -8], [-9, -6, 0, 11, 2, 7, 6, -15], [2, 4, 4, -7, 4, -5, -1, 1], [10, -8, 4, 6, -4, 7, 2, -4], [17, -6, -3, -3, -12, 0, -1, 14], [12, -5, 5, 6, 3, 5, -3, -4], [-8, 12, 0, -3, 6, -5, -1, -3], [2, 8, -2, -10, -4, -3, 4, 4], [7, -3, 2, -8, -5, 3, 1, 8], [5, 4, -1, -6, 4, 0, 10, 8], [-2, 6, 0, -11, 2, -4, 0, 1], [3, -3, -10, -8, -6, 5, 0, 9], [8, 0, 1, -8, 6, -5, 3, -3], [-2, 9, 0, -5, -2, 2, 6, -3], [-5, 2, -5, -7, -8, -2, 3, 10], [-5, -5, -5, 5, 6, 6, 9, -14], [-13, 1, -3, -10, -3, -4, 9, -2], [0, 2, 3, -9, -8, -6, -12, 9], [-1, 2, -1, -3, -4, 3, -3, 4], [0, -4, 3, 1, -2, 0, -4, 7], [6, -3, -5, -6, -9, 0, 3, 10], [-6, 3, 6, -4, 3, 4, 7, -10], [13, -6, 0, 4, 3, 0, 4, -4], [12, -8, -7, 4, -12, -2, -8, 16], [1, 4, -1, -1, 4, 7, 4, -1], [3, -3, 1, -5, -8, -2, -6, 10], [-4, -1, 3, 4, 3, 2, 6, -20], [6, -5, -8, 0, -9, 3, 8, 6], [-18, 8, 1, 6, 2, 6, 13, -10], [-2, -8, 1, -1, 3, 6, 4, 4], [4, 2, -6, -1, -12, 1, -2, 16], [5, 5, 0, 9, 0, 3, 2, 1], [1, -9, -2, 9, -1, 9, 13, -7], [1, -5, 6, -2, 4, 3, -4, 1], [-24, 16, -3, -3, 8, -4, 12, -17], [16, -4, 5, -1, 0, 0, -8, -4], [-2, 7, -4, -5, 0, 4, 8, 8], [14, 5, 3, -11, -3, -6, -4, 21], [11, -5, 10, 5, 6, -2, -7, 1], [5, -6, 3, 11, 1, 3, -3, 0], [8, -3, 1, 4, 3, -3, -11, -6], [-8, 9, 7, 7, 3, -4, -5, -11], [6, -4, -1, -9, -1, -3, -11, 15], [15, -2, 0, 4, -11, -1, 2, -3], [-9, -2, 0, 0, 7, 4, -1, -11], [-6, 4, -4, -10, -8, -2, -14, 7], [3, -2, -1, -2, 1, 7, -6, 10], [-2, -11, -6, 22, -4, 5, 6, 0], [-14, 15, -5, -7, 5, -6, 0, -7], [-13, 1, -9, -4, -4, 6, 11, -7], [9, 5, -7, -2, 0, -3, -7, 3], [-8, 26, 4, -9, 4, -5, -2, 0], [20, 2, 1, -1, 1, -1, -5, 10], [19, -4, 3, -6, -6, -2, 2, 17], [-14, 2, -3, -12, -12, 2, 0, 15], [13, -17, 1, 11, -5, 10, 7, -5], [-11, -12, -2, -5, -10, 1, -4, 1], [-3, 1, -1, -11, -10, -3, -5, 20], [-7, 3, 0, -7, -1, -12, -3, -5], [-2, -4, 0, 12, 5, 8, 9, -7], [16, 6, 6, -3, -4, -6, -9, 5], [-14, 2, -1, -5, 10, -1, 11, -7], [-1, 14, 1, -8, 1, 1, -8, -6], [-15, -5, 7, 0, 7, 5, 15, -24], [1, 12, -7, -10, -3, 3, 6, 11], [10, 13, 5, -7, 4, -2, -7, 13], [14, -7, 9, -9, -8, -3, -14, 8], [-3, -1, -10, -17, -5, 6, 5, 9], [-1, -1, -8, 4, -11, 3, -10, 8], [-25, -1, 4, -1, 10, 8, 16, -25], [2, -9, 5, -3, 3, -4, -3, -4], [-3, 17, 3, -10, 14, 0, 4, -2], [-10, -15, 1, 1, -14, 6, 4, -2], [5, -11, -8, -1, -13, -4, -6, 20], [-10, 2, 6, -2, 6, 1, 5, -25], [17, -4, 5, 4, -3, 5, -3, -1], [16, 2, 6, -16, -8, 1, -13, 21], [-3, 15, 2, -25, -7, -1, -1, 5], [13, -10, 3, 4, 1, -2, -4, -4], [-14, 2, -3, 8, 10, 8, 0, -20], [-4, -3, 8, 10, 9, 11, 6, -25], [-15, 6, 2, 2, 16, 8, 2, -16], [-28, -2, -6, 6, 3, 15, 13, -13], [10, 7, 6, 16, 6, -4, -4, -9], [6, -12, -2, 14, 7, -1, 9, -25], [1, -7, -1, 14, -6, 4, -2, 6], [-18, 14, 13, 12, 10, 3, 1, -23], [1, -4, 0, -3, 3, 3, -4, 10], [19, -9, 0, 1, 2, 0, 6, -5], [14, 1, 1, 14, 7, 0, -12, 6], [23, -14, -3, -3, -1, -3, -4, 19], [5, 8, -1, 1, -2, -1, 0, 2], [1, -4, -10, 18, 1, 4, -1, -8], [25, -5, 1, -4, -9, 0, -13, 30], [19, 9, 4, -4, -7, 4, -9, -4], [8, 5, 7, 6, 10, -5, -1, 8], [5, 11, -4, -15, -6, -10, -21, 17], [20, 3, 8, -14, -3, -8, -5, 16], [-3, 0, -1, 12, -1, 0, 15, -10], [12, 4, -7, -2, -8, -3, -3, 35], [6, 4, -3, 2, -1, -1, -22, 10], [-10, 5, 5, 9, 5, 0, 10, -18], [-26, 2, -4, -10, 0, -1, 25, -15], [-15, 13, 4, -26, -4, -11, -6, -7], [11, -16, -9, 18, -3, 0, -6, 2], [3, 10, 5, -15, -9, -13, -17, 3], [13, -7, 0, -9, -8, 9, -10, 18], [-13, 7, -4, 2, 19, 4, 21, -6], [-5, -2, -3, -15, -2, -1, 8, 20], [-3, -14, -5, 7, -6, 8, 0, 14], [8, 1, -4, -4, 7, 5, 18, -2], [-1, -2, -11, -16, -8, -10, 1, 25], [-6, 12, 5, -18, 0, -8, -10, 9], [5, -16, 8, 18, -6, 4, -3, -18], [17, -8, -1, -7, -10, 2, -5, 27], [-17, -8, 1, 4, 3, -1, 9, -20], [-32, 14, 0, -9, 6, -10, 13, -25], [-1, -9, -2, -21, -15, -8, -16, 31], [-46, 12, -1, 0, 11, 4, 13, -20], [-15, -5, 0, -3, 0, -6, 2, -6], [6, -1, -13, -5, 0, 0, -5, 8], [-32, 11, -14, -16, 0, -2, 20, 6], [-4, 5, -10, -2, 2, 4, 14, -3], [-6, -6, 3, 8, 13, 4, 16, -16], [9, -1, -12, -7, -10, 1, -9, 12], [5, -4, -13, 0, -4, -2, -3, 9], [-17, -5, -2, -23, -9, -6, 4, 5], [14, 3, 4, -10, -17, -3, -28, 17], [41, -18, -1, 5, -11, 3, -12, 34], [-2, -3, 5, 12, 4, 7, -11, -16], [14, 2, 5, -9, 2, 5, 5, 9], [-3, -5, 9, 19, 6, 10, 19, -38], [-2, 1, 10, 9, 11, 2, -1, 13], [1, 7, -12, -14, -6, 1, -10, 20], [-8, 1, 4, 0, 6, 4, -5, 3], [0, -2, -4, -9, -4, 0, 1, -13], [7, -1, 4, 2, -6, 9, 0, 18], [9, 1, -7, -12, -2, -19, -6, 5], [14, -6, 0, 8, 6, -11, -19, 5], [-26, 2, 1, 0, 4, 7, 7, -14], [-15, 2, -7, -16, -7, -7, 6, -15], [-23, 16, 10, 3, 14, 3, 9, -26], [-1, 9, -8, -7, -8, 0, 9, 18], [-1, -5, -1, 20, 13, 7, 27, -21], [-17, 4, -1, 15, 19, 7, 19, -22], [3, -7, 2, 25, 7, 5, 18, -25], [19, -22, -13, -6, -22, -6, -7, 27], [-15, 7, 10, -6, 6, -13, -8, -19], [7, 7, 13, 7, 8, 5, 3, -17], [-17, -11, 0, -21, -9, -12, 0, 13], [12, -14, -3, -16, -9, -2, -6, 9], [28, -1, 8, -1, 0, -4, 3, 10], [23, -12, -4, -17, -14, -1, -7, 40], [16, -1, 4, 2, 7, -2, -2, 12], [-11, -3, 10, -3, 11, 7, 4, -5], [-15, 11, -6, 24, 16, 6, 18, -34], [9, -3, -5, 11, -11, -2, 2, 0], [14, -23, 1, 20, 1, 5, -2, 0], [6, 7, -13, -18, 0, -2, 13, 23], [5, 0, 16, 11, 17, 4, -10, -7], [10, -4, -9, 6, -11, -4, -7, 26], [6, -10, -2, 13, -1, 0, 4, -30], [-2, -11, 5, -10, -5, -7, -12, 10], [-1, 13, -7, -8, -12, -3, -8, 21], [-19, 2, 8, 9, 4, -14, -7, -18], [12, -6, -10, 7, -14, 5, 0, 16], [33, -11, -2, 17, 9, -2, -4, -11], [10, 1, -11, 1, -2, -3, -16, 11], [-6, 1, -12, 20, 3, 1, -1, -10], [-4, -14, -9, -2, -18, 1, 4, 1], [3, -16, -11, 2, -10, -1, 2, -7], [0, -4, 5, 22, -1, 6, -19, 4], [-7, 10, -8, -13, 6, 9, 3, 14], [-22, 22, 0, -2, 6, -6, -4, -9], [7, 7, -3, 0, -2, 5, 0, 20], [-22, -8, -8, 10, 14, -1, 30, -32], [3, -3, 17, 18, 19, -8, -4, -14], [22, -3, -5, -3, -19, 12, 3, 9], [18, 1, 4, -23, -8, -13, -25, 6], [-36, -11, 1, 10, 3, 13, 6, -9], [-4, 6, -1, 0, 7, -5, 14, -21], [22, -8, 3, -20, -5, -3, -3, 36], [-5, 12, -19, -21, 4, -2, 5, 19], [-9, -5, 3, 9, 7, 20, -3, -4], [15, 9, 2, -18, 5, 2, -27, 17], [30, -4, -2, -5, -9, 4, -13, 14], [6, -22, 0, -6, -16, -1, -4, 14], [1, -10, 12, 20, 11, 1, 15, -5], [-9, 16, 8, -10, 1, -15, -8, -9], [-9, -10, 3, 9, 7, 4, 12, 0], [-7, 1, 12, 6, 16, 11, 13, -30], [10, 4, 7, 7, 17, 3, 21, -24], [3, -16, 1, -18, -3, -7, -10, 16], [6, 12, -9, -22, 11, -14, -1, 25], [-3, -3, 12, 22, 9, 0, 20, -30], [-21, -15, -2, 1, -4, -1, -3, -18], [-16, 7, -10, -11, 2, 1, 23, 10], [27, 2, -5, -17, -12, -4, -8, 7], [-38, 10, -11, 13, 12, -1, 18, -47], [-30, -2, -1, 10, 12, 8, 17, -15], [-20, 18, -5, -12, 14, -7, 7, -15], [12, -17, -6, -14, -21, 5, -6, 14], [-12, 20, -10, 0, 3, -2, 23, -8], [11, 12, -20, 0, -8, -7, -24, 12], [33, -6, 6, -6, -2, -5, -25, 21], [2, 19, 6, -13, -6, -1, -1, -5], [28, -6, -5, 13, -8, 8, 10, 17], [21, -27, 9, 17, -4, -1, -8, 2], [4, 11, -2, 0, -1, -3, 0, -22], [-33, -5, 2, 7, 12, 3, -1, 4], [13, 8, 5, 12, 17, 6, -12, -6], [-15, 0, -4, -12, 3, 12, 7, 8], [-43, 11, -15, 14, 3, 5, 22, -21], [18, 7, -14, -10, -16, -16, -7, 17], [-24, 6, 3, 8, 14, -3, -3, -5], [-8, 20, -2, -6, 5, -6, 15, 2], [-6, -6, 6, 2, 11, -1, 13, 10], [-32, -5, -3, 9, 9, -4, 15, 6], [20, -7, -6, 9, -6, 0, 1, 21], [-8, 0, -9, -1, 4, -13, 7, -30], [-1, 1, -2, 23, 13, 5, 16, -26], [-1, -15, -4, -14, -3, 3, -11, 13], [58, -22, 4, 3, -6, -7, -15, 36], [28, -20, -6, 10, -9, 5, 9, 14], [15, -20, -2, 23, -18, 0, 3, -14], [21, 10, 1, -22, -3, -6, 10, 4], [9, -6, 0, -6, 5, -7, -7, 30], [-7, -18, -5, 12, -10, 9, 24, -26], [8, 7, 3, -31, -2, -5, -14, -4], [-12, 7, 1, -21, -20, -11, -27, 19], [20, -22, 15, -1, -9, 6, -9, 10], [-36, 20, 11, 8, 17, 7, 31, -31], [-17, -6, 3, 3, 10, 4, 27, -34], [26, -30, -3, 33, -10, 6, 2, 1], [2, 28, -8, -22, 4, -14, -13, 37], [4, 5, -9, -1, 20, -5, 8, -28], [-17, 12, 9, 11, 7, -6, -11, -8], [15, -2, -3, -9, -14, 4, -1, 25], [20, -9, -15, -29, -1, -12, 9, 31], [1, -15, 17, -12, 4, 6, 4, -5], [27, 7, 10, -26, 9, -23, -19, 19], [43, -15, 6, -2, -4, -11, -11, 15], [19, -15, 4, 21, 1, 2, -14, 6], [-28, 24, -15, -12, 4, -15, 7, -41], [4, -2, 6, 10, -16, 1, -17, 13], [-28, 3, -2, 16, 3, -1, 4, -35], [2, -2, -2, 4, -2, -5, -16, 20], [-9, -7, 4, 2, 15, 0, -14, 7], [26, -14, 0, 6, -13, 14, -9, 22], [-20, 13, -7, -19, 6, 13, 13, 11], [18, 12, 10, 9, 9, -8, -23, 30], [-17, -6, 16, 23, 19, 18, -8, -21], [5, -14, -18, 8, -7, -2, -13, 15], [-26, 14, -4, -20, -6, -1, 13, -7], [5, -8, -8, 0, -30, 7, -19, 35], [30, -11, 10, 6, -14, 8, -16, 15], [-16, 2, 14, 15, 21, 13, 17, -41], [26, 11, -2, -10, 9, -10, 5, -14], [-31, -10, -11, 12, -5, 2, 22, -25], [1, -14, -2, 5, -7, 11, 1, -7], [-24, 14, -12, -10, -5, 3, -4, -9], [-4, 11, 5, -27, -4, 2, 3, 7], [-27, 33, 12, -4, 3, -1, -3, -31], [38, -6, 0, -26, -8, 1, -16, 13], [15, 5, -8, 13, 6, 11, 15, 0], [-61, 14, 0, -16, 0, 7, 23, -20], [5, -15, -5, 42, 13, 18, 16, -2], [15, -15, 8, 18, 18, -3, 4, 5], [-1, -7, 6, 21, 12, 12, 14, -43], [2, -11, 3, 19, 9, 6, 2, -33], [-22, 21, 0, -31, 8, -14, -7, -1], [6, -13, 8, 35, -3, 12, -12, -7], [-11, -24, -5, -4, -16, 7, 0, -19], [13, -19, 4, -24, -16, -4, -3, 34], [14, 2, -1, 4, -21, 10, -8, 19], [-39, 13, 7, 10, 12, 15, 2, -32], [-15, 19, -13, -22, -2, 5, -8, 13], [29, -23, 14, 28, 9, -6, -3, -29], [25, -24, 4, 21, 4, -11, -28, -12], [14, 6, 3, -18, 6, -14, -23, 25], [30, 3, -7, 1, -3, 11, -7, 20], [-20, -19, 1, 16, -7, 3, -12, -32], [-18, 18, -12, 21, -2, 7, 4, -28], [-36, -19, -8, 22, -9, -1, 23, -11], [-3, 3, -3, 4, 16, -10, 4, -34], [-4, -19, 13, 37, 13, 22, 0, -18], [-39, 2, 13, 3, 12, 11, 26, -49], [-23, 9, -18, -16, -18, -1, 7, 5], [-16, -15, 5, 1, -4, 4, -8, -27], [7, -8, -3, -13, -19, -12, 0, 22], [25, -6, 15, 9, 12, -6, 14, 6], [15, -27, 7, -5, -7, 7, -32, 27], [12, -15, -6, 17, -4, 4, -10, 29], [-6, 19, -13, -29, 0, -30, -4, 14], [14, 9, -1, -9, -12, 1, 20, 16], [-9, 19, -8, 8, 4, 10, 8, -14], [-51, 28, 4, 4, 14, -4, 13, -23], [15, -14, 4, 1, 1, -7, 6, 34], [-30, 1, -18, -7, -14, -7, -3, 22], [-8, 8, -7, -22, -15, 1, -24, -3], [7, -15, -2, -1, -4, 1, -22, -5], [26, 11, 3, -32, -1, -10, -22, 40], [-3, -11, -27, -11, -17, -5, 4, 32], [-3, -3, 3, 5, -6, -4, 4, -35], [-4, 16, -6, -27, -4, -21, 2, 9], [-4, 7, -4, -23, 1, 7, -23, 12], [-5, 13, 7, -24, -7, 0, 19, 6], [17, -17, -6, 2, -22, 15, 11, 15], [-8, -12, -6, 2, -24, 9, -25, 28], [17, 9, -4, 13, 13, 0, 8, 3], [17, 5, -9, -8, -6, -3, -8, 3], [21, 8, 4, -4, -11, 5, -15, 61], [29, -9, -4, -13, -2, 1, 9, 18], [10, 9, -5, -4, 2, -24, -21, 34], [-20, 15, 6, 3, 21, -2, 16, -30], [-9, 21, 12, -24, 21, -10, -24, 22], [-5, 33, -1, -3, -2, -4, -17, -2], [-9, 10, 18, 38, 14, 3, -17, -22], [-10, -18, -3, 23, 7, 7, 9, -2], [-13, 45, -4, -38, 5, -20, -20, 23], [14, -32, -4, 29, 0, 9, -9, 7], [16, 4, -10, -8, -22, -7, -20, 20], [23, 0, 7, 13, -14, 14, -26, 12], [7, -17, 2, 7, 12, 1, 25, -6], [45, -15, -2, -8, 6, -18, -21, 24], [-9, -10, -10, 5, -14, 6, -10, 6], [26, -13, -7, 11, -21, -12, -22, 17], [13, -6, 15, 4, 10, 8, -19, 17], [-6, -9, 10, 31, 12, 13, 8, 9], [-18, -2, 11, -22, 9, 9, 18, -25], [-38, -24, -10, 19, 13, 22, 30, -43], [-18, 15, 13, 13, 7, -5, -1, 11], [-30, -4, -6, 17, 3, 2, 15, 12], [6, 17, 21, 4, 29, 10, 10, -21], [-13, 9, -9, 1, -15, 4, 20, -6], [3, 0, 11, 5, 4, 27, 9, -21], [6, 13, 15, 8, 10, -19, 7, -16], [-20, 14, 15, 2, 5, 2, 4, -46], [-44, 3, -3, -18, 16, 3, 27, -14], [-15, 4, -7, -19, -8, -6, 9, 14], [-1, 3, 4, 9, 22, -13, 5, -24], [-29, 17, 5, -1, 14, -2, -2, -39], [19, 0, 20, -1, 16, -1, -14, -6], [7, -19, -10, 14, -12, 2, 21, -26], [-10, 2, 13, -14, 13, 0, 21, -33], [11, 8, 5, -10, -17, -2, -27, 16], [-19, -2, 8, -14, -4, -4, -9, 2], [-18, -7, 11, 4, -6, -14, -10, -20], [0, -24, 24, -2, 10, 7, 8, 2], [9, -10, -11, 20, -19, 28, 12, 13], [-44, 34, -17, 8, 21, -8, 22, -38], [-16, -25, 18, -6, 12, -7, -10, -23], [-52, 5, -22, 21, -4, 14, 15, -29], [29, 10, -19, -4, -16, 0, 6, 19], [-2, 0, -17, -7, 10, 3, -4, 17], [6, 0, 14, -25, 5, -5, 16, -2], [-2, -1, 4, -5, 2, -2, 7, 19], [21, 2, -14, 6, -11, -1, -20, 9], [-2, -6, -25, 2, -18, -7, -9, 54], [-30, 22, 18, 11, 33, 4, 13, -45], [-7, -15, -2, 27, 9, -6, -6, -26], [-55, 15, -5, 9, 17, -5, 8, -33], [-6, 18, 4, 5, 18, 15, 6, -23], [21, 26, -6, -24, 15, 1, -18, -2], [40, 8, 1, -16, -6, -6, -20, 60], [42, -7, 11, 2, 3, 13, 0, 21], [-47, 14, -1, 7, 23, 2, -10, -45]];
    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_bl();".
// 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_bl(: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_bl();".
// 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_bl( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_10000_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![-5, 10, 25, -45, 1, 23, -6, -3, 1]>,<7,R![421, 779, -622, -385, 226, 55, -28, -2, 1]>,<11,R![1, -5, -74, 35, 96, -50, -14, 5, 1]>],Snew);
    return Vf;
end function;