
// Make newform 76.3.j.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_76_j();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_76_j_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_76_3_j_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_76_3_j_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 := [69312, 0, 2467872, 0, 8319228, 0, 8232133, 0, 3386277, 0, 647217, 0, 64261, 0, 3429, 0, 93, 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, 0, 0], [-5641264464, -87012228696, 717644768940, 0, 1492988376027, 0, 838953142315, 0, 173289673767, 0, 16988391675, 0, 856101563, 0, 21385203, 0, 209415, 0], [-5641264464, 87012228696, 717644768940, 0, 1492988376027, 0, 838953142315, 0, 173289673767, 0, 16988391675, 0, 856101563, 0, 21385203, 0, 209415, 0], [56236356811614666648, 0, -177533443631457549678, 0, 101006975635179024567, 0, 165108014281179112579, 0, 45319436032825833851, 0, 5341210410044580379, 0, 315299474772470975, 0, 9142933787921503, 0, 103021303575977, 0], [6612929380896, 69806264079024, 0, 164926508337168, 0, 114681096004341, 0, 34116160058661, 0, 5294541300849, 0, 462556367605, 0, 22835687541, 0, 591176061, 0, 6185597], [18986345814851468476224, 85994899137728002418592, 163584759074688739803336, 276951487824653832085728, 153807669299209335425982, 247688622814187776629015, 52888979654682545521790, 90445956981209747924647, 8964501357540755862278, 15977086148660713783531, 837441313983081944030, 1503744656663588632375, 43740144259416552670, 77156143119142574903, 1187806470401576590, 2029864741038824639, 12923880049145062, 21307902360226751], [-18986345814851468476224, 85994899137728002418592, -163584759074688739803336, 276951487824653832085728, -153807669299209335425982, 247688622814187776629015, -52888979654682545521790, 90445956981209747924647, -8964501357540755862278, 15977086148660713783531, -837441313983081944030, 1503744656663588632375, -43740144259416552670, 77156143119142574903, -1187806470401576590, 2029864741038824639, -12923880049145062, 21307902360226751], [55795156588540909344, 10192478574256957800, 557831701929060994512, -966396343240290658194, 541373962530316733163, -1740816180557103044331, 128923463614356506923, -926382620163067424475, 6444753337028719351, -198011810669232279327, -1058533984963821029, -20900421407663018667, -141560882685702949, -1160708994558830091, -5975400590311957, -32413949123345859, -84585395212837, -356420916893601], [55795156588540909344, -10192478574256957800, 557831701929060994512, 966396343240290658194, 541373962530316733163, 1740816180557103044331, 128923463614356506923, 926382620163067424475, 6444753337028719351, 198011810669232279327, -1058533984963821029, 20900421407663018667, -141560882685702949, 1160708994558830091, -5975400590311957, 32413949123345859, -84585395212837, 356420916893601], [17641491875231716199520, -40233077119486778882880, 54906988656881342162448, -245772295640201960461668, 12885382854331920928818, -259031416490425683173601, -10213969077236531364270, -106018973858087065310881, -3613930626675568410102, -20085455778755268339325, -456696393282690219726, -1981734855138083887105, -27767346851853045678, -105313087778809730849, -817494977563699038, -2848706449870389401, -9292132113830094, -30578865294080117], [16866863503588187406720, 68353407262496286219072, 128353110743143432185192, 222044499167772489923280, 145187412576671752297974, 234803239959855855700197, 60191110055156592895830, 100659926058446279288917, 11434966984186084818750, 19591016775336282193633, 1131735633699699198966, 1960441049946278852101, 60446536734618041238, 104923489970995620581, 1645965155810586246, 2847359718602523677, 17795857570083582, 30600034474056845], [-17641491875231716199520, -40233077119486778882880, -54906988656881342162448, -245772295640201960461668, -12885382854331920928818, -259031416490425683173601, 10213969077236531364270, -106018973858087065310881, 3613930626675568410102, -20085455778755268339325, 456696393282690219726, -1981734855138083887105, 27767346851853045678, -105313087778809730849, 817494977563699038, -2848706449870389401, 9292132113830094, -30578865294080117], [-16866863503588187406720, 68353407262496286219072, -128353110743143432185192, 222044499167772489923280, -145187412576671752297974, 234803239959855855700197, -60191110055156592895830, 100659926058446279288917, -11434966984186084818750, 19591016775336282193633, -1131735633699699198966, 1960441049946278852101, -60446536734618041238, 104923489970995620581, -1645965155810586246, 2847359718602523677, -17795857570083582, 30600034474056845], [-1068490779420678666312, 11804400309444777341088, 3373135428997693443882, 9057175479137712478173, -1919132537068401466773, -7249653970449891821421, -3137052271342403139001, -6345815016952600651489, -861069284623690843169, -1520496906844321281001, -101482997790847027201, -168102984777232484709, -5990690020676948525, -9555418270538650385, -173715741970508557, -270240639017877677, -1957404767943563, -2992452061703166], [-17046979348526320544784, -56316967455250952729832, -208178000999139775297860, -167854559979994870942272, -284524779447566533302111, -218913924589800259930839, -138252907082485063877031, -109667478341841075751015, -28513867486948769040867, -23049392895410291223331, -2945351338600272256287, -2411226129183011287999, -160742476080266035815, -132892631528273117975, -4418432327712763071, -3683209991497786079, -47898861085310355, -40207947127666487], [17046979348526320544784, -56316967455250952729832, 208178000999139775297860, -167854559979994870942272, 284524779447566533302111, -218913924589800259930839, 138252907082485063877031, -109667478341841075751015, 28513867486948769040867, -23049392895410291223331, 2945351338600272256287, -2411226129183011287999, 160742476080266035815, -132892631528273117975, 4418432327712763071, -3683209991497786079, 47898861085310355, -40207947127666487], [30151239574730085354240, -74264982370409236974576, 117906430648705249114296, -651798809527250310940500, 56241196451553784914612, -717975899925076248816807, 10705277145937685961348, -302078464085178974875847, 888360430575354176388, -58075520974252197437579, 17795603693081960484, -5776125910255860834167, -1734324174272048796, -308342462440461549319, -102976667688246492, -8362310334460095151, -1576548808318068, -89899552734606139], [-30151239574730085354240, -74264982370409236974576, -117906430648705249114296, -651798809527250310940500, -56241196451553784914612, -717975899925076248816807, -10705277145937685961348, -302078464085178974875847, -888360430575354176388, -58075520974252197437579, -17795603693081960484, -5776125910255860834167, 1734324174272048796, -308342462440461549319, 102976667688246492, -8362310334460095151, 1576548808318068, -89899552734606139]];
    Rf_basisdens := [1, 174024457392, 174024457392, 18595918563334754748, 13225858761792, 16959477729761296330176, 16959477729761296330176, 223151022760017056976, 223151022760017056976, 16959477729761296330176, 16959477729761296330176, 16959477729761296330176, 16959477729761296330176, 706644905406720680424, 4239869432440324082544, 4239869432440324082544, 8479738864880648165088, 8479738864880648165088];
    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_76_j();"
function MakeCharacter_76_j()
    N := 76;
    order := 18;
    char_gens := [39, 21];
    v := [18, 5];
    // 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_76_j_Hecke();"
function MakeCharacter_76_j_Hecke(Kf)
    N := 76;
    order := 18;
    char_gens := [39, 21];
    char_values := [[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, 1, 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 := 3;
    raw_aps := [[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, -1, 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, -1], [2, 0, 0, 0, -2, -1, -1, 1, 0, 0, 1, 0, 1, -1, 1, 1, 1, 0], [0, 0, 0, 1, -2, -1, -1, 0, -1, 1, -2, 3, -1, 1, 0, 0, 0, 0], [2, 1, 0, -1, 0, 1, 1, -1, 1, 0, -1, 2, -3, 0, -1, -1, -2, -1], [-4, -3, 1, 0, 4, 3, 2, -2, 1, 0, 1, -7, 5, 2, -2, -1, 0, -1], [0, 0, 2, 3, 4, 3, 2, -2, 3, 1, -5, -6, 4, 1, -1, 0, 0, 0], [0, 5, -4, 0, 6, -1, 5, 2, 4, 6, 1, 6, -11, 1, 0, 0, 0, 1], [2, -4, -2, 2, 2, 0, 2, 1, 6, 0, 0, -2, -4, 3, 0, 3, 0, 1], [-6, 5, 0, 0, -6, -3, 2, 2, -1, 8, -9, 4, 6, 0, 2, -2, 2, 0], [-8, -6, 6, 0, 16, 2, 2, 5, -5, -14, -2, -14, -2, 0, -1, -1, -1, -1], [7, 3, -10, 0, -5, 7, 1, -10, 1, -7, -5, -8, 3, 0, 0, -2, 0, -4], [-8, 1, 0, -1, 16, 0, -6, -1, -12, 16, -8, -7, 6, 0, 1, 0, 0, 2], [20, -1, -2, -2, -2, -6, -2, 3, -3, -8, 14, 20, 0, 0, 0, 0, 0, -2], [4, -1, -5, 5, 4, 2, 1, 0, -5, -14, 26, -4, 7, 6, -2, -5, -1, -6], [-9, -4, -8, 8, -9, -4, 0, 12, 5, -18, 13, -22, -22, 2, 2, 6, 8, -6], [-4, 0, 1, 1, 10, -6, 0, 12, -1, 16, 6, 10, -6, -3, 0, 1, 1, -3], [1, -3, 1, -7, -15, 0, -1, -7, 2, -12, -12, -1, 16, -7, 3, -7, -3, 0], [-38, -2, 1, -1, 46, 1, 3, -2, 0, -46, 37, -4, 5, 7, -8, 0, -7, 0], [11, 8, -5, 1, -34, 3, 1, 5, -1, 11, 20, 0, -45, -5, 1, -1, 6, 0], [34, 3, -2, 2, -28, -1, 5, -2, 5, -34, 7, -4, -3, 2, -2, 5, 0, 10], [24, 0, 0, 0, -24, 4, 5, -5, 1, -29, 33, 8, 24, 12, -11, -8, -8, 3], [54, 10, -12, 6, -30, 1, -2, -1, 10, 26, -14, 24, -52, 5, 6, 1, 12, 6], [-60, 7, 10, -7, 3, 7, 0, -17, 0, -57, -10, -4, -4, -8, -8, -2, -7, 2], [-6, -3, 3, 10, -42, 10, 0, 10, 3, 0, 8, 48, -6, 5, -8, -5, 0, -10], [-44, 0, 5, -6, 22, -4, -8, 12, 4, 24, 30, 26, -42, 6, 1, -2, -1, -1], [-37, -10, 0, -12, -37, -16, 7, 7, -9, 30, -14, 0, 23, -6, 1, 3, -3, 4], [-26, 5, -6, 12, 28, -6, -8, 5, 0, -28, 32, -10, 28, 3, 9, 2, -3, 1], [-20, 22, -22, -6, 40, -11, -11, -9, 9, 28, -42, 28, -42, -12, 19, 19, 13, 13], [44, -14, 15, -8, 2, 13, 1, -13, -14, -8, -9, 46, -45, -4, -7, -4, -14, -8], [45, 14, -3, 3, -52, -14, -14, 11, -7, 7, -38, -40, 54, 3, -3, -11, -3, -11], [-26, -24, 29, -6, 15, 9, -24, -18, -29, 2, -9, 15, 35, -3, 0, -6, 1, -3], [-14, 28, -11, -6, -25, 5, -17, 5, -28, 0, -35, 39, 3, 8, 0, 14, 0, 6], [6, 24, 2, -6, -50, 26, 12, -2, -12, 6, 18, 0, -62, 5, -6, -2, -11, 0], [4, 8, -8, 0, -8, -14, -14, -13, 13, 52, -60, 52, -60, 0, -3, -3, -1, -1], [2, -26, 22, -8, 54, -22, 10, 26, 20, 54, 24, -60, -10, 0, 8, 0, 0, -13], [0, 2, -1, 19, 6, 22, 29, 7, 22, 7, -64, 42, -64, 19, 1, -3, 4, 1], [-8, -22, 17, 5, 52, -6, 22, 0, 17, -16, 38, -52, 22, -9, 2, -5, 1, 9], [-76, 5, 26, -1, 2, 5, 0, -31, 18, -74, -7, 46, 46, 2, 2, -1, -1, 1], [-80, 0, -10, 14, 40, -14, -12, 26, 14, 54, 59, 45, -87, -14, -7, 8, 1, 7], [-24, 14, -9, -13, 36, 0, 9, 20, -5, -46, -46, 24, -45, 8, 9, 8, -9, 21], [-64, 14, 14, -6, 0, -3, 3, -5, -5, 26, -65, -26, 65, 0, -15, 15, -22, 22], [18, -16, -4, 11, 8, 20, 12, -4, 12, -18, 6, -114, 45, 17, -11, -5, 6, -10], [-12, -16, 32, 0, 12, 35, 43, -43, 8, -86, -25, -76, 43, 3, -7, -21, -21, -14], [46, 26, -9, 15, 28, 40, -9, -20, 17, -16, -24, 46, 37, 22, 1, -22, 1, -7], [32, 5, -6, 1, -32, 5, 0, 1, 16, 0, 27, -45, -45, -1, -1, -10, 1, 10], [-38, 8, -32, 6, 50, -32, 2, 8, 0, -50, 70, 22, -46, -10, 16, 38, 10, 19], [2, -22, 22, -3, -4, -31, -31, 42, -42, 65, -105, 65, -105, -6, -6, -6, -1, -1], [94, -17, -17, 15, 0, 5, -5, 22, 22, 32, 63, -32, -63, 0, 4, -4, 21, -21], [-27, 6, 23, -4, -77, -23, -14, -6, -28, -77, -4, 44, 14, 3, 7, 0, 3, 16], [0, 20, -10, -25, -62, -33, -20, 13, -33, 66, 23, 10, 76, -25, 16, 13, 3, 16], [57, 17, -44, -10, -49, -14, -27, 14, 17, -36, 32, 8, -30, -35, 3, 25, 6, -10], [74, 16, 7, 2, -55, -12, 16, 24, -7, -18, 12, -55, -35, -9, 0, 2, 2, -9], [1, -40, 43, 7, 64, 0, -43, 22, -3, -50, -50, -1, -21, -7, 4, -7, -4, -14], [104, 1, -23, 15, -4, -22, -11, 23, 11, 104, -78, 0, 47, -5, 15, 3, 20, 0], [-10, 24, -15, -27, 44, -9, -48, -15, -48, 10, 43, -20, 58, -20, 27, 18, 7, 36], [0, 22, -14, -24, 6, 14, -29, -22, -58, 6, -14, 32, 29, 0, 24, 0, 0, -6], [0, 16, -8, 1, -14, -39, -34, 5, -39, -50, 5, 34, -50, 1, 0, -17, 17, 0], [46, 20, -26, 5, -23, 59, -20, 0, -26, 64, -187, 23, 43, 2, 6, -5, 3, -2], [69, -30, -8, 32, 23, 30, -4, -38, -2, -92, -7, 84, -80, 6, -6, -11, -32, -11], [-32, 0, 15, 0, 16, 7, 52, -59, -7, -118, 55, 62, 4, 0, -10, 17, 7, 10], [-131, -23, -12, -12, 34, 35, -17, -12, -17, 131, -132, 84, -25, 5, 12, 13, 17, 26], [-168, -21, 42, 0, 168, -34, -23, 23, 11, -86, 98, -22, 109, 4, -13, -4, -4, 9], [-91, -1, -13, -1, -34, -70, -13, 35, -14, 100, -30, -91, -21, -14, -11, 14, -11, 13], [-160, 31, 20, 5, -10, 62, 51, -62, 31, -88, -18, -170, 109, 16, -4, -11, -8, 5], [-112, 0, -2, -3, 56, -13, 60, -47, 13, -7, -8, -21, -32, 3, -23, 30, 7, 23], [79, 28, 1, 20, -121, 1, 39, 28, 0, 121, -80, -2, -35, 19, 1, 18, -19, 9], [145, -28, 29, 25, -266, -29, -6, 28, -12, -266, 174, 72, 6, 5, -20, 0, 5, -10], [22, -20, 40, 0, -22, -27, -7, 7, 20, 104, -121, -44, -97, -5, 3, 41, 41, 38], [0, 36, -18, 14, 132, 11, -11, -22, 11, 102, 34, -45, 158, 14, -39, -37, -2, -39], [100, -48, -21, 24, -50, 48, 16, -69, 8, -50, -98, 24, -40, 32, -32, 11, -24, 11], [14, -10, -25, 24, 202, -26, 35, -26, 10, 0, -76, -216, -21, 4, -16, -20, 0, -24], [70, 64, 0, -74, 70, -28, 6, 6, -22, -72, 118, -18, -78, -37, 10, 19, -19, 29], [136, -22, 22, -20, -272, -21, -21, 16, -16, 38, 15, 38, 15, -40, 34, 34, -5, -5], [8, -18, -13, 5, 122, 31, 4, -13, 4, -8, 99, 120, -64, 8, -5, -14, 3, -28], [-146, 57, -18, -32, 4, 42, -18, -21, 39, 126, -168, -146, 22, -20, 4, 20, 4, -12], [-94, -53, 52, -1, -2, 53, -126, -1, -63, 96, -55, 84, 42, 12, -12, -2, 1, -2], [91, -6, 8, -20, -41, -6, 0, -2, -40, 50, 47, 184, 184, 22, 22, -1, -20, 1], [-28, -68, 70, 24, 5, 0, -70, -3, -2, 34, 34, 28, 65, -2, 4, -2, -4, -26], [-75, -14, -14, 23, 0, -12, 12, 66, 66, -14, -38, 14, 38, 0, -27, 27, 24, -24], [-148, 90, -6, -2, -28, -84, -3, -6, -3, 148, -92, 200, -97, 1, 2, -13, 3, -26], [-14, -31, -29, -4, -140, -41, -60, 41, -31, 208, -63, -154, 74, -5, -11, 1, -22, -4], [114, -32, 33, 3, -70, 23, 32, 0, 33, -44, 65, 70, 12, -27, 32, -3, 16, 27], [182, -27, 22, 5, 58, -27, 0, 5, 25, 240, -31, -58, -58, -40, -40, 12, 5, -12], [107, 19, -26, -40, 53, -5, 7, -5, -19, 0, 131, -160, 100, -7, 18, 33, 0, 40], [100, -84, 0, 68, 100, 24, 18, 18, 42, -82, 5, 53, -100, 34, -27, -22, 22, -49], [150, -8, -8, -9, 0, -67, 67, 41, 41, -27, 311, 27, -311, 0, -31, 31, -32, 32], [36, 11, -60, -50, -322, 60, -21, -11, -42, -322, -24, -62, 21, -17, 33, 0, -17, 40], [-292, -38, 76, 0, 292, 81, 64, -64, -17, 18, 53, 152, -82, 17, -26, -60, -60, -34], [0, 84, -42, 44, 44, 42, 14, -28, 42, 14, 165, -207, 207, 44, -31, 0, -31, -31], [86, -41, 34, -26, -130, 50, -41, -100, -34, -114, -50, -130, 85, 13, 0, -26, -31, 13], [48, -41, 0, 72, 48, 56, -15, -15, 41, -174, 196, -78, -159, 36, 19, -14, 14, 5], [-58, 6, -27, -30, 74, -21, 73, 27, -73, -58, 5, 0, 140, -26, -30, 12, -4, 0], [-30, -12, 44, -29, -31, -44, 26, 12, 52, -31, 14, 62, -26, 8, 37, 0, 8, 67], [-280, -10, 44, 16, 62, 58, 44, -29, 34, -186, 128, -280, 18, 33, 18, -33, 18, -17], [156, -130, 95, 25, -114, -33, 130, 0, 95, 0, 33, 114, -88, 41, -76, -25, -38, -41], [360, 0, -28, 2, -180, -89, 6, 83, 89, -113, 207, 118, -11, -2, 7, -46, -39, -7], [56, 31, 62, -32, -102, 0, -62, 65, -93, 148, 148, -56, 164, 6, 42, 6, -42, 38], [-162, -6, 84, 10, 176, 180, 84, -90, 78, 96, -276, -162, 92, 63, -17, -63, -17, -53], [-282, 12, -40, 28, 64, -85, -12, 0, -40, 81, -77, -64, -206, 13, -42, -28, -21, -13], [-100, 125, -81, -28, -156, -4, -44, -4, -125, 0, 66, 256, -56, -1, 24, 27, 0, 28], [50, -3, 0, -36, 50, 84, -63, -63, 21, -191, -14, 121, -128, -18, 52, -33, 33, 19], [-21, 8, -8, -15, 42, -23, -23, 20, -20, 52, -3, 52, -3, -30, -41, -41, -69, -69], [96, 3, 3, -6, 0, -19, 19, -1, -1, -43, -134, 43, 134, 0, -25, 25, 19, -19], [-62, 40, -80, 0, 62, 101, 26, -26, -75, 103, -219, -15, -129, 15, 7, 9, 9, 2], [182, -2, -50, 43, -166, 2, -74, -52, -37, -16, -168, 117, -43, 40, -40, -7, -43, -7], [175, 5, 5, 2, 1, 45, 5, -90, -5, -252, -45, 1, -181, -58, 0, 2, 24, -58], [260, 37, 37, -35, -106, 0, -37, 6, -74, -92, -92, -260, 143, -33, 33, -33, -33, 2], [-54, -81, 0, -12, -54, -78, -57, -57, -135, -19, 70, 27, 38, -6, -28, 29, -29, 1], [112, 69, -69, 17, -224, -66, -66, 42, -42, 86, 60, 86, 60, 34, 26, 26, 42, 42], [-16, -102, -1, 25, 84, 1, 3, 102, 6, 84, -17, -120, -3, -11, -36, 0, -11, -18], [30, 117, -131, 39, -137, -12, -131, 6, -14, 326, -314, 30, -6, 10, 27, -10, 27, 29], [0, 34, -17, -37, -273, -75, -42, 33, -75, -256, 43, 32, -246, -37, 3, 9, -6, 3], [-318, -35, 80, -28, 110, -19, -35, 38, -80, -194, 19, 110, 243, -27, 0, -28, 36, -27], [145, 9, 78, 16, -116, 78, -111, 9, 0, 116, -223, 20, 71, -31, 47, 54, 31, 27], [-52, 14, 40, 8, 167, 54, 29, -40, -29, -52, -169, 0, 107, 60, 8, -28, -52, 0], [-208, -81, -81, 51, 0, -35, 35, 77, 77, 322, 5, -322, -5, 0, 19, -19, 46, -46], [100, 0, 0, 0, -100, -21, 2, -2, 23, -174, -109, -304, 172, -73, -28, 16, 16, 44], [-132, -28, 96, -26, 42, -43, 68, 43, -28, 286, -100, -90, 64, 17, -4, -43, -8, -26], [-128, -19, 13, 25, 118, 71, 19, 0, 13, -110, 149, -118, -29, 26, 112, -25, 56, -26], [370, 0, -70, 0, -185, -142, 25, 117, 142, 338, -46, -188, -175, 0, -19, 62, 43, 19], [16, 32, 0, 66, 16, -76, 100, 100, 24, 94, -214, 196, -6, 33, -14, 25, -25, 11], [-85, -26, 26, -9, 170, 21, 21, -28, 28, 288, -441, 288, -441, -18, 7, 7, 29, 29], [85, 7, -14, 0, -85, -96, -15, 15, 81, 128, 128, 160, -113, 31, -79, -45, -45, 34], [-28, -64, 122, 81, -34, 64, 48, 58, 24, 62, -98, -408, 360, 79, -79, 3, -81, 3], [-124, 80, -103, -14, -44, -27, 23, -27, -80, 0, -165, 168, -147, -50, 19, -36, 0, 14], [138, 57, 81, -17, -60, 138, 13, -81, -13, 138, -216, 0, 155, 5, -17, -85, -22, 0], [194, -42, 72, 78, 244, -72, 61, 42, 122, 244, 266, -162, -61, 32, -46, 0, 32, 8], [0, -16, 8, -13, -194, 50, -5, -55, 50, 92, -324, 274, -177, -13, -76, 8, -84, -76], [-112, -94, 17, 10, 363, 94, 112, -77, 56, -251, 269, -12, -100, -20, 20, -24, -10, -24], [-436, 63, -7, -56, 344, 63, 0, -56, 29, -92, -407, -6, -6, -1, -1, 8, -56, -8], [318, -14, -166, 72, -328, 0, 166, 80, 180, 18, 18, -318, 162, -35, -53, -35, 53, -107], [160, 120, -72, 4, -250, 48, -124, 72, 124, 160, 42, 0, 22, 13, 4, -18, -9, 0], [-66, 83, 83, 8, 0, -8, 8, 37, 37, 289, -243, -289, 243, 0, 61, -61, 32, -32], [244, -8, -45, -38, -182, -200, -45, 100, -53, 91, 109, 244, -137, -61, 46, 61, 46, 23], [-56, 21, 48, -1, -386, -21, 69, 21, 21, 332, -145, -442, -13, -22, 25, 21, 50, -1], [-388, 0, 2, 41, 194, -19, 25, -6, 19, -157, 178, 159, -27, -41, -24, 40, 16, 24], [-192, 10, -10, -26, 384, 21, 21, 101, -101, 176, -289, 176, -289, -52, 41, 41, -20, -20], [0, 66, -33, -12, 366, -81, -66, 15, -81, 301, -212, 293, 74, -12, -19, 14, -33, -19], [382, -38, -118, 41, 10, -82, -156, 82, -38, 236, -36, 392, -226, -27, 42, 68, 84, 41], [354, 39, 31, 35, -128, -122, 39, 244, -31, 52, 122, -128, -265, -60, 0, 35, -55, -60], [6, -41, 100, -39, -42, -26, -59, -26, 41, 0, -204, 36, 65, -32, 100, 7, 0, 39], [34, -40, 138, -64, 187, 0, -138, -1, -98, -210, -210, -34, -49, -6, 36, -6, -36, 58], [170, 53, 0, 100, 170, 14, 121, 121, 135, 356, -188, -182, 235, 50, -25, 2, -2, -23], [544, -83, 2, 6, -32, 81, -28, 2, -28, -544, 431, -204, 130, 42, -6, -2, 36, -4], [-120, -82, 86, -3, 194, 82, -116, 4, -58, -74, 112, -378, 494, 23, -23, 7, 3, 7], [-37, -66, -16, 46, -196, -66, 0, 82, -76, -233, 262, 60, 60, -32, -32, -14, 46, 14], [31, 8, -105, -10, -171, -17, 8, 34, 105, 418, 17, -171, 132, -29, 0, -10, 44, -29], [-92, 0, 79, 18, 46, 18, -2, -16, -18, 76, 442, 460, -534, -18, 33, 36, 69, -33], [98, -75, 17, -19, -158, 58, -80, 17, -80, -98, -118, -224, 192, -3, 19, -78, 16, -156], [218, 8, -16, 0, -218, -122, -168, 168, -46, -99, -177, -398, 267, -2, -14, -69, -69, -55], [213, -152, -9, 19, 255, 46, -9, -23, -161, 148, -194, 213, 264, 94, -15, -94, -15, -75], [232, 14, 37, 24, -320, 61, 51, -61, 14, 100, -111, -88, -283, -102, -3, 126, -6, 24], [-116, 61, -66, -79, 373, -66, 125, 61, 0, -373, 182, -286, 447, -21, -58, 4, 21, 2], [-386, -194, 194, -24, 772, 70, 70, -93, 93, 220, 24, 220, 24, -48, -85, -85, -65, -65], [324, -27, 54, 0, -324, -83, -94, 94, -11, 126, 313, 356, -32, -80, -4, -14, -14, -10], [155, 54, -30, -52, -325, -54, -104, 24, -52, 170, -271, -372, 476, -74, 74, 73, 52, 73], [-253, -101, -38, -8, 85, 30, 139, 30, 101, 0, -12, 168, -392, -27, -43, -19, 0, 8], [-62, 83, -205, -43, 124, 0, 205, -3, 122, -286, -286, 62, -329, -19, 74, -19, -74, 24], [352, 10, 49, 79, -542, 59, -86, -49, 86, 352, 131, 0, -88, 32, 79, -16, 47, 0], [345, 130, -128, -62, -54, -2, 33, -128, 33, -345, 293, -180, 57, 4, 62, -1, 66, -2], [-292, -121, 44, 9, 156, 121, 156, -77, 78, 136, 35, -660, 504, 22, -22, -53, -9, -53], [-99, 138, -154, -46, -276, 138, 0, 16, 5, -375, 138, 68, 68, -60, -60, -15, -46, 15], [-628, 0, 45, -7, 314, -24, -78, 102, 24, -89, 328, 304, -137, 7, -56, -7, -63, 56], [-474, 12, 80, -26, 198, 80, 53, 12, 0, -198, 394, 386, -825, -50, 24, 0, 50, 0], [112, 124, -29, 19, -220, -95, 75, -29, 75, -112, -13, 396, -273, 8, -19, -1, -11, -2], [226, 73, -140, -88, -46, 0, -140, 0, -67, 72, -72, 226, 94, -154, 77, 154, 77, 66]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_76_j_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_76_3_j_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_76_3_j_a(:prec:=18)
    chi := MakeCharacter_76_j();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    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_76_3_j_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_76_3_j_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_76_j();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;