
// Make newform 225.6.a.n in Magma, downloaded from the LMFDB on 22 December 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_225_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_225_6_a_n();".
// 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_225_6_a_n();".
// 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 := [-11, 0, 1];
        Kf := NumberField(Polynomial([elt : elt in poly]));
        AssignNames(~Kf, ["nu"]);
    end if;
    Rf_num := [[1, 0], [0, 2]];
    Rf_basisdens := [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_225_a();"
function MakeCharacter_225_a()
    N := 225;
    order := 1;
    char_gens := [101, 127];
    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_225_a_Hecke( : Kf := Kf)
    return MakeCharacter_225_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 := 6;
    raw_aps := [[0, 1], [0, 0], [0, 0], [0, 9], [-252, 0], [0, -18], [0, -104], [220, 0], [0, -367], [-6930, 0], [6752, 0], [0, -2106], [198, 0], [0, -63], [0, -1589], [0, 878], [-24660, 0], [-5698, 0], [0, 6579], [-53352, 0], [0, 10692], [-51920, 0], [0, 9323], [-9990, 0], [0, 15264], [109098, 0], [0, 10647], [0, 14641], [21010, 0], [0, -15832], [0, 13149], [-192852, 0], [0, -21644], [318340, 0], [84150, 0], [-155848, 0], [0, -53766], [0, -21843], [0, -2729], [0, 74258], [444420, 0], [156902, 0], [-332352, 0], [0, 118512], [0, 8986], [395800, 0], [-251548, 0], [0, -43533], [0, 175501], [-547670, 0], [0, -7252], [-1005840, 0], [895202, 0], [-558252, 0], [0, -118784], [0, 245993], [-1736370, 0], [-1720048, 0], [0, -191826], [-1465002, 0], [0, -248823], [0, -359962], [0, -139941], [-568152, 0], [0, -259668], [0, 19846], [-1580548, 0], [0, -185256], [0, -579239], [1594450, 0], [0, 44528], [1104840, 0], [0, 277029], [0, 442242], [-5093420, 0], [0, -478627], [1799910, 0], [0, 739314], [642798, 0], [2057110, 0], [-2937420, 0], [2717702, 0], [-4994352, 0], [0, -313848], [4704040, 0], [0, 859463], [6203250, 0], [0, 324684], [3851298, 0], [0, -313893], [0, 197221], [-6763680, 0], [0, -1005831], [6875748, 0], [-6940100, 0], [0, -138847], [4979790, 0], [147798, 0], [0, 1867617], [-9998098, 0], [0, -1787661], [0, 136366], [0, 1309643], [-2270070, 0], [14380652, 0], [0, -850176], [0, 193681], [0, -1056712], [-8800200, 0], [-10766998, 0], [0, 2279709], [0, -1253718], [0, 1825396], [-9732380, 0], [-8601448, 0], [6424398, 0], [0, 549837], [0, 569911], [0, 2516978], [-1221660, 0], [16278902, 0], [0, 2169792], [0, 395626], [0, -1553377], [4502852, 0], [4880898, 0], [9969610, 0], [-11916720, 0], [0, 208449], [0, -919098], [-6169460, 0], [0, 2375513], [-15181648, 0], [0, 98334], [-4514202, 0], [12079870, 0], [0, 1571558], [0, -5206581], [0, -3155114], [24879690, 0], [-3954148, 0], [3435498, 0], [0, -595233], [0, -5098199], [-15201470, 0], [28901160, 0], [0, -3046878], [0, 2570716], [-19550540, 0], [0, -4083907], [0, -298926], [42283998, 0], [0, 20277], [0, 584431], [0, 4332159], [-1876752, 0], [6768520, 0], [11535570, 0], [0, -5919156], [-29491902, 0], [0, 3160261], [0, 2474228], [0, 7114329], [-38477052, 0], [0, 4073176], [0, -4348927], [-52159648, 0], [0, 1474614], [3000910, 0], [0, -4588882], [-53339220, 0], [-28955698, 0], [-53563752, 0], [0, -6233148], [-1966160, 0], [16141050, 0], [14987852, 0], [22414698, 0], [0, -5995593], [32239570, 0], [0, -1631331], [-65928852, 0], [0, 9113562], [0, -3886364], [0, -5420347], [-7967610, 0], [0, 1563354], [0, 937917], [-8389370, 0], [-39802752, 0], [0, -3090528], [0, 7030943], [68786852, 0], [51025698, 0], [0, -3751619], [0, -10496212], [-96256798, 0], [0, 5786982], [0, 12313696], [0, 7302233], [77173470, 0], [-31816048, 0], [0, 4222494], [-38550050, 0], [-50889060, 0], [0, -3492074], [-29529920, 0], [0, -380077], [33322410, 0], [17691452, 0], [0, 4790664], [-58549302, 0], [0, 8810847], [0, 5685241], [-56616120, 0], [44028602, 0], [0, 5803749], [21047598, 0], [0, -12904529], [0, -10945942], [17319302, 0], [-125384600, 0], [146500290, 0], [0, 15398667], [0, -828299], [108645130, 0], [0, 16758548], [31851360, 0], [0, -9810711], [-71215452, 0], [0, -16655778], [102817660, 0], [-83309248, 0], [-90050202, 0], [0, -18189423], [0, 25061131], [-45897410, 0], [0, -2164162], [-122008500, 0], [28437048, 0], [0, -8395717], [-3412948, 0], [0, -27023913], [36378850, 0], [0, -20065672], [3203640, 0], [0, -26051571], [136556748, 0], [-119257820, 0], [0, 6882773], [0, 13960314], [16255998, 0], [0, -27372809], [99035110, 0], [0, -11652382], [47502180, 0], [118560902, 0], [0, -1863801], [0, -18296294], [0, 11731284], [0, -1050093], [0, 12106621], [-119936630, 0], [0, -21138138], [0, 29664736], [96033100, 0], [89072190, 0], [208346598, 0], [0, -14182983], [0, 2351798], [-120968098, 0], [0, 15774939], [0, -2411028], [64699360, 0], [0, -19942776], [0, 13583727], [0, -1328519], [128963890, 0], [14352602, 0], [-55118052, 0], [0, 22843133], [-10942648, 0], [0, -26209889], [263195702, 0], [0, -12961521], [17448048, 0], [0, -22736808], [0, -2822174], [217479880, 0], [107433810, 0], [234809298, 0], [0, -3585659], [0, 35623268], [172958148, 0], [0, 24826302], [112053150, 0], [100542752, 0], [0, -9640642], [256744620, 0], [0, 17291619], [0, -14042988], [0, -12885314], [117977200, 0], [0, 38227403], [-150780148, 0], [0, -26191296], [0, 32221201], [-124396670, 0], [-7707240, 0], [0, 22428522], [0, -27653707], [-72125370, 0], [162063198, 0], [0, 10861677], [0, 47525431], [158719990, 0], [190556100, 0], [99272448, 0], [0, 18097632], [-359743230, 0], [53498852, 0], [0, 10725444], [-299009502, 0], [0, 29361987], [0, 7309628], [-108323998, 0], [116476780, 0], [0, -23039703], [0, 1597891], [0, 27400118], [-140097298, 0], [0, 60617206], [-265242560, 0], [0, -19943437], [-157522948, 0], [0, -56900279], [-34515230, 0], [0, 15364208], [10390202, 0], [0, 55383669], [0, -56692638], [0, 11585836], [11940390, 0], [39877352, 0], [0, -8221702], [29278260, 0], [173741702, 0], [0, 56837439], [-357434352, 0], [0, 66214066], [-242194348, 0], [0, -19401876], [-63479502, 0], [0, 64839627], [93700090, 0], [0, -37540012], [-404604000, 0], [506469348, 0], [0, -49710104], [0, -7745167], [0, -63556506], [-439124202, 0], [0, -15519989], [498510540, 0], [0, -56257821], [0, -29260908], [0, 4600126], [0, -71218953], [-177139798, 0], [-58433652, 0], [97314340, 0], [0, -43297387], [-601598250, 0], [400252952, 0], [0, 241434], [411888420, 0], [-192104352, 0], [0, 514512], [61648290, 0], [0, 58578804], [-220194702, 0], [0, -98496052], [0, -41128911], [0, -72693584], [222898060, 0], [0, 57754793], [47122352, 0], [0, 65864574], [0, 19533177], [0, -53330669], [486181390, 0], [0, 54006038], [214155900, 0], [0, 133659], [343555848, 0], [0, -66186468], [173002720, 0], [41888970, 0], [733585052, 0], [-381318102, 0], [-246261950, 0], [0, 9212528], [0, 15875829], [0, 49887676], [-318434490, 0], [-539389048, 0], [0, -47317086], [309731598, 0], [0, -58680603], [-47944620, 0], [0, -7110648], [0, 87825106], [0, -50009737], [325115252, 0], [0, 115056684], [-271815102, 0], [503521920, 0], [0, -60499431], [0, 44785336], [0, -81424447], [107208990, 0], [0, -45014346], [0, -124399349], [-593134740, 0], [0, -22144428], [0, -16556834], [0, 1432043], [-263709270, 0], [-123213748, 0], [-43223400, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_225_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_225_6_a_n();".
// 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_225_6_a_n(:prec:=2)
    chi := MakeCharacter_225_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 6));
    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_225_6_a_n();".
// 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_225_6_a_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_225_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,6,sign)));
    Vf := Kernel([<2,R![-44, 0, 1]>,<7,R![-3564, 0, 1]>],Snew);
    return Vf;
end function;