
// Make newform 135.3.i.a in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_135_i();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_135_i_Hecke();"
// To make the coeffs of the qexp of the newform in the Hecke field type "qexpCoeffs();"
// To make the newform (type ModFrm), type "MakeNewformModFrm_135_3_i_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_135_3_i_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 := [81, 0, 36000, 0, 117844, 0, 109032, 0, 43602, 0, 8704, 0, 912, 0, 48, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2223, 0, 63115, 0, -21801, 0, -27813, 0, -4607, 0, -99, 0, 21, 0, 1, 0], [28755, -2376, 25605, 0, 39821, 0, 23051, 0, 5777, 0, 715, 0, 43, 0, 1, 0], [-243, 2376, -20853, 0, -39821, 0, -23051, 0, -5777, 0, -715, 0, -43, 0, -1, 0], [-20007, -678645, -568035, 1029171, 196209, 2822743, 250317, 1622335, 41463, 413677, 891, 52613, -189, 3245, -9, 77], [1074951, 7611633, 743859, 13043725, -196209, 9487793, -250317, 3201461, -41463, 556623, -891, 51883, 189, 2467, 9, 47], [2376, 87147, 0, 313711, 0, 304045, 0, 125029, 0, 25397, 0, 2693, 0, 143, 0, 3], [-678645, 8323965, 1029171, 29303677, 2822743, 27181221, 1622335, 10811157, 413677, 2150779, 52613, 225075, 3245, 11847, 77, 247], [678645, 8323965, -1029171, 29303677, -2822743, 27181221, -1622335, 10811157, -413677, 2150779, -52613, 225075, -3245, 11847, -77, 247], [-348489, -12095613, -5792913, -30933391, -7225755, -27829221, -3104187, -11314095, -610971, -2306275, -60735, -246081, -2973, -13143, -57, -277], [923103, 23155785, -8736429, 75908729, -6881221, 72179881, -897817, 29315449, 241217, 5909535, 68077, 623639, 5665, 33011, 157, 691], [-1947429, -22979961, -12892101, -75908729, -19075045, -72179881, -9813157, -29315449, -2257603, -5909535, -258107, -623639, -14375, -33011, -311, -691], [3720141, 35439723, 8685621, 99376247, 5559869, 86892751, 2047085, 33938347, 474899, 6709917, 62323, 700721, 4087, 36869, 103, 769], [-3720141, 35439723, -8685621, 99376247, -5559869, 86892751, -2047085, 33938347, -474899, 6709917, -62323, 700721, -4087, 36869, -103, 769], [-14256, 527391, -2376, 1861413, 0, 1784449, 0, 727123, 0, 146605, 0, 15443, 0, 815, 0, 17]];
    Rf_basisdens := [1, 1, 19536, 4752, 4752, 351648, 351648, 4752, 351648, 351648, 175824, 351648, 351648, 351648, 351648, 4752];
    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_135_i();"
function MakeCharacter_135_i()
    N := 135;
    order := 6;
    char_gens := [56, 82];
    v := [5, 6];
    // 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_135_i_Hecke();"
function MakeCharacter_135_i_Hecke(Kf)
    N := 135;
    order := 6;
    char_gens := [56, 82];
    char_values := [[0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, 0, 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, 1, 0, 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, 1, 0, 0, 0, 0, 0, 0, 0], [1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 1, -1, -1, 0, 0, 0], [0, -1, -1, -1, 0, 1, 0, 1, 0, 0, 0, 1, 1, -1, 0, -1], [-1, -1, -1, -1, 0, 0, 1, 0, -1, -2, -1, 1, 0, -2, -1, -1], [5, -1, -2, 0, -1, -3, 1, -8, -1, -1, 2, -1, -1, 0, 0, 1], [-2, -3, 0, -3, 3, -2, -2, 0, -1, 1, 0, 0, -4, 1, -1, -2], [5, -2, 2, -3, 1, 1, 0, -2, 0, 0, 0, -1, -1, 0, -1, 2], [4, 2, -3, -5, -4, -1, 0, 3, 0, 2, 0, -1, -5, 1, 0, -2], [0, -7, 0, 1, 4, -1, 0, 4, -3, -6, 0, 0, 0, 0, 0, 1], [2, -1, -2, 4, 8, 3, 3, 0, -3, 3, 0, -2, 4, 0, 0, 3], [-10, 5, 0, 3, 0, 1, 2, 7, -5, 0, 2, -4, -2, 0, 0, -1], [-17, 2, -3, 0, -1, 0, 6, 18, 6, 3, 1, -1, 2, 0, 0, 4], [9, -3, 1, 2, 4, 2, 0, 8, 0, -9, 1, -1, 2, 2, 0, 2], [-21, 4, 1, -6, -1, 2, 0, 32, 0, 0, -10, 5, 5, -9, -9, -12], [39, 0, 2, 3, 0, -1, -4, -22, 4, 0, -2, 5, 1, 0, 1, -6], [9, 7, 5, 1, 4, 7, 4, -6, -16, -8, 4, -3, -1, 1, 2, 5], [-4, 20, -1, -2, -10, 5, 1, 4, 5, 10, -6, 4, 3, -8, -4, -5], [4, 3, -1, 5, 1, -4, -2, 0, -1, -1, 8, -4, -4, 2, 2, 8], [-18, -6, 5, 8, 20, 2, 2, 0, 10, -10, 0, 0, 4, -1, 1, 2], [1, 3, -5, 0, 1, -11, -12, 1, -6, -3, 2, -2, -8, 0, 0, -12], [-27, -5, -1, -3, 1, 1, 0, -20, 0, 12, -2, 7, 7, -9, 0, -6], [-9, 2, -5, 0, -4, -4, 6, 26, 6, 6, 8, -4, -4, 3, 3, 6], [-23, -11, 8, -6, -12, 8, 0, 20, -24, -12, -9, 3, 3, -6, -12, -10], [1, 3, -3, 10, 1, 5, 0, 3, 0, -25, 0, 2, 4, -2, 0, 4], [-1, 17, -1, -3, -14, -8, 1, 26, 11, 22, 7, 1, 0, -2, -1, -3], [28, 17, 6, 0, 6, -4, -16, -68, -8, -8, -12, 6, 6, 0, 0, -16], [13, 13, 2, 3, -13, 4, 4, 0, 17, -17, 0, -10, -2, 1, -1, 4], [17, 7, 14, 3, -1, 7, 0, -8, 6, 0, -3, -1, -1, 0, -7, -10], [19, -10, 12, -16, 3, 1, 1, 0, 5, -5, 0, 1, 3, -2, 2, 1], [48, 0, 8, 6, -19, 11, 14, -25, 7, 0, 4, 2, 16, 0, 10, 18], [27, -19, -8, 14, 32, 8, 0, 20, 0, 12, -5, -7, -7, 2, 0, 8], [-3, -20, 6, 21, 18, -7, -6, -18, 12, 24, 2, 3, 9, -6, -3, 12], [29, 7, 0, 0, 22, 8, 16, -13, -25, 0, -4, -3, 13, 0, -11, 5], [45, -5, 12, 10, 6, 2, -20, -47, -28, -14, 8, 2, -8, 10, 20, -1], [-1, -5, 8, 27, 19, -1, -8, -54, 26, 52, -7, 1, 9, -2, -1, 18], [-7, -15, 7, -10, 5, -3, -3, 0, 9, -9, 0, 15, 9, 3, -3, -3], [-91, -12, -7, -15, -16, 2, 11, 44, 1, 0, -6, 3, 14, 0, -9, 17], [10, -8, 2, -38, -10, -12, 0, -2, 0, 20, 10, -12, -22, 22, 0, -8], [-38, -57, 15, 11, 21, 10, -20, 56, 17, 17, -20, 10, 10, -16, -16, 2], [-1, -2, 15, -8, 0, -6, -6, 0, 18, -18, 0, -4, -16, 9, -9, -6], [27, 37, 16, 24, -30, -16, 0, 29, 0, 24, 8, 2, 2, 6, 0, 15], [4, 3, -5, -6, 2, -9, 5, -80, 19, 38, -9, -4, -9, 8, 4, 3], [77, -10, 5, -12, -17, 8, -2, -144, 26, 26, 10, -5, -5, -3, -3, -26], [-22, 1, -13, -5, -27, 6, 6, 0, -9, 9, 0, 20, 32, -12, 12, 6], [8, 31, -10, -19, -33, 2, 10, -53, -22, -44, 24, -8, -18, 16, 8, -1], [71, -20, 30, -7, -22, 19, -22, -68, 70, 35, -4, -3, -14, -7, -14, -28], [55, 7, 22, 27, 1, 1, 0, 56, 0, 23, 10, 1, 24, 9, 0, 18], [-19, -58, -10, -7, 24, -1, 10, 75, 14, 28, -16, 19, 9, -38, -19, -16], [-38, 33, 15, -2, 0, 33, 3, 72, 27, 27, -4, 2, 2, 7, 7, -1], [20, -14, -20, -18, -23, -21, -22, -9, 43, 0, -2, -2, -24, 0, -6, -10], [26, -37, -4, 2, -42, -6, -4, -36, 4, 2, -8, 10, 8, 2, 4, -17], [13, 8, 11, 11, -5, 20, -2, 6, 50, 50, 32, -16, -16, 17, 17, 20], [-75, -2, -24, -15, -16, -7, 10, 38, -28, 0, -12, -1, 9, 0, -25, 0], [-88, 34, -8, 5, -31, -15, 0, -76, 0, -59, -13, 12, -11, -25, 0, -10], [-51, 11, 14, 11, 19, 6, -22, 86, -71, -71, -16, 8, 8, -13, -13, 0], [96, -57, -9, -11, 79, -16, -16, 0, -29, 29, 0, 24, -8, -4, 4, -16], [-98, 52, 8, -3, 11, 11, 6, 114, -18, -9, 13, -16, -13, -3, -6, -22], [51, -67, -17, -23, 50, -13, 0, 56, 0, -12, 6, 5, -25, 1, 0, -11], [8, 121, 8, 4, -58, -12, -8, 20, -10, -20, 7, -8, 0, 16, 8, 4], [197, -9, -17, -15, 58, -8, 1, -98, 65, 0, -5, -1, 0, 0, -11, 5], [-151, 17, -13, 32, 3, -6, -6, 0, -30, 30, 0, -5, -17, -3, 3, -6], [-250, 13, 18, 33, 41, 14, 10, 107, -22, 0, -16, 36, 46, 0, 4, -19], [-47, -47, 6, 3, -25, 9, 6, 48, -54, -27, 4, -1, 2, 3, 6, 32], [28, 15, -1, -20, -15, 0, 0, 22, 0, -31, -14, -6, -7, -8, 0, -14], [-88, -48, -12, 14, -52, -8, 8, 88, 76, 38, 14, 0, 4, 14, 28, 18], [0, -41, 0, -6, 27, -44, 0, 60, 30, 60, -19, 0, 0, 0, 0, -6], [-62, -5, 35, -24, 2, 1, -33, 40, 27, 0, -1, -18, -51, 0, -20, -29], [-29, 93, -34, 9, 5, -22, 24, 54, -42, -21, 34, -25, -13, 9, 18, -30], [-69, 32, 13, 53, 8, 29, 0, -106, 0, 18, 10, -37, 5, 47, 0, 50], [53, 78, -12, 5, 3, -18, 6, -102, 48, 48, 4, -2, -2, 32, 32, 16], [-88, 50, 6, 5, 33, 7, 2, 72, 82, 41, -11, 16, 17, 5, 10, -26], [-19, -25, 14, 11, 21, 63, -14, 72, -16, -32, -25, 19, 33, -38, -19, -22], [45, 45, -44, -48, -96, -4, -4, 0, -17, 17, 0, -42, -50, 23, -23, -4], [95, 13, -41, 3, -24, 0, 41, -30, 19, 0, 25, -35, 6, 0, 15, 53], [23, 87, -21, 17, -100, -23, 0, 48, 0, -38, 18, 25, -19, -7, 0, 5], [-32, -56, 2, -100, 10, -8, -8, 0, 44, -44, 0, 2, -14, 10, -10, -8], [-103, 6, 20, 3, 11, 8, -4, 59, -23, 0, 12, -15, -19, 0, 9, 2], [23, -78, 8, 53, 54, 9, -8, -40, 32, 64, 46, -23, -15, 46, 23, 68], [200, -17, -6, -15, 43, -22, -38, -103, -16, 0, -4, 6, -32, 0, -2, -25], [-12, 22, 36, -26, -18, 38, 4, 22, 8, 4, -16, -10, -8, -26, -52, -52], [61, 37, -11, -24, -22, -8, 14, -126, -71, -71, -4, 2, 2, -30, -30, -34], [-113, -45, -52, 10, 103, 13, 13, 0, 5, -5, 0, -3, 23, -26, 26, 13], [169, -13, -3, -30, 23, -9, -12, -183, 90, 45, -44, 14, 8, -30, -60, -20], [-116, -139, 16, 57, 162, 31, 0, -88, 0, -7, -17, 28, 75, -45, 0, 6], [63, -63, -46, -30, -50, -38, 54, -86, 93, 93, 40, -20, -20, 9, 9, -6], [159, -49, -4, -17, 27, 7, 22, -176, -10, -5, -34, 17, 28, -17, -34, 64], [32, -40, -11, -69, -20, -39, 0, 71, 0, 52, 12, 39, -11, -27, 0, -48], [-10, 16, -19, 38, -3, 33, 19, 46, -67, -134, 18, 10, -9, -20, -10, 47], [-41, -25, 2, 4, 1, 7, 3, 88, 75, 75, 6, -3, -3, -20, -20, 11], [157, -95, -19, -56, 65, 3, 0, 133, 0, -55, 28, -24, -40, 52, 0, -2], [94, 33, -6, 34, -14, 7, 7, 0, -43, 43, 0, -18, -4, 4, -4, 7], [-59, -26, 58, -57, -67, 42, 26, 33, 61, 0, -24, -7, 19, 0, -55, 28], [23, -66, 8, 1, 41, -76, -8, -177, -43, -86, 8, -23, -15, 46, 23, 16], [-6, 60, 7, 24, 20, 17, 3, 20, -51, -51, 8, -4, -4, -21, -21, 51], [-221, -18, -18, 21, -185, -18, -18, 102, -21, 0, 22, 17, -1, 0, 61, 22], [70, -87, 29, 26, 58, 8, -50, -204, 29, 29, -64, 32, 32, 20, 20, 2], [-38, -22, 83, -12, 40, 19, 19, 0, -19, 19, 0, -8, 30, 7, -7, 19], [6, -21, -90, 18, 18, 2, 2, 0, 19, -19, 0, 42, 46, -19, 19, 2], [-80, -90, 7, -9, -141, 13, 12, 98, 0, 0, 9, -18, -12, -9, -18, -30], [-84, 60, -38, 28, -10, -84, -8, 244, 32, 32, 76, -38, -38, 64, 64, 48], [37, 51, 7, 69, 121, 52, 97, -8, -193, 0, 39, -21, 76, 0, 57, 85], [157, 30, 27, 129, 70, 23, 0, 144, 0, 206, -58, -13, 37, -45, 0, 42], [-19, -60, 8, 25, 68, 39, -8, 138, 2, 4, -70, 19, 27, -38, -19, -2], [63, 40, 60, 96, -25, 26, 26, 0, 4, -4, 0, 41, 93, -16, 16, 26], [-58, 14, 25, 39, 7, -15, 0, -82, 0, -92, 21, -24, -14, 45, 0, 42], [26, -63, 12, 22, 54, 11, -13, -116, -11, -11, -64, 32, 32, 16, 16, 31], [-190, -12, 106, -42, 81, 49, -8, 85, 71, 0, -50, 20, 12, 0, -80, -46], [-207, -36, 7, -5, 110, -15, -44, 134, 20, 10, -78, 73, 51, -5, -10, 24], [24, 51, 27, 62, 11, -43, -27, -34, -87, -174, 13, -24, 3, 48, 24, 59], [197, -31, 11, 20, 63, -33, -33, 0, 51, -51, 0, 19, -47, 9, -9, -33], [196, 55, 62, 78, 13, 70, 78, -104, -30, 0, 11, 12, 90, 0, 34, 34], [-317, -2, 32, 3, 105, -28, -120, 242, 162, 81, -72, 75, 15, 3, 6, -85], [-19, 53, 29, 38, -60, 18, 18, 0, -99, 99, 0, -8, 28, 0, 0, 18], [-10, 45, -6, 78, -4, 34, 0, -48, 0, 22, 34, -38, -10, 72, 0, 75], [19, 81, -17, 5, -29, 10, 17, 422, -83, -166, 1, -19, -36, 38, 19, 41], [70, -122, -29, 16, 2, -25, 33, -112, -135, -135, 28, -14, -14, 55, 55, 65], [148, -58, 51, -36, -75, -23, -97, -110, 115, 0, -50, 72, -25, 0, -28, -89], [-77, 135, -89, -10, -133, 37, 0, -73, 0, -67, -18, 4, -48, -22, 0, -16], [-8, -72, 40, 44, 34, -118, -40, 212, 34, 68, 40, 8, 48, -16, -8, -4], [38, -97, 19, -46, -25, -34, -106, -74, 94, 47, -82, 36, -17, -46, -92, -116], [-130, 35, 7, -2, -77, 18, 0, -64, 0, 25, 16, 66, 91, -50, 0, -26], [-275, -49, -58, -34, -11, -49, 67, 504, 53, 53, -46, 23, 23, -22, -22, -1], [409, 49, 11, 12, -11, 17, 12, -359, 6, 3, 62, -50, -44, 12, 24, 14], [212, 78, 53, 15, 37, -28, -134, -468, 2, 2, -44, 22, 22, -27, -27, -104], [16, 22, -19, 33, -80, 5, 48, 85, 48, 24, 134, -101, -77, 33, 66, 80], [-124, -120, 92, 4, 4, 42, -142, 248, 34, 34, 0, 0, 0, 4, 4, -134], [-115, 25, 5, 32, 0, 12, 14, 114, 310, 155, 31, 1, 8, 32, 64, 20], [-4, 178, -16, -80, -142, -10, 16, -178, 56, 112, 22, 4, -12, -8, -4, -68], [30, -32, -5, 34, 156, 44, 44, 0, 28, -28, 0, -58, 30, 17, -17, 44], [360, 33, 50, 24, -150, 26, 2, -154, 166, 0, 43, -52, -50, 0, 34, 12], [-2, -27, 34, -23, 30, 53, -34, -246, -125, -250, -58, 2, 36, -4, -2, -59], [263, -39, -53, -74, 19, -69, -69, 0, 39, -39, 0, -15, -153, 27, -27, -69], [-281, 48, -38, 57, -167, -20, -2, 124, 53, 0, -24, 33, 31, 0, -15, -74], [-23, 150, -26, 31, -51, -54, 26, 336, -41, -82, -40, 23, -3, -46, -23, 34], [122, 226, 48, 0, -18, 28, -68, -208, 140, 140, 36, -18, -18, 108, 108, -68], [7, -111, -47, -79, 10, 62, 47, -52, 19, 38, 19, -7, -54, 14, 7, -25], [536, -70, 19, -48, -101, -55, -129, -292, 63, 0, -26, 48, -81, 0, -4, -85], [149, -117, -54, -8, -36, -10, 98, -242, -173, -173, 56, -28, -28, -77, -77, 82], [153, 89, 50, 102, -44, 44, 44, 0, 31, -31, 0, -32, 56, 41, -41, 44], [213, -61, 31, -77, 38, 71, 0, 188, 0, -120, -6, -25, 77, 19, 0, -29], [22, -153, -53, -86, 21, -117, 53, -648, -59, -118, 47, -22, -75, 44, 22, -11], [-45, 174, -42, 28, 27, 1, 85, 92, -67, -67, 2, -1, -1, -2, -2, 141], [10, -46, -29, 69, 97, -2, -2, 0, 98, -98, 0, 64, 60, -59, 59, -2], [-24, -148, 51, 26, 169, -63, 0, -66, 0, -87, 26, -42, -54, 68, 0, 47], [-424, 37, 43, -70, 117, -10, -106, 396, 58, 29, -98, 28, -25, -70, -140, -124], [-52, 14, 14, -41, -19, -37, 0, -74, 0, 151, -9, -22, -45, 13, 0, -14], [-3, -19, 78, 92, 38, 114, -78, -150, 81, 162, 32, 3, 81, -6, -3, 11], [-428, 130, -47, -88, -106, 33, 127, 892, -19, -19, 36, -18, -18, -43, -43, -49], [-1, -107, -73, -59, 14, -12, 73, 158, -1, -2, 19, 1, -72, -2, -1, 13], [267, -25, 60, 3, 15, 120, 0, -558, 93, 93, -24, 12, 12, 33, 33, 6], [501, -50, 67, 158, 211, -19, -19, 0, 79, -79, 0, 47, 9, -25, 25, -19], [-117, 31, 15, 27, -52, 32, 49, 56, -451, 0, -9, 5, 54, 0, -13, 9], [374, 29, 140, -13, 34, 147, 14, -406, -314, -157, -45, 32, 39, -13, -26, -26], [72, -56, 0, -164, -46, 12, 0, 78, 0, 18, 34, 6, 18, 28, 0, -68], [-145, -97, -27, -62, 164, -18, -18, 0, -129, 129, 0, -32, -68, 12, -12, -18], [110, 344, 60, 36, -288, 4, 0, 84, 0, -356, -50, -26, 38, -24, 0, 6], [-559, 54, 49, 24, -81, -18, -18, 0, 90, -90, 0, -3, -39, -3, 3, -18], [107, -40, -58, -117, 146, -33, -8, -45, -4, 0, -60, -17, -25, 0, -137, -28], [366, 52, 35, -104, -74, -26, 0, 280, 0, -3, 26, -86, -77, 112, 0, 4], [-60, -217, 19, -38, -16, -3, -41, 76, -73, -73, -44, 22, 22, 43, 43, -117], [87, 192, -48, -75, -153, -93, 48, 280, -84, -168, 126, -87, -135, 174, 87, 60], [62, 77, 37, 143, 131, -16, -90, -100, -111, -111, 24, -12, -12, 56, 56, 196], [23, 84, -85, 63, 21, 26, 137, 38, 49, 0, 78, -99, 38, 0, 57, 131], [-157, -81, 93, 139, 143, -5, 0, -96, 0, -20, -46, 61, 149, -107, 0, 16], [-330, 102, 2, 18, -90, 62, 62, 0, -32, 32, 0, -96, 28, -28, 28, 62], [178, -7, -57, -15, -6, -129, -144, -202, -252, -126, -39, 24, -48, -15, -30, -182]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_135_i_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_135_3_i_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_135_3_i_a(:prec:=16)
    chi := MakeCharacter_135_i();
    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_135_3_i_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_135_3_i_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_135_i();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;