
// Make newform 64.14.a.e 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_14_a_e();".
// 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_14_a_e();".
// 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 := 14;
    raw_aps := [[0], [0], [-17678], [0], [0], [-7254006], [-8582078], [0], [0], [1486672730], [0], [26174743922], [-48310539670], [0], [0], [286798198946], [0], [308331475930], [0], [0], [2582975771994], [0], [0], [7780304165930], [10874684920338], [20533982284402], [0], [0], [21118877404554], [-3536725250254], [0], [0], [27461252630218], [0], [-266166284930014], [0], [-367185057885382], [0], [0], [-283466137467734], [0], [-96164813543742], [0], [-789098699975054], [1312360953678322], [0], [0], [0], [0], [662503966665810], [3080865212553466], [0], [5899825387535010], [0], [6700426503480322], [0], [-7718543043892694], [0], [13688986182646338], [-11792989824992470], [0], [1047586045632914], [0], [0], [-32103873964712134], [-25080793418240582], [0], [19842223925085138], [0], [-25087317634856870], [61396975927281314], [0], [0], [103405334307453346], [0], [0], [110502713637837074], [104733602878029802], [100704394980737602], [-176877901443615846], [0], [215613198376233810], [0], [-37360839325792286], [0], [0], [327867718193142386], [-299213197984864758], [-412132600703997718], [0], [0], [0], [0], [0], [0], [0], [183774268854938330], [-229221227470961462], [0], [1020305217815891322], [0], [550687965345066602], [0], [1514631435351675706], [0], [913544977892901122], [0], [747652730919273874], [0], [1049404505567577130], [0], [-1057098582469023086], [2596331982004515002], [0], [0], [-1658373121348278350], [0], [0], [2413840055051444266], [0], [-4275287606676200350], [-4818483169551118126], [2400941755808651122], [0], [0], [3910512857955655130], [-6745637800451730990], [0], [0], [-4808442030903641574], [0], [0], [0], [-9615572561337472062], [4681682238761151482], [10249654986933897650], [9084285883587581714], [0], [12763508371573628218], [11921754374796404330], [0], [16466245390309223650], [0], [0], [1888598787810106266], [0], [15802262424764028674], [-4859483200340443942], [0], [0], [-23785276024588057142], [12146047010383457650], [0], [0], [0], [0], [0], [38903784590677710034], [-27303255400081059398], [-16415264284055028022], [0], [-27341654631373569734], [0], [0], [5287395073293885698], [0], [0], [49141559095373262898], [-7381597352662128990], [60477377989390796674], [0], [71647929076932196538], [0], [-73219174141467088806], [0], [77937172731447097130], [0], [56674296772981978418], [0], [-80352232535939710294], [0], [0], [79594992996671758386], [111232016166255119258], [0], [-123787972955806728350], [72490989318345234042], [0], [58540057633745082666], [0], [-159361476838852654014], [0], [0], [176585682044956509530], [0], [-190018717325690774534], [-180491493983341694350], [190703142201522160026], [-225783517233048170302], [0], [-178087965761981133110], [0], [-55595203133859164862], [148134826150260992610], [0], [247730017518583954618], [0], [0], [321398887585375614490], [0], [121113846237232480322], [-177000296452091304350], [0], [0], [0], [376687579817133018730], [0], [-184948895542225430782], [0], [379070571115461627034], [397957740496775587410], [0], [-29554597042969398350], [0], [0], [-512858050043734483966], [-610413385361405398166], [0], [0], [0], [-612863778016289170806], [0], [0], [-616397468099929428710], [0], [0], [585969666824294026626], [-597904800739419577054], [0], [0], [0], [0], [0], [-1080996591969116025910], [-1071994937589393513326], [0], [0], [0], [0], [0], [1046513579014290114042], [430226616192588550402], [0], [-1150749257715249697446], [-1287485553665242962134], [0], [1450137397305083188962], [0], [1461704973662800962098], [-50380264932219387398], [0], [0], [1739017221802835635410], [1787003053651918823834], [593714669680938906962], [0], [-1092213653204189392310], [733476479165659417738], [0], [-1640623212396796194286], [-1244423471965270487222], [0], [-749792666577500413974], [0], [-907083157221836187918], [0], [0], [2772018630358415539930], [-115893992431575015910], [0], [0], [0], [0], [3013005078329736887218], [0], [0], [-3593749035384872844414], [-1595925805917060647038], [0], [-3443143105651957784926], [1797102430201720438090], [0], [3135964333976223386954], [0], [-3162245693639835544534], [4768874898620661758714], [0], [-3731529151695528224126], [0], [0], [5161679045824583823754], [1370535179976733373258], [0], [0], [0], [2998257011584382545938], [0], [5266816358876607534570], [0], [-6506692673314900968686], [0], [6839916721196858327650], [6872226057754913340242], [0], [0], [-4988718431260039026630], [0], [0], [-6819832377504371047614], [-4124938629777523155566], [0], [5038865851422872944858], [8794745946858210698330], [0], [-4968907804393412282966], [8561898958791715842210], [0], [0], [0], [-9404866639562879789294], [-8047230746151765233430], [-1067751228242802291782], [0], [0], [0], [0], [-10959687494079014274406], [7650934955044513308706], [-3606534991290570412230], [0], [-3173419328112134272126], [11723784660019612279802], [13320408367887073472146], [0], [-15434146237658177847046], [0], [13012600715585121821010], [0], [0], [8084213357097588783362], [0], [-8343645077588185965558], [14705625348002468057290], [0], [11661023784152604279650], [-18151830306206008054166], [0], [0], [9602690466211154137378], [0], [-272070191914499880622], [19963606195449729485978], [0], [0], [0], [-6652633581469696073734], [21352965027062741073002], [0], [14604640547427809292890], [0], [0], [0], [-26919916849148910750814], [0], [-18548369002358419114758], [0], [0], [-29686207175414251413086], [-15946998033275664247454], [-17270502726495887313222], [-10644528800732198497862], [-11740844478455211261046], [0], [-20760943514960656309022], [0], [0], [0], [37879871504308854986082], [0], [0], [17313940011211281884226], [-32853615175702892630894], [0], [0], [0], [-28289187359368971516006], [0], [40903056865034253466730], [0], [8321211091496367911650], [2945975610203935592314], [-45035756028887188423054], [0], [46475579345873054384858], [-44722647251961973558126], [0], [47724172601609977134378], [16342469157476233553698], [0], [0], [25131724829399133616274], [-50613271519076617491838], [0], [0], [40067141154904670208378], [58665165534353568395882], [0], [0], [-63138142438147191247102], [0], [-49261712594685098621254], [15864068099734194103922], [0], [0], [-69880737242720990195894], [62303152855572359146058], [0], [-20568140274606250874006], [0], [0]];
    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_14_a_e();".
// 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_14_a_e(:prec:=1)
    chi := MakeCharacter_64_a();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 14));
    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_14_a_e();".
// 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_14_a_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_64_a();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,14,sign)));
    Vf := Kernel([<3,R![0, 1]>],Snew);
    return Vf;
end function;