
// Make newform 64.10.a.f in Magma, downloaded from the LMFDB on 22 April 2026.
// To make the character of type GrpDrchElt, type "MakeCharacter_64_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_64_10_a_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_64_10_a_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
        Kf := Rationals();
    end if;
    return [Kf!elt[1] : elt in input];
end function;


// To make the character of type GrpDrchElt, type "MakeCharacter_64_a();"
function MakeCharacter_64_a()
    N := 64;
    order := 1;
    char_gens := [63, 5];
    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_64_a_Hecke( : Kf := Kf)
    return MakeCharacter_64_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 := 10;
    raw_aps := [[0], [60], [2074], [-4344], [-93644], [12242], [-319598], [553516], [-712936], [-2075838], [-6420448], [18197754], [9033834], [-19594732], [-18484176], [-10255766], [-121666556], [45948962], [-50535428], [267044680], [-176213366], [-269685680], [227032556], [72141594], [228776546], [803255994], [781725544], [1007558100], [480691826], [-2897809422], [-4243302272], [-2897275972], [-2356171830], [2715272628], [-1674018550], [5327085464], [11583464642], [-948417636], [-14471751768], [13988594226], [4549239180], [-15648401430], [20205213888], [-7108270654], [-22592354982], [35550572488], [5584799084], [47471286496], [33770236764], [-7289894854], [67973875754], [-31128335120], [14237169522], [57838873412], [-18717636350], [-28043704312], [44660013266], [-103375407856], [-181402536310], [-125487340070], [-133560982748], [3506345466], [294356526348], [24030478392], [-255229429254], [-230255270622], [121212223732], [252248783826], [-299996354844], [125625054210], [-431672436638], [183614574696], [377184699760], [-269400214742], [204101558980], [-41063054976], [286341596314], [-373016278958], [470676092178], [-860520026790], [-846564598116], [227834561914], [-647351247440], [569897580082], [598042001592], [-310867196284], [747113578178], [-1542748002550], [-1627664637422], [-1115912327728], [530193690732], [-2100193101344], [-1053067241240], [-2105563975596], [-288806514612], [517680916728], [-601746738078], [-167285350070], [1579659728948], [3087362040642], [-262135558628], [-364237965134], [-3040524950516], [-735845268742], [-1446179281404], [-2269446467518], [-3419769190412], [-1324823990062], [-4199355004584], [1056816176410], [5970959278688], [-2806501620038], [1483017996714], [-1534690184236], [-4434983884424], [-4562565055102], [3328184469948], [2313741117832], [-7036972526766], [-2203195690068], [7295701439242], [-4470794975582], [3420953448058], [9187304863636], [1888109494156], [-1619072302686], [10637470151002], [13276980190928], [2600173095384], [11481760443010], [7759843772764], [-2581154752024], [-8392078385424], [-8158751330390], [-6274332345926], [6120270592514], [6628748091162], [-11950278911188], [11888669804098], [-16806313131158], [-19847266374892], [-4839917601942], [8416642196024], [21665755733252], [3677342994722], [-14694216924600], [19984481397322], [21198869701914], [-25180929567516], [21590511823712], [-26318199578766], [4235125165810], [25655740252876], [-31404421045640], [38700089580212], [17343586363280], [-1752315456872], [-19997698662494], [4621370155242], [-16495866242766], [-19960617139572], [-8830867785606], [20356173341384], [-7668880334220], [6230169370962], [52279985380056], [-37367157255200], [-36623047460038], [8661501739634], [22284627948202], [-29290340529084], [63808042246242], [-36425818211576], [9937454692426], [46569572681744], [-14238112558886], [-50107084098524], [46632331339002], [-31757269357784], [6734224083634], [-68346933926848], [-61991246527492], [6248130073050], [64405611195018], [-16073708939184], [-57869779806390], [-41867377784062], [25587970854876], [93770537494186], [-91746463456128], [56502082040962], [24246523609524], [52454914520492], [-57943198604606], [-40736867182692], [35853430681066], [-113885595834830], [93646888307618], [-23487326397758], [124784790145992], [-6339283536622], [59394368487632], [-65882725422902], [93785593215970], [70908355647828], [-14077714315422], [-61347046832896], [57228685112124], [-120506365641398], [140614440717620], [-136934740124526], [32301722514570], [110254925298712], [-83850773453020], [-142594050905048], [115514966050154], [88632618926384], [141165364319954], [-111408196793256], [-254424998202366], [76603174172602], [142476133899384], [95534575560834], [-21895690489456], [-22042155270996], [-54180460887542], [11835002485338], [-96032820546144], [-33774992980824], [-34670408967020], [71279371608882], [-121230073706356], [-267267121248832], [-227110984189942], [248492634161268], [34450613522896], [-220790236251310], [38784545893834], [-112194155686300], [-38776481444632], [371541782002764], [99503725560388], [209402539310344], [-13159248259630], [442460737222290], [-173756049060584], [48753483722272], [133965817872924], [-213893351070700], [-412793864936912], [-174913190081502], [-285196482321342], [196924486401352], [241826059282570], [175035255297426], [-159485611442196], [437803826314570], [-211166373496348], [-411100916523846], [174464009216314], [436543879849600], [-326101378823748], [-332821905194086], [503809892316354], [202972298982050], [-241746856777316], [465205938292274], [-379525612284806], [83535814806916], [-36242312990374], [296695176981266], [72294621399916], [-291335368848998], [689743687444192], [44802131140210], [37603069992440], [81480840732996], [-254673887766686], [-349625610006710], [-35849380672724], [595313384636192], [72470214907432], [463887398788664], [-556997287387430], [519504841705204], [951443904510800], [-468543907852078], [397832832355914], [-119151903037864], [348508370845282], [-836826586344590], [27015929034444], [107427320904506], [-383560666031436], [-336248572037550], [505385486381506], [-598256141652064], [-518368267557654], [-961456416663420], [-154393971489668], [-1142182468868854], [-516061146549742], [131995367275472], [289917632022124], [161837679567972], [773761627776482], [902935122783828], [-198334774054670], [-1262200210614536], [343907358941722], [-1481873656652784], [657477182425482], [744600088528930], [-390485148594148], [789505412132648], [-1038563042383510], [335426843288076], [-366477957253056], [1191077492361794], [1792729647466194], [1626970846721516], [-445481775255014], [968874534167810], [888578484422752], [979677233349290], [-1035167451331854], [1163036529047484], [-910793324674140], [1139278516732064], [1213677941854842], [-569140604772814], [520514237548962], [492628757158080], [-393560095712388], [2344086377033076], [348179989014372], [975657891478658], [2247848006507490], [2535716521518122], [1162198911249648], [932853957408170], [-417073457279046], [-941740195823334], [-13368658337784], [259582230301762], [-683412989078756], [1739736181565946], [-575278093449964], [176686219830576], [-813522210666646], [1778742797035260], [1196349326918282], [2841493498348690], [-2213732883962544], [-1916346835862966], [-2118183773126630], [-1866075113191072], [-142702097424172], [-1560904806997006], [-2440565128058760], [-1465309626138470], [184023866525130], [-145264121635440], [327519598597796], [2481353417300636], [1565203359533802], [2473071881026866], [2480309113241800], [2517151179673498], [-956516748255652], [-866362149196716], [-3144498963489296], [4053170675605162], [2364594067595512], [-130716884947358], [-4233565355592660], [1510728439157280], [-39278370809054], [-3932125600886094], [3227335336547066], [2650227863880738], [-2842301796318326], [-3328928112047784], [-61061705032350], [2946235113185756], [-3404502892443288], [4867120507874928], [2127089885662762], [3665516083876292], [-469739494647168], [-3775054464542078], [357887217359770], [-2243443827445836], [2982551855016876], [2273121207447960], [2921690257256026], [-4890736372082016], [1419537419017962], [-1281996737515628], [-2273956724949014], [5223613221991330], [2582677682585538], [2653400552523472], [-63028747997030], [74320735130170], [-1057672504624664], [-2340945064093198], [-4898782119159438], [-2686645689215156], [489615988595004], [5929486234387346], [-2288240256868214], [-2361952481039068], [-1847970008930020], [-460052843136918], [-1455216726149198], [4777507303443264], [999782195761736], [989438284508370], [-5526852331728296], [-6068898545221630], [-7284305129208902], [-3892480278007952], [-2707313789609788], [-2655254725249334], [3615206019920978], [4583462803435180], [-1883579982802854], [2688353803516068], [5023244438497976]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_64_a_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_64_10_a_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_64_10_a_f(:prec:=1)
    chi := MakeCharacter_64_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 10));
    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_64_10_a_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_64_10_a_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_64_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,10,sign)));
    Vf := Kernel([<3,R![-60, 1]>],Snew);
    return Vf;
end function;