
// Make newform 1638.2.y.c in Magma, downloaded from the LMFDB on 06 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_1638_y();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1638_y_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_1638_2_y_c();".
// 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_1638_2_y_c();".
// 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 := [16, -192, 1000, -2984, 6002, -7284, 5494, -2528, 537, 104, 82, 40, 40, -12, 20, -8, 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], [-1241745401323893045120, 8241251957213875681648, -25336716035274686737392, 51391858403342645582656, -62649332902158867279196, 47667259736333919738010, -21808020956822433751512, 4903094374641295408884, 1020795990219764087478, 772580391658572562209, 376243159872598807668, 354666884436870105751, -100481314110617395302, 172850373062827022431, -69972490944959614420, 8810453484481419787], [-1085567858194490072528, 1899665583663956469552, -1803781446690608394440, -16870573462608118490784, 40583108581656169060702, -42222271916356105928370, 23777099458901783246312, -7715416262234299811216, -2232874028881130210033, -1496640349486741021843, -832915315773135893517, -414765410197699453211, -24321857261037208927, -160527514035902012089, 83939786441538639147, -11698868362125004523], [-688035310999430319936, 1223669711029373195936, -1337614489088590409536, -9878164327266277702768, 24115377250520373698014, -25156031875780250361942, 14293572868649033061836, -4661033040459466556800, -1353648933950372385221, -908623952155848342689, -506423030574247080325, -250853466954085937957, -16319571173558912787, -95940201065736020691, 50507927046357057783, -7056265369041347413], [584542587322075416256, -6345035029579124763184, 22015992179237618937056, -59666511517259564371568, 85522905553061971943036, -71714984825576732213630, 36016637613027621087280, -9040315704986997841364, -2140109490702079740406, -1554085951107517057027, -832189061146464961192, -580973445915534642573, 84539613688524773590, -266427488701355331405, 118440678597716652792, -15512786429751648481], [1132557453324976, -9921841312383600, 36373121308786984, -85988580899868352, 113219568956294482, -89995923668790394, 43071159787870216, -9762784462391544, -2059136017414191, -1556179415520171, -813094141556031, -672027705019791, 156692672910367, -330704749144585, 138301296365753, -17629042972135], [-5461217065603874041056, 28187891884784858482352, -83367849189249536007984, 167255862936333756869672, -202700550842959912371380, 152474456531607125759006, -70284854675750366215080, 14659355868512024837184, 2767834969348104265578, 2214609403385323639239, 1080922593807350558892, 1102498869243079260809, -336668411993367414666, 555732503777147660849, -221460659791030258892, 27618690357517314377], [-279499445405065755616, 1993104387746791628592, -6920281476952229423680, 15655604483093553031400, -20225042951737164171076, 15761322054866684640150, -7479537828009877711936, 1610616387006658622896, 319025985360768953674, 248834741223746675003, 128940368648258272180, 114652279378357623829, -30177590547698697114, 57893279211948857965, -23725077653206080572, 2994205490140966885], [230650006331699752288, -8172884498812969815760, 27334688839069881823120, -74087120998872004208428, 108875122499736129093878, -92985688483113292755994, 47300775478873296839804, -12718504372712238057134, -3213503277998927522285, -2273883870064584412477, -1210140853074258222021, -795843408701129124477, 87439838101676457197, -345810066853522286123, 158317828633569406855, -21021125277878065035], [4594234067017961740912, -32704211824134297823056, 113290524649632008609896, -255893117550647532091576, 330245570373096907880674, -257602217727197625956850, 122377315584533125740504, -26518146320519299868868, -5298795931979829079119, -4119021926724842141523, -2132152285813122333791, -1884437999079307605855, 488970196259846469679, -946327635507412920985, 388757174834211391657, -49126513370488191843], [-173800820357319824000, 1877723782800634003472, -6839508571946680389328, 16843089874635801410280, -23031984120255279800080, 18702343634812872455386, -9156677325533603260864, 2216412847574252038128, 505845176238109617604, 371518171538157562353, 195879950407577618886, 147208949701147260155, -27419531607829393332, 69052681399000190511, -29847215167948824266, 3864658061768228203], [-86403333747699113040, 721447802675349777936, -2492515748087927513296, 5881827248365393945584, -7873012308851057290458, 6315975651765399848848, -3073296023857682221012, 716962068095369669060, 157144920416365985515, 117634991912270128330, 61656767642984327249, 48710885983548768572, -10035678268519997763, 23308379550483686890, -9928702582560774307, 1276526512941182592], [2843022865035613822288, -30720251742910176984016, 111801051146031036422952, -275740924695600545790456, 377291053196996031008750, -306755660242939679338134, 150243396566568180601152, -36247032904767641034644, -8241672942777890208849, -6063214626278609704081, -3198697671069615739577, -2407748268319976601885, 449310809676387503553, -1132759458792787778755, 489378408129875891831, -63339678856780924817], [-2518978615690731247584, 21045328421921509411184, -72756860161951393888760, 171629244002356527144712, -229381109249059549524710, 183776514720788436149812, -89220721495115426880088, 20812646058759375633528, 4558720902396543677761, 3410112571569873689484, 1785615929598208319327, 1414642074489096799934, -294961959206387202913, 677750823115831653832, -288250772557220061321, 37037873510832940534], [-8959875000406315192960, 68990110593562938689168, -234920709364472643874720, 518214954251064184683624, -660948392250966820874916, 513739714253880450210650, -242208722605567502092176, 53615137411232141953176, 10998554188225265272386, 8423861562924163947573, 4303488155661520466960, 3803103338086808595731, -985083990357572690098, 1881186256855318965939, -773428726504321982064, 97877540218991487563], [126368538107948144992, -1189717155114541656976, 4360594470258801958640, -10909298670034740842996, 14975962328106194724620, -12191705274702342508766, 5981076301653901757392, -1420703207804796672278, -317406292972740382954, -235321088511760626589, -124819562231765638096, -94589569346544940167, 17989365574802015890, -45070576058898156183, 19407561787926980496, -2506621258792392877]];
    Rf_basisdens := [1, 291433150735989873312, 291433150735989873312, 145716575367994936656, 291433150735989873312, 211731643404256, 291433150735989873312, 22417934671999221024, 145716575367994936656, 291433150735989873312, 22417934671999221024, 6335503276869345072, 291433150735989873312, 145716575367994936656, 291433150735989873312, 6335503276869345072];
    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_1638_y();"
function MakeCharacter_1638_y()
    N := 1638;
    order := 4;
    char_gens := [911, 703, 379];
    v := [2, 4, 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_1638_y_Hecke();"
function MakeCharacter_1638_y_Hecke( : Kf := false)
    N := 1638;
    order := 4;
    char_gens := [911, 703, 379];
    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], [0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    values := ConvertToHeckeField(char_values : pass_field := ISA(Type(Kf), Fld), 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, -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, 1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, -1, 0, -1, 0], [0, 0, 0, 0, 1, 1, 0, 0, 0, -1, 1, 0, 0, 0, 0, 1], [0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0], [2, 0, 0, -1, 2, -1, 1, 0, 0, 0, -1, 0, 0, 1, -1, 0], [-1, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1], [0, 1, 0, 0, 1, 3, -1, 1, 1, 0, 1, 0, 0, 1, -1, 1], [0, 0, -1, 0, 2, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 0], [0, -1, 1, -1, 0, 0, 0, 2, 0, 1, 0, 1, 0, -1, 0, 0], [2, 0, 1, 0, 0, 2, -1, 2, 1, 0, 0, 1, 0, 0, -1, -1], [0, -2, 0, 0, 1, -1, 1, 0, -1, 1, 0, 0, 1, -1, 0, 0], [0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, -1, -2, -1, -1, 0], [0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, -2, -1, 1], [0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0], [-2, 0, -1, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 0], [0, 0, -1, 1, -2, 1, 1, 0, 0, 0, 2, 1, 0, -1, -1, 0], [2, 0, 2, -2, 0, 2, 0, 2, 0, 0, 0, 2, 0, -2, 0, 0], [-2, -2, -1, 1, 0, -2, 1, -3, -1, 0, 0, -1, 0, 1, 1, 1], [2, -3, -2, 0, -3, 0, 1, 0, 1, 1, 0, 0, -1, 0, -1, -1], [0, 0, 0, 2, 0, 2, -2, 2, 0, 0, 0, 0, 0, 2, -2, 0], [-2, 0, -1, 2, -2, 2, 0, 0, 0, 0, 2, 1, -2, -2, 0, 0], [-2, 0, -1, 2, -2, 1, 0, 0, -1, 0, 0, 1, 0, -2, 0, -1], [-6, -2, 2, 0, -3, 0, 0, 1, 0, 2, -1, 0, -2, 0, -1, -1], [0, -2, 0, 0, 0, -2, 2, 1, -2, 0, 1, -1, 0, -2, 0, 0], [0, 2, 0, 0, -1, 4, -1, -1, 1, -1, -1, -2, -1, 2, 0, 0], [0, 0, 1, -1, 1, 0, 0, 0, 0, 0, -2, -1, 1, 1, 0, 0], [0, -1, 0, 0, 3, 2, 0, 0, 0, -2, 0, 2, -2, 2, -2, 2], [0, 2, 0, 0, -2, 2, -2, -2, 2, 2, -2, -2, 2, -2, 2, -2], [0, 0, 0, 0, -3, -6, 2, -1, -2, -1, -1, -3, -1, 0, 1, -1], [3, 0, -2, 0, 5, 0, 3, 0, 0, 0, 0, 2, 1, 0, -3, 0], [4, 4, 0, 2, 2, 0, 1, 3, 1, 0, -3, 0, 0, 0, -3, -3], [-1, -4, 2, 1, 0, 1, 1, 0, -3, 0, 0, 2, 0, 1, 1, 3], [-2, -5, 0, -3, 0, -3, 1, 2, 0, 1, 0, 0, 0, -3, 1, 0], [6, -6, 1, 0, -4, 0, 1, -1, 1, -2, 1, 0, 2, 0, 1, 1], [-3, 12, -1, 0, 0, -2, -1, 0, 0, 0, 0, -1, 0, 0, -1, 0], [2, 0, 0, 0, 2, -6, -1, 0, -3, 0, -3, 0, 2, 0, 1, -3], [6, 0, -4, -2, -1, 0, 1, 1, 1, 0, -1, 0, 0, 0, -2, -2], [-2, 3, -2, -2, 4, 0, 1, 1, 1, -2, -1, 0, 2, 0, 0, 0], [0, -4, 0, 0, 5, -2, 2, -1, -2, -1, -1, 2, -1, 4, -3, 3], [0, -1, 0, 0, 2, -3, -1, 0, 1, -2, 0, 4, -2, 1, 0, 0], [3, 2, 0, 2, 0, 1, 0, 2, 2, 2, 0, 0, 0, 2, 0, -2], [2, 0, 2, 0, 0, 2, 1, 0, -1, 2, 0, 2, 0, 0, 1, 1], [0, -6, 0, 0, 6, -2, -2, 1, 2, 2, 1, 3, 2, 2, 2, -2], [1, -2, 0, 1, 1, 0, 0, -4, 0, -1, 4, 0, 1, 0, 3, 3], [-2, 0, 2, 0, -6, 2, 1, 0, -1, 0, -2, -2, 2, 0, -1, -1], [2, -6, 1, 2, 0, 4, 1, 0, -3, 0, 0, 1, 0, 2, 1, 3], [6, 6, -1, 2, 0, 7, -4, 2, 3, 0, 0, -1, 0, 2, -4, -3], [8, -1, 0, 0, -1, 0, 0, 2, 0, 4, -2, 0, -4, 0, 0, 0], [-4, -6, 0, -2, 0, -2, 2, -6, -4, -2, 0, 0, 0, -2, 2, 4], [0, 12, 3, 0, 0, -1, 1, 0, 0, 4, 0, 3, 0, 0, 1, 0], [4, -4, 1, 4, -7, 0, -3, -3, -3, -3, 3, 0, 3, 0, 0, 0], [-16, -4, 0, 4, -3, 0, -1, -1, -1, -2, 1, 0, 2, 0, 2, 2], [0, -4, 0, 0, 2, 10, 4, 4, -4, -2, 4, 4, -2, -6, -2, 2], [0, 4, 0, 0, -3, -2, -3, 0, 3, 2, 0, 0, 2, -4, 2, -2], [2, 6, 1, -2, 0, 6, -4, 4, 0, -6, 0, 1, 0, -2, -4, 0], [0, -6, 0, 0, 8, -2, -2, 2, 2, 0, 2, -2, 0, 0, 0, 0], [-2, 0, 0, -2, 0, 4, 1, 0, 1, 0, 2, 0, -2, 2, -1, 1], [0, -6, 0, 0, 4, -10, -1, -3, 1, 2, -3, -2, 2, -2, 3, -3], [-4, 0, 3, -1, -4, 3, -3, 0, 2, 0, 0, -3, 0, 1, 3, 2], [-8, -8, 2, 2, 0, -6, 0, 2, -2, -4, 0, 2, 0, 2, 0, 2], [16, 2, -2, 2, 2, 0, 1, 0, 1, -4, 0, 0, 4, 0, -1, -1], [-2, -6, 6, 0, -10, 0, -1, 0, -1, 0, 0, 0, 0, 0, -3, -3], [3, 4, -2, -1, 0, 1, 0, 0, 2, 4, 0, -2, 0, -1, 0, -2], [3, 0, -1, -2, 0, -4, 0, 0, -1, 0, -6, 1, -2, 2, 0, -1], [0, -4, 0, 0, -1, -15, 0, -4, 0, 5, -4, -2, 5, 1, 5, -5], [0, 2, 0, 0, -7, -14, 3, -1, -3, 5, -1, 2, 5, 0, 2, -2], [4, -2, -1, 2, 0, 7, -2, 0, -1, 0, 0, -1, 0, 2, -2, 1], [-4, 4, -1, 0, 0, -2, -3, 6, 1, 0, 0, -1, 0, 0, -3, -1], [-4, 0, 4, 0, -2, 0, -4, 0, 0, 0, -4, -4, 6, 0, 4, 0], [4, 6, -2, 2, 5, 0, 2, -3, 2, -1, 3, 0, 1, 0, -3, -3], [0, 0, 4, 2, -2, 0, -3, 6, -3, 0, -6, 0, 0, 0, 1, 1], [-1, 0, 3, 0, -4, -2, -4, 0, 1, 0, 2, -3, 6, 0, 4, 1], [12, 4, -2, 2, 0, 8, -1, -3, 5, -2, 0, -2, 0, 2, -1, -5], [4, -4, -4, 0, -1, 0, 3, -5, 3, 4, 5, 0, -4, 0, 0, 0], [0, 16, -1, 2, 0, 5, -2, 6, -3, 2, 0, -1, 0, 2, -2, 3], [6, 0, -2, -4, 4, -2, 1, 0, 3, 0, 2, 2, 4, 4, -1, 3], [-4, 0, 5, 1, -4, 0, -5, 0, 1, 0, 5, -5, 4, -1, 5, 1], [0, -8, 0, 0, 5, 6, 2, -5, -2, 3, -5, 1, 3, 4, 1, -1], [8, 0, -1, -4, 2, -7, -2, 0, 3, 0, 0, 1, 4, 4, 2, 3], [-6, -10, 0, 0, 0, -4, 2, -8, -4, 2, 0, 0, 0, 0, 2, 4], [0, -12, 0, 0, 14, 0, -2, 1, 2, -2, 1, 2, -2, 4, 0, 0], [0, -8, 0, 0, 6, -2, 2, 1, -2, -2, 1, 1, -2, -2, 0, 0], [0, -2, 0, 0, 3, -2, -1, 5, 1, -1, 5, 4, -1, 0, 0, 0], [-3, 0, -2, -2, 9, 4, 0, 0, 1, 0, 6, 2, 3, 2, 0, 1], [2, 0, 2, 3, -8, -4, -1, 0, -1, 0, -6, -2, -4, -3, 1, -1], [14, 4, 2, 0, 0, 12, -2, 3, 4, 4, 0, 2, 0, 0, -2, -4], [4, 3, 0, 3, 0, -1, 1, -2, 4, 1, 0, 0, 0, 3, 1, -4], [4, -4, 3, 4, -3, 0, -3, -3, -3, -3, 3, 0, 3, 0, 4, 4], [10, 0, 0, 0, 6, -6, 3, 0, 1, 0, -3, 0, -2, 0, -3, 1], [0, 0, 0, 0, 16, 4, 4, 0, 0, 0, 0, 0, 0, 0, -4, 0], [-20, 0, -4, -6, 5, 0, -2, -1, -2, -1, 1, 0, 1, 0, 7, 7], [-1, 0, 1, -2, -14, 0, 2, 0, -3, 0, -2, -1, 0, 2, -2, -3], [0, 8, 0, 0, -8, -12, -1, -1, 1, -2, -1, -2, -2, 4, 1, -1], [4, 12, -4, 2, 0, -6, 2, -5, 8, 4, 0, -4, 0, 2, 2, -8], [0, -12, 0, 0, 10, -8, 4, -4, -4, 1, -4, -3, 1, 4, -2, 2], [6, -4, 2, 0, -2, 0, 1, -1, 1, 4, 1, 0, -4, 0, 1, 1], [6, 1, 7, -5, 0, 14, -2, 6, -6, -5, 0, 7, 0, -5, -2, 6], [-10, -6, -10, 0, -4, 0, 3, -4, 3, -2, 4, 0, 2, 0, -1, -1], [-2, 0, 0, -4, 6, 0, -4, 0, 2, 0, 8, 0, 4, 4, 4, 2], [4, 10, -1, 4, 9, 0, -1, -1, -1, -3, 1, 0, 3, 0, 0, 0], [-6, -6, 0, 0, -6, 0, 1, -2, 1, 3, 2, 0, -3, 0, -1, -1], [0, 2, 0, 0, 0, 10, -4, 2, 4, 4, 2, 4, 4, -2, 2, -2], [-8, 0, 1, 0, -14, 7, -2, 0, 1, 0, 2, -1, 4, 0, 2, 1], [-8, -12, -1, 2, 0, -8, -1, 2, 1, -2, 0, -1, 0, 2, -1, -1], [8, 0, 0, 0, 4, -2, 7, 0, -1, 0, 0, 0, -8, 0, -7, -1], [0, -1, 0, 0, -2, -11, 1, -2, -1, 2, -2, 4, 2, 1, 2, -2], [-12, 4, -2, -8, 4, 0, -2, 5, -2, 0, -5, 0, 0, 0, 2, 2], [-10, 10, -5, 2, 8, 0, 2, -1, 2, 4, 1, 0, -4, 0, -4, -4], [6, 0, -9, -1, -1, -4, 2, 0, 0, 0, 2, 9, 3, 1, -2, 0], [13, 1, 2, -2, 0, 12, 1, -2, 0, 5, 0, 2, 0, -2, 1, 0], [0, 2, -2, -3, 0, -1, 2, 7, -1, 4, 0, -2, 0, -3, 2, 1], [0, 19, 4, -5, 0, -1, 3, -2, -2, 5, 0, 4, 0, -5, 3, 2], [4, 3, 2, 0, 3, 0, 2, 10, 2, 4, -10, 0, -4, 0, -2, -2], [-8, 0, -2, 3, 2, 7, 1, 0, -2, 0, -1, 2, -4, -3, -1, -2], [0, -4, -8, -2, 0, 0, 3, -1, 3, -2, 1, 0, 2, 0, 1, 1], [0, -5, 0, 0, 5, 13, 3, 3, -3, 2, 3, 8, 2, -5, -3, 3], [0, -3, 0, 0, 6, -2, 0, -3, 0, 0, -3, 4, 0, -4, -3, 3], [-2, -4, 2, -4, 0, -3, 0, -6, 1, 6, 0, 2, 0, -4, 0, -1], [0, -12, 0, 0, 11, 11, 0, 4, 0, 1, 4, 2, 1, 1, 1, -1], [0, 2, 0, 0, 1, -4, -5, 2, 5, 0, 2, 2, 0, -6, 2, -2], [-1, 0, 0, -2, -3, 0, 0, 0, -1, 0, -10, 0, -1, 2, 0, -1], [-6, 0, -8, -2, 0, 6, -2, 0, 2, 0, 0, 8, 8, 2, 2, 2], [14, 4, -4, -2, 7, 0, -1, -1, -1, -4, 1, 0, 4, 0, 4, 4], [-16, 16, -1, -2, 0, -13, 1, -4, -4, -4, 0, -1, 0, -2, 1, 4], [-2, -8, 6, 6, -8, 0, -2, 0, -2, 0, 0, 0, 0, 0, 2, 2], [0, 2, 0, 0, -8, 2, 6, -1, -6, 0, -1, -3, 0, -6, 0, 0], [10, 0, -1, 4, -14, -5, 7, 0, -2, 0, 4, 1, 0, -4, -7, -2], [5, -4, 3, 0, 0, 2, 3, 0, 0, 0, 0, 3, 0, 0, 3, 0], [-12, 0, 2, -4, 0, -12, 4, 0, -4, 0, 0, 2, 0, -4, 4, 4], [0, -12, 0, 0, 12, 14, 4, -4, -4, -4, -4, 2, -4, 2, -4, 4], [4, -1, -8, -8, 9, 0, 2, -2, 2, -5, 2, 0, 5, 0, 8, 8], [-8, 0, 5, 4, -6, 6, 1, 0, -3, 0, 0, -5, 0, -4, -1, -3], [-2, 0, 7, -1, -12, 6, 5, 0, -1, 0, -3, -7, -4, 1, -5, -1], [2, -16, -2, -2, 0, 4, 3, -3, -5, 4, 0, -2, 0, -2, 3, 5], [-2, 14, -4, -3, 0, -9, 4, -3, 3, 0, 0, -4, 0, -3, 4, -3], [-6, -4, 0, -2, 5, 0, 5, -10, 5, 0, 10, 0, 0, 0, 4, 4], [0, 1, 0, 0, 3, 8, -2, 6, 2, -2, 6, -2, -2, 8, -2, 2], [4, 0, -8, -3, 2, 5, 7, 0, 2, 0, 3, 8, 0, 3, -7, 2], [-12, 12, 2, 4, 0, -8, -2, -4, -2, 6, 0, 2, 0, 4, -2, 2], [0, -5, 0, 0, 5, -12, 1, -6, -1, -1, -6, -6, -1, -4, -1, 1], [11, 0, -4, -2, -7, -4, 6, 0, 1, 0, 2, 4, 3, 2, -6, 1], [0, -8, 0, 0, 6, -14, 4, 3, -4, 2, 3, 9, 2, -8, -2, 2], [2, 0, -1, 1, -8, -3, 1, 0, -2, 0, 8, 1, 2, -1, -1, -2], [-2, 20, 5, 0, 0, -1, -2, 6, 1, -2, 0, 5, 0, 0, -2, -1], [12, 2, -2, -8, -1, 0, 3, 3, 3, 2, -3, 0, -2, 0, -6, -6], [-16, -22, 6, 0, -20, 0, -2, 2, -2, 0, -2, 0, 0, 0, 4, 4], [-12, 4, 0, 6, 0, -10, -2, 0, 0, 4, 0, 0, 0, 6, -2, 0], [0, 0, -7, 0, 6, 1, 2, 0, -1, 0, 8, 7, 0, 0, -2, -1], [4, 14, -5, 0, 12, 0, 0, 2, 0, 1, -2, 0, -1, 0, -2, -2], [0, 4, 0, 0, -5, -1, 3, 6, -3, -1, 6, 4, -1, -9, -2, 2], [0, 6, 0, 0, -8, 10, -7, 2, 7, 2, 2, -4, 2, 2, 9, -9], [0, 0, 0, 0, 2, 6, -6, 6, 6, 2, 6, 0, 2, -6, 4, -4], [0, -3, 0, 0, 2, 1, 7, 4, -7, 2, 4, 8, 2, 1, -6, 6], [6, 8, -8, -2, 8, 0, 2, -2, 2, -4, 2, 0, 4, 0, -2, -2], [14, -12, 0, 2, 0, 14, 0, 6, 0, 6, 0, 0, 0, 2, 0, 0], [18, 2, -6, 6, 0, 0, 5, 5, 5, 2, -5, 0, -2, 0, -7, -7], [-8, 12, -5, 5, 0, -13, 0, -10, 5, 0, 0, -5, 0, 5, 0, -5], [7, 0, 6, 4, -13, -10, -2, 0, -1, 0, 2, -6, -7, -4, 2, -1], [4, -7, 8, 0, -11, 0, -2, 2, -2, -2, -2, 0, 2, 0, -2, -2], [12, 0, 0, 1, -25, -13, 0, 0, -1, 0, 2, 0, 5, -1, 0, -1], [0, -12, 0, 0, 10, -12, -2, 2, 2, -2, 2, 0, -2, 0, 4, -4], [-7, -5, 0, 2, 0, -4, -5, -10, 2, -3, 0, 0, 0, 2, -5, -2], [-4, 0, -2, -4, 14, 6, 5, 0, -3, 0, 3, 2, 2, 4, -5, -3], [-24, -5, 4, -6, -1, 0, -3, 0, -3, -1, 0, 0, 1, 0, 7, 7], [8, -8, 0, 0, -7, 0, 0, 1, 0, -1, -1, 0, 1, 0, 1, 1], [2, 18, -6, 3, 0, 2, 1, -10, -1, 4, 0, -6, 0, 3, 1, 1], [2, -6, -2, 2, -5, 0, -1, -4, -1, 0, 4, 0, 0, 0, 2, 2], [-3, -9, -8, 2, 0, -6, -2, 0, 5, 3, 0, -8, 0, 2, -2, -5], [16, 10, 6, 0, 0, 23, -3, 8, -4, 6, 0, 6, 0, 0, -3, 4], [16, 12, 4, -16, 14, 0, -2, 4, -2, 2, -4, 0, -2, 0, 4, 4], [-2, 0, 0, -1, 0, 0, 1, 0, -3, 0, 8, 0, 4, 1, -1, -3], [0, -6, 0, 0, 8, 6, -6, 7, 6, 0, 7, -3, 0, 6, 4, -4], [0, 6, 0, 0, -5, 14, 4, 3, -4, 2, 3, 6, 2, -4, -5, 5], [0, -8, 3, 1, 0, 3, -4, 6, 1, 6, 0, 3, 0, 1, -4, -1], [7, 0, -4, 1, 2, -13, -5, 0, -1, 0, 2, 4, 8, -1, 5, -1], [0, -10, 0, 0, 9, -28, -1, -5, 1, 5, -5, -6, 5, 2, 2, -2], [14, 8, 9, -4, 10, 0, -1, 5, -1, -4, -5, 0, 4, 0, 3, 3], [0, -3, 2, 1, 0, -3, 5, 2, -2, 3, 0, 2, 0, 1, 5, 2], [4, -8, 12, 0, -10, 0, -4, 10, -4, 6, -10, 0, -6, 0, 2, 2], [-20, -21, 6, 0, -21, 0, -4, 4, -4, -3, -4, 0, 3, 0, 4, 4], [-12, 28, -1, 0, 0, -12, -2, 0, 2, 0, 0, -1, 0, 0, -2, -2], [3, 0, 4, 7, 8, -7, -3, 0, -1, 0, 10, -4, 0, -7, 3, -1], [-18, 2, 4, 0, 7, 0, 0, -6, 0, 4, 6, 0, -4, 0, 5, 5], [0, -4, 0, 0, -2, -8, 5, -2, -5, 4, -2, 6, 4, 0, 1, -1], [-10, 0, 4, -3, 2, 13, 5, 0, -2, 0, -1, -4, -12, 3, -5, -2], [4, 12, -2, 3, 0, 0, -3, 4, 7, -6, 0, -2, 0, 3, -3, -7], [-8, 0, -8, 8, -10, 10, 5, 0, -3, 0, 5, 8, 2, -8, -5, -3], [-12, -2, 6, -4, -6, 0, -1, 3, -1, -4, -3, 0, 4, 0, -3, -3], [19, 9, -6, -2, 0, 18, 0, -4, 1, 1, 0, -6, 0, -2, 0, -1], [-2, -12, 4, -6, -14, 0, -4, 2, -4, -2, -2, 0, 2, 0, 2, 2], [8, 0, 0, 4, -18, -6, 3, 0, -1, 0, 5, 0, 0, -4, -3, -1], [10, -2, 8, 4, -3, 0, 0, 5, 0, 3, -5, 0, -3, 0, -1, -1], [0, -16, -1, 12, -22, 0, 0, 2, 0, 7, -2, 0, -7, 0, -6, -6], [-2, 0, 6, -5, -20, -4, -9, 0, 3, 0, 2, -6, 0, 5, 9, 3], [0, -11, 0, 0, 15, 6, -2, 0, 2, 3, 0, 0, 3, 14, -2, 2], [8, 0, -7, -2, 10, -2, 2, 0, 4, 0, 4, 7, -2, 2, -2, 4], [0, 2, 0, 0, -2, 14, 2, -6, -2, -2, -6, -6, -2, 10, -2, 2], [-9, 0, 8, 7, -2, 3, -4, 0, -2, 0, -2, -8, 6, -7, 4, -2], [-6, -2, 1, -2, -2, 0, -4, -7, -4, 2, 7, 0, -2, 0, 4, 4], [-6, 0, -3, 6, -2, 5, -1, 0, 0, 0, 6, 3, -8, -6, 1, 0], [10, -8, 4, 6, -12, 0, -3, -1, -3, 6, 1, 0, -6, 0, -1, -1], [6, 0, -1, -2, 18, 0, 1, 0, 5, 0, 6, 1, 6, 2, -1, 5], [0, 2, 0, 0, -5, -2, 0, -6, 0, 8, -6, -4, 8, 4, 3, -3], [-2, 0, 1, -2, -12, -8, -7, 0, -3, 0, 0, -1, 8, 2, 7, -3], [0, -1, 0, 0, 4, 4, 0, -1, 0, 6, -1, 8, 6, 6, -3, 3], [-3, 23, -2, 2, 0, -2, -8, 8, 7, -5, 0, -2, 0, 2, -8, -7], [0, 0, 0, 0, 6, 8, -3, -1, 3, 0, -1, 10, 0, 12, -3, 3], [0, 2, 0, 0, -5, 11, 1, 0, -1, -1, 0, -12, -1, -5, 2, -2], [0, 10, 0, 0, -11, 8, 3, 0, -3, 6, 0, 12, 6, -2, -2, 2], [6, 9, -4, 0, 1, 0, -1, 8, -1, 9, -8, 0, -9, 0, -7, -7], [0, 0, 1, -2, 18, 0, -1, 0, 1, 0, -2, -1, 2, 2, 1, 1], [0, 4, -6, -2, 0, 0, -3, -1, 3, -6, 0, -6, 0, -2, -3, -3], [4, 6, 5, 3, 0, 10, -1, -7, -5, 0, 0, 5, 0, 3, -1, 5], [20, -10, 4, 4, -16, 0, 2, 0, 2, -4, 0, 0, 4, 0, -8, -8], [0, -10, 0, 0, 2, 0, 8, -4, -8, 1, -4, 5, 1, 0, 0, 0], [-2, 6, 2, 6, 0, -2, -2, -6, 2, -2, 0, 2, 0, 6, -2, -2], [5, 0, 0, 3, -14, -11, -5, 0, -1, 0, 6, 0, 0, -3, 5, -1], [4, 8, 6, 2, 6, 0, -1, 2, -1, 4, -2, 0, -4, 0, -1, -1], [-12, 26, 3, 2, 0, -12, -7, -2, 7, 4, 0, 3, 0, 2, -7, -7], [3, 1, 8, -10, 0, 10, -4, 8, -3, -3, 0, 8, 0, -10, -4, 3], [14, 0, 0, 4, 10, -16, 0, 0, -2, 0, -8, 0, -2, -4, 0, -2], [-12, 18, -3, -8, 23, 0, -1, -3, -1, -5, 3, 0, 5, 0, 6, 6], [0, 7, 0, 0, -1, -4, -6, 2, 6, -9, 2, 0, -9, -4, 0, 0], [0, 6, 0, 0, -6, -8, 4, 0, -4, -5, 0, -3, -5, -8, -4, 4], [0, 8, 0, 0, -4, -14, 0, 2, 0, 0, 2, 8, 0, 6, -4, 4], [0, 8, 0, 0, -12, 2, -4, -3, 4, 4, -3, -17, 4, 6, 8, -8], [-1, 0, 0, -8, 11, 2, 2, 0, -1, 0, -2, 0, -7, 8, -2, -1], [0, 0, 0, 0, 0, 2, -5, 2, 5, -2, 2, -4, -2, 2, 5, -5], [10, -2, -2, 4, -8, 0, 1, 1, 1, 2, -1, 0, -2, 0, -7, -7], [2, 0, 6, -1, 3, -7, -4, 0, -1, 0, 2, -6, -7, 1, 4, -1], [16, -8, -4, 14, -14, 0, -3, -2, -3, -1, 2, 0, 1, 0, -3, -3], [0, -26, 4, 2, -24, 0, -5, -3, -5, -2, 3, 0, 2, 0, 7, 7], [-4, 16, -2, -4, 0, -10, 7, 3, -1, 14, 0, -2, 0, -4, 7, 1], [18, 10, -3, 1, 0, 8, -1, 9, 11, -4, 0, -3, 0, 1, -1, -11], [-7, 0, -2, -5, -2, 1, -3, 0, -3, 0, 0, 2, 8, 5, 3, -3], [8, -3, -12, -4, -2, 0, 1, -3, 1, -4, 3, 0, 4, 0, 0, 0], [0, -16, 0, 0, 18, 8, -1, -7, 1, -4, -7, 0, -4, 4, -1, 1], [-14, -4, -4, -4, 0, -22, 3, -14, 5, -6, 0, -4, 0, -4, 3, -5], [0, -10, 0, 0, 6, -4, 4, 0, -4, 6, 0, 10, 6, 4, 0, 0], [2, 8, 1, 10, 4, 0, -2, -3, -2, 0, 3, 0, 0, 0, -2, -2], [10, 0, -1, -2, 6, -5, 4, 0, 1, 0, 0, 1, 0, 2, -4, 1], [16, -6, 3, -6, 0, 22, 0, 4, -6, -6, 0, 3, 0, -6, 0, 6], [2, 20, -2, -2, 18, 0, 2, -7, 2, 2, 7, 0, -2, 0, -4, -4], [26, -2, 0, 2, 0, 18, 8, -2, 0, 2, 0, 0, 0, 2, 8, 0], [14, 0, 5, -2, -32, -16, 1, 0, -3, 0, -10, -5, -4, 2, -1, -3], [-14, 0, 9, 5, -8, 1, -9, 0, -4, 0, -4, -9, 6, -5, 9, -4], [7, -1, -4, 7, -4, 0, 2, -2, 2, 4, 2, 0, -4, 0, -5, -5], [4, 9, -7, 3, 0, -2, 4, -6, 2, -5, 0, -7, 0, 3, 4, -2], [4, 18, -6, -6, 0, 6, 0, -8, -2, -16, 0, -6, 0, -6, 0, 2], [24, 0, 6, -8, 2, -24, 4, 0, -4, 0, -14, -6, 2, 8, -4, -4], [0, 6, 0, 0, 2, -30, -6, 7, 6, -2, 7, 4, -2, 6, -2, 2], [0, -8, 0, 0, 9, -8, -5, -3, 5, -4, -3, -4, -4, -6, 4, -4], [-11, 0, 0, 2, 3, 6, -3, 0, -2, 0, 4, 0, -3, -2, 3, -2], [22, 1, 4, -2, 5, 0, 1, 8, 1, 1, -8, 0, -1, 0, 3, 3], [0, 0, 10, 4, -4, 0, 6, 0, -6, 0, -14, -10, -4, -4, -6, -6], [10, -10, -4, 2, -5, 0, 3, 0, 3, -2, 0, 0, 2, 0, 2, 2], [0, 0, 1, 11, -20, -10, -5, 0, -5, 0, 9, -1, 0, -11, 5, -5], [0, 2, 0, 0, -2, 16, 4, 0, -4, -2, 0, -2, -2, 16, -4, 4], [0, -11, 0, 0, 0, -16, 12, -1, -12, 6, -1, 6, 6, -2, -1, 1], [-22, 0, -6, 4, -20, 21, 1, 0, -2, 0, 10, 6, 6, -4, -1, -2], [-26, 0, -9, 4, 6, 0, 8, -7, 8, 2, 7, 0, -2, 0, -2, -2], [-6, 0, 15, -2, -18, 2, 2, 0, -6, 0, -8, -15, 6, 2, -2, -6], [-14, 2, -6, 8, 8, 0, 3, -9, 3, -2, 9, 0, 2, 0, 3, 3], [-5, 8, 4, 11, 0, -7, -2, -12, 4, -4, 0, 4, 0, 11, -2, -4], [-6, -10, -2, 0, 0, 0, 0, 0, -6, -16, 0, -2, 0, 0, 0, 6], [6, -10, -3, 7, 0, 13, -8, 10, 1, -8, 0, -3, 0, 7, -8, -1], [-2, 14, -8, 2, 9, 0, 1, 3, 1, -6, -3, 0, 6, 0, -6, -6], [0, -6, 0, 0, 15, -10, -6, 1, 6, 1, 1, 2, 1, 12, -3, 3], [6, 0, -1, 3, 4, 3, 9, 0, 0, 0, 8, 1, -2, -3, -9, 0], [-2, -6, 5, -3, 0, 0, -3, 9, 1, -8, 0, 5, 0, -3, -3, -1], [0, 12, 0, 0, -8, 18, -10, 4, 10, -4, 4, -8, -4, -2, 6, -6], [20, 2, -6, 6, -2, 0, 4, 0, 4, -6, 0, 0, 6, 0, -8, -8], [10, 0, 0, -4, 16, -8, 4, 0, -2, 0, -10, 0, 4, 4, -4, -2], [-5, 9, 2, -6, 0, -2, 0, 4, -3, 9, 0, 2, 0, -6, 0, 3], [-22, 27, -5, 3, 0, -20, 0, -6, -2, 1, 0, -5, 0, 3, 0, 2], [-22, 28, -4, -3, 0, -22, -3, 8, 3, -6, 0, -4, 0, -3, -3, -3], [16, -10, 0, 8, -14, 0, 0, 2, 0, -6, -2, 0, 6, 0, -4, -4], [0, -20, 0, 0, 12, -24, 2, -5, -2, 0, -5, -14, 0, -8, 6, -6], [-10, -9, 10, 7, 0, -5, 1, 6, -6, 1, 0, 10, 0, 7, 1, 6], [0, 14, 0, 0, -18, -6, 2, -9, -2, 2, -9, -8, 2, 6, 2, -2], [-22, 0, -3, -4, 24, 17, -5, 0, 0, 0, -10, 3, 10, 4, 5, 0], [-4, -18, -2, 1, 0, -5, 6, -17, -5, 0, 0, -2, 0, 1, 6, 5], [20, 6, 8, 0, -2, 0, -6, 2, -6, -2, -2, 0, 2, 0, -2, -2], [11, -6, -4, 7, -15, 0, -6, 4, -6, -5, -4, 0, 5, 0, -3, -3], [5, 6, -2, 11, 0, 3, -1, -14, 3, -6, 0, -2, 0, 11, -1, -3], [-8, 8, 5, -10, 0, -4, -3, 0, -1, -2, 0, 5, 0, -10, -3, 1], [0, -6, 3, -8, -6, 0, 4, 0, 4, 11, 0, 0, -11, 0, -4, -4], [0, -3, 0, 0, -7, -25, 3, -7, -3, 8, -7, -4, 8, -3, 7, -7], [0, -2, 0, 0, 7, -6, 2, 1, -2, -7, 1, 17, -7, 0, -7, 7], [-19, 11, -2, -10, 0, -10, 2, 4, -11, 3, 0, -2, 0, -10, 2, 11], [-2, 0, 2, -12, 0, 12, 6, 0, 4, 0, 2, -2, -4, 12, -6, 4], [-18, -13, 6, -14, -17, 0, -2, 8, -2, 5, -8, 0, -5, 0, -2, -2], [2, 6, 6, 8, -7, 0, -8, 7, -8, 2, -7, 0, -2, 0, -5, -5], [0, -4, 0, -6, 3, 0, 4, -9, 4, -3, 9, 0, 3, 0, 3, 3], [8, 30, 2, 0, 29, 0, -1, 3, -1, -6, -3, 0, 6, 0, 0, 0], [0, 0, 0, 0, 3, 14, 2, 9, -2, 1, 9, 3, 1, -8, -5, 5], [12, -2, -8, 1, 0, -1, 8, -1, 5, 4, 0, -8, 0, 1, 8, -5], [0, -4, 0, 0, 6, 6, -6, 5, 6, 6, 5, -12, 6, -10, 4, -4], [32, 0, 4, 6, -6, -32, 1, 0, -1, 0, -2, -4, -2, -6, -1, -1], [0, 8, 0, 0, -12, 0, 6, -2, -6, -8, -2, 8, -8, 0, -2, 2]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1638_y_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1638_2_y_c();".
// 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_1638_2_y_c(:prec:=16)
    chi := MakeCharacter_1638_y();
    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_1638_2_y_c();".
// 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_1638_2_y_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1638_y();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![1024, -5120, 12800, 17216, 17988, -20328, 21512, 14284, 5625, -1464, 1040, 592, 182, -16, 8, 4, 1]>],Snew);
    return Vf;
end function;