
// Make newform 912.3.z.c in Magma, downloaded from the LMFDB on 09 January 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_912_z();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_912_z_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_912_3_z_c();".
// 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_912_3_z_c();".
// 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 := [42436, 0, 219143, 0, 122933, 0, 24582, 0, 2118, 0, 79, 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], [1412407522, 0, 2008429407, 0, 548477608, 0, 51672008, 0, 1921270, 0, 23747, 0], [-489645314, -1987221747, 0, -838656513, 0, -148061635, 0, -11032807, 0, -343574, 0, -3718], [-413363737922, -182223806939, -326124349666, -39381180635, -98838992816, -2112079593, -12298747754, -172175507, -590646496, -12151548, -8626044, -220608], [-413363737922, 182223806939, -326124349666, 39381180635, -98838992816, 2112079593, -12298747754, 172175507, -590646496, 12151548, -8626044, 220608], [477615621610, 160151011965, 285609782221, -4970958763, 20172904114, -13414445723, -1543775330, -1898556241, -153749748, -88917860, -2719097, -1259260], [477615621610, -160151011965, 285609782221, 4970958763, 20172904114, 13414445723, -1543775330, 1898556241, -153749748, 88917860, -2719097, 1259260], [-12569335140, 37831118872, -241097575171, -30969310666, -102756606262, -18004356408, -12288255350, -2240573258, -547224580, -99568654, -7614069, -1374518], [12569335140, 37831118872, 241097575171, -30969310666, 102756606262, -18004356408, 12288255350, -2240573258, 547224580, -99568654, 7614069, -1374518], [56240131688, 808968308728, 464172134843, 573537725530, 177936918700, 114065852316, 21073726046, 9306602704, 942069930, 326047698, 13149289, 3935932], [56240131688, -808968308728, 464172134843, -573537725530, 177936918700, -114065852316, 21073726046, -9306602704, 942069930, -326047698, 13149289, -3935932], [145477974766, -463013293307, 206868228921, -400287441135, 56493193624, -98524275217, 5322216824, -9504388683, 197890810, -380293910, 2445941, -5013062]];
    Rf_basisdens := [1, 147368978, 979290628, 30358009468, 30358009468, 30358009468, 30358009468, 30358009468, 30358009468, 30358009468, 30358009468, 30358009468];
    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_912_z();"
function MakeCharacter_912_z()
    N := 912;
    order := 6;
    char_gens := [799, 229, 305, 97];
    v := [3, 6, 6, 2];
    // 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_912_z_Hecke();"
function MakeCharacter_912_z_Hecke( : Kf := false)
    N := 912;
    order := 6;
    char_gens := [799, 229, 305, 97];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := ISA(Type(Kf), Fld), 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]];
    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 := 3;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1], [1, 0, 2, 0, 0, 0, 0, -1, -1, 0, 0, 0], [-2, 0, -4, 1, -1, -1, 1, 0, 0, 0, 0, 0], [1, -1, 2, 0, 0, 1, -1, 0, 0, 1, 0, 1], [-1, 0, -3, 2, -1, -1, 1, 2, 1, 0, 1, 0], [1, 0, 2, 0, -1, 0, 0, 0, -1, 1, -1, 1], [2, -1, -2, 1, 0, 0, 0, -2, 0, 0, 0, 1], [2, -2, 3, 1, -2, 1, 0, 1, 2, 0, 1, -1], [-4, -2, -8, 2, -2, -1, 1, -1, -1, 1, -1, 4], [-11, 7, 0, 1, 1, -2, -2, 0, 0, -3, -3, 0], [-2, 1, -9, -4, 2, 0, 2, -6, -3, 2, 0, -5], [15, 1, 8, 0, 2, 0, -1, 0, 1, 1, 0, 0], [4, 6, 1, 1, 0, -1, -3, -5, 0, -3, -2, 0], [6, 2, 5, -1, 2, -1, 0, 2, 4, 0, -1, 5], [-3, -4, 0, 0, 0, 0, -3, 0, -2, 3, 0, -1], [-5, -1, -3, -1, 2, 2, -3, 1, 2, 3, -1, -2], [4, -2, 2, 4, 0, 0, -3, 6, 0, -3, -3, 6], [-8, 3, -4, 0, -2, -3, -6, 0, -4, 3, -3, 5], [1, 1, -3, 2, -1, 3, -1, 8, 4, 2, -3, 1], [-2, -8, -2, 0, -7, -1, 0, 0, 3, -1, -1, -3], [17, -11, 34, 2, -2, 4, -4, -1, -1, 2, -2, 22], [4, 4, 3, -3, 6, -1, 5, 2, 4, -5, 4, -12], [-6, -13, 29, -2, 1, -2, 6, 4, 2, 4, 2, 6], [16, -6, 25, -3, 6, 9, -3, 1, 2, 3, 6, -4], [14, -5, 28, 1, -1, -1, 1, -12, -12, 1, -1, 10], [-19, -3, -38, 11, -11, -7, 7, -3, -3, -1, 1, 6], [-11, 0, -26, 12, -6, -6, 11, 2, 1, 5, 6, -5], [-58, -3, 0, -3, -3, 6, 6, -3, 3, 3, 3, 0], [15, -12, -38, 5, 0, -1, 11, -2, 0, 11, 12, -3], [56, -9, 24, 0, -12, -3, 2, 0, 6, -5, -3, -5], [-32, -4, -25, -3, 6, 7, 0, 1, 2, 0, 7, -13], [-19, 11, 10, 12, 0, -1, 4, 5, 0, 4, 5, -4], [4, 6, -35, 4, -2, 1, -4, 12, 6, -3, -1, 0], [-6, -8, -12, 18, -18, -8, 8, 18, 18, -4, 4, 16], [-2, -16, 8, 8, -4, -3, 2, -18, -9, -1, 3, 18], [39, 10, 78, -18, 18, 12, -12, 3, 3, 2, -2, -20], [-1, -1, 15, -5, 0, -4, -9, -5, 0, -9, -5, 5], [3, -13, 49, -6, 3, -6, -3, -14, -7, -9, 6, 13], [23, -3, 46, 2, -2, -2, 2, -17, -17, -3, 3, 6], [-54, 3, -63, 6, -12, -9, -1, -6, -12, 1, -10, 1], [-27, -4, -54, 2, -2, 15, -15, 25, 25, -1, 1, 8], [-12, 11, -85, 26, -13, -9, 12, 2, 1, 3, 9, -10], [61, 32, 0, -7, -7, -6, -6, 16, -16, -9, -9, 0], [11, 15, -16, 4, 0, -1, 2, 5, 0, 2, 3, -8], [-100, -28, -38, 0, 11, 11, -2, 0, -23, 13, 11, -15], [59, 13, 39, 0, 20, 11, 3, 0, 0, 8, 11, 12], [20, 0, 40, -18, 18, 6, -6, -22, -22, 1, -1, 0], [46, 0, 0, -9, -9, -12, -12, -2, 2, -12, -12, 0], [15, -4, -22, -26, 13, 10, -15, 16, 8, -5, -10, 6], [7, 20, 14, -5, 5, -12, 12, 21, 21, -10, 10, -40], [150, -8, 166, -8, 16, 16, -9, -9, -18, 9, 7, 6], [27, 32, -27, 4, 0, -6, -3, -15, 0, -3, 3, -14], [26, -14, 49, -9, 18, 23, -4, -16, -32, 4, 19, -3], [-204, -5, -98, 0, -14, 7, 6, 0, 22, 1, 7, 17], [5, 23, -98, -14, 7, -11, -5, 2, 1, -16, 11, -25], [50, -22, 23, 0, -4, 7, 18, 0, -5, -11, 7, -22], [37, -26, 0, 3, 3, -12, -12, 14, -14, -4, -4, 0], [72, -16, 90, -2, 4, 18, 7, 25, 50, -7, 25, 21], [121, -19, 60, 0, -9, 5, 11, 0, -12, -6, 5, -11], [25, 48, 0, -2, -2, -9, -9, -3, 3, -4, -4, 0], [-20, -12, 2, 0, -3, 20, 16, 0, 7, 4, 20, 15], [56, 5, 112, 1, -1, -22, 22, 0, 0, -18, 18, -10], [-115, -19, -98, 2, -4, 17, -8, 9, 18, 8, 9, -27], [65, -20, 71, 14, -28, 6, 5, 0, 0, -5, 11, 8], [-5, -22, -10, -4, 4, -10, 10, 10, 10, -9, 9, 44], [-2, -13, 94, -22, 11, 8, 2, 0, 0, 10, -8, 0], [4, -13, 0, 0, -15, -7, -10, 0, -36, 3, -7, -2], [177, 56, 0, 9, 9, 1, 1, 5, -5, 16, 16, 0], [-97, -82, 0, 10, 10, 13, 13, 6, -6, 46, 46, 0], [164, 6, 92, 0, 26, 10, 0, 0, -14, 10, 10, 0], [-38, 71, -2, -7, 0, -10, 15, 1, 0, 15, 25, -59], [19, 75, 0, -4, -4, -36, -36, -10, 10, -47, -47, 0], [10, 1, 20, -9, 9, -7, 7, -3, -3, -2, 2, -2], [-73, -21, -25, 0, 12, 20, 17, 0, -3, 3, 20, -10], [-171, -16, -162, 7, -14, 9, -2, 9, 18, 2, 7, -50], [39, -20, 62, -12, 6, 17, -39, 40, 20, -22, -17, 53], [3, -60, 105, -14, 7, 1, -3, 32, 16, -2, -1, 56], [-169, 1, -159, -11, 22, 10, 4, 10, 20, -4, 14, 6], [23, -26, 46, -10, 10, 21, -21, -17, -17, 19, -19, 52], [11, -38, -205, 0, 0, 17, -11, 40, 20, 6, -17, 49], [-64, -6, 75, -29, 0, -3, -7, 9, 0, -7, -4, -6], [111, 37, 81, -7, 14, -30, 5, -11, -22, -5, -25, 4], [-101, -21, -69, 0, -3, -15, 7, 0, 21, -22, -15, -55], [-66, 10, 161, 17, 0, -5, -50, 31, 0, -50, -45, 51], [202, -29, 0, 11, 11, 16, 16, 20, -20, 1, 1, 0], [135, 71, 0, -8, -8, -17, -17, 25, -25, -47, -47, 0], [-3, -3, 99, 14, -7, -12, 3, 44, 22, -9, 12, 7], [132, 8, 264, 24, -24, -7, 7, 14, 14, -4, 4, -16], [154, -18, 308, 45, -45, -21, 21, 14, 14, -5, 5, 36], [3, 40, -3, 14, 0, 4, 2, 33, 0, 2, -2, -13], [-77, -43, -154, 9, -9, 27, -27, -17, -17, 17, -17, 86], [-206, 3, -100, 0, -4, -11, -28, 0, -8, 17, -11, 13], [-127, -9, -83, 0, -17, -23, -7, 0, 45, -16, -23, -31], [105, -28, -114, -9, 0, 13, 11, -14, 0, 11, -2, 5], [217, 4, 235, -22, 44, 18, -21, -1, -2, 21, -3, 8], [89, 28, 0, -12, -12, 5, 5, 26, -26, -14, -14, 0], [113, -76, -181, 0, 0, -4, 32, -9, 0, 32, 36, 4], [-123, 16, -112, -27, 54, 11, -16, -39, -78, 16, -5, -37], [218, 47, -261, 42, 0, -5, 19, 8, 0, 19, 24, -24], [-243, -12, -230, -1, 2, 13, -15, 6, 12, 15, -2, 11], [-58, 17, -116, 1, -1, -4, 4, -58, -58, -5, 5, -34], [-423, -89, 0, 12, 12, 30, 30, -29, 29, 54, 54, 0], [149, -22, 298, 40, -40, -14, 14, -59, -59, -12, 12, 44], [392, -13, 0, 14, 14, 21, 21, -47, 47, 11, 11, 0], [298, 12, 135, 0, 21, -27, -26, 0, 11, -1, -27, -37], [251, 28, 222, 1, -2, -29, -18, -3, -6, 18, -47, 48], [261, -11, -300, 40, 0, 7, 23, -62, 0, 23, 16, 6], [16, -78, 0, -17, -17, 10, 10, 2, -2, 20, 20, 0], [0, -57, 0, 33, -33, -15, 15, -49, -49, 18, -18, 114], [-46, -63, 204, 42, -21, -9, 46, 2, 1, 37, 9, 38], [-260, 20, -264, -16, 32, -4, 0, 25, 50, 0, -4, 10], [106, -25, 212, 45, -45, -49, 49, 14, 14, -9, 9, 50], [-66, -46, 133, -19, 0, -15, -41, 23, 0, -41, -26, 47], [32, 17, 479, 40, -20, 14, -32, 30, 15, -18, -14, 35], [-458, -44, -230, 0, -12, -3, -4, 0, -22, 1, -3, -34], [-60, 49, -120, -11, 11, -16, 16, -54, -54, -7, 7, -98], [458, -90, 0, 5, 5, 7, 7, 34, -34, -9, -9, 0], [-134, -63, 156, 39, 0, 12, -5, -40, 0, -5, -17, 62], [448, -40, 467, 21, -42, 19, 12, 3, 6, -12, 31, 19], [105, -52, 0, 25, 25, -11, -11, 19, -19, -6, -6, 0], [147, -62, 0, 14, 14, 11, 11, -21, 21, 40, 40, 0], [-69, 50, -138, 60, -60, -27, 27, 7, 7, -15, 15, -100], [121, 60, 242, -20, 20, -11, 11, -43, -43, 2, -2, -120], [2, 29, -280, -40, 20, 13, -2, 18, 9, 11, -13, -47], [-128, 25, -106, -47, 94, 22, -14, -40, -80, 14, 8, 32], [-251, 78, -138, 0, 32, -10, 5, 0, -54, -15, -10, 21], [-96, 64, -50, 0, 15, -29, -54, 0, -17, 25, -29, 45], [311, 108, 0, -5, -5, -16, -16, 36, -36, -24, -24, 0], [467, 63, 190, 0, -5, -38, 11, 0, 2, -49, -38, -19], [-695, 43, -353, 0, -12, 0, 11, 0, 57, -11, 0, 44], [158, 64, -77, 25, 0, -37, -59, 61, 0, -59, -22, 21], [-25, -12, 233, -32, 16, 22, 25, 30, 15, 47, -22, -29], [439, -97, 0, -7, -7, 15, 15, -12, 12, 59, 59, 0], [-349, -34, -338, 23, -46, 11, 10, 1, 2, -10, 21, 27], [413, 30, 383, 0, 0, -30, 8, 45, 90, -8, -22, -29], [-42, -68, -84, -28, 28, -7, 7, 62, 62, -18, 18, 136], [-649, 82, 0, 11, 11, -16, -16, 15, -15, -51, -51, 0], [-30, 87, 0, 18, 18, -5, -5, -29, 29, -36, -36, 0], [-51, 108, -32, -47, 0, -9, 37, -28, 0, 37, 46, -119], [430, 28, 405, -3, 6, -25, -2, -51, -102, 2, -27, 13], [167, 186, -137, 12, 0, -8, -19, -29, 0, -19, -11, -72], [254, -66, -187, -19, 0, 19, -24, -45, 0, -24, -43, 57], [-311, -11, 0, -30, -30, 33, 33, -21, 21, -39, -39, 0], [-375, -97, -177, 0, 14, 18, 15, 0, 43, 3, 18, -90], [-34, 6, -903, 32, -16, -8, 34, -64, -32, 26, 8, -24], [-72, 52, -112, 48, -24, -70, 72, -28, -14, 2, 70, -100], [-80, -194, -66, 80, 0, -4, 71, 50, 0, 71, 75, 64], [16, 124, 32, -83, 83, -3, 3, 36, 36, -13, 13, -248], [36, 44, -569, -92, 46, 0, -36, 52, 26, -36, 0, -54], [818, -77, 0, 16, 16, -35, -35, 3, -3, 0, 0, 0], [62, 95, -5, -42, 0, -9, -33, 88, 0, -33, -24, -40], [-458, -83, 411, 30, 0, -5, 21, 39, 0, 21, 26, 33], [-189, 43, -147, 0, -77, -30, 45, 0, 33, -75, -30, 15], [-31, 36, -62, -61, 61, -2, 2, 23, 23, -31, 31, -72], [198, 84, 396, -46, 46, 5, -5, -12, -12, 18, -18, -168], [-10, -33, -543, 52, -26, 16, 10, -92, -46, 26, -16, 49], [-450, 5, -474, 19, -38, -24, 16, 38, 76, -16, -8, 128], [-604, -46, -554, -4, 8, 50, -30, -56, -112, 30, 20, 42], [160, -53, 101, 0, 44, 32, 22, 0, -75, 10, 32, -55], [-16, -71, -63, 88, -44, -32, 16, -56, -28, -16, 32, 99], [383, 153, 146, 0, -26, -46, -1, 0, 1, -45, -46, 88], [-99, -36, 20, 0, 61, 70, 1, 0, -2, 69, 70, 42], [355, -1, 0, -4, -4, -30, -30, -9, 9, -10, -10, 0], [-606, -55, -318, 0, -59, 23, 76, 0, 60, -53, 23, -26], [324, -94, 141, 0, -59, 0, 42, 0, 36, -42, 0, -77], [-388, 18, -420, 14, -28, -32, 31, 25, 50, -31, -1, 132]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_912_z_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_912_3_z_c();".
// 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_912_3_z_c(:prec:=12)
    chi := MakeCharacter_912_z();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_912_3_z_c();".
// 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_912_3_z_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_912_z();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![20070400, 21557760, 18782864, 7312832, 2689200, 445104, 147200, 18612, 5668, 288, 90, 4, 1]>,<23,R![66557140961536, -48581533388352, 12804751944944, -718612546992, -42311836240, 4163052480, 154763736, -20658228, 183456, 29880, -398, -36, 1]>],Snew);
    return Vf;
end function;