
// Make newform 637.2.c.g in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_637_c();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_637_c_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_637_2_c_g();".
// 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_637_2_c_g();".
// 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 := [228484, 0, -65056, 0, 40192, 0, -1748, 0, 3468, 0, 296, 0, 121, 0, 10, 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, 0, 0, 0, 0], [-24635344078600, 0, 18907611617666, 0, -1697477109286, 0, 476412021848, 0, 6825369227, 0, 13620194602, 0, 979990851, 0, 127996212, 0], [39168135376626, 0, -4374820319640, 0, 1697477109286, 0, -476412021848, 0, -6825369227, 0, -13620194602, 0, -979990851, 0, -127996212, 0], [-47980987815069, 0, 9290284007112, 0, -4317537291960, 0, -267899653440, 0, -245977410085, 0, -51065796556, 0, -5785250672, 0, -306986712, 0], [137905300117434, 0, -55028459919508, 0, 28800814691994, 0, -1507742096165, 0, 1041868051029, 0, -76432745837, 0, -6971345277, 0, -1919925366, 0], [-8985354172108, 0, -650215400000, 0, -629466852193, 0, -1652632053818, 0, -319450784079, 0, -101725454643, 0, -9797848728, 0, -774992715, 0], [-200469162311696, 0, 205861498545968, 0, -44623804952754, 0, 15440128011114, 0, -973429379572, 0, 571971494681, 0, 51263835016, 0, 7536716227, 0], [-43848384888236764, -37371933389289288, 3760983663948440, 13968719402934952, -12187826973066802, -7093806687835658, -293425161053504, -273519392828494, -525360644247946, -429503087786032, 4895835168025, -41285442593947, 967985226688, -4349411499250, 622324322223, 14293266565], [-43848384888236764, 37371933389289288, 3760983663948440, -13968719402934952, -12187826973066802, 7093806687835658, -293425161053504, 273519392828494, -525360644247946, 429503087786032, 4895835168025, 41285442593947, 967985226688, 4349411499250, 622324322223, -14293266565], [0, 6798316810890078, 0, -1813923014677882, 0, 175107970404104, 0, -119878681965659, 0, -7115864546186, 0, -4005316030475, 0, -319783603172, 0, -35037469784], [0, 148357429566350, 0, 1813923014677882, 0, -175107970404104, 0, 119878681965659, 0, 7115864546186, 0, 4005316030475, 0, 319783603172, 0, 35037469784], [0, -13669488488924920, 0, 3989750050797588, 0, -3507661099590954, 0, -852548409536598, 0, -294174736630566, 0, -47876731013081, 0, -4532646032618, 0, -213313563659], [0, -14210388338752134, 0, 4550695896767236, 0, -469842822901166, 0, 485530936606623, 0, 33948059485677, 0, 16771353642497, 0, 1364700202471, 0, 144596254252], [0, 9888185130797466, 0, 1476021840137492, 0, 2897226083423780, 0, -229804479818813, 0, 33697049138585, 0, -31101270941936, 0, -3298265569313, 0, -374090467397], [0, 5079489900389672, 0, -4611355973197588, 0, 2905890788894446, 0, -727367833913410, 0, -11220212948958, 0, -49372803625627, 0, -4834097351350, 0, -527579471881], [0, 20029400440792962, 0, 7184835654673372, 0, 532755357398390, 0, 1332704439491341, 0, 144743314973337, 0, 73681722610361, 0, 7249765957837, 0, 674575131380]];
    Rf_basisdens := [1, 29065582596052, 14532791298026, 7266395649013, 29065582596052, 7266395649013, 58131165192104, 13893348480912856, 13893348480912856, 6946674240456428, 6946674240456428, 13893348480912856, 6946674240456428, 6946674240456428, 6946674240456428, 6946674240456428];
    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_637_c();"
function MakeCharacter_637_c()
    N := 637;
    order := 2;
    char_gens := [248, 197];
    v := [2, 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;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_637_c_Hecke();"
function MakeCharacter_637_c_Hecke(Kf)
    N := 637;
    order := 2;
    char_gens := [248, 197];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := true, 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+1)]];
    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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0], [0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 1, 0, 0, 0], [0, 1, 0, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, -1, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, 0, -2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, -2, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, -1, 0, 0], [0, 1, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 0, 1, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0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-2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 0, 4, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -5, 0, 0, -5, 6, 3], [0, 7, 0, 0, 7, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-4, 0, 9, -7, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 2, -2, -11, 0, -14, -3, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_637_c_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_637_2_c_g();".
// 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_637_2_c_g(:prec:=16)
    chi := MakeCharacter_637_c();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_637_2_c_g();".
// 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_637_2_c_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_637_c();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![22, 0, 68, 0, 50, 0, 13, 0, 1]>,<3,R![16, 0, -82, 0, 72, 0, -16, 0, 1]>],Snew);
    return Vf;
end function;