
// Make newform 1728.3.o.g in Magma, downloaded from the LMFDB on 22 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_1728_o();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1728_o_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_1728_3_o_g();".
// 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_1728_3_o_g();".
// 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 := [65536, -49152, 28672, -30720, 19456, -9216, 6784, -3648, 1552, -912, 424, -144, 76, -30, 7, -3, 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], [-1228800, 634880, -258048, 372736, -187904, 58368, -63104, 26384, -7664, 6280, -2224, 204, -394, 83, 17, 1], [-286720, 786432, -929792, 241664, -334080, 234112, -105376, 62224, -37088, 9048, -6984, 3440, -628, 371, -179, -17], [-1179648, 348160, -81920, 391168, -151552, 47360, -69760, 24336, -8688, 9672, -368, 796, -842, 59, -7, 41], [-1392640, 1650688, -939008, 621056, -422656, 230464, -117536, 68528, -31296, 13512, -6416, 2396, -756, 339, -79, 7], [-2695168, 1048576, -413696, 746496, -290560, 131456, -123488, 47472, -17184, 13736, -4472, 1360, -1116, 293, -37, 25], [-7045120, 2363392, -1673216, 1829888, -894464, 428416, -352128, 120656, -63664, 39144, -12352, 4100, -2762, 723, -135, 49], [3325952, -913408, 481280, -588800, 265216, -97664, 68928, -14736, 3984, -1768, -16, 356, -50, 169, -29, 63], [-2179072, -1241088, 894976, 500736, 113664, -146048, -81088, -19088, 17296, 8344, 2256, -652, -1090, -223, 283, 71], [892928, 212992, 458752, -374784, 42752, -92032, 74560, -13680, 17712, -8632, 2272, -1844, 786, -73, 125, -47], [1687552, 774144, 407552, -414720, -49152, -45184, 68800, 8240, 5264, -7240, -1104, -428, 862, 133, 23, -53], [-311296, 28672, 277504, -167424, 134912, -99008, 52480, -29680, 17808, -8312, 3880, -1960, 762, -255, 119, -37], [-1146880, 1658880, -813056, 707584, -457728, 256384, -168064, 85744, -43280, 22904, -9984, 4124, -1918, 593, -221, 75], [-638976, -913408, 244736, 306688, 87808, 25536, -65888, -2416, -7104, 9496, -16, 708, -1084, -7, -29, 85], [2146304, -4124672, 2381824, -1999872, 1183744, -712064, 435648, -237328, 101072, -59240, 24080, -10156, 4102, -1455, 459, -193], [1040384, -83968, 621056, -575744, 205312, -196512, 133440, -46048, 33120, -18080, 5420, -3126, 1510, -277, 163, -59]];
    Rf_basisdens := [1, 540672, 270336, 540672, 135168, 270336, 540672, 540672, 540672, 270336, 270336, 135168, 270336, 270336, 540672, 135168];
    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_1728_o();"
function MakeCharacter_1728_o()
    N := 1728;
    order := 6;
    char_gens := [703, 325, 1217];
    v := [3, 6, 4];
    // 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_1728_o_Hecke();"
function MakeCharacter_1728_o_Hecke( : Kf := false)
    N := 1728;
    order := 6;
    char_gens := [703, 325, 1217];
    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], [-1, 1, 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 := 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 := 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, 0, 0, 0, 0, 0, 0, 0, 0], [1, -1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, -1, 1, -1, 1, 0, 0, 0, 0, 0], [6, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], [-1, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 1, 0, -3, 0, -3], [0, 0, 1, 0, 0, 2, 0, 0, 0, -2, -1, 0, 1, 0, 0, 0], [0, 0, 2, 1, 0, -1, 0, -1, -2, 0, 0, 0, 3, 0, 0, 0], [0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, 2, 0], [0, 0, 0, 3, 0, 1, 0, 1, 0, 0, 0, 0, 5, 0, 0, 0], [-7, 0, 0, 0, 6, 0, -3, 0, 0, 0, 0, -6, 0, 1, 3, 1], [-8, 8, 0, 0, 0, 0, 3, 0, 0, 0, 0, 2, 0, 0, 0, 3], [0, 0, 0, 5, 0, 0, 0, 0, -2, -5, 6, 0, 0, 0, 0, 0], [0, 0, 0, 3, 0, 0, 0, 6, 3, -3, -2, 0, 0, 0, 0, 0], [-3, 0, 0, 0, -4, 0, 1, 0, 0, 0, 0, 4, 0, -3, -1, -3], [0, 0, 6, 3, 0, 6, 0, 6, -6, 0, 0, 0, 2, 0, 0, 0], [0, 12, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 7, -12, 0], [0, 0, -1, 11, 0, 9, 0, 9, 1, 0, 0, 0, -3, 0, 0, 0], [0, 0, -5, 0, 0, -5, 0, 0, 0, -22, -1, 0, 1, 0, 0, 0], [7, 0, 0, 0, -3, 0, -12, 0, 0, 0, 0, 3, 0, 5, 12, 5], [0, 0, 0, 11, 0, 0, 0, 5, 4, -11, -11, 0, 0, 0, 0, 0], [0, 0, 0, 1, 0, 0, 0, 26, 1, -1, -5, 0, 0, 0, 0, 0], [29, 0, 0, 0, -4, 0, 3, 0, 0, 0, 0, 4, 0, 9, -3, 9], [0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, -9, 0], [0, -37, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0, 0, 6, -3, 0], [0, 0, -3, 9, 0, 28, 0, 28, 3, 0, 0, 0, -4, 0, 0, 0], [0, 0, -7, 0, 0, 8, 0, 0, 0, -26, 13, 0, -13, 0, 0, 0], [-25, 0, 0, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 7, 9, 7], [-43, 43, 0, 0, 0, 0, -1, 0, 0, 0, 0, 3, 0, 0, 0, -12], [0, 0, -6, 0, 0, 0, 0, 0, 0, 12, -18, 0, 18, 0, 0, 0], [0, 0, -13, -23, 0, 14, 0, 14, 13, 0, 0, 0, -11, 0, 0, 0], [0, -94, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -3, -17, 0], [0, 0, 2, 5, 0, 36, 0, 36, -2, 0, 0, 0, -12, 0, 0, 0], [-32, 32, 0, 0, 0, 0, -2, 0, 0, 0, 0, -24, 0, 0, 0, 9], [0, 0, 0, 35, 0, 0, 0, 23, -8, -35, 13, 0, 0, 0, 0, 0], [-15, 15, 0, 0, 0, 0, 21, 0, 0, 0, 0, -12, 0, 0, 0, 22], [0, 0, 8, 0, 0, 4, 0, 0, 0, -16, -2, 0, 2, 0, 0, 0], [0, 0, 9, -21, 0, 12, 0, 12, -9, 0, 0, 0, 10, 0, 0, 0], [0, -131, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0], [0, 0, 14, 0, 0, -34, 0, 0, 0, -20, -2, 0, 2, 0, 0, 0], [73, 0, 0, 0, -24, 0, 3, 0, 0, 0, 0, 24, 0, -27, -3, -27], [0, 0, 0, 39, 0, 0, 0, 24, -15, -39, -26, 0, 0, 0, 0, 0], [12, -12, 0, 0, 0, 0, -3, 0, 0, 0, 0, 12, 0, 0, 0, 29], [10, 0, 0, 0, 28, 0, 6, 0, 0, 0, 0, -28, 0, 24, -6, 24], [0, 0, -3, 0, 0, 27, 0, 0, 0, -42, -3, 0, 3, 0, 0, 0], [0, 0, -2, 13, 0, 19, 0, 19, 2, 0, 0, 0, 38, 0, 0, 0], [0, 0, 0, 9, 0, 0, 0, -44, 15, -9, 38, 0, 0, 0, 0, 0], [0, 0, 0, 29, 0, 0, 0, 25, -25, -29, -9, 0, 0, 0, 0, 0], [-117, 117, 0, 0, 0, 0, -15, 0, 0, 0, 0, 6, 0, 0, 0, -8], [74, 0, 0, 0, 23, 0, 21, 0, 0, 0, 0, -23, 0, 18, -21, 18], [0, 0, -30, 9, 0, -9, 0, -9, 30, 0, 0, 0, 37, 0, 0, 0], [0, -51, 0, 0, -30, 0, 0, 0, 0, 0, 0, 0, 0, 8, 30, 0], [0, 0, 3, 0, 0, 0, 0, 0, 0, 18, -57, 0, 57, 0, 0, 0], [-79, 79, 0, 0, 0, 0, 14, 0, 0, 0, 0, 30, 0, 0, 0, 18], [0, 0, 0, 17, 0, 0, 0, 19, 14, -17, -1, 0, 0, 0, 0, 0], [163, 0, 0, 0, -26, 0, -21, 0, 0, 0, 0, 26, 0, -21, 21, -21], [0, 0, 22, 0, 0, 38, 0, 0, 0, 28, 8, 0, -8, 0, 0, 0], [0, 37, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 0, 38, 45, 0], [0, -46, 0, 0, -39, 0, 0, 0, 0, 0, 0, 0, 0, 15, 4, 0], [0, 0, 19, 43, 0, -44, 0, -44, -19, 0, 0, 0, 29, 0, 0, 0], [-65, 65, 0, 0, 0, 0, -23, 0, 0, 0, 0, 24, 0, 0, 0, 18], [0, 0, -3, 0, 0, -12, 0, 0, 0, -66, -3, 0, 3, 0, 0, 0], [0, 0, 8, -35, 0, -19, 0, -19, -8, 0, 0, 0, -45, 0, 0, 0], [0, -63, 0, 0, 12, 0, 0, 0, 0, 0, 0, 0, 0, 8, 6, 0], [0, -146, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 15, 32, 0], [0, 0, 0, -75, 0, 0, 0, -13, 18, 75, -38, 0, 0, 0, 0, 0], [-109, 109, 0, 0, 0, 0, -78, 0, 0, 0, 0, -30, 0, 0, 0, -38], [0, 0, -21, 81, 0, -27, 0, -27, 21, 0, 0, 0, -31, 0, 0, 0], [0, -59, 0, 0, -42, 0, 0, 0, 0, 0, 0, 0, 0, -34, -21, 0], [0, -206, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 0, -51, -15, 0], [0, 0, -32, 0, 0, -62, 0, 0, 0, 8, 26, 0, -26, 0, 0, 0], [0, 0, 0, -65, 0, 0, 0, -21, -46, 65, -39, 0, 0, 0, 0, 0], [40, -40, 0, 0, 0, 0, -66, 0, 0, 0, 0, 12, 0, 0, 0, 23], [0, 0, 48, 0, 0, -39, 0, 0, 0, 96, -72, 0, 72, 0, 0, 0], [0, 0, 13, 59, 0, 40, 0, 40, -13, 0, 0, 0, -28, 0, 0, 0], [0, -253, 0, 0, 50, 0, 0, 0, 0, 0, 0, 0, 0, -6, 39, 0], [35, 0, 0, 0, 84, 0, -33, 0, 0, 0, 0, -84, 0, 19, 33, 19], [-514, 514, 0, 0, 0, 0, -19, 0, 0, 0, 0, -18, 0, 0, 0, -27], [45, -45, 0, 0, 0, 0, -6, 0, 0, 0, 0, -48, 0, 0, 0, 20], [0, 0, -4, -89, 0, -37, 0, -37, 4, 0, 0, 0, 46, 0, 0, 0], [0, -108, 0, 0, -24, 0, 0, 0, 0, 0, 0, 0, 0, -5, 24, 0], [0, 0, -4, 0, 0, 98, 0, 0, 0, 64, -2, 0, 2, 0, 0, 0], [91, 0, 0, 0, -9, 0, 54, 0, 0, 0, 0, 9, 0, 5, -54, 5], [0, 0, 0, -41, 0, 0, 0, 51, 50, 41, -33, 0, 0, 0, 0, 0], [0, 0, 0, -57, 0, 0, 0, -42, 36, 57, -118, 0, 0, 0, 0, 0], [357, 0, 0, 0, 37, 0, 50, 0, 0, 0, 0, -37, 0, 3, -50, 3], [0, -144, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 29, -45, 0], [0, -244, 0, 0, -76, 0, 0, 0, 0, 0, 0, 0, 0, -51, -42, 0], [0, 0, -30, -57, 0, -113, 0, -113, 30, 0, 0, 0, 41, 0, 0, 0], [0, 0, -51, 0, 0, -78, 0, 0, 0, 6, -81, 0, 81, 0, 0, 0], [0, 0, 0, 25, 0, 0, 0, -133, 22, -25, 9, 0, 0, 0, 0, 0], [0, 0, 44, 0, 0, -50, 0, 0, 0, 32, 10, 0, -10, 0, 0, 0], [0, 0, 44, 103, 0, 50, 0, 50, -44, 0, 0, 0, -56, 0, 0, 0], [0, 0, 70, -35, 0, -14, 0, -14, -70, 0, 0, 0, -16, 0, 0, 0], [0, 0, -27, 0, 0, -87, 0, 0, 0, 6, -39, 0, 39, 0, 0, 0], [-172, 172, 0, 0, 0, 0, -108, 0, 0, 0, 0, 52, 0, 0, 0, -51], [330, 0, 0, 0, -53, 0, -13, 0, 0, 0, 0, 53, 0, -6, 13, -6], [0, 0, -53, 0, 0, -37, 0, 0, 0, 82, -19, 0, 19, 0, 0, 0], [-178, 0, 0, 0, -60, 0, -6, 0, 0, 0, 0, 60, 0, -32, 6, -32], [0, 0, 0, -21, 0, 0, 0, 29, 33, 21, 67, 0, 0, 0, 0, 0], [289, 0, 0, 0, -62, 0, 123, 0, 0, 0, 0, 62, 0, 69, -123, 69], [0, 0, 65, 37, 0, -109, 0, -109, -65, 0, 0, 0, 7, 0, 0, 0], [0, 83, 0, 0, 84, 0, 0, 0, 0, 0, 0, 0, 0, 84, -50, 0], [0, 0, 1, 31, 0, -167, 0, -167, -1, 0, 0, 0, 101, 0, 0, 0], [109, 0, 0, 0, -33, 0, -78, 0, 0, 0, 0, 33, 0, -61, 78, -61], [0, 0, 0, -21, 0, 0, 0, -168, 18, 21, 86, 0, 0, 0, 0, 0], [251, 0, 0, 0, 62, 0, -39, 0, 0, 0, 0, -62, 0, 63, 39, 63], [0, 0, -19, -77, 0, -184, 0, -184, 19, 0, 0, 0, 42, 0, 0, 0], [0, 282, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 11, -21, 0], [0, 0, 85, 25, 0, -102, 0, -102, -85, 0, 0, 0, 36, 0, 0, 0], [-137, 0, 0, 0, -60, 0, 39, 0, 0, 0, 0, 60, 0, 15, -39, 15], [-184, 184, 0, 0, 0, 0, -91, 0, 0, 0, 0, -48, 0, 0, 0, 39], [0, 0, 0, -117, 0, 0, 0, -79, -27, 117, -11, 0, 0, 0, 0, 0], [0, 0, -50, 0, 0, -118, 0, 0, 0, -116, -76, 0, 76, 0, 0, 0], [0, -565, 0, 0, -6, 0, 0, 0, 0, 0, 0, 0, 0, 72, -26, 0], [0, 0, 17, -121, 0, 33, 0, 33, -17, 0, 0, 0, 15, 0, 0, 0], [0, 0, 56, 0, 0, -10, 0, 0, 0, -8, -50, 0, 50, 0, 0, 0], [-223, 223, 0, 0, 0, 0, 15, 0, 0, 0, 0, -44, 0, 0, 0, 120], [0, 0, 0, -93, 0, 0, 0, -15, 54, 93, -64, 0, 0, 0, 0, 0], [-183, 183, 0, 0, 0, 0, 45, 0, 0, 0, 0, -90, 0, 0, 0, 10], [0, 252, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, -37, -30, 0], [0, 263, 0, 0, -16, 0, 0, 0, 0, 0, 0, 0, 0, 66, -75, 0], [0, 0, -11, 0, 0, 136, 0, 0, 0, 62, -19, 0, 19, 0, 0, 0], [0, 0, 0, 99, 0, 0, 0, 8, -27, -99, -71, 0, 0, 0, 0, 0], [391, 0, 0, 0, 52, 0, -99, 0, 0, 0, 0, -52, 0, 99, 99, 99], [0, 51, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, -152, -39, 0], [0, 0, 12, 0, 0, 24, 0, 0, 0, 120, -60, 0, 60, 0, 0, 0], [0, 0, 0, -1, 0, 0, 0, 125, -38, 1, 85, 0, 0, 0, 0, 0], [-32, 32, 0, 0, 0, 0, 102, 0, 0, 0, 0, 6, 0, 0, 0, 107], [0, 0, -6, 0, 0, -45, 0, 0, 0, -84, 30, 0, -30, 0, 0, 0], [0, 0, -9, -33, 0, 96, 0, 96, 9, 0, 0, 0, -104, 0, 0, 0], [0, 0, -77, 85, 0, -144, 0, -144, 77, 0, 0, 0, 0, 0, 0, 0], [-26, 0, 0, 0, 48, 0, -60, 0, 0, 0, 0, -48, 0, 0, 60, 0], [230, -230, 0, 0, 0, 0, -4, 0, 0, 0, 0, 15, 0, 0, 0, -21], [81, -81, 0, 0, 0, 0, 147, 0, 0, 0, 0, 87, 0, 0, 0, 2], [211, 0, 0, 0, 16, 0, 21, 0, 0, 0, 0, -16, 0, -129, -21, -129], [0, 0, -79, -49, 0, -54, 0, -54, 79, 0, 0, 0, 51, 0, 0, 0], [-164, 164, 0, 0, 0, 0, 64, 0, 0, 0, 0, -84, 0, 0, 0, 21], [-175, 0, 0, 0, 65, 0, -114, 0, 0, 0, 0, -65, 0, 15, 114, 15], [0, 0, 63, 0, 0, 162, 0, 0, 0, 114, 213, 0, -213, 0, 0, 0], [0, 124, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, -39, 122, 0], [0, 0, 28, -125, 0, 45, 0, 45, -28, 0, 0, 0, -45, 0, 0, 0], [0, 0, 58, 0, 0, 10, 0, 0, 0, 116, 26, 0, -26, 0, 0, 0], [-293, 0, 0, 0, -78, 0, 93, 0, 0, 0, 0, 78, 0, 39, -93, 39], [0, 0, 0, 199, 0, 0, 0, 62, -95, -199, 6, 0, 0, 0, 0, 0], [0, -260, 0, 0, 42, 0, 0, 0, 0, 0, 0, 0, 0, 23, -78, 0], [0, 368, 0, 0, -21, 0, 0, 0, 0, 0, 0, 0, 0, -123, 118, 0], [0, 0, -29, 67, 0, -17, 0, -17, 29, 0, 0, 0, -7, 0, 0, 0], [0, 0, -70, 0, 0, -58, 0, 0, 0, 4, -80, 0, 80, 0, 0, 0], [396, -396, 0, 0, 0, 0, -132, 0, 0, 0, 0, 60, 0, 0, 0, -125], [405, 0, 0, 0, 16, 0, 131, 0, 0, 0, 0, -16, 0, 9, -131, 9], [0, 0, -5, 0, 0, -118, 0, 0, 0, -38, -151, 0, 151, 0, 0, 0], [0, 0, -46, -263, 0, -115, 0, -115, 46, 0, 0, 0, -15, 0, 0, 0], [0, 0, 0, 9, 0, 0, 0, 32, -48, -9, 16, 0, 0, 0, 0, 0], [0, 0, 0, 25, 0, 0, 0, 101, 58, -25, -117, 0, 0, 0, 0, 0], [0, 0, 44, 0, 0, -158, 0, 0, 0, -160, 34, 0, -34, 0, 0, 0], [0, -148, 0, 0, -27, 0, 0, 0, 0, 0, 0, 0, 0, -3, 118, 0], [13, 0, 0, 0, 30, 0, -33, 0, 0, 0, 0, -30, 0, -31, 33, -31], [-899, 899, 0, 0, 0, 0, -47, 0, 0, 0, 0, 54, 0, 0, 0, -24], [0, 0, 0, -143, 0, 0, 0, 161, 97, 143, -35, 0, 0, 0, 0, 0], [-259, 0, 0, 0, -31, 0, 18, 0, 0, 0, 0, 31, 0, 3, -18, 3], [0, 0, -24, 99, 0, 103, 0, 103, 24, 0, 0, 0, 161, 0, 0, 0], [0, 0, -29, 0, 0, 19, 0, 0, 0, -46, -31, 0, 31, 0, 0, 0], [-395, 395, 0, 0, 0, 0, 108, 0, 0, 0, 0, -16, 0, 0, 0, 186], [0, 0, 0, -39, 0, 0, 0, -51, 30, 39, 97, 0, 0, 0, 0, 0], [0, 0, 18, 0, 0, 246, 0, 0, 0, 84, -48, 0, 48, 0, 0, 0], [0, 81, 0, 0, -84, 0, 0, 0, 0, 0, 0, 0, 0, 190, -69, 0], [637, 0, 0, 0, -90, 0, 99, 0, 0, 0, 0, 90, 0, 65, -99, 65], [674, -674, 0, 0, 0, 0, 66, 0, 0, 0, 0, 88, 0, 0, 0, -9], [0, 0, 0, 159, 0, 0, 0, -24, -108, -159, 68, 0, 0, 0, 0, 0], [-744, 744, 0, 0, 0, 0, -72, 0, 0, 0, 0, -108, 0, 0, 0, 7], [0, 0, -26, 113, 0, 157, 0, 157, 26, 0, 0, 0, 137, 0, 0, 0], [0, -24, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 113, 45, 0], [0, 0, 55, 37, 0, -18, 0, -18, -55, 0, 0, 0, 162, 0, 0, 0], [337, -337, 0, 0, 0, 0, -117, 0, 0, 0, 0, 41, 0, 0, 0, 12], [0, 0, 0, 189, 0, 0, 0, -28, -30, -189, -14, 0, 0, 0, 0, 0], [-275, 0, 0, 0, -38, 0, -69, 0, 0, 0, 0, 38, 0, 105, 69, 105], [0, 0, -92, 0, 0, 248, 0, 0, 0, -56, 68, 0, -68, 0, 0, 0], [0, -303, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 106, 87, 0], [0, 0, 0, 201, 0, 0, 0, 64, 15, -201, -154, 0, 0, 0, 0, 0], [0, 0, 0, 195, 0, 0, 0, 12, 42, -195, 104, 0, 0, 0, 0, 0], [75, -75, 0, 0, 0, 0, -3, 0, 0, 0, 0, 66, 0, 0, 0, 64], [-609, 0, 0, 0, -131, 0, 98, 0, 0, 0, 0, 131, 0, -87, -98, -87], [0, 0, 125, 67, 0, -58, 0, -58, -125, 0, 0, 0, 18, 0, 0, 0], [0, 1234, 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 51, -82, 0], [494, 0, 0, 0, 126, 0, 126, 0, 0, 0, 0, -126, 0, 4, -126, 4], [0, 0, 0, 227, 0, 0, 0, -48, 13, -227, 105, 0, 0, 0, 0, 0], [-997, 997, 0, 0, 0, 0, -36, 0, 0, 0, 0, -126, 0, 0, 0, -14], [0, 0, -32, 0, 0, 100, 0, 0, 0, -208, -40, 0, 40, 0, 0, 0], [-461, 0, 0, 0, -135, 0, -36, 0, 0, 0, 0, 135, 0, -79, 36, -79], [0, 0, 0, 49, 0, 0, 0, 59, 145, -49, 25, 0, 0, 0, 0, 0], [0, 0, 139, 0, 0, 212, 0, 0, 0, -14, -13, 0, 13, 0, 0, 0], [0, -209, 0, 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, 30, 101, 0], [0, 0, 9, 0, 0, -138, 0, 0, 0, -114, -129, 0, 129, 0, 0, 0], [865, -865, 0, 0, 0, 0, -42, 0, 0, 0, 0, -16, 0, 0, 0, -114], [-84, 84, 0, 0, 0, 0, -165, 0, 0, 0, 0, 102, 0, 0, 0, 41], [0, -347, 0, 0, -234, 0, 0, 0, 0, 0, 0, 0, 0, -130, 135, 0], [0, 305, 0, 0, -102, 0, 0, 0, 0, 0, 0, 0, 0, 66, -170, 0], [0, 0, 6, 0, 0, 60, 0, 0, 0, -204, -198, 0, 198, 0, 0, 0], [91, -91, 0, 0, 0, 0, 121, 0, 0, 0, 0, 18, 0, 0, 0, -30], [0, 0, 0, 197, 0, 0, 0, -22, -71, -197, 238, 0, 0, 0, 0, 0], [-35, 35, 0, 0, 0, 0, -51, 0, 0, 0, 0, 186, 0, 0, 0, -130], [0, 135, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, -82, -210, 0], [0, 0, 21, 0, 0, -114, 0, 0, 0, -138, -105, 0, 105, 0, 0, 0], [207, 0, 0, 0, -52, 0, -11, 0, 0, 0, 0, 52, 0, -165, 11, -165], [0, 0, 18, 0, 0, 6, 0, 0, 0, 132, -24, 0, 24, 0, 0, 0], [0, 0, 2, -5, 0, -76, 0, -76, -2, 0, 0, 0, 34, 0, 0, 0], [0, 655, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 36, -12, 0], [0, 0, -2, 205, 0, 100, 0, 100, 2, 0, 0, 0, 116, 0, 0, 0], [449, 0, 0, 0, -63, 0, 144, 0, 0, 0, 0, 63, 0, 195, -144, 195], [1378, -1378, 0, 0, 0, 0, -20, 0, 0, 0, 0, -90, 0, 0, 0, 75], [0, 0, 0, 13, 0, 0, 0, 150, 41, -13, -60, 0, 0, 0, 0, 0], [0, 0, 0, -117, 0, 0, 0, 189, -42, 117, 14, 0, 0, 0, 0, 0], [0, 0, 29, 67, 0, 428, 0, 428, -29, 0, 0, 0, -246, 0, 0, 0], [0, 11, 0, 0, -66, 0, 0, 0, 0, 0, 0, 0, 0, -158, 192, 0], [0, 0, -60, -261, 0, 61, 0, 61, 60, 0, 0, 0, 41, 0, 0, 0], [0, -370, 0, 0, 222, 0, 0, 0, 0, 0, 0, 0, 0, -99, 187, 0], [0, 0, -136, 0, 0, -394, 0, 0, 0, 88, -2, 0, 2, 0, 0, 0], [166, -166, 0, 0, 0, 0, -242, 0, 0, 0, 0, -78, 0, 0, 0, -129], [174, -174, 0, 0, 0, 0, 60, 0, 0, 0, 0, -6, 0, 0, 0, 37], [0, 0, -39, -279, 0, -98, 0, -98, 39, 0, 0, 0, -58, 0, 0, 0], [446, -446, 0, 0, 0, 0, -91, 0, 0, 0, 0, 42, 0, 0, 0, -195], [0, 0, -40, 0, 0, -170, 0, 0, 0, -232, -2, 0, 2, 0, 0, 0], [0, 0, 234, -93, 0, 30, 0, 30, -234, 0, 0, 0, 116, 0, 0, 0], [0, 513, 0, 0, -18, 0, 0, 0, 0, 0, 0, 0, 0, -110, 45, 0], [0, 1243, 0, 0, -59, 0, 0, 0, 0, 0, 0, 0, 0, -18, -9, 0], [0, 0, 146, 0, 0, 98, 0, 0, 0, -188, -8, 0, 8, 0, 0, 0], [0, 0, 0, -189, 0, 0, 0, -65, 168, 189, -283, 0, 0, 0, 0, 0], [0, 0, 0, -145, 0, 0, 0, 343, 116, 145, -270, 0, 0, 0, 0, 0], [-1311, 1311, 0, 0, 0, 0, -45, 0, 0, 0, 0, -54, 0, 0, 0, -38], [0, 0, -140, 0, 0, 56, 0, 0, 0, -56, 158, 0, -158, 0, 0, 0], [0, 0, -42, 231, 0, 181, 0, 181, 42, 0, 0, 0, -193, 0, 0, 0], [1115, -1115, 0, 0, 0, 0, -100, 0, 0, 0, 0, -54, 0, 0, 0, 144], [0, 0, 0, 249, 0, 0, 0, 125, -48, -249, -182, 0, 0, 0, 0, 0], [0, 0, 0, -177, 0, 0, 0, -264, 117, 177, 250, 0, 0, 0, 0, 0], [354, -354, 0, 0, 0, 0, -60, 0, 0, 0, 0, -21, 0, 0, 0, 185], [-1437, 0, 0, 0, -64, 0, -95, 0, 0, 0, 0, 64, 0, 15, 95, 15], [0, 0, -126, -261, 0, 54, 0, 54, 126, 0, 0, 0, -298, 0, 0, 0], [0, 0, -146, 0, 0, 388, 0, 0, 0, -172, 194, 0, -194, 0, 0, 0], [0, 0, 0, -37, 0, 0, 0, -188, 62, 37, 336, 0, 0, 0, 0, 0], [0, 0, -10, 0, 0, -26, 0, 0, 0, 188, 118, 0, -118, 0, 0, 0], [0, 0, 125, 449, 0, -58, 0, -58, -125, 0, 0, 0, -50, 0, 0, 0], [619, 0, 0, 0, -42, 0, 165, 0, 0, 0, 0, 42, 0, 159, -165, 159], [34, -34, 0, 0, 0, 0, -117, 0, 0, 0, 0, -100, 0, 0, 0, -27], [0, 0, 0, -429, 0, 0, 0, -156, -21, 429, -170, 0, 0, 0, 0, 0], [0, 0, -176, 0, 0, 92, 0, 0, 0, -416, 140, 0, -140, 0, 0, 0], [0, 0, -113, 257, 0, 121, 0, 121, 113, 0, 0, 0, 207, 0, 0, 0], [0, 0, -192, -135, 0, -235, 0, -235, 192, 0, 0, 0, 196, 0, 0, 0], [0, 0, 0, 0, 0, -162, 0, 0, 0, 72, 210, 0, -210, 0, 0, 0], [750, -750, 0, 0, 0, 0, -120, 0, 0, 0, 0, 84, 0, 0, 0, -143], [137, 0, 0, 0, 131, 0, -228, 0, 0, 0, 0, -131, 0, -21, 228, -21], [0, 0, -52, 349, 0, 47, 0, 47, 52, 0, 0, 0, 165, 0, 0, 0], [0, 93, 0, 0, -117, 0, 0, 0, 0, 0, 0, 0, 0, 122, -63, 0], [0, 265, 0, 0, 198, 0, 0, 0, 0, 0, 0, 0, 0, 156, 125, 0], [0, 0, 46, 0, 0, 91, 0, 0, 0, 116, 62, 0, -62, 0, 0, 0], [143, 0, 0, 0, -264, 0, -129, 0, 0, 0, 0, 264, 0, -65, 129, -65], [0, 0, 0, -131, 0, 0, 0, 367, -58, 131, -214, 0, 0, 0, 0, 0], [-1010, 0, 0, 0, -32, 0, 126, 0, 0, 0, 0, 32, 0, 204, -126, 204], [1613, 0, 0, 0, -75, 0, -12, 0, 0, 0, 0, 75, 0, -33, 12, -33], [0, 0, 0, -117, 0, 0, 0, 97, -84, 117, 113, 0, 0, 0, 0, 0], [0, 0, 0, -165, 0, 0, 0, -330, -102, 165, -70, 0, 0, 0, 0, 0], [-447, 447, 0, 0, 0, 0, 189, 0, 0, 0, 0, -162, 0, 0, 0, 322], [-263, 0, 0, 0, -168, 0, -69, 0, 0, 0, 0, 168, 0, 69, 69, 69], [-632, 632, 0, 0, 0, 0, 258, 0, 0, 0, 0, 323, 0, 0, 0, -159], [0, 0, 0, -217, 0, 0, 0, -351, 175, 217, 177, 0, 0, 0, 0, 0], [1351, 0, 0, 0, -206, 0, 75, 0, 0, 0, 0, 206, 0, 207, -75, 207], [0, 629, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 66, -170, 0], [0, 0, -13, -277, 0, -27, 0, -27, 13, 0, 0, 0, -177, 0, 0, 0], [424, -424, 0, 0, 0, 0, 94, 0, 0, 0, 0, -108, 0, 0, 0, -183], [120, -120, 0, 0, 0, 0, -84, 0, 0, 0, 0, -240, 0, 0, 0, 271], [0, 0, 2, 0, 0, 34, 0, 0, 0, 20, 286, 0, -286, 0, 0, 0], [0, -439, 0, 0, -78, 0, 0, 0, 0, 0, 0, 0, 0, 268, -156, 0], [0, 0, -27, -63, 0, -116, 0, -116, 27, 0, 0, 0, 386, 0, 0, 0], [-396, 396, 0, 0, 0, 0, -117, 0, 0, 0, 0, 18, 0, 0, 0, -103], [0, 0, -40, 0, 0, -452, 0, 0, 0, 128, -104, 0, 104, 0, 0, 0], [0, 0, 29, -443, 0, -268, 0, -268, -29, 0, 0, 0, -101, 0, 0, 0], [0, 1080, 0, 0, -48, 0, 0, 0, 0, 0, 0, 0, 0, 199, 66, 0], [-509, 0, 0, 0, 153, 0, -36, 0, 0, 0, 0, -153, 0, 305, 36, 305], [0, 0, 0, 301, 0, 0, 0, -319, -65, -301, 31, 0, 0, 0, 0, 0], [0, 0, 75, 111, 0, -192, 0, -192, -75, 0, 0, 0, 442, 0, 0, 0], [0, 0, 47, 557, 0, 26, 0, 26, -47, 0, 0, 0, -248, 0, 0, 0], [0, 0, 0, -427, 0, 0, 0, -455, -4, 427, -169, 0, 0, 0, 0, 0], [0, -513, 0, 0, 336, 0, 0, 0, 0, 0, 0, 0, 0, -104, -57, 0], [0, 0, 316, -47, 0, -140, 0, -140, -316, 0, 0, 0, -46, 0, 0, 0], [0, 0, 89, 0, 0, -229, 0, 0, 0, -50, -347, 0, 347, 0, 0, 0], [895, 0, 0, 0, 72, 0, 189, 0, 0, 0, 0, -72, 0, -109, -189, -109], [1271, -1271, 0, 0, 0, 0, -81, 0, 0, 0, 0, 82, 0, 0, 0, 54], [0, 0, 0, -627, 0, 0, 0, -104, 93, 627, 134, 0, 0, 0, 0, 0], [434, 0, 0, 0, -157, 0, 57, 0, 0, 0, 0, 157, 0, -270, -57, -270], [0, 8, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, -75, -192, 0], [0, 0, 112, 0, 0, 343, 0, 0, 0, 368, -100, 0, 100, 0, 0, 0], [1499, -1499, 0, 0, 0, 0, -16, 0, 0, 0, 0, 258, 0, 0, 0, 0], [0, 0, 105, 165, 0, -75, 0, -75, -105, 0, 0, 0, 95, 0, 0, 0], [0, -681, 0, 0, -144, 0, 0, 0, 0, 0, 0, 0, 0, -80, -63, 0], [-197, 197, 0, 0, 0, 0, 49, 0, 0, 0, 0, 162, 0, 0, 0, -30], [0, 0, 0, 175, 0, 0, 0, -459, -154, -175, 267, 0, 0, 0, 0, 0], [0, 1714, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, -153, 68, 0], [0, 0, -4, 0, 0, 32, 0, 0, 0, 184, 322, 0, -322, 0, 0, 0], [0, 0, 0, -373, 0, 0, 0, -168, -71, 373, 261, 0, 0, 0, 0, 0], [-573, 573, 0, 0, 0, 0, -120, 0, 0, 0, 0, -258, 0, 0, 0, -142], [27, 0, 0, 0, 56, 0, -95, 0, 0, 0, 0, -56, 0, -441, 95, -441], [0, 0, -144, 0, 0, -144, 0, 0, 0, -480, 204, 0, -204, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1728_o_Hecke( : Kf := Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1728_3_o_g();".
// 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_1728_3_o_g(:prec:=16)
    chi := MakeCharacter_1728_o();
    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_1728_3_o_g();".
// 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_1728_3_o_g( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1728_o();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<5,R![87616, -75480, 49337, -15291, 3870, -351, 62, -3, 1]>,<7,R![4430766096, 0, -13013727948, 0, 37316185677, 0, -2633438061, 0, 141530490, 0, -2674161, 0, 37002, 0, -225, 0, 1]>],Snew);
    return Vf;
end function;