
// Make newform 1600.3.g.k in Magma, downloaded from the LMFDB on 17 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1600_g();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1600_g_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_1600_3_g_k();".
// 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_1600_3_g_k();".
// 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 := [1, 0, 19, 0, 301, 0, 1102, 0, 3238, 0, 1102, 0, 301, 0, 19, 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], [-7647, 0, 2904, 0, 45980, 0, 1399796, 0, 487388, 0, 142780, 0, 9043, 0, 484, 0], [913, 0, 25230, 0, 68750, 0, 252226, 0, 86110, 0, 23950, 0, 1513, 0, 80, 0], [-1729, 0, 360, 0, 5700, 0, 173642, 0, 60420, 0, 17700, 0, 1121, 0, 60, 0], [25383, 0, -1836, 0, -29070, 0, -885934, 0, -308142, 0, -90270, 0, -5717, 0, -306, 0], [-10979, 0, -297502, 0, -937805, 0, -3201253, 0, -1092309, 0, -302005, 0, -19074, 0, -1007, 0], [28792, 0, 724196, 0, 3514575, 0, 9992809, 0, 3403067, 0, 925575, 0, 58417, 0, 3071, 0], [0, -2802, 0, -24119, 0, -71420, 0, -278884, 0, -95408, 0, -26620, 0, -1682, 0, -89], [0, -121760, 0, -1079482, 0, -4329720, 0, -7726640, 0, -2590264, 0, -668520, 0, -42080, 0, -2182], [999, 0, 25980, 0, 105880, 0, 322398, 0, 109880, 0, 30080, 0, 1899, 0, 100, 0], [0, 13593, 0, 120186, 0, 470675, 0, 908011, 0, 305247, 0, 79675, 0, 5018, 0, 261], [0, 1197, 0, 84304, 0, 353115, 0, 1205379, 0, 411883, 0, 113715, 0, 7182, 0, 379], [0, -3090, 0, -312479, 0, -911550, 0, -3111630, 0, -1061058, 0, -293550, 0, -18540, 0, -979], [0, 73006, 0, 638156, 0, 2241078, 0, 5904250, 0, 2003312, 0, 542118, 0, 34204, 0, 1796], [0, 1203, 0, 100416, 0, 354885, 0, 1211421, 0, 413597, 0, 114285, 0, 7218, 0, 381], [0, 9370, 0, 695947, 0, 2764150, 0, 9435590, 0, 3223394, 0, 890150, 0, 56220, 0, 2967]];
    Rf_basisdens := [1, 3900, 300, 150, 650, 1950, 5850, 150, 2925, 75, 300, 300, 650, 585, 100, 390];
    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_1600_g();"
function MakeCharacter_1600_g()
    N := 1600;
    order := 2;
    char_gens := [1151, 901, 577];
    v := [1, 1, 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_1600_g_Hecke();"
function MakeCharacter_1600_g_Hecke(Kf)
    N := 1600;
    order := 2;
    char_gens := [1151, 901, 577];
    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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,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, 0, 11], [0, 0, 0, 0, 0, 0, 0, 19, 0, 0, -39, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 53, 0, 0, -18, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, -18], [0, -43, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 33, -90, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -8, 0, 0, 14], [0, 0, 0, 0, 0, 0, 0, 0, -17, 0, 0, 0, 0, 4, 0, 0], [0, 0, -71, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -28, 0, 0, 47, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 15, 0], [0, 0, 15, 0, 0, 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 14, -19, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -17, 0, 0, 9, 0, 0, 0, 0, 0], [24, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-253, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 74, 0, 0, -17, 0], [0, 0, 0, 0, 0, 42, -21, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, -23, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 17], [0, 0, 0, 0, 0, 0, 0, 0, -35, 0, 0, 0, 0, 8, 0, 0], [0, -165, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [225, 0, 0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 0, 0, 0, 0, 58, 0, 0, -28], [0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 33, 0, 0], [-289, 0, 0, -29, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 15, 0, 0, 0, 0, 0, 0, 51, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -5, 0, 0, -105, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, -4], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 133, 0, 0, -48, 0], [0, 0, 0, 0, 0, 0, 0, 0, -77, 0, 0, 0, 0, 2, 0, 0], [723, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -167, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 93, 0, 0, 0, 0, 0, 0, -30, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 67, 0, 0, 15, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -80, 0, 0, 41, 0], [0, 0, 0, 0, 0, 96, 45, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -14, 0, 0, -17], [0, 0, 0, 0, 0, 0, 0, 49, 0, 0, -7, 0, 0, 0, 0, 0], [0, 135, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, -24, 0], [0, 0, 0, 0, 0, -104, 43, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 35, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, -5, 0, 0], [0, 0, -67, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 2, 0, 0, -17, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -72, 0, 0, 33, 0], [0, 0, 3, 0, 0, 0, 0, 0, 0, 70, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, -28, 0, 0], [0, 0, 0, 0, 0, 0, 0, 82, 0, 0, -71, 0, 0, 0, 0, 0], [96, 0, 0, -30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [950, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -63, 0, 0, 63, 0, 0, 0, 0, 0], [0, -125, 0, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -69, 0, 0, -71, 0, 0, 0, 0, 0], [186, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180, 0, 0, 51, 0], [0, 0, 0, 0, 0, -100, 121, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 29, 0, 0, 0, 0, 0, 0, -89, 0, 0, 0, 0, 0, 0], [0, 21, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 54, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0, 0, -58, 0, 0], [0, 0, 0, 0, 0, 0, 0, -73, 0, 0, -25, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -43, 0, 0, -69], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -13, 0, 0, -78, 0], [0, 0, 157, 0, 0, 0, 0, 0, 0, -73, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -40, 0, 0, 89, 0, 0, 0, 0, 0], [189, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 237, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 37, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0], [0, 97, 0, 0, 48, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, 0, 0, 39, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 13, 0, 0], [789, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 61, 0, 0, 22], [0, 0, 0, 0, 0, -221, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 131, 0, 0, -17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -65, 0, 0, -23], [0, 0, 95, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -247, 0, 0, 2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -52, 0, 0, 59], [0, 0, 255, 0, 0, 0, 0, 0, 0, -16, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -36, 0, 0, 0, 0, -68, 0, 0], [0, 0, 0, 0, 0, 0, 0, -181, 0, 0, 81, 0, 0, 0, 0, 0], [-698, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -141, 0, 0, -9, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -442, 0, 0, 11, 0], [0, 0, 0, 0, 0, 119, -54, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 157, 0, 0, 0, 0, 4, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -53, 0, 0, -102], [0, 0, 0, 0, 0, 0, 0, 0, 78, 0, 0, 0, 0, -4, 0, 0], [246, 0, 0, -112, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -106, 0, 0, 81, 0], [0, 0, 0, 0, 0, -87, -158, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 69, 0, 0, 0, 0, 0, 0, -109, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -140, 189, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -71, 0, 0, 0, 0, 0, 0, 164, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -331, 0, 0, -50, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 23, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -123, 0, 0, 32], [0, 0, -239, 0, 0, 0, 0, 0, 0, -11, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -81, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 153, 0, 0, 0, 0, 0], [0, 41, 0, 0, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-205, 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -64, 0, 0, 0, 0, -58, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, -48], [0, 319, 0, 0, 36, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 285, 0, 0, -66, 0], [0, 0, 0, 0, 0, -236, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -105, 0, 0, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 87, 0, 0, 12], [-823, 0, 0, -79, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 73, 0, 0, -105, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, -42], [0, 0, -131, 0, 0, 0, 0, 0, 0, -65, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -7, -142, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -38, 0, 0, 0, 0, 26, 0, 0], [0, 0, 0, 0, 0, 0, 0, -145, 0, 0, 97, 0, 0, 0, 0, 0], [316, 0, 0, -158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -185, 0, 0, 70, 0], [0, 0, 0, 0, 0, 0, 0, -16, 0, 0, -23, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 5, 0, 0], [0, -175, 0, 0, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [462, 0, 0, -40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 59, 0, 0, -96, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 0, 0, 23], [0, 0, 0, 0, 0, -78, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 47, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 0, 0], [0, -83, 0, 0, -31, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 227, 0, 0, 0, 0, 17, 0, 0], [-1295, 0, 0, -55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 289, 0, 0, 0, 0, 0, 0, -80, 0, 0, 0, 0, 0, 0], [144, 0, 0, 202, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -33, 0, 0, 0, 0, 0, 0, 91, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 159, 0, 0, -129, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -112, -183, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, 20, 0, 0], [1536, 0, 0, -58, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 211, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0], [0, -53, 0, 0, 11, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 92, -201, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 0, 0, 52], [0, 0, 0, 0, 0, 0, 0, 0, -48, 0, 0, 0, 0, 51, 0, 0], [0, 0, 211, 0, 0, 0, 0, 0, 0, -191, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -515, 0, 0, 14, 0], [0, 0, 0, 0, 0, 0, 0, 195, 0, 0, 15, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 466, 0, 0, -57, 0], [0, 0, 0, 0, 0, 0, 0, 0, -16, 0, 0, 0, 0, 82, 0, 0], [603, 0, 0, -89, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -273, 0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, -87, 0, 0, 0, 0, 0, 0, -84, 0, 0, 0, 0, 0, 0], [-1007, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -115, 0, 0, -305, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 191, 0, 0, -2, 0], [0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, -14, 0, 0], [0, 261, 0, 0, -25, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -104, 0, 0, 63, 0], [0, 0, 7, 0, 0, 0, 0, 0, 0, 92, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 257, -198, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, 0, 0, -36], [0, 0, 0, 0, 0, 0, 0, 0, -23, 0, 0, 0, 0, -74, 0, 0], [0, 0, -55, 0, 0, 0, 0, 0, 0, -44, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 58, 0, 0, 61, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 367, 0, 0, 54, 0], [0, 0, -435, 0, 0, 0, 0, 0, 0, -25, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 149, 0, 0, 177, 0, 0, 0, 0, 0], [1740, 0, 0, -74, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 321, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0], [-1535, 0, 0, -35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -164, 0, 0, 279, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -37, 0, 0, -142, 0], [0, 0, 0, 0, 0, 341, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 293, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -70, 0, 0, 89, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -95, 0, 0, 41], [0, 0, 201, 0, 0, 0, 0, 0, 0, -223, 0, 0, 0, 0, 0, 0], [0, 191, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -13, -270, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 184, 0, 0, -153, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -174, 0, 0, 73], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 440, 0, 0, 9, 0], [0, 0, 0, 0, 0, 97, 74, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-390, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 611, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -126, 0, 0, 39, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -105, 414, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 299, 0, 0, 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -79, 0, 0, 112], [0, 0, 0, 0, 0, 0, 0, 0, 96, 0, 0, 0, 0, 71, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -58, 0, 0, -94], [0, 0, 155, 0, 0, 0, 0, 0, 0, -110, 0, 0, 0, 0, 0, 0], [0, 181, 0, 0, 52, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 21, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-521, 0, 0, -85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 35, 0], [0, 0, 181, 0, 0, 0, 0, 0, 0, -189, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 165, 0, 0, 0, 0, 13, 0, 0], [0, 0, -329, 0, 0, 0, 0, 0, 0, -49, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 381, -138, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -431, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -166, 0, 0, 0, 0, -10, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -28, 0, 0, 23], [0, 0, 0, 0, 0, 0, 0, 95, 0, 0, 321, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -211, 0, 0, 0, 0, -17, 0, 0], [1203, 0, 0, -13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 18, -151, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 563, 0, 0, 15, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, -58], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -257, 0, 0, 140, 0], [0, 0, 0, 0, 0, 0, 0, -94, 0, 0, 367, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 142, -37, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -68, 0, 0, 0, 0, 98, 0, 0], [0, 0, 0, 0, 0, 0, 0, -266, 0, 0, 151, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 451, 0, 0, -38, 0], [0, 231, 0, 0, -38, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -75, 0, 0, -33], [0, 0, 0, 0, 0, 0, 0, 266, 0, 0, -127, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, -210, 0, 0, 0, 0, -2, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1600_g_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1600_3_g_k();".
// 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_1600_3_g_k(:prec:=16)
    chi := MakeCharacter_1600_g();
    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_1600_3_g_k();".
// 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_1600_3_g_k( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1600_g();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![96, 0, -30, 0, 1]>,<17,R![24576, 0, -552, 0, 1]>],Snew);
    return Vf;
end function;