
// Make newform 2736.3.m.e in Magma, downloaded from the LMFDB on 16 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_2736_m();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_2736_m_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_2736_3_m_e();".
// 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_2736_3_m_e();".
// 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 := [2052928, -2263536, 602332, 302996, -195494, -3250, 17067, -520, -400, -28, -2, -2, 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], [-73658615237434719847743352844, 53541427663219666647291675720, -639691616520158881950125586, -11890092294807088563695513768, 957764877347901693193909925, 981992577991514469460050707, -34589113615694853943215088, -22310969002623736017588684, -2074383187958425838207906, -376368559884857089738052, -73459412627167568758689, 51997441325289764620921], [123375392685516809200436072248, -8600983603266963856792147704, -25465637922911669259130524290, 16596882951535903126145714784, 1027241616247046163589843453, -1517499010423618250065755245, -57722877927354117656914608, 25212171466145498186618560, 3561821912524932089148298, 488084674761945636311292, 310947154005637673724987, -64153428683245785818187], [163507193570116392877294745476, -75799513659359725579054177144, -5680893582225625367089468930, 20628493787297198541294186596, -1050959033981795356921783923, -1743035770545872875094948277, 35879927549824755904232704, 36195392263413134067880368, 3533037606014996393196298, 723012291447320513297992, 168118329099878366426107, -84892865770599251162339], [-139555867932238585032328422144, 63568101195091550952213604008, 8685774484586922238019223606, -19870118216551028486489402484, 1205326107019945794872851649, 1710207624740396366280405263, -78026685225665428629074512, -42198570170669361261183364, -3277699230573006098902810, -406718968367570415284520, -125181146363758083951437, 99544283707287549393653], [69005215129095585460048480896, -68081701536668245024399137544, 17338965366054497389943460614, 17477848115776488615564996320, -5899944872959435029165030825, -2134627392568785921547380849, 308650908404778384349773404, 83207860050661196690810404, 6092808024956870779887502, 150730219315212471580168, -124228512679122943003347, -168258373562793920591915], [39176940743514085440262810034, -36171422778518273841909922184, -818461976748029610960015862, 8850090084279830046284853719, -747091570485838504448531565, -742800474069023568368046031, 38519538601465730565312664, 18745988896273876487590893, 1504109505127442397885783, 200797068306193098933167, 42447692262194396050588, -43893138267987812709820], [153431969355162127352, -96285444021538449388, -3953241666051162292, 21733840351284574574, -3779165499267309010, -2172506813770474015, 233340579213886720, 72437356465362456, 4883740095972916, 201453765859666, -6067399667026, -157524610518805], [232304768678122312, -146057139468543444, -5841144248678836, 32921184637856658, -5754231775852978, -3287098690953053, 355278937573312, 109922313318736, 7584570552796, 326852665758, -6844355458, -237830692375], [-617940713562505870867010134792, 457040698985277454669966593540, -37621682456038514990396343464, -107522646401875155097270752602, 26778235012978911074266101356, 11652026428595855807054000215, -1485792635294709509696590776, -422228084238779138708928296, -30174340328293560163623624, -1119685666340330206241094, 370305367263462111837984, 880963784071120031416741], [761462040151515795303297972096, -520469124215665830988970176408, 14295197238439818764591642738, 116824854937613937351872881128, -25496872577654676020423046395, -11860288114252872608120850355, 1427649909136390954899715516, 418375543338988828669840648, 27976093570240698616039382, 1356706251598515074862448, -304057356664857798652429, -882176042542487277342189], [-685272875849983540049645764328, 458192662062736796254079333436, -5028287258072877166764497038, -101435684173973780692532131252, 21131835060632637536868612345, 10093443958151896510700250922, -1188152538959713926738525240, -354588534592121464881430098, -23220848667899750043359316, -1298069524273119551289236, 226751202998417829946529, 745648445784192410477188]];
    Rf_basisdens := [1, 6478199571665143229964304108, 6478199571665143229964304108, 6478199571665143229964304108, 6478199571665143229964304108, 6478199571665143229964304108, 1619549892916285807491076027, 4031297913092380756, 4818191046081112, 12956399143330286459928608216, 6478199571665143229964304108, 3239099785832571614982152054];
    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_2736_m();"
function MakeCharacter_2736_m()
    N := 2736;
    order := 2;
    char_gens := [1711, 2053, 1217, 1009];
    v := [1, 2, 2, 2];
    // 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_2736_m_Hecke();"
function MakeCharacter_2736_m_Hecke(Kf)
    N := 2736;
    order := 2;
    char_gens := [1711, 2053, 1217, 1009];
    char_values := [[-1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 0, 0, 0, 0, 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+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, 0, 0], [1, 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, 1, 1, -1, 0, 0], [3, -1, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0], [-1, 1, -1, 0, 1, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, 4, 2, 1, 2], [8, -2, 0, -2, -4, 0, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 0, -1, -5, 3, 3, 1], [0, 1, -1, 1, -1, 0, 2, 0, 0, 0, 0, 0], [1, 4, 1, 3, 2, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -2, 0, 1, -4, 2, -1, 0], [0, 0, 0, 0, 0, 0, 0, -3, 10, 2, -1, 1], [-19, -2, -1, 1, 6, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 1, 0, -6, 4, 0, -5, -3], [30, -3, -2, -3, -1, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -7, 0, 6, -4, -4, -1, -5], [0, 0, 0, 0, 0, -3, 0, -2, 12, -4, -5, 1], [-14, -2, 2, -2, 3, 0, 2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 3, -5, 3, 2, 6], [0, 0, 0, 0, 0, -1, 0, 1, 5, 3, 6, -1], [35, 8, -3, 1, 2, 0, 3, 0, 0, 0, 0, 0], [21, 12, 3, 1, 0, 0, -2, 0, 0, 0, 0, 0], [-16, -11, 1, 1, -5, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 0, 3, 1, -11, -11, -1], [0, 0, 0, 0, 0, 8, 0, 18, 10, 2, -4, 0], [-23, 13, 0, -4, 7, 0, 8, 0, 0, 0, 0, 0], [24, 22, 2, -2, 6, 0, -3, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -3, 0, 9, -11, 5, 12, -2], [0, 0, 0, 0, 0, -8, 0, -1, 15, -11, -8, -2], [-61, 1, -1, -12, -11, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 14, 0, -15, 14, 4, 9, 0], [-29, 9, 0, -2, -8, 0, 12, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -11, 0, -3, -5, -9, 12, 0], [0, 4, 0, -18, -6, 0, -4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 6, 0, 4, 8, -12, 2, -2], [0, 0, 0, 0, 0, -9, 0, -2, 4, -8, -9, 1], [7, 18, 3, -5, 12, 0, -7, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -15, 0, -12, -16, 0, -3, -3], [-110, -21, -1, -7, 7, 0, -4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, 19, 30, 6, 5, -5], [37, -18, -1, 15, 22, 0, 6, 0, 0, 0, 0, 0], [38, -21, 1, -7, -3, 0, 6, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12, 0, 28, 34, 10, 29, 12], [0, 0, 0, 0, 0, -9, 0, 30, -6, -2, 11, -5], [0, 0, 0, 0, 0, -4, 0, -1, 3, 3, 5, 21], [0, 0, 0, 0, 0, 3, 0, 20, 2, 10, -19, 7], [22, -29, 10, -9, -19, 0, -3, 0, 0, 0, 0, 0], [-83, 49, -1, -6, 5, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, -21, 0, 4, 13, 3], [-54, -24, -6, 8, 8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, -19, 5, 7, 4, -16], [115, 60, 1, -23, 8, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 10, 0, -15, -4, -12, 3, 15], [89, 28, -7, 3, 0, 0, 7, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -32, 0, 14, 0, -20, -32, -10], [-106, 45, -2, -15, -19, 0, -13, 0, 0, 0, 0, 0], [-37, -12, 7, -3, 20, 0, 7, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -5, 44, 14, -3, -2], [-181, -18, -1, 3, -22, 0, 9, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 13, 0, -14, -8, 0, -13, 15], [0, 0, 0, 0, 0, -22, 0, 31, -18, 10, 25, -9], [14, 8, -2, -20, 6, 0, -4, 0, 0, 0, 0, 0], [-4, 30, 10, -6, 8, 0, -13, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -21, 0, -2, 20, 4, -15, -19], [205, 10, -3, 11, -18, 0, 10, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -22, 0, -63, -39, -9, -8, 2], [-34, 71, 0, 7, 7, 0, 15, 0, 0, 0, 0, 0], [28, -10, -14, -36, -8, 0, -4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 28, 0, -69, -10, 22, -27, -5], [0, 0, 0, 0, 0, -28, 0, -10, 52, 0, -12, -18], [-10, 11, -11, -3, 19, 0, 32, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -6, 0, -4, -6, 26, 34, 24], [0, 0, 0, 0, 0, -4, 0, 2, 42, -10, -16, -16], [-41, 23, 2, -8, 32, 0, -22, 0, 0, 0, 0, 0], [-198, -19, -4, 9, 31, 0, 13, 0, 0, 0, 0, 0], [58, 4, -4, -22, 20, 0, 7, 0, 0, 0, 0, 0], [-26, -68, 14, -8, -22, 0, -8, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 37, 0, -9, 9, 31, 20, -9], [124, -69, -9, -21, -15, 0, 14, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 33, 0, -22, 46, 10, -25, -5], [217, -22, -1, 15, -8, 0, -2, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -11, 0, 73, 33, 9, -4, -2], [0, 0, 0, 0, 0, -16, 0, 113, -27, 11, -14, -24], [-127, 12, 11, 3, -24, 0, 17, 0, 0, 0, 0, 0], [174, -28, 0, 36, 19, 0, 10, 0, 0, 0, 0, 0], [-189, 23, 4, -36, -24, 0, -34, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -18, 0, -70, -26, -22, 1, 2], [0, 0, 0, 0, 0, 4, 0, -5, 33, -9, 18, -2], [0, 0, 0, 0, 0, 19, 0, -32, 22, 12, 25, 28], [0, 0, 0, 0, 0, -11, 0, -127, 3, -49, -20, 4], [0, 0, 0, 0, 0, 17, 0, -45, 47, -15, -54, -7], [0, 0, 0, 0, 0, 4, 0, 111, -2, -8, 49, 14], [0, 0, 0, 0, 0, 31, 0, -98, 88, -10, 11, 6], [-166, -22, -4, -8, 6, 0, -21, 0, 0, 0, 0, 0], [-226, -58, 6, 4, 18, 0, 11, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, -4, -90, 22, 36, -22], [-44, 11, 6, 33, 29, 0, -11, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 55, 0, -54, -60, 36, 39, 25], [-131, 3, 2, 22, -20, 0, -14, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 54, 0, 110, -12, 28, 46, 22], [228, -10, 8, -14, -52, 0, -11, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -12, 0, -28, -38, -34, -22, -8], [-238, 18, 12, 14, 35, 0, -44, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -10, 0, -109, 3, 37, 2, 14], [-36, -8, 10, 34, -44, 0, -16, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 19, 0, 152, 64, 16, 53, 17], [269, 26, 33, -1, 16, 0, -24, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -59, 0, -7, -89, 11, -78, -36], [184, 1, 18, -37, -45, 0, -25, 0, 0, 0, 0, 0], [-235, 9, 3, 46, 35, 0, -41, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 24, 0, 48, 80, -20, -36, -8], [0, 0, 0, 0, 0, 8, 0, 18, -66, 30, 1, -14], [-274, 66, -2, 8, 0, 0, -29, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 4, 0, 133, -52, -38, 25, -10], [0, 0, 0, 0, 0, -44, 0, -5, 24, -48, -57, 11], [201, 25, -10, 16, 52, 0, -44, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -62, 0, 56, -84, -16, 8, -2], [88, -69, -5, -5, 43, 0, -20, 0, 0, 0, 0, 0], [207, -48, 13, -33, -54, 0, 36, 0, 0, 0, 0, 0], [-580, 10, -8, 14, 44, 0, -5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -71, 0, 6, -20, -16, 33, -3], [0, 0, 0, 0, 0, -56, 0, -79, -140, -38, 27, 38], [298, 19, -5, 61, -9, 0, -14, 0, 0, 0, 0, 0], [198, 34, -32, -22, 12, 0, -24, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 10, 0, 19, 2, 54, -45, -5], [0, 0, 0, 0, 0, -78, 0, -12, -88, -4, 71, -8], [-568, -78, 24, -36, 10, 0, 22, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 10, 0, 23, 10, 4, -7, 44], [0, 0, 0, 0, 0, -9, 0, -38, 38, 34, 55, 1], [0, 0, 0, 0, 0, 68, 0, -1, 53, 49, 107, 43], [-478, -71, 16, 53, -23, 0, -31, 0, 0, 0, 0, 0], [-143, -43, -3, 26, -75, 0, -19, 0, 0, 0, 0, 0], [388, -4, -24, -54, 21, 0, -56, 0, 0, 0, 0, 0], [190, -78, -20, -20, -64, 0, -5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 42, 0, -64, 8, 44, 78, 50], [196, -16, 2, 68, -28, 0, -35, 0, 0, 0, 0, 0], [437, 9, 41, 30, 47, 0, -17, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 35, 0, 58, -60, -12, -9, 9], [-415, 27, 28, -2, 62, 0, 16, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -48, 0, 56, -42, -14, -23, 42], [0, 0, 0, 0, 0, -13, 0, -32, -140, -20, -31, -13], [520, -79, -11, 1, -47, 0, -18, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 30, 0, 46, 36, 84, -24, 32], [-596, 34, 10, 48, 24, 0, -22, 0, 0, 0, 0, 0], [488, 40, -8, 60, 58, 0, -27, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -28, 0, -13, 126, 16, -33, 10], [0, 0, 0, 0, 0, 24, 0, 2, 100, 36, -88, -18], [270, 73, 9, 11, -79, 0, -34, 0, 0, 0, 0, 0], [-129, 111, -11, -14, 23, 0, -23, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 114, 0, -5, 30, 40, 61, 36], [0, 0, 0, 0, 0, 27, 0, 6, 44, -8, 73, 61], [0, 0, 0, 0, 0, -56, 0, 14, -146, 18, -16, -22], [0, 0, 0, 0, 0, 60, 0, -132, -54, 62, 100, 26], [0, 0, 0, 0, 0, -56, 0, 74, -36, -36, 12, -52], [770, -66, 22, 14, 14, 0, 64, 0, 0, 0, 0, 0], [354, -114, 6, 66, 31, 0, -8, 0, 0, 0, 0, 0], [537, -150, -11, -15, -16, 0, 61, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -81, 0, -81, -165, -83, -140, -61], [-338, -24, -20, 70, 48, 0, -83, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -60, 0, 20, 26, -62, -94, -6], [0, 0, 0, 0, 0, 88, 0, -52, -48, 44, 92, 20], [-491, 210, 1, -19, -16, 0, -37, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -96, 0, 156, -24, -64, -52, -20], [0, 0, 0, 0, 0, 32, 0, -201, -85, 11, -75, -43], [-474, -211, -8, 17, -37, 0, -5, 0, 0, 0, 0, 0], [-407, 98, -25, 75, 102, 0, -36, 0, 0, 0, 0, 0], [-509, 155, -12, 8, 72, 0, 86, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12, 0, 36, -58, -70, 2, -36], [424, 45, 13, -63, -45, 0, -36, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -19, 0, -18, 2, -128, -29, 40], [-252, -40, -16, -86, -26, 0, 6, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 5, 0, 89, 247, 35, 6, -4], [-697, -89, -47, -58, -15, 0, 15, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 34, 0, -78, -40, 8, 46, -2], [547, -101, -4, -24, -52, 0, 30, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -64, 0, 57, -133, -57, 37, 33], [224, 107, 4, 101, 103, 0, -51, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -58, 0, -138, 54, -110, -71, 14], [0, 0, 0, 0, 0, -19, 0, 12, -214, 50, 19, -11], [-242, 87, -29, 41, 111, 0, 80, 0, 0, 0, 0, 0], [-52, 38, -26, 14, 80, 0, -21, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 18, 0, 223, -6, 6, -61, -1], [301, 199, -2, -78, 0, 0, 42, 0, 0, 0, 0, 0], [86, -117, -13, -35, 31, 0, -48, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -81, 0, 194, -70, 54, 43, -45], [103, 110, -19, 41, 52, 0, 52, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -7, 0, -296, 20, -14, -11, -54], [-269, 56, -33, -21, -34, 0, -60, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12, 0, 27, 55, 45, -106, 46], [0, 0, 0, 0, 0, -48, 0, -118, -78, 30, 52, -30], [191, -110, 57, 19, 20, 0, 5, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 27, 0, 93, -51, 39, 54, 129], [-910, 44, 28, 18, -50, 0, -97, 0, 0, 0, 0, 0], [-6, 76, -6, -88, -65, 0, -30, 0, 0, 0, 0, 0], [2, -24, -10, 16, 58, 0, 72, 0, 0, 0, 0, 0], [100, 4, -2, 62, 88, 0, 24, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 70, 0, -223, 34, 30, 169, 65], [833, -16, 3, 15, 64, 0, 11, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 32, 0, -71, 37, -99, -37, 23], [-719, 63, 2, 10, -75, 0, -16, 0, 0, 0, 0, 0], [93, 88, 25, 73, 122, 0, -4, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -65, 0, -31, -99, 55, 66, 57], [-985, 131, -10, -32, -62, 0, -76, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -88, 0, 142, -24, 8, 81, 78], [0, 0, 0, 0, 0, -108, 0, -138, -6, 18, -50, -4], [973, -39, -17, -18, -69, 0, -45, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -52, 0, 62, 72, -8, -118, 48], [262, -18, -40, 6, 32, 0, -28, 0, 0, 0, 0, 0], [126, 69, 51, -49, 15, 0, -54, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 58, 0, 156, -34, 78, 67, 34], [0, 0, 0, 0, 0, -44, 0, 82, 122, -118, -78, 12], [0, 0, 0, 0, 0, 5, 0, 0, -62, -86, -21, 83], [332, 0, 32, -110, -84, 0, 58, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, 62, 50, 50, -2, 96], [-1235, -62, -31, 45, 10, 0, 7, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -184, 0, -320, 12, -32, -170, -30], [-483, -5, -4, 142, 128, 0, 38, 0, 0, 0, 0, 0], [-253, 79, -26, -60, -85, 0, -30, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 8, 0, -137, 95, 39, 57, -15], [-888, 32, 0, -92, -44, 0, 29, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 20, 0, 260, -6, -58, 75, -26], [0, 0, 0, 0, 0, 139, 0, 204, 70, 134, 211, 23], [-274, 69, 14, -75, -45, 0, -35, 0, 0, 0, 0, 0], [268, 96, -52, 76, 90, 0, 19, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -61, 0, 146, -62, -58, 35, 121], [0, 0, 0, 0, 0, 1, 0, 1, 187, 79, -40, -16], [0, 0, 0, 0, 0, 2, 0, -247, 245, -21, -38, 14], [-304, -113, 58, -59, -39, 0, 35, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -10, 0, -148, 84, -16, -36, -30], [0, 0, 0, 0, 0, -170, 0, 37, -135, -79, -121, -31], [394, 36, 26, 78, 70, 0, -59, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 62, 0, 25, -150, 112, 119, -16], [0, 0, 0, 0, 0, -48, 0, 175, -172, 60, 55, -89], [-524, 30, 44, 4, 55, 0, 42, 0, 0, 0, 0, 0], [1037, 13, 60, -40, -56, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -21, 0, -497, -1, -7, -28, -13], [0, 0, 0, 0, 0, -79, 0, 376, 232, -52, 55, 13], [0, 0, 0, 0, 0, -40, 0, 30, 238, 86, 116, -4], [0, 0, 0, 0, 0, 102, 0, -71, -108, -78, -87, 20], [0, 0, 0, 0, 0, 44, 0, -324, -38, -2, 82, -28], [371, -45, 2, 68, -13, 0, -84, 0, 0, 0, 0, 0], [-294, 92, 30, -22, 72, 0, 3, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -50, 0, 29, 108, -4, -41, 23], [0, 0, 0, 0, 0, 10, 0, -134, -282, 46, 97, 4], [0, 0, 0, 0, 0, -19, 0, 138, -118, -98, -171, 53], [0, 0, 0, 0, 0, -4, 0, -8, 36, 120, 88, 40], [0, 0, 0, 0, 0, 74, 0, 105, 272, 4, -97, 9], [578, -4, -22, -56, 34, 0, 122, 0, 0, 0, 0, 0], [-641, -205, 69, -54, -83, 0, 59, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 101, 0, -224, 94, 40, 127, 128], [185, 84, -11, -39, -136, 0, 0, 0, 0, 0, 0, 0], [745, -101, 10, 22, -46, 0, 108, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 37, 0, 171, -67, -117, -16, -29], [1266, 151, -34, 11, 121, 0, -13, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -27, 0, 60, -76, -176, 65, 7], [-859, -6, -25, -35, -144, 0, -7, 0, 0, 0, 0, 0], [-378, 84, -50, 88, 106, 0, -20, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -182, 0, 103, -205, -37, -133, -85], [0, 0, 0, 0, 0, 31, 0, 408, 122, 10, -5, -13], [-96, -17, 50, -87, -23, 0, -23, 0, 0, 0, 0, 0], [-1440, 71, 9, -5, -29, 0, 22, 0, 0, 0, 0, 0], [-275, -219, 37, -22, 59, 0, 15, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 36, 0, -412, 0, 4, -2, -28], [-153, -2, 17, -105, 34, 0, 33, 0, 0, 0, 0, 0], [669, -87, -25, -38, -71, 0, -43, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 113, 0, 218, -90, -38, -87, 53], [253, 83, 36, 14, 132, 0, -46, 0, 0, 0, 0, 0], [1534, -43, -21, -21, 7, 0, 76, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 40, 0, 122, -360, 0, 108, -80], [1290, 74, 66, 86, 99, 0, -28, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -36, 0, 222, 96, -76, -61, -76], [815, -108, -49, -21, -20, 0, -16, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 160, 0, 126, -144, 160, -40, 68], [0, 0, 0, 0, 0, -24, 0, 105, 49, 91, 176, -18], [-206, 169, -9, -101, -73, 0, 168, 0, 0, 0, 0, 0], [1147, 86, 43, 13, -80, 0, -32, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 2, 0, 449, -37, 185, 48, -22], [0, 0, 0, 0, 0, -3, 0, -302, 104, -56, -105, 49], [0, 0, 0, 0, 0, -24, 0, 200, 58, -182, -98, -58], [0, 0, 0, 0, 0, -70, 0, 77, 52, -60, 91, 75], [-437, -177, -38, -80, 87, 0, 12, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 76, 0, -181, 428, 30, -115, -50], [0, 0, 0, 0, 0, 204, 0, 69, -120, -28, 11, 155], [-902, 88, -28, 88, 23, 0, 136, 0, 0, 0, 0, 0], [-752, -142, -50, 122, 10, 0, 59, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -58, 0, -84, 376, -24, -107, 46], [-356, 32, 50, -32, -10, 0, 45, 0, 0, 0, 0, 0], [-716, -37, -33, -65, -83, 0, 60, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -56, 0, -111, -307, -81, -92, -86], [738, 172, -116, -34, 118, 0, 121, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -55, 0, -54, 144, -68, -21, 21], [1163, 179, -34, -116, 63, 0, -12, 0, 0, 0, 0, 0], [730, -163, -9, -13, 55, 0, 102, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -172, 0, -89, 49, -99, 83, -113], [1575, 159, -12, 84, 78, 0, -24, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 12, 0, -114, -44, -68, 146, 152], [0, 0, 0, 0, 0, 156, 0, 49, -42, 132, 105, 58], [-1520, -116, 30, -38, -3, 0, 46, 0, 0, 0, 0, 0], [1735, -104, 1, 25, 86, 0, 27, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 120, 0, -210, 200, 144, 239, 122]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_2736_m_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_2736_3_m_e();".
// 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_2736_3_m_e(:prec:=12)
    chi := MakeCharacter_2736_m();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 3));
    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_2736_3_m_e();".
// 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_2736_3_m_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_2736_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![-11456, -2964, 1468, 245, -65, -5, 1]>],Snew);
    return Vf;
end function;