
// Make newform 1764.4.t.a in Magma, downloaded from the LMFDB on 24 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1764_t();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1764_t_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_1764_4_t_a();".
// 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_1764_4_t_a();".
// 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 := [390625, 0, 0, 0, 26250, 0, 0, 0, 1139, 0, 0, 0, 42, 0, 0, 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], [390625, 0, 0, 0, 47838, 0, 0, 0, 1139, 0, 0, 0, 42, 0, 0, 0], [-20238750, 0, 0, 0, -878169, 0, 0, 0, -71757, 0, 0, 0, -771, 0, 0, 0], [0, 0, 21026250, 0, 0, 0, 912339, 0, 0, 0, 174267, 0, 0, 0, 801, 0], [-6993, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 0], [0, 0, -150189, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0], [0, 0, -3515625, 0, 0, 0, -53667, 0, 0, 0, -10251, 0, 0, 0, -378, 0], [0, -373281250, 0, -86782500, 0, -23919000, 0, -2594642, 0, -569500, 0, -95676, 0, -21000, 0, -1028], [0, 0, -172383750, 0, 0, 0, -7479813, 0, 0, 0, -228939, 0, 0, 0, -6567, 0], [0, -857984375, 0, 43070000, 0, -26453275, 0, -4682429, 0, -1053575, 0, -94537, 0, -7600, 0, -2861], [0, -297718750, 0, 153883750, 0, -37700900, 0, 6202994, 0, 797300, 0, 384982, 0, -1850, 0, -3304], [0, -453593750, 0, 5827500, 0, -11959500, 0, 2594642, 0, -284750, 0, 95676, 0, -10500, 0, 4778], [0, 113000000, 0, -140335625, 0, 26453275, 0, -9364858, 0, 1053575, 0, -189074, 0, 54475, 0, -7597], [0, 87125000, 0, -4946250, 0, 2301450, 0, 252724, 0, 204350, 0, -45828, 0, 13050, 0, -734], [0, 707875000, 0, 274988750, 0, -18850450, 0, 12405988, 0, 398650, 0, 769964, 0, 45950, 0, 19642], [0, -611968750, 0, -316695000, 0, -39124650, 0, 2148154, 0, -3473950, 0, -389538, 0, 59400, 0, -30614]];
    Rf_basisdens := [1, 711875, 1423750, 35593750, 2278, 28475, 2093750, 88984375, 17796875, 88984375, 88984375, 88984375, 88984375, 5234375, 88984375, 88984375];
    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_1764_t();"
function MakeCharacter_1764_t()
    N := 1764;
    order := 6;
    char_gens := [883, 785, 1081];
    v := [6, 3, 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_1764_t_Hecke();"
function MakeCharacter_1764_t_Hecke(Kf)
    N := 1764;
    order := 6;
    char_gens := [883, 785, 1081];
    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], [1, 1, 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 := 4;
    raw_aps := [[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, 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, -1, 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, 1, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, -1], [0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 2, 0, 0, 0, -2, 0], [0, 0, 5, -2, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 10, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, -6, 0, 0, 0], [-64, -64, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 29, 0, 0, 0, -29, 0, -3, 0, 0], [4, 0, 0, 0, 0, -5, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -32, 0, 0, 0, 3], [0, 0, -18, -13, -18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, -2, 0, 2], [0, 0, 0, 0, 0, 0, 0, 0, 0, -20, 10, 0, 0, 0, -10, 0], [0, -292, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -19, 0, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -3, -11, 0, 3, 0, 0, 0], [-224, -224, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -28, 0, 0, 0, 28, 0, 9, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, -5], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, -15, 0], [0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 2, 0, -2], [0, 0, 0, 0, 0, 0, 0, 0, 0, 36, -4, 0, 0, 0, 4, 0], [0, 0, -71, -44, 0, 0, -44, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -968, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -12, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-472, 0, 0, 0, 0, 68, 0, 0, -68, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -20, 0, 0, 0, -17], [0, 0, -4, -165, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -6, 0, 68, 0], [0, 0, 42, -173, 0, 0, -173, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -2060, 0, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, -78, 0, 0, 0], [-980, -980, 0, 0, 0, -60, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -172, 0, 0, 0, 172, 0, -1, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 215, 0, 0, 0, 32], [0, 0, 13, -292, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, -29, 0], [0, 0, 47, -174, 0, 0, -174, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -2312, 0, 0, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 178, 0, -83, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -131, -20, 0, 131, 0, 0, 0], [-500, 0, 0, 0, 0, -79, 0, 0, 79, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 181, 0, 4, 0], [0, 0, 0, 0, 0, 0, 0, -72, 0, 0, 0, 0, 0, 18, 0, -18], [0, 0, 0, 0, 0, 0, 0, 0, 0, -125, -1, 0, 0, 0, 1, 0], [0, 0, 76, -397, 0, 0, -397, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1, 0, -22, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 157, -39, 0, -157, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0, 24, 0, -17, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -437, 0, 0, 0, 7], [0, 0, -77, -482, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 521, 0, 0, 0, 0, 0, 26, 0, -26], [0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 104, 0, 0, 0, -104, 0], [0, -4090, 0, 0, 0, 0, 0, 0, -148, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -124, 0, -227, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 115, 110, 0, -115, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 501, 0, 0, 0, -501, 0, -10, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -305, 0, -38, 0], [0, 0, 0, 0, 0, 0, 0, -396, 0, 0, 0, 0, 0, -22, 0, 22], [0, 0, 0, 0, 0, 0, 0, 0, 0, -60, 76, 0, 0, 0, -76, 0], [0, 0, -54, -487, 0, 0, -487, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1396, -1396, 0, 0, 0, 93, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-3968, 0, 0, 0, 0, 156, 0, 0, -156, 0, 0, 0, 0, 0, 0, 0], [0, 0, 89, -476, 89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -54, 0, -52, 0], [0, 0, 0, 0, 0, 0, 0, 465, 0, 0, 0, 0, 0, -73, 0, 73], [0, 0, -229, 18, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 165, -160, 0, -165, 0, 0, 0], [-4706, -4706, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1268, 0, 0, 0, 0, 309, 0, 0, -309, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -512, 0, 0, 0, 71], [0, 0, 254, -277, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 208, -82, 0, 0, 0, 82, 0], [0, 0, -364, -407, 0, 0, -407, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -451, -67, 0, 451, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 676, 0, 0, 0, -676, 0, 54, 0, 0], [1418, 0, 0, 0, 0, -188, 0, 0, 188, 0, 0, 0, 0, 0, 0, 0], [0, 0, -367, -222, -367, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -178, 0, 134, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 13, -316, 0, 0, 0, 316, 0], [0, 0, 447, 272, 0, 0, 272, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -592, 0, -415, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-4912, -4912, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -537, 0, 0, 0, 537, 0, -124, 0, 0], [2240, 0, 0, 0, 0, -492, 0, 0, 492, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 736, 0, 0, 0, 109], [0, 0, 0, 0, 0, 0, 0, 884, 0, 0, 0, 0, 0, 68, 0, -68], [0, 1372, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 537, 0, 480, 0, 0, 0, 0, 0, 0, 0, 0, 0], [6836, 6836, 0, 0, 0, 239, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 328, 0, 0, 0, -328, 0, -155, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, 0, 0, 14], [0, 0, 0, 0, 0, 0, 0, 503, 0, 0, 0, 0, 0, -1, 0, 1], [0, 0, 0, 0, 0, 0, 0, 0, 0, -84, 16, 0, 0, 0, -16, 0], [-2366, -2366, 0, 0, 0, 372, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [12140, 0, 0, 0, 0, -252, 0, 0, 252, 0, 0, 0, 0, 0, 0, 0], [0, 0, -586, 921, -586, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1396, 0, 0, 0, 0, 0, 157, 0, -157], [0, 0, -712, -69, 0, 0, -69, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 10412, 0, 0, 0, 0, 0, 0, -372, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -146, 162, 0, 146, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 896, 0, 0, 0, -896, 0, 43, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 527, 0, 0, 0, 15], [0, 0, 533, 530, 533, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 0, -34, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -247, -352, 0, 0, 0, 352, 0], [0, 14702, 0, 0, 0, 0, 0, 0, -536, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -384, 0, -411, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -782, -92, 0, 782, 0, 0, 0], [7640, 0, 0, 0, 0, 204, 0, 0, -204, 0, 0, 0, 0, 0, 0, 0], [0, 0, 356, 1289, 356, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 113, 0, -550, 0], [0, 0, 0, 0, 0, 0, 0, 1904, 0, 0, 0, 0, 0, -92, 0, 92], [0, 0, 562, -417, 0, 0, -417, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -805, 0, 524, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -86, -284, 0, 86, 0, 0, 0], [6520, 0, 0, 0, 0, 164, 0, 0, -164, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1995, 0, 0, 0, 192], [0, 0, 279, 1376, 279, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 190, 464, 0, 0, 0, -464, 0], [0, 0, 0, 0, 318, 0, -215, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2008, -2008, 0, 0, 0, -186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -764, 0, 0, 0, -298], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1352, 0, -176, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -405, 87, 0, 0, 0, -87, 0], [0, 15932, 0, 0, 0, 0, 0, 0, 684, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -269, 0, 1374, 0, 0, 0, 0, 0, 0, 0, 0, 0], [24404, 24404, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-6776, 0, 0, 0, 0, -882, 0, 0, 882, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -171, 0, 0, 0, -113], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1278, 0, 26, 0], [0, 0, 0, 0, 0, 0, 0, -55, 0, 0, 0, 0, 0, 270, 0, -270], [0, 0, 0, 0, 0, 0, 0, 0, 0, 212, 240, 0, -212, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1177, 0, 0, 0, -1177, 0, -208, 0, 0], [0, 0, 840, 1811, 840, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 48, 0, -756, 0], [0, 0, 1110, -317, 0, 0, -317, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 18152, 0, 0, 0, 0, 0, 0, -276, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -585, 0, 956, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 955, -125, 0, -955, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1812, 0, 0, 0, 1812, 0, 295, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 724, 0, -166, 0], [0, 0, 0, 0, 0, 0, 0, 1391, 0, 0, 0, 0, 0, 291, 0, -291], [0, 0, 0, 0, 0, 0, 0, 0, 0, 791, 446, 0, 0, 0, -446, 0], [0, 0, 929, 1910, 0, 0, 1910, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-170, -170, 0, 0, 0, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1077, 0, 0, 0, -1077, 0, -105, 0, 0], [1252, 0, 0, 0, 0, -921, 0, 0, 921, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1580, 0, 0, 0, -119], [0, -6956, 0, 0, 0, 0, 0, 0, 627, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 889, 0, 2446, 0, 0, 0, 0, 0, 0, 0, 0, 0], [24548, 24548, 0, 0, 0, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1441, 0, 0, 0, 109], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1940, 0, -80, 0], [0, 0, 0, 0, 0, 0, 0, -807, 0, 0, 0, 0, 0, 280, 0, -280], [0, 0, 509, 2564, 0, 0, 2564, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1956, 0, -1037, 0, 0, 0, 0, 0, 0, 0, 0, 0], [3776, 0, 0, 0, 0, 148, 0, 0, -148, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1832, 0, 0, 0, 254], [0, 0, -704, 1545, -704, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -276, 0, 0, 0, 0, 0, 109, 0, -109], [0, 11188, 0, 0, 0, 0, 0, 0, -765, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 172, -430, 0, -172, 0, 0, 0], [-18262, 0, 0, 0, 0, -540, 0, 0, 540, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3747, 0, 0, 0, 224], [0, 0, 1297, 356, 1297, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1232, 0, 286, 0], [0, 0, 405, 2442, 0, 0, 2442, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -11746, 0, 0, 0, 0, 0, 0, -804, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 575, 528, 0, -575, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -3561, 0, 0, 0, 3561, 0, 37, 0, 0], [35372, 0, 0, 0, 0, 756, 0, 0, -756, 0, 0, 0, 0, 0, 0, 0], [0, 0, -598, 339, -598, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 596, 0, 744, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1904, -2, 0, 0, 0, 2, 0], [7048, 7048, 0, 0, 0, -276, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1192, 0, 0, 0, 1192, 0, -267, 0, 0], [-43882, 0, 0, 0, 0, 252, 0, 0, -252, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2101, 0, 0, 0, -115], [0, 0, -881, -1106, -881, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 801, 0, 0, 0, 0, 0, -464, 0, 464], [0, 6808, 0, 0, 0, 0, 0, 0, -634, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -890, -180, 0, 890, 0, 0, 0], [-3938, -3938, 0, 0, 0, -1780, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1692, 0, 0, 0, 0, 0, 500, 0, -500], [0, 0, 0, 0, 0, 0, 0, 0, 0, -995, 477, 0, 0, 0, -477, 0], [0, 0, 0, 0, -383, 0, -836, 0, 0, 0, 0, 0, 0, 0, 0, 0], [24668, 24668, 0, 0, 0, 537, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -731, 0, 0, 0, -516], [0, 0, -77, -896, -77, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3879, 0, 0, 0, 0, 0, 221, 0, -221], [0, 8392, 0, 0, 0, 0, 0, 0, 1568, 0, 0, 0, 0, 0, 0, 0], [-44414, -44414, 0, 0, 0, -1020, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4669, 0, 0, 0, -4669, 0, 71, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3268, 0, 0, 0, -18], [0, 0, 2442, -2199, 2442, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 387, 0, 44, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1955, 543, 0, 0, 0, -543, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 819, -949, 0, -819, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 656, 0, 0, 0, -656, 0, 413, 0, 0], [0, 0, 0, 0, 0, 0, 0, 2661, 0, 0, 0, 0, 0, -326, 0, 326], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1093, 88, 0, 0, 0, -88, 0], [0, 0, 1885, -1124, 0, 0, -1124, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -1408, 0, -2405, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -399, 154, 0, 399, 0, 0, 0], [-28574, -28574, 0, 0, 0, 1488, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3215, 0, 0, 0, -3215, 0, 496, 0, 0], [63316, 0, 0, 0, 0, -441, 0, 0, 441, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2080, 0, 0, 0, -432], [0, 0, 0, 0, 0, 0, 0, 4724, 0, 0, 0, 0, 0, -298, 0, 298], [0, 0, 0, 0, 0, 0, 0, 0, 0, -126, -490, 0, 0, 0, 490, 0], [0, -16124, 0, 0, 0, 0, 0, 0, -2237, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1893, 0, 0, 0, 0, 0, -105, 0, 105], [0, 0, -181, -610, 0, 0, -610, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -850, 0, -2719, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-12376, -12376, 0, 0, 0, -978, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -690, 0, -1176, 0], [0, 0, -240, -4015, 0, 0, -4015, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-17860, -17860, 0, 0, 0, 437, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1076, 0, 0, 0, 1076, 0, -695, 0, 0], [45712, 0, 0, 0, 0, 870, 0, 0, -870, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -99, 0, 0, 0, 221], [0, 0, -1433, -5538, -1433, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 1308, 0, 0, 0, -1308, 0], [0, 0, 2585, 836, 0, 0, 836, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1624, 0, 0, 0, 0, 0, 0, 1538, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1361, 646, 0, -1361, 0, 0, 0], [-68, 0, 0, 0, 0, -2795, 0, 0, 2795, 0, 0, 0, 0, 0, 0, 0], [0, 0, -2092, -3139, -2092, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1005, 0, -926, 0], [0, 0, 0, 0, 0, 0, 0, -5460, 0, 0, 0, 0, 0, 51, 0, -51], [0, 0, 0, 0, 0, 0, 0, 0, 0, -55, -507, 0, 0, 0, 507, 0], [0, 0, -634, -5813, 0, 0, -5813, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 383, 0, -2376, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 2080, 0, 0, 0, -2080, 0, 37, 0, 0], [0, 0, -3813, -1464, -3813, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1582, -1116, 0, 0, 0, 1116, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 2667, -980, 0, -2667, 0, 0, 0], [-21568, -21568, 0, 0, 0, -1418, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1117, 0, 0, 0, -1117, 0, -85, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3436, 0, 0, 0, -201], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1234, 0, -928, 0], [0, 0, 0, 0, 0, 0, 0, 6072, 0, 0, 0, 0, 0, 701, 0, -701], [0, 21740, 0, 0, 0, 0, 0, 0, -1012, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 3121, 0, 1210, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-65624, 0, 0, 0, 0, -86, 0, 0, 86, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2863, 0, 0, 0, 365], [0, 0, 1019, -6082, 1019, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2929, 0, 519, 0], [0, 0, 0, 0, 0, 0, 0, 5073, 0, 0, 0, 0, 0, 530, 0, -530], [0, 0, 1139, 32, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -35110, 0, 0, 0, 0, 0, 0, 324, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 607, 1202, 0, -607, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -3733, 0, 0, 0, 3733, 0, 154, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 866, -674, 0, 0, 0, 674, 0], [0, -100120, 0, 0, 0, 0, 0, 0, -236, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, -723, 0, -1624, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2555, -1235, 0, 2555, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2054, 0, 668, 0], [0, 0, 0, 0, 0, 0, 0, -2003, 0, 0, 0, 0, 0, 209, 0, -209], [0, 0, 0, 0, 0, 0, 0, 0, 0, 280, 500, 0, 0, 0, -500, 0], [0, 0, 0, 0, -2902, 0, -545, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1041, 0, 0, 0, -1041, 0, 219, 0, 0], [-104764, 0, 0, 0, 0, 860, 0, 0, -860, 0, 0, 0, 0, 0, 0, 0], [0, 0, 1266, -3325, 1266, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 2098, -1976, 0, 0, 0, 1976, 0], [0, 20740, 0, 0, 0, 0, 0, 0, 3095, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -85, 1759, 0, 85, 0, 0, 0], [-13060, -13060, 0, 0, 0, 2349, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1291, 0, -1933, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 4760, -816, 0, 0, 0, 816, 0], [0, 0, -3601, 2224, 0, 0, 2224, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -55904, 0, 0, 0, 0, 0, 0, -1634, 0, 0, 0, 0, 0, 0, 0], [-760, -760, 0, 0, 0, -2380, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5960, 0, 0, 0, 823], [0, 0, 0, 0, 0, 0, 0, -1760, 0, 0, 0, 0, 0, -992, 0, 992], [0, -12136, 0, 0, 0, 0, 0, 0, 1076, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -7816, 0, 0, 0, 7816, 0, 336, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3164, 0, 338, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 452, -1476, 0, 0, 0, 1476, 0], [0, 0, 233, 1162, 0, 0, 1162, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 14896, 0, 0, 0, 0, 0, 0, 1896, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 242, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -2918, 648, 0, 2918, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1095, 0, 0, 0, 1095, 0, -953, 0, 0], [0, 0, 5970, -999, 5970, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 7596, 0, 0, 0, 0, 0, -59, 0, 59], [0, 0, 1528, -2493, 0, 0, -2493, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 5988, 0, 0, 0, -5988, 0, 838, 0, 0], [78854, 0, 0, 0, 0, 680, 0, 0, -680, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -5893, 0, 0, 0, 0, 0, -48, 0, 48], [0, 0, 0, 0, 0, 0, 0, 0, 0, -5389, 1148, 0, 0, 0, -1148, 0], [0, 0, 0, 0, 0, 0, 0, 6565, 0, 0, 0, -6565, 0, 826, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1880, 0, 0, 0, -576], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1734, 0, -2156, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 1446, 2398, 0, 0, 0, -2398, 0], [0, 0, 2374, 3215, 0, 0, 3215, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 33680, 0, 0, 0, 0, 0, 0, -252, 0, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1764_t_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1764_4_t_a();".
// 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_1764_4_t_a(:prec:=16)
    chi := MakeCharacter_1764_t();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 4));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(1999) - 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_1764_4_t_a();".
// 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_1764_4_t_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1764_t();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,4,sign)));
    Vf := Kernel([<5,R![1327104, 0, 276480, 0, 56448, 0, 240, 0, 1]>],Snew);
    return Vf;
end function;