
// Make newform 4410.2.b.f in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_4410_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_4410_b_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_4410_2_b_f();".
// 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_4410_2_b_f();".
// 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, 0, 0, 0, 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, 1, 0, 0, 0], [0, 0, 0, 1, 0, 1, 0, 0], [0, 0, 1, 0, 0, 0, 1, 0], [0, 1, 0, 0, 0, 0, 0, 1], [0, 1, 0, 0, 0, 0, 0, -1], [0, 0, 1, 0, 0, 0, -1, 0], [0, 0, 0, 1, 0, -1, 0, 0]];
    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_4410_b();"
function MakeCharacter_4410_b()
    N := 4410;
    order := 2;
    char_gens := [3431, 2647, 1081];
    v := [1, 2, 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_4410_b_Hecke();"
function MakeCharacter_4410_b_Hecke(Kf)
    N := 4410;
    order := 2;
    char_gens := [3431, 2647, 1081];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0], [-1, 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 := 2;
    raw_aps := [[0, 1, 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, -2, -1, 0, -2, 0, 0, 0], [0, 0, 1, -1, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1, -1], [0, 0, 0, 3, -2, 0, 0, 0], [0, -2, 1, 1, -1, 0, 0, 0], [0, 2, 0, 2, 3, 0, 0, 0], [0, 0, 1, -2, 2, 0, 0, 0], [2, 0, 0, 0, 0, -2, 1, -5], [-2, 0, 0, 0, 0, -1, 4, -1], [-2, 0, 0, 0, 0, 4, 1, -1], [2, 0, 0, 0, 0, 3, 1, -2], [0, 4, -3, -2, -1, 0, 0, 0], [6, 0, 0, 0, 0, 2, 1, 0], [0, -2, 0, -1, 2, 0, 0, 0], [-4, 0, 0, 0, 0, 3, 3, -2], [0, -2, -4, -1, 0, 0, 0, 0], [0, -4, -5, 0, -3, 0, 0, 0], [0, 0, 0, 0, 0, -4, 0, -4], [-2, 0, 0, 0, 0, 2, 8, 2], [10, 0, 0, 0, 0, 0, 2, 4], [0, -2, 0, -4, 0, 0, 0, 0], [8, 0, 0, 0, 0, -2, -3, 0], [0, 2, 1, 2, 1, 0, 0, 0], [0, -6, 3, -2, -1, 0, 0, 0], [6, 0, 0, 0, 0, 3, 2, -7], [0, 0, -8, -4, 2, 0, 0, 0], [4, 0, 0, 0, 0, 6, 0, -4], [8, 0, 0, 0, 0, -4, 5, 2], [0, -8, -1, -1, -7, 0, 0, 0], [0, -4, 2, -3, -6, 0, 0, 0], [0, 10, 1, 2, 0, 0, 0, 0], [-4, 0, 0, 0, 0, 4, -5, -4], [0, -4, -4, -2, 6, 0, 0, 0], [0, 0, 0, 0, 0, 1, -1, -6], [-4, 0, 0, 0, 0, -8, 5, -1], [4, 0, 0, 0, 0, -4, 6, -8], [0, 6, 2, 4, -7, 0, 0, 0], [0, 2, -6, 1, 6, 0, 0, 0], [0, 8, -2, -5, -4, 0, 0, 0], [-4, 0, 0, 0, 0, 6, -8, -2], [0, 4, -9, 0, -3, 0, 0, 0], [0, 0, 13, 4, -4, 0, 0, 0], [-12, 0, 0, 0, 0, 5, -4, 1], [0, -6, -1, -2, 11, 0, 0, 0], [16, 0, 0, 0, 0, 4, -2, -4], [0, 0, -10, -1, -6, 0, 0, 0], [0, -4, 8, 6, -2, 0, 0, 0], [0, -6, -10, 9, -4, 0, 0, 0], [0, -8, 4, 8, -1, 0, 0, 0], [-2, 0, 0, 0, 0, -6, 2, 6], [14, 0, 0, 0, 0, 5, 3, 0], [0, -6, 13, -5, -9, 0, 0, 0], [6, 0, 0, 0, 0, -8, 4, 4], [0, 20, 2, 2, 3, 0, 0, 0], [0, 0, 0, 0, 0, 3, 5, -8], [0, -2, -2, -5, 0, 0, 0, 0], [0, -10, -3, 1, 1, 0, 0, 0], [4, 0, 0, 0, 0, 0, -2, 6], [0, 2, 4, 14, -6, 0, 0, 0], [4, 0, 0, 0, 0, 6, 4, 6], [0, 4, 9, 4, -1, 0, 0, 0], [0, -14, 0, -2, -6, 0, 0, 0], [-4, 0, 0, 0, 0, -11, -8, 3], [2, 0, 0, 0, 0, -10, 0, 0], [0, 0, 0, 4, 4, 0, 0, 0], [0, 6, 6, 3, -14, 0, 0, 0], [8, 0, 0, 0, 0, 4, 9, 9], [0, 12, 4, -5, -8, 0, 0, 0], [0, -4, -16, 0, 0, 0, 0, 0], [14, 0, 0, 0, 0, -8, -7, 3], [4, 0, 0, 0, 0, 2, 2, -12], [12, 0, 0, 0, 0, -10, -11, 1], [0, 26, -3, 2, 6, 0, 0, 0], [0, 4, 2, -6, 0, 0, 0, 0], [0, -6, 6, 3, 2, 0, 0, 0], [0, -20, 8, -8, -11, 0, 0, 0], [2, 0, 0, 0, 0, 20, 0, 0], [-14, 0, 0, 0, 0, -7, -2, -11], [0, -4, 2, -3, 2, 0, 0, 0], [0, 2, 12, 2, 14, 0, 0, 0], [0, 24, -14, -10, -7, 0, 0, 0], [0, 4, -8, 12, -6, 0, 0, 0], [0, -14, -8, 13, -6, 0, 0, 0], [-2, 0, 0, 0, 0, 8, 8, -2], [-6, 0, 0, 0, 0, -4, -2, 12], [-10, 0, 0, 0, 0, -18, 8, 4], [2, 0, 0, 0, 0, 14, -2, 2], [-16, 0, 0, 0, 0, 4, -12, -4], [-10, 0, 0, 0, 0, 10, 4, 6], [0, 22, -4, 4, 5, 0, 0, 0], [-8, 0, 0, 0, 0, -12, 12, -2], [-14, 0, 0, 0, 0, -3, -5, -4], [-10, 0, 0, 0, 0, 4, 7, -6], [-10, 0, 0, 0, 0, 8, 6, 10], [0, 10, 5, -3, 1, 0, 0, 0], [14, 0, 0, 0, 0, 17, -8, 9], [18, 0, 0, 0, 0, 6, -11, 7], [0, -14, 8, 2, 14, 0, 0, 0], [-4, 0, 0, 0, 0, -6, -4, 16], [0, 14, 0, 7, -4, 0, 0, 0], [-8, 0, 0, 0, 0, -2, -6, 20], [0, -8, 7, 18, 3, 0, 0, 0], [-14, 0, 0, 0, 0, -16, 0, 0], [6, 0, 0, 0, 0, -11, 3, -14], [0, 0, 0, 11, 6, 0, 0, 0], [0, -4, 11, 4, -2, 0, 0, 0], [0, -2, 7, 10, -1, 0, 0, 0], [-16, 0, 0, 0, 0, 3, -19, -8], [0, -4, 1, -15, 3, 0, 0, 0], [0, -2, 24, -5, -10, 0, 0, 0], [-6, 0, 0, 0, 0, -2, 1, -2], [0, -16, 10, 13, 2, 0, 0, 0], [0, 2, -1, 1, 23, 0, 0, 0], [-10, 0, 0, 0, 0, -5, 11, -6], [0, -22, -4, -10, 18, 0, 0, 0], [0, -18, 15, 8, 12, 0, 0, 0], [0, -22, -2, -13, 0, 0, 0, 0], [-16, 0, 0, 0, 0, 0, 14, -6], [-14, 0, 0, 0, 0, 0, -18, -6], [0, -2, -1, -16, 13, 0, 0, 0], [0, -2, 18, -3, -6, 0, 0, 0], [0, 14, -3, 4, 0, 0, 0, 0], [-10, 0, 0, 0, 0, 10, 10, 14], [-8, 0, 0, 0, 0, -3, -10, 15], [0, -6, -7, 6, -5, 0, 0, 0], [0, -18, -10, -16, 14, 0, 0, 0], [28, 0, 0, 0, 0, -8, 8, 8], [0, -12, 2, -14, 6, 0, 0, 0], [2, 0, 0, 0, 0, -14, -3, 2], [-14, 0, 0, 0, 0, -8, -1, -23], [-18, 0, 0, 0, 0, 10, 8, 4], [0, -12, 1, -6, -22, 0, 0, 0], [-22, 0, 0, 0, 0, 4, 6, 4], [0, 6, 0, -30, 2, 0, 0, 0], [26, 0, 0, 0, 0, -12, -2, 2], [0, 12, 2, 11, 16, 0, 0, 0], [0, -30, -8, 5, 4, 0, 0, 0], [0, 6, -16, 2, 1, 0, 0, 0], [-4, 0, 0, 0, 0, 0, 0, 16], [0, 12, 10, -10, 0, 0, 0, 0], [0, 0, 18, 9, -12, 0, 0, 0], [-4, 0, 0, 0, 0, 5, 6, -17], [0, -10, 4, 10, 20, 0, 0, 0], [6, 0, 0, 0, 0, 5, -11, 6], [0, -6, -14, 11, 6, 0, 0, 0], [0, -28, -10, 4, -10, 0, 0, 0], [2, 0, 0, 0, 0, 0, -3, -3], [10, 0, 0, 0, 0, -7, -8, 1], [-12, 0, 0, 0, 0, 21, -5, -8], [-16, 0, 0, 0, 0, -6, 5, 3], [-8, 0, 0, 0, 0, -11, -11, 6], [0, 2, 22, -1, 0, 0, 0, 0], [-14, 0, 0, 0, 0, 4, -1, 12], [2, 0, 0, 0, 0, 20, -2, 22], [0, 6, -22, 0, 10, 0, 0, 0], [-8, 0, 0, 0, 0, 16, 13, 10], [0, -18, -19, 14, -11, 0, 0, 0], [0, -8, -5, -19, -11, 0, 0, 0], [-16, 0, 0, 0, 0, -2, -4, 10], [-26, 0, 0, 0, 0, 2, -10, -10], [0, -22, -18, 16, 2, 0, 0, 0], [0, 0, 0, 0, 0, -6, -11, -5], [-6, 0, 0, 0, 0, -4, 19, 8], [0, 2, -4, -6, 12, 0, 0, 0], [18, 0, 0, 0, 0, 4, -5, -8], [-10, 0, 0, 0, 0, 4, 20, -10], [0, 10, 17, 16, -14, 0, 0, 0], [0, 12, 8, -25, 8, 0, 0, 0], [0, 6, -14, 5, 4, 0, 0, 0], [-8, 0, 0, 0, 0, -26, 4, -14], [0, 28, 20, -14, 11, 0, 0, 0], [10, 0, 0, 0, 0, 14, -22, 10], [4, 0, 0, 0, 0, 23, -4, -5], [0, -6, -9, -10, 18, 0, 0, 0], [0, -10, 13, 20, 17, 0, 0, 0], [0, -34, 4, 1, -10, 0, 0, 0], [8, 0, 0, 0, 0, 10, 8, 20], [6, 0, 0, 0, 0, -14, 19, 12], [12, 0, 0, 0, 0, -19, 11, 18], [-4, 0, 0, 0, 0, -12, 9, 9], [0, -10, -5, -29, 5, 0, 0, 0], [8, 0, 0, 0, 0, -12, 10, -8], [0, 0, 0, 0, 0, -29, 1, -12], [0, 26, -15, -5, -3, 0, 0, 0], [-6, 0, 0, 0, 0, 0, 14, -12], [-12, 0, 0, 0, 0, 19, 2, 1], [0, -22, 10, -8, 8, 0, 0, 0], [0, -10, 7, -16, 19, 0, 0, 0], [32, 0, 0, 0, 0, 12, 2, 0], [-12, 0, 0, 0, 0, -18, 8, 10], [0, -6, 7, 8, -9, 0, 0, 0], [2, 0, 0, 0, 0, -21, -7, 14], [-22, 0, 0, 0, 0, -4, 9, 0], [4, 0, 0, 0, 0, 27, 3, -16], [30, 0, 0, 0, 0, -13, 3, -6], [-4, 0, 0, 0, 0, -10, -9, -29], [0, -6, -17, 18, 8, 0, 0, 0], [0, 8, 7, 12, 0, 0, 0, 0], [0, -32, 7, 3, -9, 0, 0, 0], [0, 20, 9, 2, -2, 0, 0, 0], [2, 0, 0, 0, 0, 2, -10, -18], [-12, 0, 0, 0, 0, 20, 4, -10], [0, 32, -17, -6, -6, 0, 0, 0], [0, -16, -10, 4, -2, 0, 0, 0], [0, 20, 8, 19, -4, 0, 0, 0], [0, 8, -6, -11, 2, 0, 0, 0], [8, 0, 0, 0, 0, 10, -16, 4], [24, 0, 0, 0, 0, -22, -16, -10], [-8, 0, 0, 0, 0, 8, 24, -4], [-28, 0, 0, 0, 0, 24, 6, 2], [0, 0, 0, 0, 0, 5, -6, -13], [0, -16, 6, -6, -13, 0, 0, 0], [10, 0, 0, 0, 0, 12, -4, 28], [-14, 0, 0, 0, 0, 13, -6, -5], [0, 2, 17, 5, -9, 0, 0, 0], [0, -10, 10, -6, -10, 0, 0, 0], [-6, 0, 0, 0, 0, -6, -16, -10], [0, 20, -12, -12, -1, 0, 0, 0], [0, -16, 12, 9, 2, 0, 0, 0], [6, 0, 0, 0, 0, -10, 12, 22], [-22, 0, 0, 0, 0, 14, 16, 18], [2, 0, 0, 0, 0, 2, -30, 2], [4, 0, 0, 0, 0, 2, -11, 1], [0, -2, -4, -1, 6, 0, 0, 0], [0, 20, -6, 10, 4, 0, 0, 0], [0, -6, -4, -20, 5, 0, 0, 0], [-14, 0, 0, 0, 0, 22, 5, 13], [0, 16, 2, 11, 0, 0, 0, 0], [-12, 0, 0, 0, 0, -18, 10, 18], [0, 24, -22, -5, -6, 0, 0, 0], [0, -2, 2, -12, 24, 0, 0, 0], [-2, 0, 0, 0, 0, 21, -3, 24], [0, -32, 1, 8, 8, 0, 0, 0], [0, 0, 15, 26, 3, 0, 0, 0], [0, -18, -7, -14, 12, 0, 0, 0], [-24, 0, 0, 0, 0, -9, -8, -13], [0, 2, -5, -12, -27, 0, 0, 0], [0, 24, -8, -3, 2, 0, 0, 0], [0, -12, -6, -12, -4, 0, 0, 0], [-10, 0, 0, 0, 0, 13, 4, -5], [-18, 0, 0, 0, 0, -9, -15, 4], [-16, 0, 0, 0, 0, 11, -6, -21], [0, 6, -1, 16, 3, 0, 0, 0], [16, 0, 0, 0, 0, 12, -19, 14], [8, 0, 0, 0, 0, 3, 24, 23], [0, -10, 0, -12, -18, 0, 0, 0], [-12, 0, 0, 0, 0, -13, -13, 30], [34, 0, 0, 0, 0, 7, 18, -7], [0, 26, 18, 12, 0, 0, 0, 0], [0, 24, 2, -10, -15, 0, 0, 0], [-8, 0, 0, 0, 0, -18, -12, 8], [0, -6, 14, -8, -17, 0, 0, 0], [-14, 0, 0, 0, 0, -11, -2, -21], [0, 38, 7, 9, -25, 0, 0, 0], [-38, 0, 0, 0, 0, 4, -16, -8], [0, 2, -24, 4, -10, 0, 0, 0], [-6, 0, 0, 0, 0, 8, -12, 14], [0, 24, 18, 6, 8, 0, 0, 0], [0, -42, -2, -11, -8, 0, 0, 0], [0, -24, 15, -9, -17, 0, 0, 0], [-12, 0, 0, 0, 0, 0, -1, 7], [0, 30, -14, 19, 10, 0, 0, 0], [0, -14, -16, -20, -5, 0, 0, 0], [-2, 0, 0, 0, 0, -2, 12, 20], [0, 0, 0, 0, 0, 5, 19, 16], [0, 4, -1, -2, -19, 0, 0, 0], [0, -22, 28, 9, 4, 0, 0, 0], [-10, 0, 0, 0, 0, -12, 7, -19], [0, 0, -9, 14, 25, 0, 0, 0], [2, 0, 0, 0, 0, -6, 20, 2], [0, 44, -11, -20, -3, 0, 0, 0], [0, 32, -4, 26, 18, 0, 0, 0], [0, 18, -7, -6, 3, 0, 0, 0], [2, 0, 0, 0, 0, 6, -6, -6], [14, 0, 0, 0, 0, 6, -21, 22], [14, 0, 0, 0, 0, -14, 9, 32], [14, 0, 0, 0, 0, 3, 33, -22], [2, 0, 0, 0, 0, 20, -8, 16], [-16, 0, 0, 0, 0, 0, -13, 3], [0, 46, -4, 1, -2, 0, 0, 0], [0, 6, 17, 13, -7, 0, 0, 0], [0, 18, 26, 23, -26, 0, 0, 0], [-12, 0, 0, 0, 0, -6, -20, -30], [0, -20, -21, 10, -21, 0, 0, 0], [0, -8, 11, 22, 12, 0, 0, 0], [-14, 0, 0, 0, 0, 0, -18, 18], [0, -22, -32, 4, -7, 0, 0, 0], [0, 0, 0, 0, 0, -22, -20, 22], [0, -32, 26, 8, -4, 0, 0, 0], [-8, 0, 0, 0, 0, -24, 3, -6], [20, 0, 0, 0, 0, -13, -13, 16], [-18, 0, 0, 0, 0, 2, -29, -16], [0, 8, 12, -2, 7, 0, 0, 0], [-16, 0, 0, 0, 0, 8, 26, -12], [-18, 0, 0, 0, 0, 12, -2, 12], [0, 16, 10, -8, 10, 0, 0, 0], [0, 6, 4, 28, 10, 0, 0, 0], [0, 22, 32, 12, -30, 0, 0, 0], [4, 0, 0, 0, 0, 14, 14, -6], [0, -34, 3, 14, -3, 0, 0, 0], [12, 0, 0, 0, 0, -18, 4, -16], [-10, 0, 0, 0, 0, 2, -8, 22], [0, 30, -13, -2, -25, 0, 0, 0], [0, 44, -20, -3, -10, 0, 0, 0], [0, -4, 28, -5, -24, 0, 0, 0], [-30, 0, 0, 0, 0, 24, 17, 3], [26, 0, 0, 0, 0, 3, 25, -26], [0, 2, -2, 14, -17, 0, 0, 0], [0, 16, 16, -25, 12, 0, 0, 0], [26, 0, 0, 0, 0, 8, 13, 21], [0, 4, -26, -6, -30, 0, 0, 0], [0, -12, 5, 18, -8, 0, 0, 0], [14, 0, 0, 0, 0, 0, 20, -20], [0, -16, 28, -5, -20, 0, 0, 0], [0, 34, -8, 6, 18, 0, 0, 0], [0, 26, -8, -23, -18, 0, 0, 0], [0, 32, 12, 5, -4, 0, 0, 0], [12, 0, 0, 0, 0, 16, -36, -6], [-14, 0, 0, 0, 0, -30, -17, 16], [2, 0, 0, 0, 0, 12, -4, 18], [0, -12, -17, -9, -19, 0, 0, 0], [0, 8, -14, -8, -23, 0, 0, 0], [12, 0, 0, 0, 0, 4, 14, -8], [0, 4, -28, 10, -4, 0, 0, 0], [0, -2, 20, 18, -22, 0, 0, 0], [0, 8, -15, -22, 3, 0, 0, 0], [-34, 0, 0, 0, 0, -4, 14, -6], [0, -30, 2, -18, -18, 0, 0, 0], [0, 4, 6, 48, -7, 0, 0, 0], [-12, 0, 0, 0, 0, 18, -24, -18], [4, 0, 0, 0, 0, -3, 6, -23], [24, 0, 0, 0, 0, 4, 20, 28], [10, 0, 0, 0, 0, -7, 14, -13], [-16, 0, 0, 0, 0, 0, -1, -7], [0, -8, 8, -26, -19, 0, 0, 0], [0, 48, 16, 2, -8, 0, 0, 0], [50, 0, 0, 0, 0, 14, 25, -23], [0, 8, -19, 33, 15, 0, 0, 0], [-2, 0, 0, 0, 0, -4, 17, 14], [-4, 0, 0, 0, 0, 2, -18, 18], [0, -24, 3, -4, 7, 0, 0, 0], [0, 34, 7, 10, -18, 0, 0, 0], [0, -24, 24, 31, 20, 0, 0, 0], [-32, 0, 0, 0, 0, -1, -17, -10], [-32, 0, 0, 0, 0, 19, -8, 17], [34, 0, 0, 0, 0, -8, 24, 16], [0, 0, -6, 37, 14, 0, 0, 0], [48, 0, 0, 0, 0, 6, 10, -2], [0, 22, -6, 10, -29, 0, 0, 0], [0, 4, -4, 18, 28, 0, 0, 0], [26, 0, 0, 0, 0, -19, -8, 7], [24, 0, 0, 0, 0, 26, -19, 7], [36, 0, 0, 0, 0, -15, -16, -15], [-12, 0, 0, 0, 0, 22, 10, -18], [0, 22, -4, -6, 8, 0, 0, 0], [0, -6, 1, -19, -17, 0, 0, 0], [-10, 0, 0, 0, 0, 8, 29, -17], [2, 0, 0, 0, 0, -9, 4, 35], [0, 34, 13, 11, -21, 0, 0, 0], [0, -22, -16, 6, -1, 0, 0, 0], [0, 24, -22, 16, 10, 0, 0, 0], [12, 0, 0, 0, 0, 24, -10, -4], [-6, 0, 0, 0, 0, 2, -18, -40], [-4, 0, 0, 0, 0, 26, 10, 4], [-12, 0, 0, 0, 0, 24, 0, 20], [0, -14, -24, 6, -19, 0, 0, 0], [0, -58, 20, 3, -8, 0, 0, 0], [0, -22, 15, -13, -27, 0, 0, 0], [0, 2, -15, 4, -8, 0, 0, 0], [0, -24, 0, -22, -9, 0, 0, 0], [22, 0, 0, 0, 0, 22, -3, 3], [40, 0, 0, 0, 0, 26, 15, -28], [0, 16, 8, 15, -16, 0, 0, 0], [0, -2, -28, -2, -52, 0, 0, 0], [26, 0, 0, 0, 0, 18, -18, -14], [0, -10, 16, 22, 4, 0, 0, 0], [22, 0, 0, 0, 0, -22, 16, -18], [0, -36, -12, 6, 6, 0, 0, 0], [20, 0, 0, 0, 0, -6, -18, 4], [0, 34, 0, -2, -8, 0, 0, 0], [0, 6, -8, -33, 16, 0, 0, 0], [-28, 0, 0, 0, 0, 4, -35, -9], [-28, 0, 0, 0, 0, 20, 4, -12], [0, 2, 24, -22, -16, 0, 0, 0], [-24, 0, 0, 0, 0, 1, 9, -14], [-18, 0, 0, 0, 0, 15, 23, 24], [0, 0, 0, 0, 0, 6, -17, -14], [30, 0, 0, 0, 0, 22, 18, -14], [0, -38, 0, -34, -5, 0, 0, 0], [0, -6, 14, -4, -4, 0, 0, 0], [0, 46, 6, -3, -18, 0, 0, 0], [-10, 0, 0, 0, 0, -32, -14, 0], [0, 12, -12, 4, 17, 0, 0, 0], [14, 0, 0, 0, 0, -49, -6, 19], [28, 0, 0, 0, 0, 0, -30, 6], [0, -10, 2, 20, -17, 0, 0, 0], [0, 32, 12, 11, 34, 0, 0, 0], [0, -16, 7, -1, -19, 0, 0, 0], [-10, 0, 0, 0, 0, -28, -8, 8], [-26, 0, 0, 0, 0, -21, 39, -10], [8, 0, 0, 0, 0, -6, 21, 32], [0, -4, 15, -16, -10, 0, 0, 0], [-10, 0, 0, 0, 0, 2, 33, -13], [0, -6, -8, -27, 6, 0, 0, 0], [0, 10, 17, -25, 25, 0, 0, 0], [2, 0, 0, 0, 0, 4, 17, 2], [0, -6, -34, 6, 12, 0, 0, 0], [0, -14, 0, 38, 8, 0, 0, 0], [0, -24, 0, 10, -6, 0, 0, 0], [-4, 0, 0, 0, 0, 1, 28, -25], [28, 0, 0, 0, 0, -10, 18, 26], [-10, 0, 0, 0, 0, 32, -17, 10], [0, 10, 26, -21, -4, 0, 0, 0], [0, 36, 2, 22, -16, 0, 0, 0], [-30, 0, 0, 0, 0, -15, 25, -20], [-38, 0, 0, 0, 0, 13, -23, -12], [0, 14, -7, 2, -22, 0, 0, 0], [0, 0, -7, 13, -19, 0, 0, 0], [0, 38, 4, 26, -2, 0, 0, 0], [-12, 0, 0, 0, 0, -38, 18, -2], [0, 40, 29, -34, 3, 0, 0, 0], [-16, 0, 0, 0, 0, 8, -30, 6], [0, -8, 6, 14, 22, 0, 0, 0], [0, 10, -4, -21, 10, 0, 0, 0], [0, 12, 18, -11, 8, 0, 0, 0], [16, 0, 0, 0, 0, 9, 38, 5]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_4410_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_4410_2_b_f();".
// 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_4410_2_b_f(:prec:=8)
    chi := MakeCharacter_4410_b();
    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_4410_2_b_f();".
// 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_4410_2_b_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_4410_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<11,R![1156, 0, 2032, 0, 852, 0, 56, 0, 1]>,<17,R![-2, -8, -8, 0, 1]>],Snew);
    return Vf;
end function;