
// Make newform 3564.2.i.t in Magma, downloaded from the LMFDB on 18 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_3564_i();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_3564_i_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_3564_2_i_t();".
// 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_3564_2_i_t();".
// 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 := [9, -252, 3528, -4422, 2800, -408, 162, -204, 152, -18, 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], [2796863125032, -151514740149693, 251251092715326, -62207461178828, 3530606847621, 4146511251844, 14995936118036, -2477713557845, 151821416226, 281639173048, 150004431449, 4219095960], [11199188889288, -194336250154467, 174977111530908, -94843791051884, 385576869076, -5890482366924, 9692799812344, -3098623808303, -10874788028, 57113609088, 71705413468, -6484052088], [252524494555971, 994818855120, -13788155934363, 13730296754699, 13414014344752, -1589680650461, -451550997459, 1104498336968, -157262552999, -19668060275, 8133490914, 9299982465], [355793955480, -492338554923, 6867668293638, -7968852455620, 1090736576013, -266555870208, 269331097116, -386186629853, 48776182110, -1650447072, -2069597445, -2750711188], [3694668722064, -204036077524746, 309774703168110, -238304653618024, 40230073562987, 974094031696, 14460393607636, -12509435164544, 1821086395994, 168410363512, 7932704851, -82821032344], [-247656519, -42783162, 595806276, -666276527, 126161504, 388316, 22392261, -37197626, 5714144, 95747, -222972, -279432], [-86245333972914, -6900815131986, 96139835799855, -108479773583614, 8832900690888, -784058367927, 3669193992324, -5950337959658, 679473978957, -17385401814, -33468459198, -42033703465], [-24784878, 1390183698, -1823003160, 1148955965, -164580036, 62104724, -85229462, 62268674, -7363776, -75781, -28556, 405744], [-60402814067835, 3392795994207852, -4413367065549828, 2972434593825592, -438132834661648, 156337965115424, -201770487339699, 161900965920808, -19626684693736, 27250451714, 129583122540, 1082573996136], [114964945674135, -6452506534940379, 8416860848777175, -5340206028315137, 761130699500542, -291801347823766, 387424675420523, -289804140425773, 34438656044419, 105634150883, -7566377254, -1909077352544], [-125528950369608, 2200637124154833, -2758626854840940, 1767444654094827, -259408267666014, 101855474554922, -126131075181086, 96134879282611, -11467900114482, 32154593429, 30428609356, 636792327880]];
    Rf_basisdens := [1, 76706025554046, 76706025554046, 76706025554046, 4512119150238, 76706025554046, 143870286, 10958003650578, 54382422, 76706025554046, 76706025554046, 10958003650578];
    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_3564_i();"
function MakeCharacter_3564_i()
    N := 3564;
    order := 3;
    char_gens := [1783, 1541, 2917];
    v := [3, 2, 3];
    // 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_3564_i_Hecke();"
function MakeCharacter_3564_i_Hecke(Kf)
    N := 3564;
    order := 3;
    char_gens := [1783, 1541, 2917];
    char_values := [[1, 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, 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]];
    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, 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, -1, 0, 0, 0, 0, 0, 0, -1, 0], [1, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0], [-1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 2, -1, -1, -2, 0, -1, 0, 0, 0, 0], [0, -1, 0, 0, 0, 0, 0, 0, 1, -1, -1, 0], [0, -1, 0, 1, -1, 0, 1, 0, 0, 1, 1, -1], [0, 0, 0, 0, 0, 0, 0, -1, -1, 1, 1, 1], [-1, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0], [0, -2, 0, 0, 0, 1, 0, 0, 4, 1, -1, 0], [2, 0, -2, 1, 0, 0, 2, 0, -2, 2, 1, 0], [3, 1, -1, 1, 1, 0, 0, 0, -3, 0, 1, 2], [-1, 0, 1, -1, -1, -1, -2, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, -2, 0, 0, 3, 1, 3, 0], [1, 1, 1, -1, 1, 0, 3, 0, -1, 3, -1, 1], [0, -1, 0, 0, 0, 1, 0, 0, 1, 2, 0, 0], [-7, 0, 1, -1, 1, -1, 0, 0, 0, 0, 0, 0], [-1, 0, -1, 2, -1, 1, 3, 1, 0, 0, 0, 0], [2, -1, -2, 0, -1, 0, 2, 0, -2, 2, 0, 1], [2, 0, 4, -2, 0, 0, 0, 0, -2, 0, -2, -2], [-3, 0, -1, 3, 1, 1, 3, 0, 0, 0, 0, 0], [-4, -2, 2, -2, -2, 0, 4, 0, 4, 4, -2, 0], [1, 0, -1, -1, 0, 0, 0, 0, -1, 0, -1, -1], [0, -1, 0, 0, 0, -1, 0, -1, 2, 5, 1, 1], [-4, 0, -2, 2, 0, 2, -2, 0, 0, 0, 0, 0], [-3, 0, -1, 0, -1, 1, 3, 1, 0, 0, 0, 0], [0, 1, 0, 0, 0, -2, 0, -2, 1, 0, 3, 2], [0, 0, 0, 3, 3, 0, 0, 1, 0, 0, 0, 0], [0, 2, 0, 0, 0, 2, 0, -1, 5, -3, 0, 1], [-1, 1, 0, 3, 1, 0, 2, 0, 1, 2, 3, 2], [0, 3, 0, 0, 0, -2, 0, 1, -2, 4, 1, -1], [0, 1, 0, 0, 0, -1, 0, 2, 1, -3, -2, -2], [-4, 1, -2, 3, 1, 0, 4, 0, 4, 4, 3, 1], [0, 1, 0, 0, 0, -3, 0, -1, -3, 1, -3, 1], [5, 0, -2, 1, -2, 2, -1, -1, 0, 0, 0, 0], [0, -2, 0, 0, 0, 5, 0, 1, 5, -4, -1, -1], [3, -1, -2, 1, -1, 0, 2, 0, -3, 2, 1, 2], [-10, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0], [3, 0, 1, -2, -1, -1, 2, 0, 0, 0, 0, 0], [6, 0, 1, 4, 0, 0, -1, 0, -6, -1, 4, 2], [0, -2, 0, 0, 0, -3, 0, 0, 3, 3, 4, 0], [4, 0, -1, 0, -1, 1, 2, 1, 0, 0, 0, 0], [-6, 0, 1, -1, 3, -1, 1, -1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 2, 4, 2, 0], [0, -2, 4, 0, -2, 0, 0, 0, 0, 0, 0, 2], [12, 2, -1, -3, 2, 0, -3, 0, -12, -3, -3, 0], [0, 1, 0, 0, 0, 1, 0, 0, -6, 4, 4, 0], [0, 0, 3, -2, 1, -3, 2, -1, 0, 0, 0, 0], [0, 4, 0, 0, 0, -5, 0, -2, 0, 5, 1, 2], [7, -2, -1, -3, -2, 0, 1, 0, -7, 1, -3, 0], [-2, 0, 4, 0, 0, -4, -4, -2, 0, 0, 0, 0], [0, -1, 0, 0, 0, -4, 0, -2, 7, -2, -3, 2], [0, 0, -1, 5, 0, 0, 3, 0, 0, 3, 5, -2], [0, 0, -4, 4, 2, 4, -1, 2, 0, 0, 0, 0], [2, 0, -2, -1, -4, 2, -4, -2, 0, 0, 0, 0], [0, -2, 0, 1, -2, 0, 8, 0, 0, 8, 1, -2], [10, 1, 5, -2, 1, 0, -2, 0, -10, -2, -2, -3], [0, 2, 0, 0, 0, 2, 0, -2, -8, 2, -2, 2], [0, -3, 0, 0, 0, 1, 0, 0, -13, -1, -2, 0], [-10, 0, 0, -1, -4, 0, -2, -2, 0, 0, 0, 0], [0, -2, 0, 0, 0, -1, 0, 0, 14, 3, -2, 0], [-1, 3, -3, 1, 3, 0, 1, 0, 1, 1, 1, 3], [-5, -3, 2, -3, -3, 0, 2, 0, 5, 2, -3, -2], [8, -1, 3, -1, -1, 0, -5, 0, -8, -5, -1, -1], [0, -3, 0, 0, 0, 6, 0, -1, 6, -4, 0, 1], [0, -4, 0, 0, 0, -2, 0, 3, -1, -5, -2, -3], [-6, -2, 2, -2, -2, 0, 2, 0, 6, 2, -2, -2], [-9, 3, 0, 3, 3, 0, -1, 0, 9, -1, 3, 0], [9, 0, 2, 2, 0, -2, -3, 1, 0, 0, 0, 0], [-2, 5, -1, 3, 5, 0, -3, 0, 2, -3, 3, 3], [0, 2, 0, 0, 0, -4, 0, -2, 4, 4, 7, 2], [7, 0, -3, 0, 5, 3, -6, 2, 0, 0, 0, 0], [0, -2, 0, 0, 0, 2, 0, 2, 0, 12, -4, -2], [-3, -1, 6, -5, -1, 0, -1, 0, 3, -1, -5, 2], [-5, 0, 5, 1, 1, -5, 1, 1, 0, 0, 0, 0], [0, -1, 0, 0, 0, -6, 0, 0, -11, 6, 5, 0], [0, 5, 0, 0, 0, 3, 0, -1, 7, -7, -4, 1], [0, -1, 0, 0, 0, -4, 0, 0, 9, -7, 3, 0], [0, 3, -11, 6, 3, 0, 0, 0, 0, 0, 6, 2], [-7, 0, 4, 2, -2, -4, 5, 3, 0, 0, 0, 0], [-3, 0, 1, -3, 5, -1, 1, 1, 0, 0, 0, 0], [8, -2, 2, 4, -2, 0, -4, 0, -8, -4, 4, 0], [-1, -3, 0, 3, -3, 0, 7, 0, 1, 7, 3, 2], [4, 0, 0, 4, 4, 0, -8, 0, 0, 0, 0, 0], [5, 1, -1, 4, 1, 0, -1, 0, -5, -1, 4, 3], [-17, 0, -3, -3, 0, 0, -8, 0, 17, -8, -3, 1], [0, 4, 0, 0, 0, -4, 0, 0, 10, 4, 0, 0], [9, 0, 3, -1, -5, -3, -6, -2, 0, 0, 0, 0], [-4, 0, 6, -4, 0, 0, -2, 0, 4, -2, -4, 0], [-5, 0, -3, 6, -1, 3, 0, 2, 0, 0, 0, 0], [0, -2, 0, 0, 0, 5, 0, -1, 3, -2, -1, 1], [0, -4, 0, 0, 0, -2, 0, 2, -8, -4, -4, -2], [-10, 0, -2, -4, 2, 2, -6, 0, 0, 0, 0, 0], [0, -2, 0, 0, 0, 6, 0, 0, -14, 0, 2, 0], [9, 0, -1, 3, 5, 1, 6, 0, 0, 0, 0, 0], [-8, 0, 0, -2, 1, 0, -14, 1, 0, 0, 0, 0], [-11, 0, -1, -2, -5, 1, 3, 1, 0, 0, 0, 0], [-12, 0, 6, -1, 0, 0, -10, 0, 12, -10, -1, 0], [5, 0, 1, 8, 1, -1, 5, 0, 0, 0, 0, 0], [0, 4, 0, 0, 0, 0, 0, 1, -15, -11, -2, -1], [-18, 5, 2, -5, 5, 0, 7, 0, 18, 7, -5, -1], [0, -4, 0, 0, 0, -2, 0, 0, 12, -10, -2, 0], [1, 0, 2, 0, -2, -2, 12, -4, 0, 0, 0, 0], [-6, 0, -1, 2, 0, 0, -1, 0, 6, -1, 2, -2], [-4, 0, 6, -1, 3, -6, 9, 3, 0, 0, 0, 0], [0, 3, 0, 0, 0, 3, 0, 0, -3, 6, -3, 0], [1, -1, -3, 0, -1, 0, -9, 0, -1, -9, 0, 3], [0, 1, 0, 0, 0, -8, 0, 1, 8, -4, 3, -1], [10, 0, 2, 2, 1, -2, 0, -3, 0, 0, 0, 0], [0, 6, 0, 0, 0, 4, 0, 2, -8, -7, -2, -2], [0, 1, 1, -1, 1, 0, -7, 0, 0, -7, -1, -3], [-7, 0, 4, 3, 2, -4, -1, -3, 0, 0, 0, 0], [0, 4, 4, -6, 4, 0, -9, 0, 0, -9, -6, 0], [0, -1, 0, 0, 0, -7, 0, 0, 1, 6, 0, 0], [-6, 0, 4, -6, 2, -4, -12, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 2, 0, 4, -13, 3, -1, -4], [7, 8, 1, -3, 8, 0, -2, 0, -7, -2, -3, 1], [0, -1, 0, 0, 0, 3, 0, 0, 6, -4, 4, 0], [17, 0, 1, 5, 0, 0, -5, 0, -17, -5, 5, 2], [-16, -2, -3, 5, -2, 0, -3, 0, 16, -3, 5, 0], [25, 0, -2, 3, -1, 2, 11, -2, 0, 0, 0, 0], [-13, -2, 10, -1, -2, 0, -13, 0, 13, -13, -1, -1], [6, 0, 3, 0, -3, -3, -10, -3, 0, 0, 0, 0], [-3, 1, -1, -5, 1, 0, -3, 0, 3, -3, -5, -5], [-19, 0, 6, 3, -7, -6, 5, -4, 0, 0, 0, 0], [13, 5, -5, 6, 5, 0, -10, 0, -13, -10, 6, 0], [0, 1, 0, 0, 0, -6, 0, -1, 4, 8, 5, 1], [0, 0, -4, 5, 4, 4, 0, -4, 0, 0, 0, 0], [0, 2, 0, 0, 0, -3, 0, -3, 5, -12, 1, 3], [0, 6, 0, 0, 0, -2, 0, -5, 5, -7, 3, 5], [22, 0, 7, -7, -5, -7, -7, -3, 0, 0, 0, 0], [0, -3, 0, 0, 0, 1, 0, 1, 4, -8, 0, -1], [0, 2, 0, 0, 0, 1, 0, 0, 17, -13, -7, 0], [21, 0, 6, -1, -5, -6, -4, -2, 0, 0, 0, 0], [0, 4, 0, 0, 0, -2, 0, -2, 14, -4, 0, 2], [0, -3, 0, 0, 0, -1, 0, 2, -3, 9, -1, -2], [-3, 0, 6, -3, -1, -6, 6, 0, 0, 0, 0, 0], [8, 0, -2, 1, 0, 2, 2, -4, 0, 0, 0, 0], [-3, 3, -4, 9, 3, 0, 12, 0, 3, 12, 9, 0], [0, 1, 0, 0, 0, -1, 0, -5, -8, 3, -5, 5], [-11, 0, -5, 7, 8, 5, 10, 3, 0, 0, 0, 0], [8, 0, -4, 6, -6, 4, -2, 0, 0, 0, 0, 0], [9, -3, -6, -3, -3, 0, 1, 0, -9, 1, -3, 0], [6, -7, 4, 2, -7, 0, -2, 0, -6, -2, 2, -3], [-10, -3, 9, -2, -3, 0, -12, 0, 10, -12, -2, 1], [0, -2, 0, 0, 0, 4, 0, -2, 10, -8, -8, 2], [11, 0, 2, -3, -1, -2, -9, -4, 0, 0, 0, 0], [0, -5, 0, 0, 0, -1, 0, 3, -11, -1, 0, -3], [0, 0, -5, 6, 6, 5, 5, 6, 0, 0, 0, 0], [-3, 0, 4, 1, -4, -4, -11, -3, 0, 0, 0, 0], [0, 2, 0, 0, 0, -12, 0, 1, -1, 3, 8, -1], [-8, 2, -6, 0, 2, 0, -10, 0, 8, -10, 0, 6], [-6, 6, 5, 2, 6, 0, 13, 0, 6, 13, 2, 4], [-12, 0, 4, -1, -6, -4, 2, -4, 0, 0, 0, 0], [16, -4, 6, 2, -4, 0, 7, 0, -16, 7, 2, -4], [-17, 0, -7, -4, 3, 7, 3, 3, 0, 0, 0, 0], [0, -1, 0, 0, 0, -1, 0, -3, -18, -8, 6, 3], [-14, 4, 3, -12, 4, 0, -1, 0, 14, -1, -12, -2], [9, 0, 14, -9, -1, -14, 2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 0, 12, -6, 4, 0], [-21, 0, 8, -5, 1, -8, 1, 2, 0, 0, 0, 0], [0, -1, 0, 0, 0, -9, 0, -4, 1, 16, 1, 4], [9, 3, -4, -7, 3, 0, -11, 0, -9, -11, -7, -2], [-8, 0, -1, -9, 1, 1, -3, -1, 0, 0, 0, 0], [13, 1, 3, -2, 1, 0, -1, 0, -13, -1, -2, -1], [9, 0, 11, -2, 0, -11, 3, 0, 0, 0, 0, 0], [0, -9, 0, 0, 0, 5, 0, 0, 1, -14, -1, 0], [-3, 0, -7, 7, 0, 0, -4, 0, 3, -4, 7, -1], [0, -6, 0, 0, 0, 4, 0, 1, -28, -3, -3, -1], [0, -8, 0, 0, 0, -3, 0, 2, -8, 7, -11, -2], [9, 5, -9, 6, 5, 0, 3, 0, -9, 3, 6, -1], [0, -6, 0, 0, 0, -10, 0, 1, -17, -1, 7, -1], [0, -3, 0, 0, 0, -7, 0, -2, -15, 2, 13, 2], [6, -2, -8, 11, -2, 0, -2, 0, -6, -2, 11, 0], [12, 0, -4, 6, 8, 4, 3, 0, 0, 0, 0, 0], [14, 0, 0, 1, 1, 0, -10, 5, 0, 0, 0, 0], [27, 7, -7, 3, 7, 0, -7, 0, -27, -7, 3, 5], [-23, -1, -7, 8, -1, 0, -4, 0, 23, -4, 8, -2], [21, -2, -2, 6, -2, 0, -7, 0, -21, -7, 6, 3], [0, 5, 0, 0, 0, 5, 0, -4, -2, 12, -4, 4], [-13, 0, 1, 3, 6, -1, -8, -1, 0, 0, 0, 0], [0, -1, 0, 0, 0, 6, 0, 4, -27, 11, 7, -4], [-25, 1, -7, 5, 1, 0, 3, 0, 25, 3, 5, 6], [-17, 0, -5, -9, 0, 5, -3, 2, 0, 0, 0, 0], [-2, -2, 2, 8, -2, 0, 12, 0, 2, 12, 8, 4], [0, -1, 0, 0, 0, -2, 0, 7, 4, -10, -8, -7], [-21, 0, -3, -5, -2, 3, -10, -1, 0, 0, 0, 0], [18, 0, -11, 4, 7, 11, 2, 0, 0, 0, 0, 0], [-7, 4, 11, -9, 4, 0, 0, 0, 7, 0, -9, -1], [4, 0, 11, 1, -1, -11, 9, 1, 0, 0, 0, 0], [-2, 2, -6, -4, 2, 0, 7, 0, 2, 7, -4, -4], [-1, 0, 2, -4, -6, -2, 11, -3, 0, 0, 0, 0], [0, 1, 0, 0, 0, -2, 0, -2, -3, 9, -5, 2], [0, 1, 0, 0, 0, -5, 0, -1, 23, -19, -5, 1], [-7, -4, 6, 5, -4, 0, 7, 0, 7, 7, 5, 5], [2, -7, 4, -5, -7, 0, -3, 0, -2, -3, -5, 7], [14, 0, 3, 3, -4, -3, -1, 8, 0, 0, 0, 0], [0, -1, 0, 0, 0, 4, 0, -5, -2, 23, 3, 5], [28, 5, 6, 0, 5, 0, -4, 0, -28, -4, 0, -3], [0, 10, 0, 0, 0, -4, 0, -4, -16, 2, -2, 4], [19, -1, -11, 3, -1, 0, 5, 0, -19, 5, 3, -3], [-18, 0, 9, -2, 8, -9, -7, 2, 0, 0, 0, 0], [11, 0, 6, -11, -1, -6, 1, 4, 0, 0, 0, 0], [-5, 0, -5, 4, -1, 5, -6, -2, 0, 0, 0, 0], [0, 6, 0, 0, 0, -7, 0, -8, 8, -11, -1, 8], [16, 4, 5, -1, 4, 0, 1, 0, -16, 1, -1, 2], [0, 1, 0, 0, 0, 5, 0, -2, 15, -2, 8, 2], [-10, 0, 8, -8, 0, -8, 12, -4, 0, 0, 0, 0], [0, -2, 0, 0, 0, 1, 0, 6, 12, -4, -6, -6], [-8, -5, -3, -11, -5, 0, 5, 0, 8, 5, -11, -1], [17, -5, -4, -3, -5, 0, 9, 0, -17, 9, -3, 2], [0, -2, 0, 0, 0, 15, 0, 5, 13, -12, -5, -5], [3, -7, 13, 4, -7, 0, -2, 0, -3, -2, 4, -2], [0, 0, 0, 0, 0, 6, 0, -2, -10, -12, -9, 2], [52, -3, -4, 1, -3, 0, 7, 0, -52, 7, 1, -3], [-20, 0, -4, 10, 4, 4, 2, 0, 0, 0, 0, 0], [0, -2, 0, 0, 0, 0, 0, 4, -30, 21, 4, -4], [0, 3, 0, 0, 0, -11, 0, -1, 13, 5, -1, 1], [0, -4, 0, 0, 0, 2, 0, -2, 0, 4, -1, 2], [0, -5, 0, 0, 0, 6, 0, 4, 13, -12, -3, -4], [14, 0, -11, 3, -1, 11, 3, -3, 0, 0, 0, 0], [0, 6, 0, 0, 0, 1, 0, -1, 7, 20, -5, 1], [11, -3, 9, -13, -3, 0, 1, 0, -11, 1, -13, -1], [-13, -7, -2, -1, -7, 0, -3, 0, 13, -3, -1, -6], [16, 0, -13, 2, 4, 13, -9, -4, 0, 0, 0, 0], [-2, -7, 6, 0, -7, 0, 4, 0, 2, 4, 0, -3], [4, -6, 19, -7, -6, 0, -3, 0, -4, -3, -7, -4], [0, 6, 0, 0, 0, -12, 0, -3, 10, 21, 3, 3], [16, 0, 0, -7, 4, 0, 2, 6, 0, 0, 0, 0], [0, 1, 0, 0, 0, -4, 0, 1, -22, -8, -3, -1], [0, 5, 0, 0, 0, -12, 0, -6, 7, 12, 11, 6], [-12, 9, 5, 7, 9, 0, 11, 0, 12, 11, 7, 7], [-3, 12, 2, 8, 12, 0, -3, 0, 3, -3, 8, 1], [0, 1, 0, 0, 0, 7, 0, -3, 7, -7, 3, 3], [25, 0, 11, -3, 0, -11, -4, -5, 0, 0, 0, 0], [0, 10, 0, 0, 0, -3, 0, 2, 28, 15, -2, -2], [-17, 0, 3, 3, -3, -3, 2, -2, 0, 0, 0, 0], [9, 13, -5, 3, 13, 0, 0, 0, -9, 0, 3, 0], [-16, 0, 4, -3, 10, -4, 0, -6, 0, 0, 0, 0], [0, 1, 0, 0, 0, 7, 0, 7, 2, 11, -3, -7], [32, 0, -2, 2, 8, 2, 8, -2, 0, 0, 0, 0], [0, 2, 0, 0, 0, -8, 0, 3, 9, -9, 0, -3], [18, -2, 2, -6, -2, 0, -4, 0, -18, -4, -6, 0], [27, 0, -12, 11, 4, 12, 3, -1, 0, 0, 0, 0], [0, 5, 0, 0, 0, -2, 0, -2, -3, 27, 1, 2], [0, -5, 0, 0, 0, 2, 0, 1, 0, -4, 2, -1], [3, 0, 1, -7, 0, -1, 14, 1, 0, 0, 0, 0], [0, 9, 0, 0, 0, -7, 0, -3, 15, 21, 4, 3], [-27, 0, 8, -5, -5, -8, 2, -4, 0, 0, 0, 0], [0, 8, 0, 0, 0, 4, 0, -2, 26, -10, 2, 2], [-18, 4, -2, -3, 4, 0, -1, 0, 18, -1, -3, 5], [1, 5, -13, 0, 5, 0, 9, 0, -1, 9, 0, 4], [-22, 0, -8, -14, -4, 8, 2, -2, 0, 0, 0, 0], [-22, 0, 5, -16, -9, -5, 8, -2, 0, 0, 0, 0], [28, -6, -4, 4, -6, 0, -4, 0, -28, -4, 4, 2], [-16, 0, -2, -2, -4, 2, -19, 4, 0, 0, 0, 0], [0, 0, 10, 2, -1, -10, 2, -7, 0, 0, 0, 0], [18, 0, 8, 3, 0, 0, 16, 0, -18, 16, 3, -4], [11, -2, -1, 9, -2, 0, -10, 0, -11, -10, 9, -1], [0, -6, 0, 0, 0, -7, 0, -2, -7, 13, 12, 2], [-26, 0, 8, -1, 4, -8, -14, -6, 0, 0, 0, 0], [0, -8, 0, 0, 0, 20, 0, -2, 14, -6, -4, 2], [-1, 3, -9, 16, 3, 0, 12, 0, 1, 12, 16, 0], [2, 0, 13, 8, -6, -13, 6, 0, 0, 0, 0, 0], [13, -5, 5, -7, -5, 0, 11, 0, -13, 11, -7, 2], [0, -2, 0, 0, 0, 8, 0, 0, -26, 18, 9, 0], [0, -5, 0, 0, 0, 7, 0, 1, -10, -14, 2, -1], [0, -3, 0, 0, 0, -1, 0, 2, -6, 12, 0, -2], [12, 0, 1, 3, 1, -1, 11, 7, 0, 0, 0, 0], [5, -2, -12, -7, -2, 0, 5, 0, -5, 5, -7, -1], [0, 9, 0, 0, 0, -12, 0, -5, 20, 2, -3, 5], [0, 0, 0, 0, 0, -1, 0, 0, 25, -9, -9, 0], [-20, 0, -8, 2, 4, 8, -10, 6, 0, 0, 0, 0], [0, -5, 0, 0, 0, -1, 0, 0, -11, 14, 17, 0], [1, 3, -3, 15, 3, 0, 15, 0, -1, 15, 15, 3], [7, 0, -9, 0, 6, 9, 15, 2, 0, 0, 0, 0], [23, 0, 9, 7, 0, 0, -4, 0, -23, -4, 7, 1], [0, 8, 0, 0, 0, -8, 0, -1, -1, 13, 12, 1], [0, -12, 0, 0, 0, 8, 0, 6, -8, -6, -12, -6], [19, -6, 1, -13, -6, 0, 4, 0, -19, 4, -13, -1], [9, 6, 11, 1, 6, 0, 7, 0, -9, 7, 1, -2], [0, 9, 0, 0, 0, 8, 0, 1, -10, 4, 0, -1], [14, 0, 1, -2, -4, -1, -1, -2, 0, 0, 0, 0], [28, 0, 5, -2, -5, -5, -4, -2, 0, 0, 0, 0], [0, -10, 0, 0, 0, 13, 0, 5, 21, 12, -7, -5], [-5, -6, -6, -5, -6, 0, 9, 0, 5, 9, -5, 5], [-33, 0, -1, -2, -3, 1, -9, 2, 0, 0, 0, 0], [16, -6, 15, -12, -6, 0, 1, 0, -16, 1, -12, -2], [-2, 0, -2, 6, 2, 2, -2, 4, 0, 0, 0, 0], [0, 1, 0, 0, 0, 3, 0, -1, -6, -22, 8, 1], [0, -2, 0, 0, 0, -1, 0, 1, 33, -4, -5, -1], [-17, -5, -1, -3, -5, 0, 7, 0, 17, 7, -3, -3], [0, 3, 0, 0, 0, -13, 0, -3, 14, -8, 10, 3], [20, -3, -5, 7, -3, 0, -5, 0, -20, -5, 7, -3], [-14, -4, 2, 0, -4, 0, -1, 0, 14, -1, 0, -2], [23, 0, -19, 5, 2, 19, 10, 3, 0, 0, 0, 0], [-16, 1, 14, -4, 1, 0, 4, 0, 16, 4, -4, 5], [0, 1, 0, 0, 0, 1, 0, 3, -1, 7, -7, -3], [6, 0, 4, 4, 8, -4, 2, 2, 0, 0, 0, 0], [14, 0, -10, 0, -3, 10, 18, 3, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_3564_i_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_3564_2_i_t();".
// 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_3564_2_i_t(:prec:=12)
    chi := MakeCharacter_3564_i();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_3564_2_i_t();".
// 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_3564_2_i_t( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_3564_i();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![9, -72, 732, 1248, 2644, 960, 1034, 24, 348, 0, 20, 0, 1]>,<7,R![16, -272, 4220, -7044, 11785, -778, 2578, -148, 427, 0, 26, -2, 1]>,<17,R![1104, 1056, -68, -272, -51, 4, 1]>],Snew);
    return Vf;
end function;