
// Make newform 185.2.e.b in Magma, downloaded from the LMFDB on 03 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_185_e();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_185_e_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_185_2_e_b();".
// 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_185_2_e_b();".
// 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, -3, 94, -71, 927, -520, 795, -264, 378, -116, 98, -16, 13, -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, 0, 0], [0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [36649787622939, -15090367197, -58979062619, 2837804858708, -506155546708, -1369641296906, -2613610890128, -935461175501, -189135667754, -559923414664, -36288739259, -80268303612, 5939251426, -9478348504], [-4054063958955, -15718415822970, -39429508447438, 9782345905237, -39768160695548, 5856808357145, -19045573904398, 4306381352474, -5401005991738, 688819306006, -717256889278, 104613638997, -60819893197, 1783045984], [-7664107792896, -13222783522698, -74488789134352, 17904331741840, -65211169517942, 5125957072448, -29551616470432, 3046673790389, -7374082038544, -124142989856, -953424895018, -10160356080, -68330049472, -11870550653], [-819032579649, 2778128635896, -130856346377389, 30526706162557, -86999035289222, -543072789556, -41578157064514, -1529387300830, -8405270601085, -2509907850122, -1095006990100, -351939083643, -45163761508, -50193883907], [1563889592313, 86973263651613, 15389014323523, -5808955864888, 57042228519017, -22808515036439, 29649613060228, -19534514071514, 11885631465559, -5194941963136, 1641485138212, -758931579168, 184672214059, -53204394598], [-39106885361886, 8349476274885, -379856809607269, 88742313628963, -260490950320958, -259577071762, -122120860303414, -3652700726989, -25026676135501, -6969800135702, -3248732231041, -975548947317, -141430535950, -141103303217], [451744955163, -13622864693649, 7496353723154, -134420112134786, 77056436544346, -113099854920862, 39361064916509, -54829342415962, 17443900816016, -14227761134297, 2409092772764, -1898109132612, 300581407148, -145551529322], [-37457690633037, 157250593428483, -363591920891567, 82201415957672, -191824487880025, -28502988876989, -86305601479412, -28303109693687, -10493690110931, -13453366193056, -1238292354101, -1922422841808, 86191905049, -207325143397], [-7617632295159, 1233264760365, -9262029788041, 158288331648463, -95361554372399, 143246835651113, -46533981085963, 69865655008613, -21472043212924, 18642820820026, -2949614782456, 2492979987918, -380961431131, 196326636943], [4398007127490, -7084224386202, 54555922896730, -932657327431903, 560912691272108, -825857330982968, 286067604799291, -400695922370138, 126887530312852, -104502335125348, 17511425468350, -13929871784304, 2189537640988, -1072227588916], [1902753058536, -119620363148940, -202891592822444, -1171442050682476, 473777663410352, -1075478726223161, 245914842273604, -512714743951808, 132023358039862, -138176509615492, 18373498937056, -18343976363517, 2529739953856, -1469993686828], [-2488211637801, 56389266201446, -151896197155562, 559047952819978, -379508505806857, 453827991804461, -190597380583792, 215201354526920, -74929953390539, 53875950396371, -10277156808510, 7139242100648, -1200104506751, 527727247875]];
    Rf_basisdens := [1, 1, 12653250462279, 1807607208897, 4217750154093, 12653250462279, 12653250462279, 12653250462279, 12653250462279, 12653250462279, 4217750154093, 12653250462279, 12653250462279, 4217750154093];
    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_185_e();"
function MakeCharacter_185_e()
    N := 185;
    order := 3;
    char_gens := [112, 76];
    v := [3, 1];
    // chi(gens[i]) = zeta^v[i]
    assert UnitGenerators(DirichletGroup(N)) eq char_gens;
    F := CyclotomicField(order);
    chi := DirichletCharacterFromValuesOnUnitGenerators(DirichletGroup(N,F),[F|F.1^e:e in v]);
    return MinimalBaseRingCharacter(chi);
end function;

// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_185_e_Hecke();"
function MakeCharacter_185_e_Hecke(Kf)
    N := 185;
    order := 3;
    char_gens := [112, 76];
    char_values := [[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 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]];
    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, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], [1, -1, 0, 1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 1], [0, 0, 0, -1, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, -1, 1, 1, 1, 0, 0, -1, 1, 0], [1, 0, 0, 1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -1, -1, 0, 0, 0, 0, 0, -1, -1, 1, 1, 1], [-1, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, -2, 0, -1], [1, -1, 0, 1, 0, 0, 0, 0, -1, 1, 1, 1, -1, -1], [1, -2, -2, -1, -1, -1, 1, -2, -1, 0, 1, -1, 2, 0], [-2, 0, 0, -3, 2, 2, -2, 2, 0, 0, 0, 0, 0, 0], [-4, 1, -1, -2, 0, 0, 0, 0, 1, 0, 3, -3, 2, 0], [0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 2, 0, 2, 0, -1, 2, -2, 0, -2, 1, 0, 1], [0, 0, -2, 0, 1, -1, -2, -2, -4, 0, -1, 2, -1, 0], [-2, -1, 0, -1, 0, 2, 2, -1, 0, 1, 0, 0, 0, 0], [-3, 2, 0, 1, 1, 3, -1, 0, 0, 0, 0, 0, 0, 0], [-4, 1, 0, -2, 0, 4, -4, 1, 0, 0, 0, 0, 0, 0], [-2, -2, -1, 3, 0, 0, 0, 0, -2, -2, -3, 1, -3, 2], [3, 3, 0, 1, 1, -3, -2, -1, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0, -1, 1, -1, 0, 0, 1, 0, -2], [0, 0, 3, 0, 0, -1, 0, 3, 2, 0, 0, 0, -4, 1], [-1, -2, 2, 2, 0, 0, 0, 0, -2, 3, 0, 3, -2, -3], [5, 0, 2, -2, 0, 0, 0, 0, 0, 3, 1, -1, 2, -3], [2, 4, 2, 4, 0, 0, 0, 0, 4, 0, -3, 3, -4, 0], [-1, 1, 0, 0, -1, 1, 0, 1, 0, -1, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 3, 0, 3, 0, -1, -3, 2, -2], [0, 0, -1, 0, -3, 0, 4, -1, 0, 0, 3, -4, 1, 2], [0, 0, -3, 0, -2, 0, 0, -3, 2, 0, 2, 0, 0, 1], [0, 0, -1, 0, -1, 4, 3, -1, -5, 0, 1, -3, 1, 2], [3, 3, 0, 3, 0, 0, 0, 0, 3, 1, -1, 2, -3, -1], [0, 0, -1, 0, 0, 5, -1, -1, -2, 0, 0, 1, -1, 3], [4, -1, 1, 0, 0, 0, 0, 0, -1, 1, -1, 3, 0, -1], [8, -4, 0, 2, 0, -8, -2, -3, 0, 0, 0, 0, 0, 0], [0, 0, -3, 0, -1, 3, 0, -3, -2, 0, 1, 0, 3, -2], [0, 0, -1, 0, 0, -4, 2, -1, 0, 0, 0, -2, 3, 0], [9, -1, 0, 2, -2, -9, -1, -1, 0, 1, 0, 0, 0, 0], [0, 0, 1, 0, -2, -6, 2, 1, 4, 0, 2, -2, -1, -2], [-3, 3, -5, -5, 0, 0, 0, 0, 3, -2, 2, 2, 5, 2], [4, -2, 0, 1, 1, -4, 6, -1, 0, 0, 0, 0, 0, 0], [-5, -4, 0, 3, 0, 0, 0, 0, -4, 1, -4, 3, -3, -1], [-12, 3, 0, -1, 0, 0, 0, 0, 3, 0, -1, 1, 1, 0], [0, 0, 0, 0, 3, -1, -5, 0, 1, 0, -3, 5, 1, 0], [3, -1, -4, 1, 0, 0, 0, 0, -1, 0, 1, -2, -1, 0], [-1, 0, 0, 4, 0, 0, 0, 0, 0, -1, -3, 1, -4, 1], [2, -4, 5, 1, 0, 0, 0, 0, -4, 1, -4, -1, -1, -1], [4, 4, 0, 3, -3, -4, 1, -3, 0, 0, 0, 0, 0, 0], [2, -2, 0, -4, 2, -2, -2, 0, 0, -3, 0, 0, 0, 0], [8, -8, -2, 4, 0, 0, 0, 0, -8, -2, -1, 4, -4, 2], [0, 0, -2, 0, -4, 9, 3, -2, -1, 0, 4, -3, 0, -3], [8, 1, 0, 0, -3, -8, 2, -1, 0, -1, 0, 0, 0, 0], [5, 1, -2, -2, 0, 0, 0, 0, 1, 3, 2, 2, 2, -3], [0, 0, 0, 0, 5, -3, 4, 0, -3, 0, -5, -4, -2, 2], [-2, -3, 0, 2, -1, 2, -4, -1, 0, -1, 0, 0, 0, 0], [-4, -4, 4, 1, 0, 0, 0, 0, -4, 1, -3, 1, -1, -1], [0, 0, 5, 0, 4, 2, -1, 5, 2, 0, -4, 1, -8, 0], [5, -4, 0, 2, -3, -5, 3, -1, 0, 1, 0, 0, 0, 0], [0, 0, -1, 0, 3, -11, -3, -1, -6, 0, -3, 3, 2, -1], [4, 0, 0, -4, 2, -4, -4, 0, 0, -2, 0, 0, 0, 0], [-12, 1, 0, -1, 1, 12, 0, 6, 0, -3, 0, 0, 0, 0], [-3, 4, -3, -7, 0, 0, 0, 0, 4, -2, 3, 3, 7, 2], [0, 0, 2, 0, 2, 4, -4, 2, -5, 0, -2, 4, 2, 0], [0, 0, 1, 0, 0, 9, -5, 1, -2, 0, 0, 5, 2, 0], [0, 0, 3, 0, -4, 1, 3, 3, 1, 0, 4, -3, 0, -1], [0, 0, 2, 0, 4, 10, -9, 2, 0, 0, -4, 9, -4, 0], [-3, 5, 0, -3, -2, 3, -6, -4, 0, -1, 0, 0, 0, 0], [-5, 2, -1, -3, 0, 0, 0, 0, 2, -1, 2, -7, 3, 1], [0, 0, 1, 0, 3, 6, -1, 1, 8, 0, -3, 1, -4, -1], [0, 0, -2, 0, 1, 6, -2, -2, -9, 0, -1, 2, 0, 2], [-6, 4, 2, -3, 0, 0, 0, 0, 4, -3, 0, -3, 3, 3], [-12, 1, 0, 1, 0, 12, 4, -1, 0, 1, 0, 0, 0, 0], [-12, 3, 0, -3, 2, 12, -1, 5, 0, 0, 0, 0, 0, 0], [0, 0, 3, 0, -1, -10, 6, 3, 2, 0, 1, -6, 8, 2], [3, -8, 0, -3, 4, -3, -3, 1, 0, 0, 0, 0, 0, 0], [10, 5, 0, -1, 1, -10, -5, -7, 0, 3, 0, 0, 0, 0], [1, -6, 2, 5, 0, 0, 0, 0, -6, -1, -1, -3, -5, 1], [-7, 7, -4, -3, 0, 0, 0, 0, 7, -1, 0, 0, 3, 1], [0, 0, 2, 0, -4, -8, 7, 2, 7, 0, 4, -7, 2, -1], [0, 0, -5, 0, -4, 2, 1, -5, -4, 0, 4, -1, 6, 0], [2, -6, -6, -3, 0, 0, 0, 0, -6, 0, 3, -6, 3, 0], [4, -9, 0, 0, 0, -4, 8, 6, 0, 2, 0, 0, 0, 0], [3, 5, 2, -3, 0, 0, 0, 0, 5, 0, 0, -2, 3, 0], [12, -5, 0, 1, 0, -12, 2, 2, 0, -3, 0, 0, 0, 0], [-6, 7, -1, -3, 0, 0, 0, 0, 7, 6, 0, -6, 3, -6], [5, 5, 0, 5, 0, -5, 1, -3, 0, 1, 0, 0, 0, 0], [-23, 6, 0, -4, 0, 23, 0, 2, 0, 0, 0, 0, 0, 0], [0, 0, -3, 0, 0, -3, -1, -3, 0, 0, 0, 1, 9, 1], [3, -4, 0, 4, 2, -3, 5, 0, 0, 0, 0, 0, 0, 0], [11, -4, -1, -2, 0, 0, 0, 0, -4, -2, -4, 4, 2, 2], [0, 0, -3, 0, -3, -7, 5, -3, 9, 0, 3, -5, -1, -1], [-8, -6, 5, 5, 0, 0, 0, 0, -6, -3, -3, -1, -5, 3], [-18, 0, 1, 1, 0, 0, 0, 0, 0, -2, 2, -1, -1, 2], [9, -3, 0, -9, 3, -9, 2, 12, 0, 0, 0, 0, 0, 0], [0, 0, 10, 0, 3, 5, -2, 10, 5, 0, -3, 2, -6, -3], [0, 0, -1, 0, 4, 6, -1, -1, 4, 0, -4, 1, -6, -2], [8, 6, 0, -1, 1, -8, 0, 3, 0, 2, 0, 0, 0, 0], [14, -6, 0, -3, -2, -14, 4, 1, 0, 0, 0, 0, 0, 0], [-12, 7, 0, 0, 0, 0, 0, 0, 7, -6, -7, 1, 0, 6], [-6, 0, 2, -2, 0, 0, 0, 0, 0, -2, 1, 0, 2, 2], [0, 0, 1, 0, 5, 5, -4, 1, -7, 0, -5, 4, -6, 5], [-3, -7, -2, 5, 0, 0, 0, 0, -7, -4, 0, 4, -5, 4], [6, 3, 6, 2, 0, 0, 0, 0, 3, 2, -4, -8, -2, -2], [0, 0, -1, 0, -4, -8, -1, -1, 7, 0, 4, 1, 1, -2], [0, 0, -1, 0, 6, 0, -4, -1, 0, 0, -6, 4, -6, -4], [20, -8, 0, 2, -4, -20, 14, 1, 0, -3, 0, 0, 0, 0], [4, 1, -2, -4, 0, 0, 0, 0, 1, 0, 8, -2, 4, 0], [-6, -2, 0, 1, -3, 6, 7, -5, 0, 2, 0, 0, 0, 0], [0, 0, 0, 0, -1, -3, 5, 0, -4, 0, 1, -5, -3, -4], [0, 0, 2, 0, 1, 14, -8, 2, -3, 0, -1, 8, -7, -5], [0, 0, 0, 0, 3, -13, -2, 0, 3, 0, -3, 2, -1, -2], [0, 0, 2, 0, 6, -3, 6, 2, 3, 0, -6, -6, 2, 3], [-2, 1, -8, -8, 0, 0, 0, 0, 1, -1, 4, -9, 8, 1], [0, 0, -6, 0, -3, 3, 1, -6, 6, 0, 3, -1, 9, 0], [0, 0, -6, 0, -3, 15, 2, -6, -3, 0, 3, -2, -1, 1], [-5, -2, -4, 0, 0, 0, 0, 0, -2, -6, 2, 5, 0, 6], [-1, 2, 0, -1, 5, 1, 1, -6, 0, 4, 0, 0, 0, 0], [16, -7, 0, 10, -4, -16, 9, -6, 0, 1, 0, 0, 0, 0], [-6, -1, 0, 0, -4, 6, 3, 3, 0, -3, 0, 0, 0, 0], [17, 8, 0, 3, 1, -17, -7, -5, 0, 2, 0, 0, 0, 0], [8, 1, 0, 4, 4, -8, -11, -2, 0, 0, 0, 0, 0, 0], [4, 5, 5, 4, 0, 0, 0, 0, 5, 2, 5, -1, -4, -2], [0, 0, -1, 0, -1, 16, -7, -1, -7, 0, 1, 7, -5, -3], [0, 0, -2, 0, -1, -2, -6, -2, -14, 0, 1, 6, 3, -3], [0, 0, 1, 0, -7, 13, -4, 1, -1, 0, 7, 4, -1, -3], [-5, -3, 3, -1, 0, 0, 0, 0, -3, 2, 0, 3, 1, -2], [0, 0, 6, 0, 8, 7, -12, 6, 3, 0, -8, 12, -10, -1], [0, 3, 0, 4, 3, 0, 4, -2, 0, -5, 0, 0, 0, 0], [4, 6, 0, 13, -6, -4, 12, -3, 0, 0, 0, 0, 0, 0], [6, -12, -1, 0, 0, 0, 0, 0, -12, 1, 6, -3, 0, -1], [-15, 0, 0, -2, -4, 15, -6, 0, 0, 0, 0, 0, 0, 0], [-19, 2, 2, -6, 0, 0, 0, 0, 2, -1, -2, -11, 6, 1], [0, 0, 0, 0, -5, -13, -4, 0, -8, 0, 5, 4, 3, 3], [0, 0, -4, 0, -5, 4, -3, -4, 3, 0, 5, 3, 10, 2], [-9, -6, 1, 4, 0, 0, 0, 0, -6, -7, -5, 5, -4, 7], [-10, 1, 0, -7, 5, 10, -1, 16, 0, -3, 0, 0, 0, 0], [-1, 2, 4, -9, 0, 0, 0, 0, 2, 6, 4, -9, 9, -6], [0, 0, -3, 0, 2, 1, -8, -3, 5, 0, -2, 8, 4, -2], [-2, -9, 0, -8, 6, 2, -9, 2, 0, 1, 0, 0, 0, 0], [-11, 2, 0, -1, -2, 11, 2, 3, 0, -8, 0, 0, 0, 0], [2, 3, 0, 7, -8, -2, -1, -3, 0, -3, 0, 0, 0, 0], [0, 0, -5, 0, -6, -5, -5, -5, 8, 0, 6, 5, 1, 2], [3, -4, 0, -3, -5, -3, 3, 2, 0, -3, 0, 0, 0, 0], [0, 0, -1, 0, 2, -1, 3, -1, 10, 0, -2, -3, 9, 2], [0, 0, -3, 0, -3, -17, 7, -3, 0, 0, 3, -7, 6, 4], [0, 0, -1, 0, -6, 1, 13, -1, -1, 0, 6, -13, 0, -10], [-5, -12, -2, -6, 0, 0, 0, 0, -12, 4, 3, -3, 6, -4], [-1, -4, -1, -7, 0, 0, 0, 0, -4, 0, -6, -6, 7, 0], [0, 0, 6, 0, 6, 6, -2, 6, -6, 0, -6, 2, -6, -1], [-15, 4, 0, 8, 0, 0, 0, 0, 4, -4, -1, 2, -8, 4], [6, 0, 0, 3, 10, -6, -3, -2, 0, 3, 0, 0, 0, 0], [14, 1, 0, 1, 5, -14, 5, 5, 0, 5, 0, 0, 0, 0], [11, 7, 10, 5, 0, 0, 0, 0, 7, 1, -4, -5, -5, -1], [-13, -6, 0, -8, 7, 13, -9, 6, 0, 4, 0, 0, 0, 0], [3, 0, 4, 1, 0, 0, 0, 0, 0, 3, 11, -12, -1, -3], [-3, -1, -7, -3, 0, 0, 0, 0, -1, -1, 3, 11, 3, 1], [9, -5, 0, 7, -6, -9, 13, 3, 0, -7, 0, 0, 0, 0], [0, 0, 6, 0, -1, 13, 2, 6, -8, 0, 1, -2, -5, -8], [0, 0, -5, 0, 5, 9, -5, -5, -6, 0, -5, 5, -5, 5], [0, 0, -1, 0, -5, 15, 3, -1, 0, 0, 5, -3, -1, 0], [0, 0, 3, 0, 6, 8, -3, 3, 6, 0, -6, 3, -1, 1], [-6, 2, 0, 3, -5, 6, 7, 6, 0, -5, 0, 0, 0, 0], [0, 0, -4, 0, 7, 7, -8, -4, 1, 0, -7, 8, -1, 1], [0, 0, 2, 0, 3, 8, 6, 2, -4, 0, -3, -6, -10, 1], [0, 0, -2, 0, 1, -18, 6, -2, 4, 0, -1, -6, 0, 0], [-1, 8, 1, 4, 0, 0, 0, 0, 8, 5, -1, 4, -4, -5], [0, 0, 1, 0, -6, 13, 0, 1, 3, 0, 6, 0, 0, 3]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_185_e_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_185_2_e_b();".
// 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_185_2_e_b(:prec:=14)
    chi := MakeCharacter_185_e();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_185_2_e_b();".
// 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_185_2_e_b( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_185_e();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<2,R![9, -3, 94, -71, 927, -520, 795, -264, 378, -116, 98, -16, 13, -2, 1]>],Snew);
    return Vf;
end function;