
// Make newform 8410.2.a.bh in Magma, downloaded from the LMFDB on 01 January 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_8410_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_8410_2_a_bh();".
// 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_8410_2_a_bh();".
// 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, -2, 7, 2, -7, -1, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0], [-2, -10, 4, 14, 1, -2], [-5, -10, 10, 15, 0, -2], [4, 12, -9, -21, -1, 3], [-5, -19, 13, 29, 1, -4]];
    Rf_basisdens := [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_8410_a();"
function MakeCharacter_8410_a()
    N := 8410;
    order := 1;
    char_gens := [5047, 7571];
    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_8410_a_Hecke( : Kf := Kf)
    return MakeCharacter_8410_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 := [[-1, 0, 0, 0, 0, 0], [0, 1, 0, -1, 0, 0], [1, 0, 0, 0, 0, 0], [0, 0, -2, 1, -2, -1], [2, 0, -1, 1, -1, -2], [-3, 0, 0, 0, 1, -2], [0, 0, -2, 2, 0, -1], [2, -3, -2, 2, -1, -1], [0, 3, 0, 0, -3, 2], [0, 0, 0, 0, 0, 0], [4, 2, 1, 0, 0, 6], [-2, 1, 1, 2, -3, -1], [3, -3, 0, -2, 3, 3], [4, 0, -5, 5, -3, -2], [0, -2, 0, 0, -1, -2], [-3, 3, 2, 3, -1, 2], [7, 0, -2, 0, -1, -1], [-4, 0, 3, -8, 6, -4], [0, 3, 1, -1, 1, -1], [-4, 3, 3, -2, 4, 1], [-1, 3, -1, -3, 2, -4], [2, 7, 4, -3, 0, 5], [-6, -2, -1, -4, 8, 1], [4, 0, -3, 4, -6, -10], [11, 3, -2, 9, -3, 5], [2, 5, 6, 1, -6, -1], [0, 0, 7, 1, 2, 2], [-5, -7, -5, -1, 7, -7], [3, -4, -7, 6, -7, -3], [9, 1, -2, -2, -4, 3], [-3, -4, 2, -3, 1, -2], [3, 1, -2, 3, 4, 2], [-1, 4, 4, 0, 1, 5], [3, -1, -3, 5, 5, 2], [-1, 5, -2, -1, -8, 3], [0, -6, -2, -2, 8, -2], [5, 1, 2, -3, 1, 9], [2, 10, 7, -2, -6, 2], [4, 1, 6, 0, 5, 9], [0, 7, 8, -2, -7, 8], [11, 2, 1, 6, -12, -1], [-8, 0, 1, -1, -4, 3], [-2, -1, -4, -6, -4, 0], [2, -8, -2, -7, 1, -4], [-13, -4, -7, -1, 4, -6], [-5, -2, -1, 5, -1, -12], [-4, 8, 2, 3, -6, 3], [11, -3, 0, -3, -6, 4], [15, -8, -7, 10, -12, 2], [17, 8, 12, 4, -7, 10], [3, -11, -11, 4, 3, -4], [-8, 3, 7, 8, -6, -5], [2, -3, 3, 3, 11, -3], [-1, 8, 6, 0, 1, 6], [-19, 4, 4, 0, 1, 3], [4, -4, -5, 9, -8, 3], [2, -2, 1, -12, 14, 1], [7, -2, -2, -4, 10, -5], [11, 3, -6, 16, -6, 6], [8, 4, 1, 1, -5, 4], [6, 5, 3, -9, -2, -5], [1, -8, -2, 7, 9, -16], [2, -1, 6, -2, 7, 12], [-8, 8, 5, -11, 8, -4], [3, 9, 4, -3, 5, 10], [-9, 6, -3, -4, 1, 3], [3, 4, -1, 0, 9, 5], [-3, -2, 2, -8, 8, -3], [-7, 1, 8, -14, 1, -2], [-7, 5, 6, -5, 0, -4], [8, -1, -7, -11, 6, 11], [26, -2, -8, 22, -12, -7], [0, -2, -1, 4, -10, -10], [-11, 10, 7, -5, 0, -3], [-17, -1, 12, -13, 9, 1], [10, 12, 17, -3, -3, 7], [11, -10, -13, 9, -2, -15], [6, -5, -9, 9, -16, -12], [-14, -3, 4, -3, -1, -16], [15, -7, -14, 7, -7, 8], [12, 3, 3, 9, 0, -2], [11, -9, -8, 1, 6, 9], [1, -8, 1, 11, 1, 4], [-15, -3, 0, 0, 14, -5], [-18, 4, -1, 2, -5, -2], [12, -6, 1, -6, 1, -5], [-2, -11, -9, 2, -9, -16], [-13, 1, 9, 0, 2, -6], [-7, 10, -7, 0, -7, -2], [2, 5, -5, -5, -7, -7], [13, -4, -2, -3, 0, 14], [12, 0, -3, 13, -2, -5], [-11, -14, -8, 8, -2, -16], [-3, 0, -3, 2, -3, 14], [2, 7, 4, 1, -17, -4], [4, 3, 2, -1, -6, -5], [20, 7, 1, 5, -4, 14], [15, -12, -6, 0, -1, -11], [21, -3, -2, 0, 0, 23], [15, 3, -11, 13, -6, 11], [-2, -10, -6, 16, -1, 7], [-3, 2, 8, -11, 11, 6], [-16, 13, 4, -3, 0, -12], [21, 1, -9, 11, 1, 6], [19, 0, 14, -1, -4, 15], [5, 5, 7, 8, -10, 13], [12, -12, -1, 8, 2, 5], [-2, -22, -7, 16, 8, -22], [-4, -6, -11, 16, 12, -10], [-13, -3, 13, 1, 0, -11], [-14, -15, -4, -6, 16, -4], [-21, -2, -4, -6, 8, -18], [15, 11, 10, 1, 3, 9], [2, -2, 9, -7, 10, 1], [-14, -11, -4, 16, 9, -7], [13, 1, -1, 12, -10, -15], [7, -11, 3, -3, 18, -17], [3, 2, 4, -14, -4, 15], [21, 0, 8, 13, 5, 5], [15, 2, 14, -6, 2, 5], [-11, -8, -16, 3, 1, -15], [-23, 2, -4, 5, 7, -21], [27, 6, 5, 4, -14, 6], [21, 0, -1, 15, -24, -3], [-9, 7, 5, 6, 7, -3], [2, 19, 9, -6, 1, 15], [24, -10, -4, 9, -22, 9], [-6, -11, -9, -6, 14, 0], [0, 7, 13, 4, -7, -7], [-11, -22, -25, 11, 10, -12], [3, -12, 3, -5, 6, 5], [-21, 2, -5, -23, 10, 1], [-9, 2, 11, 14, 4, -6], [2, -6, -1, -1, 20, -1], [8, -22, -25, 11, 0, -15], [18, -5, 11, 0, -10, 17], [2, -10, 4, -3, -2, -2], [17, -9, -7, 5, -10, -4], [-8, -8, 12, -12, 4, -5], [1, 3, -7, 7, -6, -23], [0, 2, 15, -14, 12, 8], [13, -4, 7, -1, -20, 15], [11, 5, 0, 1, -14, 7], [15, -6, -2, 25, -12, -4], [0, 1, 7, -10, 21, 6], [11, -25, -13, -6, 8, -11], [-27, -6, 3, -14, 13, 3], [-2, 2, 9, 4, 12, 3], [23, -1, 7, 15, 2, 3], [4, 7, -4, 1, -8, -4], [0, -2, 9, -17, -3, 16], [10, 11, 15, -15, 14, 6], [14, 6, 10, 0, 14, 10], [0, -9, 14, -3, 9, 6], [-15, 4, 18, 2, -7, 1], [7, 0, 9, 5, 2, -11], [24, -8, -4, 23, -14, -5], [1, 0, -2, 0, 9, 22], [-20, -11, -6, 5, 8, -21], [12, -4, -14, 19, -16, 1], [26, 6, 6, -1, -1, 15], [-14, 10, 27, -11, 16, 6], [-15, -18, 8, -2, 12, -13], [-10, 1, -6, -14, 11, -18], [-21, -19, -9, -16, 15, -17], [2, -9, 8, -12, 22, 13], [-1, 20, 21, -9, -9, 22], [-7, -4, -8, -7, -1, 3], [15, -1, -8, 7, -12, -15], [17, -4, -9, 2, 5, 29], [4, -7, 16, -7, 14, 11], [-9, -6, -15, 18, -5, 3], [24, -11, -11, -10, 2, 4], [3, -13, -7, 13, 4, 15], [-10, -5, -11, -23, 10, 5], [14, -6, -8, -10, -7, -1], [3, 9, 4, -11, -13, 20], [0, 5, -7, -11, -13, 5], [-22, -10, 14, -19, 8, -6], [13, 13, -3, -10, 0, 7], [-26, -10, -16, -11, 21, -17], [16, -2, 8, 10, -17, 14], [7, -6, -8, 2, -15, -16], [19, 11, 1, 7, 5, 11], [-5, -3, -6, 6, -5, -8], [-7, -2, 19, -7, 21, -2], [-33, -11, -5, 4, 9, -5], [-18, 13, 10, -30, 0, 24], [28, 7, 1, 10, -16, -11], [6, 2, -7, -1, 0, -22], [-18, 4, 0, -17, 12, 14], [-1, -16, -15, 12, 20, -18], [2, 15, 7, -27, -2, -2], [-4, 9, -19, 6, -21, -11], [10, -18, -9, -7, -5, -5], [-2, 22, 16, -21, 13, 24], [-3, 9, -7, -17, -2, -2], [15, 9, -5, 10, -10, -4], [11, -11, 7, 6, 17, 16], [-6, 3, -2, -17, 8, 15], [-13, -17, 6, -29, 27, -14], [-22, 18, 16, -24, 9, 13], [-2, -7, 23, -9, 29, 23], [15, -2, -6, 17, -8, -10], [38, -9, -15, 44, -27, 11], [12, 0, 0, 14, -1, 27], [-16, -22, -5, -1, 1, -28], [7, 9, 8, 7, -4, 3], [20, 8, 10, -16, -13, -7], [12, 12, 1, -13, -11, 1], [-14, 19, 34, -15, 25, 17], [6, 12, -16, 7, -16, -19], [-26, -3, 4, -6, -4, 11], [-14, -17, -7, 7, 15, -28], [32, 4, -10, 14, -6, 11], [-13, -1, -9, -15, -16, -7], [-4, 13, -9, 3, -6, 7], [-11, 6, 13, 9, -19, -2], [-2, 14, 26, -11, 7, 21], [34, -15, -8, 20, -27, 11], [9, 10, -4, -2, 1, 13], [0, 0, -15, 9, -4, -3], [10, 5, 2, -28, 0, -1], [-12, -16, -16, 14, 2, -25], [-9, 1, 3, -35, 9, 6], [-26, -16, -21, 0, 6, -10], [-21, 5, 4, -7, 9, 24], [-12, -10, -10, 20, 4, -30], [-11, 2, -11, 21, -25, -3], [16, -1, -25, 23, -5, -17], [1, 25, 7, -8, -9, 16], [21, 11, -8, 15, -11, 29], [-21, -5, 1, -9, 2, -29], [8, 8, -2, 11, -32, 5], [-27, -3, 1, -12, 19, -24], [1, -5, 13, -11, 0, 21], [11, 9, -7, -20, -15, 25], [5, -18, -5, -3, -15, -12], [-34, -18, -10, -12, 22, -12], [1, 9, 15, -9, 11, 11], [17, 12, 16, 20, -3, 4], [-33, -8, 2, 8, 10, -5], [10, -17, -7, -18, 29, -5], [-2, 22, 17, 5, -30, 15], [-7, 7, -4, -16, -1, -1], [-11, 9, 33, -15, 15, -1], [-8, -1, -14, 26, 2, -4], [-22, -17, 2, -17, 26, -11], [17, -5, -7, 5, -18, -1], [-16, -2, 19, -9, 8, 22], [3, 19, 0, -3, -15, 6], [-8, 9, 2, 23, -9, -23], [39, 3, 10, 2, 4, 31], [-10, -6, -12, 18, -8, 17], [-24, -6, -1, -5, 32, -6], [-20, -13, -4, -29, 41, 2], [-20, -2, 1, -21, 22, 8], [-4, 8, 20, 15, 10, 5], [-18, -2, 19, -23, 8, -3], [27, 4, 7, 22, -4, 23], [-34, -17, -16, 7, 20, -7], [43, 19, 0, 12, -1, 39], [-18, -21, -21, 17, 17, -9], [-58, -2, -17, -13, 7, -33], [10, 8, 12, 1, 7, -4], [-1, -16, -35, 14, 10, -19], [4, 10, 16, -29, 0, -9], [-41, 5, 16, -2, -1, -23], [-20, -5, 21, -18, 2, 15], [-38, -16, 0, 9, -8, -23], [-30, -6, 17, -43, 21, -19], [-23, 12, 6, -10, 4, -20], [-3, 18, 29, -1, -2, 7], [-13, -3, -17, 13, 25, -13], [-41, -26, -21, -6, 10, -35], [-34, 20, 10, -30, 25, -2], [-15, -1, 16, -21, 14, 17], [-27, 20, 5, 4, 4, -6], [-39, -7, 10, 2, -4, -38], [-36, -1, 13, -10, 5, -7], [-6, 9, -9, -35, 4, 16], [20, 26, 10, 9, -5, 42], [-11, -18, -15, -22, 24, -4], [34, -15, -38, 17, -7, 3], [-21, 6, 15, -9, -8, -5], [10, 2, 3, -17, -8, 40], [-36, -18, -23, 10, 11, -22], [33, -28, -11, 14, -16, 0], [1, 10, 4, -3, 4, -21], [-27, -11, -2, -21, 15, -32], [19, -4, 14, 38, 1, 2], [13, -9, 9, -8, -3, 11], [37, -28, -26, 34, -4, -43], [-23, -7, -17, 11, 1, -21], [-2, 14, 2, 1, -26, 23], [3, -15, -5, -29, 10, -13], [-12, -17, 0, -8, 23, 12], [-8, -16, -8, -6, 17, -11], [16, 13, -5, -15, 8, 20], [-25, 21, 26, -2, -8, 14], [-3, 6, 5, -17, -21, 3], [13, -16, -4, -7, 9, 12], [40, -1, 0, 29, -40, 13], [6, -6, 2, -15, -12, -21], [-21, 13, 6, -11, 15, 15], [-22, -6, 23, 2, -13, -9], [-14, 9, 6, -29, 37, 19], [-6, 36, 15, 10, 4, 26], [8, -9, -20, 16, 8, 3], [9, 2, -12, 9, -25, 5], [9, -17, 7, -9, 30, -12], [4, -29, -12, 9, 25, -19], [-21, -9, -15, 2, -5, -8], [6, -14, 18, 4, 6, 15], [50, -5, -26, 42, -21, -24], [23, -5, -18, 37, -11, 1], [26, 6, -3, 42, -25, 2], [15, 10, -3, -7, 4, 43], [24, -24, -12, 40, -19, -15], [26, 21, 25, 9, -23, 21], [-41, -9, -8, -28, 27, 3], [19, -1, 6, 16, 3, 7], [-31, 3, -6, -31, 24, -18], [-18, 20, 28, -10, -14, 20], [5, -23, -4, 20, -3, 14], [-14, -16, 10, 25, 16, -24], [18, 6, 1, 32, -24, 3], [16, 0, -8, -17, -30, 2], [-51, 2, 0, 7, -6, -9], [27, -21, -4, 29, -22, 15], [-11, 31, 37, -22, 11, 28], [-41, -15, 0, -13, 24, -19], [-5, 35, 21, -6, -5, 6], [33, -2, 4, 24, -21, 12], [55, 10, 5, 18, -3, 28], [27, -19, -10, 36, -28, 22], [-29, 15, 19, -2, 44, 13], [-55, 26, 25, -26, 31, 18], [27, -6, -16, 12, 1, -2], [13, -22, -26, 13, -25, -18], [6, 0, -10, 43, -12, -17], [-12, 1, 8, 24, -19, -34], [-40, -3, 13, -16, 27, -13], [-49, -11, -9, -8, 2, -38], [13, 19, 5, 14, -35, 41], [19, 25, 29, 6, -9, 13], [43, -16, -24, 32, -35, 11], [23, 19, 9, 4, -3, 17], [-2, -10, 6, 6, 24, -12], [28, -21, -11, 11, 5, -3], [-33, 2, 18, -38, 19, -31], [20, -10, 3, -22, 7, 19], [27, -9, -3, 14, 19, 10], [-20, -23, -20, 19, 34, -34], [15, -5, -13, -10, -20, -2], [3, -17, -23, 31, 3, 6], [4, -9, 15, -35, 22, -13], [-10, 5, -21, 15, -16, -26], [17, -8, 11, -20, 7, 5], [23, -4, -36, 31, -28, 5], [-37, -19, -24, -9, 18, -26], [-8, 28, 4, -15, -12, 17], [32, 5, 15, 16, 1, 10], [-7, -9, 13, -19, 48, -3], [13, -4, 6, -33, 24, 9], [15, 29, 22, 18, -30, 0], [-4, -19, -3, 13, 0, -12], [-6, -28, -9, -20, 52, -6], [10, -1, 28, 10, 14, 14], [19, -11, -1, -32, 2, -8], [-16, 33, 28, -23, 25, 35], [-15, 11, 10, -24, -1, 20], [38, -1, -10, 16, 2, -23], [-5, 0, -7, 20, -11, -22], [-40, -13, -2, -31, 28, -12], [0, -8, 14, -14, 16, 24], [-4, 34, 14, -25, 7, 7], [13, -7, -12, -17, 12, 32], [-25, 6, 22, -27, 38, -25], [25, -13, 8, 1, 15, -22], [-6, -7, -5, 35, 19, 8], [-2, -18, 6, -38, 18, -28], [-26, -8, -21, -15, 1, -35], [28, 22, 9, -7, -6, -3], [39, -10, 13, 19, -26, 25], [43, 1, -9, 26, -18, 1], [-41, -9, -28, 18, 2, -10], [0, -7, -15, -4, 24, 7], [10, -29, -20, -14, 14, 0], [-39, 2, 20, -4, 23, 19], [23, 31, 32, 1, -4, 18], [-27, -2, 12, 0, 32, 20], [14, -19, -21, 20, -19, -20], [-42, 26, 27, -47, 47, -4], [-12, -16, -13, -11, 32, -34], [16, 33, 3, 18, -36, -5], [26, -15, -16, 39, -11, 0], [27, -8, 7, -16, 26, 34], [20, -2, -30, 6, 12, -17], [-32, 1, 2, -1, 16, -24], [29, -20, -15, -21, 18, 43], [15, 6, 20, 16, 10, 5], [15, 33, 9, -18, 6, 11], [-37, 2, 22, -35, 28, 5], [10, -25, 8, 5, -2, 12], [-4, -12, -9, -19, 20, 10], [39, -19, -4, -2, 9, 32], [32, 15, -6, -6, -12, 15], [-13, 26, 10, -21, -15, 7], [-46, -1, 16, 6, -12, -42], [15, -18, -30, 29, -17, 26], [-4, 8, 24, -18, 47, 43], [-6, 20, 17, -7, -2, 4], [14, -37, -19, 20, 8, -31], [-28, 20, 20, -48, 1, 41], [12, 2, 2, 48, -18, -22], [15, 6, -11, -11, -17, -14], [-9, 21, 10, -15, -15, 4], [-31, 22, 20, -12, 4, 2], [2, 11, -6, -14, 26, -10], [-10, -18, -16, 1, -19, -24], [-3, -36, 1, 14, 5, -6], [47, 5, -18, 30, -18, -22], [3, -21, 5, 5, -10, 0], [23, -39, 9, 8, 3, 13], [-23, 29, 22, -41, 13, 43], [-4, 17, 2, -15, -4, -5], [-2, 24, -10, -2, -6, 23], [-8, 0, 4, -12, 12, -6], [21, 6, 7, 29, -50, -11]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_8410_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_8410_2_a_bh();".
// 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_8410_2_a_bh(:prec:=6)
    chi := MakeCharacter_8410_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_8410_2_a_bh();".
// 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_8410_2_a_bh( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_8410_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![29, -41, -3, 24, -6, -3, 1]>,<7,R![601, 558, 11, -107, -18, 5, 1]>,<11,R![-181, 501, -258, -32, 53, -13, 1]>],Snew);
    return Vf;
end function;