
// Make newform 9675.2.a.cb in Magma, downloaded from the LMFDB on 06 June 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_9675_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_9675_2_a_cb();".
// 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_9675_2_a_cb();".
// 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, 3, -1, -5, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0, 0, 0, 0], [2, 0, -5, 0, 1], [-2, 1, 5, 0, -1], [-3, -3, 5, 1, -1], [3, 3, -9, -1, 2]];
    Rf_basisdens := [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_9675_a();"
function MakeCharacter_9675_a()
    N := 9675;
    order := 1;
    char_gens := [7526, 8902, 5851];
    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_9675_a_Hecke( : Kf := Kf)
    return MakeCharacter_9675_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, -1, -1, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, -2, -1, 1, 1], [1, 0, 2, 1, 0], [-1, 1, 1, 0, -3], [-1, 1, 3, -1, -2], [-3, 1, 1, 1, -2], [0, -2, -1, -1, 1], [4, -3, -2, 3, 0], [-3, -3, 3, -1, 1], [-3, -1, 2, 0, -1], [5, 6, 4, -3, 0], [1, 0, 0, 0, 0], [-3, -4, 3, 0, 1], [-1, 0, -3, 3, -3], [2, -3, -2, -4, 2], [-6, 4, 5, 1, -6], [0, 0, 5, -3, 1], [0, -4, -2, -2, -3], [1, -2, -3, -3, 2], [4, -7, -3, 0, 8], [4, -7, -4, 4, 3], [4, -2, 4, 3, -2], [2, 0, 2, 4, 3], [6, 4, 3, 2, -1], [-4, -1, -1, 1, -4], [-1, -2, -4, 1, 4], [3, 4, -2, 3, 3], [-1, 3, 2, 2, -6], [3, 3, 1, 2, 6], [6, -4, -3, 6, 6], [-10, -4, 0, 1, -5], [0, 4, 6, 1, -5], [7, -2, -2, 4, 4], [-1, 11, 10, -4, -5], [0, -7, -4, 3, -1], [-4, 1, -5, 2, -2], [4, -3, -9, 2, 8], [1, 10, -1, -10, -8], [-7, -4, 5, -4, -7], [0, 1, -6, 0, 3], [2, 13, 11, -5, 3], [6, 7, -3, -2, -1], [-1, -9, -2, 9, 8], [4, -7, -10, 11, -1], [1, -5, -2, 2, 4], [-6, -17, -2, 7, 11], [-4, 0, 4, 9, 1], [-2, -12, 3, -6, 2], [6, 9, -2, 6, -6], [-10, 2, 1, 2, -11], [7, -1, -6, 10, 4], [9, -3, -5, 8, 2], [-6, -6, 3, 5, -1], [14, -3, -1, -2, 1], [7, 5, 4, -6, 0], [10, 9, 3, -2, -5], [7, 11, 11, 0, -6], [2, 7, -6, -2, -11], [-6, -2, -9, 2, -2], [7, -2, 5, 6, 5], [-9, -16, -4, 1, 1], [4, -3, 3, 1, 0], [3, 8, 2, -12, -8], [-1, 15, 14, -10, -3], [0, -4, 1, -12, 4], [-13, 2, 4, -5, -8], [-23, 1, 3, 4, -3], [8, -6, -8, -14, 4], [-10, 11, 11, -6, 0], [4, 10, 9, 9, -8], [7, -1, -7, 5, 3], [-8, 5, 7, -2, -8], [-1, 14, 4, -13, -11], [3, 16, 19, 1, -4], [15, 4, -1, -12, 1], [2, 11, 11, 6, -3], [7, -14, -5, 4, 4], [-4, -3, -6, 14, 3], [12, 9, -3, -1, -8], [-12, 17, 15, -7, -19], [-15, -9, 0, 2, -9], [1, -7, -6, 1, -6], [8, 10, 11, -2, -7], [-8, 0, 7, 11, -1], [17, 17, 15, -5, -4], [-15, 10, 6, 4, 1], [21, -5, -12, -7, -6], [4, -17, -7, 24, 7], [7, -17, -22, 9, 3], [-7, 12, 9, -16, -4], [-8, -19, -4, 7, 12], [-8, 6, 14, -3, -13], [7, -12, -13, 4, 3], [-2, -5, -7, -7, 6], [20, -10, -8, -2, 9], [20, -13, -21, 6, 8], [4, -14, -8, 8, 12], [3, -8, 3, 4, 14], [-9, -9, -7, 0, -1], [18, 0, 3, -3, -2], [6, 8, -5, 3, 14], [3, 4, 0, -8, -14], [0, -13, 8, 6, 10], [-31, 5, 6, 3, -1], [-16, -9, 2, -7, 9], [-8, 16, 0, 4, -9], [12, 12, 6, 5, 2], [7, -10, -17, 11, -3], [-8, 13, -3, -1, 9], [2, -18, 5, -5, 15], [0, -7, 3, 1, 15], [20, -13, -11, 7, 14], [18, 22, 8, 0, -11], [11, 19, 9, -15, 2], [8, -4, 8, 2, 1], [-1, 14, 1, 2, 6], [-18, 3, 11, -13, -5], [-14, 5, 0, 0, -11], [-3, 15, 11, 4, 4], [5, 25, 27, -3, -9], [-8, 17, 1, -5, -9], [20, -11, -4, 0, 10], [26, 2, -6, -7, -11], [-13, 17, 16, 0, -10], [-12, -3, 14, -16, 1], [-13, -22, -5, 15, 18], [-1, 14, 1, 12, -11], [10, 3, 17, -10, 13], [-15, -1, 11, 2, -11], [-17, -12, -12, 4, 10], [14, 2, -18, 14, -3], [-22, 5, 12, 4, -8], [-3, 15, 20, -10, -11], [15, -14, -17, -8, 1], [-10, 3, 22, 6, 13], [27, 0, -15, 7, -1], [-1, 11, 12, -10, -6], [-3, 0, -4, 9, -7], [-4, -14, -17, 7, -3], [7, -23, -16, 14, 25], [-18, 5, 10, -4, 8], [-6, -17, -4, 4, -5], [-1, 13, 2, -6, 3], [2, -19, -27, 12, -4], [-12, 14, -2, -1, 5], [18, 22, 0, -5, -7], [7, -17, -26, -1, 7], [-11, 17, 23, 9, -15], [-10, 8, 8, 4, -2], [-13, -2, 9, -8, 0], [-12, 24, 25, -3, -6], [-5, 0, -5, -8, -4], [14, -7, 5, -3, -3], [-6, -3, -10, 1, 17], [-4, 1, 1, 3, -13], [1, -2, 21, 2, 18], [-9, 11, -2, 13, 4], [8, 29, 30, 2, -22], [-7, -6, 9, 15, 8], [-18, 10, 17, -17, -6], [25, 18, 16, -5, -5], [-21, -25, -15, 17, -11], [19, 24, 19, -2, -6], [10, 17, -1, -2, 5], [-6, -19, -12, 14, -2], [23, 3, 10, -5, -8], [-5, -12, -8, 16, -9], [1, 31, 20, -18, -11], [-18, 7, -1, 12, 5], [0, 5, 10, -8, 5], [-3, 16, 4, 6, 15], [-14, 26, 32, 8, -17], [-20, -8, 9, -1, -15], [-6, 0, -8, 9, 10], [27, -12, -14, 4, 4], [3, 3, -16, -5, -14], [-25, 16, 21, -17, -4], [9, 20, -6, -7, -11], [19, -5, 20, 8, -9], [25, -5, -23, 14, 15], [-8, 12, 2, -2, 3], [-11, -27, -6, 11, 15], [-23, 13, 14, 12, -22], [4, -10, 1, -3, 13], [23, 11, -12, 2, -4], [-16, 14, 12, 5, -2], [6, 0, 14, -7, -6], [8, -21, -17, -9, 10], [-18, 13, 20, 5, -26], [-8, -7, -8, -9, -10], [-1, 20, 28, -9, -8], [8, 0, -10, 27, -7], [-15, 1, 13, 2, -17], [-23, 6, -1, 17, -5], [-13, -1, 24, -2, -7], [15, -16, -14, 27, -4], [-17, -13, -12, -2, 15], [-21, -14, -3, 11, -7], [32, -11, -34, 19, 11], [12, -2, -17, 17, 0], [-23, 25, 40, -13, -9], [2, -3, -5, 18, 14], [8, 15, 3, -13, 8], [-5, -2, -14, -3, -12], [-24, -29, -6, -15, 10], [-18, 9, 7, 11, -1], [-6, 0, -10, -15, -3], [6, 16, 4, -12, -14], [12, -6, -16, -13, 16], [14, 2, 12, -10, -11], [-14, 13, 17, -23, -29], [35, 0, -9, 17, -1], [2, -8, 8, 6, -5], [-10, 10, 8, 6, -4], [-1, -7, 1, 18, 9], [2, -20, -20, 15, 9], [30, -16, -15, 0, 13], [18, 17, 4, -18, 12], [-36, -14, 10, -7, 8], [-11, 12, 29, -3, 10], [-19, -33, -1, -8, 2], [16, 31, 15, -8, 3], [9, -4, 5, 11, 24], [2, 38, 30, 0, -25], [-2, -30, 6, 7, 16], [9, -10, 9, 7, 3], [-1, -9, -7, -17, -15], [-33, -6, 6, -18, 3], [-12, 11, -7, 3, 9], [-14, -5, 24, 9, 4], [0, -7, -27, 5, 9], [-22, 1, 12, 7, 9], [-18, -22, 6, -2, 6], [-19, 34, 31, -6, -35], [10, -20, -2, 13, 17], [-12, 6, -4, -7, -4], [0, -12, -4, -2, 16], [24, -12, 2, -2, -3], [-20, -14, 0, -6, -15], [-15, 12, 9, 0, -1], [2, -3, -17, 8, 21], [-43, 0, -7, 12, -18], [-18, 17, 18, -29, -28], [6, -9, 10, 26, -4], [30, 41, 18, -16, -2], [4, -13, -16, 35, -7], [-19, 6, 15, 11, -13], [0, -7, 1, 7, -20], [24, -26, -12, 5, 33], [-4, 3, 4, 8, 11], [20, -1, 7, -1, 10], [-4, 18, 26, -1, -26], [-17, 11, 27, -16, 2], [-5, 12, 10, -1, -16], [-13, -8, -11, 4, 10], [30, 6, -1, -6, 26], [-19, -32, -26, 13, 27], [-23, -14, 11, 5, 5], [-25, 20, 12, 21, -15], [24, -1, 6, -12, -20], [2, 2, 4, 3, 19], [-10, 32, 10, 16, -19], [33, -8, 8, -15, 28], [-7, 31, 4, -26, -7], [19, -11, -2, -7, 19], [-9, -29, -37, -6, 21], [-17, 18, 12, -1, -35], [14, 25, 19, 10, -10], [-20, 18, 10, 2, -12], [7, -12, 5, -4, 4], [4, 3, -39, -6, -4], [8, -28, -19, 5, 5], [-20, -39, -27, 5, 1], [16, -3, 0, 2, 24], [4, 1, 4, 8, -6], [16, 21, 22, 1, -11], [13, -8, 2, 12, 15], [-7, -15, -9, -13, 9], [16, 9, 1, -1, 28], [-31, 18, 5, -1, -24], [30, 13, -5, 12, -13], [-28, 8, -4, -1, -14], [-7, -1, 15, 6, -11], [-3, -6, -20, 7, -1], [2, 18, 17, 12, -5], [-33, 8, 14, -10, -28], [-7, 2, 17, -4, -33], [-3, -9, 29, 3, 20], [33, 14, 3, -18, -3], [-28, 18, 14, -30, -10], [-8, -10, 3, -16, -20], [-20, 16, 23, -28, -18], [-11, -11, -3, 26, 1], [10, -28, 9, 1, 16], [-4, 23, 14, 21, -8], [47, -14, -21, 9, 18], [5, -8, -9, -18, 10], [14, 1, -4, -27, 7], [25, -21, -32, 14, 7], [-45, -4, -12, -4, 2], [-8, 2, 10, -2, -2], [14, 6, -9, 14, 17], [-60, -10, -12, 5, 2], [-16, 22, -19, -20, 12], [27, 11, 16, -3, 3], [7, -39, -20, -7, 24], [-7, -8, 13, 13, 25], [13, 10, 8, -19, 3], [-45, -29, -23, 5, 14], [-3, -8, -17, 6, 26], [4, -10, 18, 19, 19], [-12, -48, -29, 24, 27], [8, 30, -1, -23, -27], [28, 18, -19, 0, -1], [17, 47, 27, -30, -13], [-4, 3, 24, 11, -17], [-19, 14, 6, 7, -1], [7, -5, -25, -24, 13], [-23, -4, 5, 15, -11], [-7, 0, 12, 26, 12], [52, 11, -17, 2, -5], [4, -20, -37, 4, -6], [14, 14, -8, 28, -8], [-16, -27, 26, -8, 7], [-40, -15, -11, 14, 18], [-10, -33, -22, 6, 23], [34, -9, -18, 12, 0], [26, -20, -9, -14, -3], [16, 12, 11, -14, -9], [-44, -9, 4, 13, 17], [-21, 22, 26, -8, 1], [-14, -18, -12, 5, -25], [-4, -3, 13, -20, -3], [38, -23, -40, 19, 16], [23, -9, 27, 8, -1], [2, -28, -1, 21, 32], [-19, -27, -1, 2, 14], [32, 29, -3, -1, -18], [-13, 15, 14, -29, -3], [-8, 9, -4, 4, -16], [-19, 10, 33, -4, -5], [-3, -30, 2, -16, 3], [38, -14, -15, 28, 16], [-14, 2, 4, -12, -3], [9, 14, -14, -9, 0], [18, -8, 12, 27, -4], [-14, 10, 12, -22, -22], [57, 16, 17, -17, 11], [-20, -28, -17, 6, 19], [18, -22, -43, -5, 27], [25, 10, 19, 7, -8], [-40, -21, -13, 11, -16], [-13, 30, -3, 12, -28], [18, 28, 3, -16, 15], [-4, -30, -25, -3, 5], [-31, -2, 1, 19, 9], [-31, 32, 32, 8, -45], [-51, 15, 0, 3, -17], [18, 11, -9, -4, -12], [4, 40, -17, -16, -40], [-2, -6, -39, 3, -11], [8, -36, -34, -3, 27], [-1, -10, -26, 10, -6], [11, -45, -39, 6, 38], [1, 32, 0, -36, 2], [25, -21, -46, 13, 10], [19, 34, -12, -5, -4], [9, 22, 17, -12, -26], [15, -28, -9, -4, 14], [-10, -3, 39, -2, 2], [0, -14, -44, 15, -18], [-15, -10, -3, 27, 23], [-38, -24, 16, -20, 4], [8, 31, 19, -24, -21], [-32, 11, 6, 34, -24], [40, 7, -6, 21, 1], [26, 37, 7, -23, -17], [4, 11, 8, -27, -5], [40, -23, -20, 11, 6], [0, -38, 5, 10, 23], [-22, -47, -49, 4, 23], [27, 24, -7, 20, 3], [-32, 22, 10, 0, -33], [1, 36, 3, -15, -26], [-21, 5, -5, -36, 4], [5, -2, 4, 9, -9], [29, -13, -18, 4, 21], [-34, 10, 14, -2, 11], [-11, -4, 24, 1, 14], [4, -38, 13, 15, 21], [-33, -57, -30, 17, 16], [5, -21, -9, 25, 6], [-36, 9, 32, 13, 10], [16, -38, -16, -38, 12], [-15, 44, 49, -4, 5], [-4, -15, -16, 34, 1], [1, 14, 13, 13, -21], [10, -6, -16, -6, 11], [15, -7, 15, -11, 13], [-7, -37, 7, -8, 25], [-12, 2, 12, -25, -9], [43, -24, -10, -28, 40], [6, 29, 40, 16, -29], [-37, 29, 29, -1, -12], [2, -10, 0, -7, -23], [16, 21, 3, -9, 27], [13, 36, 35, 0, -25], [23, -12, -24, -9, 3], [-37, 21, 33, 13, -24], [-18, -25, -20, 22, 28], [-40, 31, 14, -7, -40], [13, 44, 15, -35, -6], [13, -33, -10, 9, -4], [13, -1, 6, -14, 0], [-13, -1, -18, 1, -20], [-49, 26, 11, -31, -9], [-16, -60, -46, 33, 9], [-23, -10, -1, -3, 20], [39, 0, -27, 23, 14], [-32, 27, 57, 1, 3], [0, -27, -8, 20, 35], [36, 23, 27, -2, -13], [-2, -2, -2, -29, 9], [10, 15, 1, -34, -8], [7, 34, -12, -29, -14], [-5, 21, 28, 10, 1], [4, -37, -56, -6, 12], [54, -28, -32, 14, 18]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_9675_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_9675_2_a_cb();".
// 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_9675_2_a_cb(:prec:=5)
    chi := MakeCharacter_9675_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_9675_2_a_cb();".
// 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_9675_2_a_cb( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_9675_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![-1, 3, 1, -5, 0, 1]>,<7,R![5, 2, -14, -11, 0, 1]>,<11,R![191, -281, 108, 7, -9, 1]>,<13,R![305, 183, -57, -40, -1, 1]>],Snew);
    return Vf;
end function;