
// Make newform 624.2.cn.d in Magma, downloaded from the LMFDB on 16 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_624_cn();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_624_cn_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_624_2_cn_d();".
// 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_624_2_cn_d();".
// 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 := [25, -220, 972, -2780, 5736, -9024, 11224, -11276, 9297, -6328, 3580, -1668, 642, -196, 48, -8, 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], [2945, -17721, 58327, -125328, 197448, -237337, 227114, -173970, 109509, -55495, 23298, -7564, 2019, -350, 50, 0], [-125460, 929924, -3418428, 8598668, -15739188, 22138664, -24527176, 21928484, -15945783, 9554736, -4666596, 1879372, -594074, 151876, -25920, 3456], [-363138, 2016505, -5694253, 9921731, -11752436, 9059680, -3595456, -1746621, 4103647, -4078214, 2591696, -1320043, 473557, -145319, 26244, -4446], [-2004525, 13730184, -47350335, 106330641, -173893084, 218727246, -219256768, 178229161, -119237433, 65696977, -29899787, 11090331, -3301409, 763986, -124929, 13659], [218885, 510382, -6949514, 27082796, -61611091, 99711814, -121073088, 116711850, -89528958, 56590650, -28666706, 12097498, -3923413, 1056740, -182630, 26630], [318955, -222694, -4315386, 21932579, -55417740, 95524566, -121047543, 120513439, -94697844, 61105562, -31433015, 13470792, -4413594, 1205575, -209568, 31151], [-506866, 3501235, -12506136, 28950195, -48766231, 62774562, -64335603, 53194681, -36195170, 20195906, -9316343, 3488215, -1050316, 244733, -40446, 4446], [-2071845, 14507768, -52073476, 122001074, -208344314, 273082466, -284726942, 240513840, -166733397, 95362110, -44845414, 17314892, -5311527, 1296070, -216820, 26630], [-597160, 5964282, -26093918, 71276310, -136496129, 196859312, -221711386, 200796845, -147407790, 89239997, -43899570, 17866121, -5679382, 1471552, -251845, 34456], [-1570700, 12002861, -45556942, 111767067, -197414070, 266209462, -283899773, 244795930, -172616328, 100424851, -47884454, 18791545, -5830901, 1450428, -244547, 31151], [-2946190, 20879374, -74804909, 174197744, -294631494, 381718799, -393312770, 327817666, -224500179, 126534965, -58795272, 22315745, -6769285, 1612436, -267691, 31151], [-273965, -1585494, 14435393, -52438780, 116130120, -184926311, 222238161, -212379442, 161907582, -101686623, 51288524, -21520004, 6958330, -1862113, 321385, -46358], [-1289570, 10489359, -41710597, 107176707, -197668010, 278102740, -307981421, 275748766, -200765043, 120883519, -59214555, 24045856, -7626613, 1976255, -337691, 46358], [-701840, 8096306, -38325579, 111186219, -222600632, 333141867, -385802736, 358323284, -268073830, 165437899, -82494331, 34143086, -10958903, 2891923, -497409, 70161], [-3835485, 28915123, -108502921, 263398784, -461729963, 619023919, -657422824, 564862707, -397246280, 230473591, -109669069, 42919133, -13295132, 3295102, -555006, 70161]];
    Rf_basisdens := [1, 65, 17095, 3419, 17095, 17095, 17095, 3419, 17095, 17095, 17095, 17095, 17095, 17095, 17095, 17095];
    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_624_cn();"
function MakeCharacter_624_cn()
    N := 624;
    order := 12;
    char_gens := [79, 469, 209, 145];
    v := [12, 12, 6, 5];
    // 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_624_cn_Hecke();"
function MakeCharacter_624_cn_Hecke(Kf)
    N := 624;
    order := 12;
    char_gens := [79, 469, 209, 145];
    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], [0, 0, 0, 0, 0, -1, 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 := 2;
    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, -1, 0, -1, 0, 0, 0], [0, 1, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, -1, 0, 0], [-1, 0, 1, 0, 0, 1, 0, 0, 0, 0, -1, 1, 0, 1, 0, 0], [0, 0, 0, 0, 1, 0, -1, 0, 0, 0, 0, 1, 0, -1, 0, 0], [-1, -1, -1, 0, 0, 1, 0, 0, 1, 0, -2, 2, -1, 2, 0, 0], [0, 2, 0, 1, 2, 0, 2, 0, 0, -2, 2, -4, 2, -2, 1, 0], [2, -2, -2, 0, 0, 2, 0, 0, 0, 0, -1, 1, 0, 1, 0, 0], [0, 2, 0, -1, -1, 0, -1, 0, 0, -2, 1, 0, 1, 0, 1, 1], [0, -2, 0, 0, -1, 0, -3, 1, 0, 2, -1, 4, -1, 2, 0, 1], [0, 0, -2, 0, 0, -2, -2, 0, 0, 2, -3, 1, 1, 1, 0, 0], [1, -2, 0, 0, 0, 1, -3, 0, 0, 3, -6, 3, -1, 3, 0, 0], [0, -2, 0, -2, -6, 0, -4, -2, 0, 2, -4, 8, -4, 4, -1, 2], [0, -1, 0, 0, 0, 0, -1, 0, 0, 1, -1, 0, 0, 0, 0, 0], [0, 3, 0, 1, 0, 0, 0, -1, 0, -3, 3, -3, 3, 0, 0, -2], [0, 2, 0, 0, 6, 0, 3, 0, 0, -2, 4, -7, 4, -4, -1, -1], [0, 1, 0, -4, 0, 0, 1, 2, 0, -1, -1, 0, -1, -2, 2, 2], [-3, 0, 3, 0, 0, 4, -2, 0, 8, 2, -4, 2, -1, 2, 0, 0], [-4, 1, 4, 0, 0, 4, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0], [0, -4, 0, 0, 3, 0, 2, 3, 0, 4, -1, -1, -1, 0, -3, 1], [1, -4, 5, 0, 0, -6, 0, 0, -1, 0, -2, 2, -2, 2, 0, 0], [6, 4, 0, 0, 0, 0, 0, 0, 0, 0, -1, 1, 1, 1, 0, 0], [0, 1, 0, 2, 0, 0, 0, 2, 0, -1, 0, 0, 0, -1, 4, 0], [0, 6, 0, -1, -4, 0, -2, 0, 0, -6, 0, 2, 0, -2, 3, -1], [0, 2, 2, 0, 0, -2, 6, 0, -2, -6, 10, -4, 6, -4, 0, 0], [0, -2, 0, 0, 1, 0, 1, 3, 0, 2, -1, 0, -1, 0, 0, -3], [-1, -3, 2, 0, 0, -3, -4, 0, -3, 4, -9, 5, -5, 5, 0, 0], [0, -2, 0, -2, -1, 0, -3, -4, 0, 2, -1, 4, -1, 2, -2, -2], [1, 0, -4, 0, 0, -3, 0, 0, 1, 0, 3, -3, 3, -3, 0, 0], [0, -2, 0, -3, 4, 0, 2, 1, 0, 2, -2, 0, -2, -4, 4, -1], [4, -3, -2, 0, 0, 0, 3, 0, 8, -3, 6, -3, 0, -3, 0, 0], [0, 0, 0, 4, 8, 0, 4, -4, 0, 0, 4, -8, 4, -4, -4, -4], [0, 0, 0, 4, 2, 0, 0, -1, 0, 0, 2, -2, 2, 0, -1, -2], [2, 3, -2, 0, 0, 2, 3, 0, 4, -3, 9, -6, 3, -6, 0, 0], [0, -1, 0, 0, 3, 0, 5, 2, 0, 1, 2, -7, 2, 0, -2, -3], [1, -4, 8, 0, 0, -9, 5, 0, -1, -5, 3, 2, 3, 2, 0, 0], [-5, 3, 0, 0, 0, -2, 0, 0, 2, 0, -3, 3, 3, 3, 0, 0], [0, 2, 4, 0, 0, 4, -2, 0, 4, 2, -2, 0, 2, 0, 0, 0], [0, 2, 0, -4, -4, 0, 2, 0, 0, -2, 0, -2, 0, 2, -4, -4], [0, -7, 0, 4, -4, 0, -5, -1, 0, 7, -5, 10, -5, 6, 3, -1], [0, -2, 0, -4, 1, 0, 1, 0, 0, 2, -1, 0, -1, 0, 4, 4], [2, -7, -4, 0, 0, 9, 6, 0, 9, -6, 2, 4, -4, 4, 0, 0], [0, -2, 0, -4, 8, 0, 2, -2, 0, 2, -2, 0, -2, -8, 2, 2], [-3, 0, 10, 0, 0, -3, -2, 0, -10, 2, -4, 2, -2, 2, 0, 0], [0, 3, 0, -5, 4, 0, 1, 2, 0, -3, 6, -7, 6, -1, 1, 5], [-3, -1, -3, 0, 0, -1, -1, 0, 0, 1, -1, 0, -6, 0, 0, 0], [0, 2, 0, 0, 0, 8, -2, 0, 4, 2, 0, -2, 4, -2, 0, 0], [-6, -3, 2, 0, 0, 6, 5, 0, 2, -5, 0, 5, 2, 5, 0, 0], [0, 3, 0, 0, -1, 0, 1, 0, 0, -3, 2, -3, 2, 0, 0, 0], [-2, 8, 2, 0, 0, 0, 4, 0, 2, -4, 8, -4, 8, -4, 0, 0], [0, 0, 0, -2, 0, 0, -8, -2, 0, 0, -2, 10, -2, -2, -2, 2], [0, 5, 0, 7, -4, 0, 0, 1, 0, -5, -2, 2, -2, -3, 2, 0], [7, 2, -12, 0, 0, -12, -2, 0, -5, 2, 0, -2, 2, -2, 0, 0], [0, 3, 0, 0, 0, 0, 1, -4, 0, -3, 1, -2, 1, -2, -4, -4], [0, 2, 0, -1, -4, 0, -2, -1, 0, -2, 0, 2, 0, 2, 1, 2], [0, -1, 0, 1, -3, 0, -4, 0, 0, 1, -3, 7, -3, 1, 1, -1], [0, -5, 0, -2, 0, 0, 5, -3, 0, 5, -5, 0, -5, 0, -1, 3], [10, -3, 2, 0, 0, 10, -11, 0, -2, 11, -22, 11, -8, 11, 0, 0], [-7, 0, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0], [0, 8, 0, 0, 4, 0, 4, 1, 0, -8, 10, -14, 10, -2, 0, 0], [-8, -4, 4, 0, 0, 0, 5, 0, -8, -5, 11, -6, 0, -6, 0, 0], [0, 3, 0, 2, -3, 0, 3, 0, 0, -3, -6, 3, -6, -6, 0, -1], [10, 4, -16, 0, 0, 6, 5, 0, -10, -5, 7, -2, 7, -2, 0, 0], [0, 0, 0, -11, 0, 0, -5, -11, 0, 0, -2, 7, -2, -2, -6, 6], [-15, 8, 0, 0, 0, 5, 0, 0, -5, 0, 0, 0, 0, 0, 0, 0], [0, 9, 0, -2, -6, 0, 0, 1, 0, -9, -3, 3, -3, -6, 2, 0], [-6, 7, 2, 0, 0, -2, 9, 0, 4, -9, 17, -8, 9, -8, 0, 0], [1, -4, -2, 0, 0, 4, -4, 0, 4, 4, -10, 6, -6, 6, 0, 0], [0, -2, 0, 4, 3, 0, 2, -2, 0, 2, -2, 0, -2, -3, -6, 2], [-2, -1, 11, 0, 0, -2, -7, 0, -11, 7, -14, 7, -6, 7, 0, 0], [0, 4, 0, 2, 12, 0, 8, -2, 0, -4, 8, -16, 8, -8, -1, -2], [0, 7, 0, 3, -2, 0, -2, -5, 0, -7, 6, -4, 6, 1, 0, -6], [0, -2, -11, 0, 0, -14, 3, 0, -7, -3, 1, 2, -4, 2, 0, 0], [6, 1, -6, 0, 0, -1, 7, 0, -2, -7, 15, -8, 4, -8, 0, 0], [-8, -8, 2, 0, 0, 8, -2, 0, 2, 2, 0, -2, -10, -2, 0, 0], [0, -7, 0, 0, 10, 0, 13, -2, 0, 7, 3, -16, 3, 0, 2, 8], [0, 0, 0, -3, 0, 0, -3, -3, 0, 0, 5, -2, 5, 5, 3, -3], [-1, 5, 3, 0, 0, 3, -5, 0, 2, 5, -7, 2, 5, 2, 0, 0], [0, 4, 0, 1, -2, 0, -2, 0, 0, -4, 0, 2, 0, -2, -10, 1], [-7, 14, 0, 0, 0, 0, 14, 0, 7, -14, 28, -14, 14, -14, 0, 0], [0, -4, 0, 2, 8, 0, 4, 8, 0, 4, 8, -12, 8, 4, 2, 6], [-4, 0, -3, 0, 0, -7, 13, 0, -4, -13, 26, -13, 0, -13, 0, 0], [0, 7, 0, 5, 9, 0, 2, -6, 0, -7, 14, -16, 14, -2, -3, -5], [0, 0, 0, 0, 0, 17, 0, 0, 0, 0, 0, 0, -6, 0, 0, 0], [-2, 9, 1, 0, 0, 0, 0, 0, -3, 0, 9, -9, 0, -9, 0, 0], [0, -12, 0, -4, -16, 0, -8, 4, 0, 12, -14, 22, -14, 14, 4, 4], [0, -4, 0, -2, 0, 0, -4, -1, 0, 4, 4, 0, 4, 8, -1, 1], [-9, 6, 11, 0, 0, 9, 4, 0, 11, -4, 0, 4, 10, 4, 0, 0], [0, 7, 0, 0, -5, 0, -3, 0, 0, -7, 2, 1, 2, 0, 0, 9], [3, 16, 4, 0, 0, -7, -3, 0, -3, 3, 5, -8, 5, -8, 0, 0], [0, 0, 0, 6, 0, 0, -7, 6, 0, 0, -6, 13, -6, -6, 8, -8], [0, 11, 0, 0, -2, 0, -9, 0, 0, -11, 0, 9, 0, -9, -6, 0], [9, -5, -5, 0, 0, 5, 7, 0, -4, -7, 8, -1, 7, -1, 0, 0], [0, -4, 0, 2, -19, 0, -5, 8, 0, 4, -9, 14, -9, 14, -2, -10], [-12, 0, 4, 0, 0, -8, 2, 0, -12, -2, 12, -10, 8, -10, 0, 0], [0, -3, 0, 0, -5, 0, 3, 11, 0, 3, -3, 0, -3, 5, 11, -11], [0, -3, 0, 14, -7, 0, -4, -2, 0, 3, -6, 10, -6, 4, -1, -14], [0, -16, 0, 5, 12, 0, 6, -5, 0, 16, -2, -4, -2, 2, -7, -7], [0, -10, 4, 0, 0, -8, -3, 0, -4, 3, -13, 10, -20, 10, 0, 0], [3, -8, 1, 0, 0, -4, 9, 0, -3, -9, 5, 4, 5, 4, 0, 0], [-2, 11, 0, 0, 0, -6, 0, 0, 6, 0, 2, -2, -2, -2, 0, 0], [0, -7, 0, 0, 5, 0, 2, 0, 0, 7, 0, -2, 0, 2, -1, 0], [0, -1, 0, 12, -4, 0, -3, -8, 0, 1, -3, 6, -3, 2, 4, -8], [0, 18, 0, -7, 0, 0, -6, 6, 0, -18, 12, -6, 12, -6, 7, 1], [-8, -1, 16, 0, 0, -20, 2, 0, -20, -2, 2, 0, 0, 0, 0, 0], [9, 0, -7, 0, 0, 2, 0, 0, 9, 0, -2, 2, -2, 2, 0, 0], [0, 8, 0, -4, 14, 0, 6, 0, 0, -8, 16, -22, 16, -6, 0, 4], [0, -4, 0, 0, 0, 0, 0, 13, 0, 4, -4, 4, -4, 0, 0, 0], [0, 0, 0, 2, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, -12, -12], [0, 2, -6, 0, 0, -10, 6, 0, -5, -6, 8, -2, 4, -2, 0, 0], [-2, -4, 2, 0, 0, 6, 0, 0, 12, 0, -4, 4, -2, 4, 0, 0], [1, -8, 6, 0, 0, -1, -1, 0, 6, 1, 0, -1, -9, -1, 0, 0], [0, -8, 0, 0, 8, 0, 8, 4, 0, 8, 0, -8, 0, 0, -4, -9], [-12, 0, 8, 0, 0, 4, 4, 0, 12, -4, 4, 0, 4, 0, 0, 0], [14, -7, -8, 0, 0, -8, 7, 0, 6, -7, 1, 6, -7, 6, 0, 0], [0, 16, 0, -9, 10, 0, 12, 3, 0, -16, 12, -24, 12, -14, -6, 3], [0, -3, 8, 0, 0, -8, 7, 0, -8, -7, 9, -2, 7, -2, 0, 0], [0, 10, 0, 10, -14, 0, -8, -4, 0, -10, 2, 6, 2, 6, -10, -6], [0, 1, 0, 11, 0, 0, 1, -6, 0, -1, 0, -1, 0, -1, 11, -17], [0, -3, 0, 4, 0, 0, 3, 2, 0, 3, -3, 0, -3, 0, -2, -2], [7, 5, -3, 0, 0, 7, 2, 0, 3, -2, 4, -2, -3, -2, 0, 0], [2, 8, -1, 0, 0, 0, -6, 0, -12, 6, -10, 4, 0, 4, 0, 0], [0, 6, 0, 9, -12, 0, -6, -9, 0, -6, -3, 9, -3, 3, -12, -12], [0, -1, 0, 4, 10, 0, -1, -6, 0, 1, 11, -10, 11, 2, -6, -2], [-12, 9, 10, 0, 0, 12, 0, 0, 10, 0, 0, 0, 9, 0, 0, 0], [0, 0, 0, -7, 0, 0, 12, -7, 0, 0, -1, -11, -1, -1, 2, -2], [15, 1, 2, 0, 0, 2, -1, 0, 17, 1, 0, -1, 1, -1, 0, 0], [0, -8, 0, -4, -2, 0, -4, 12, 0, 8, -4, 8, -4, 6, 8, 12], [1, 7, -2, 0, 0, 5, -2, 0, 5, 2, 4, -6, 6, -6, 0, 0], [-7, 0, 13, 0, 0, 6, -1, 0, -7, 1, 9, -10, 11, -10, 0, 0], [8, -2, -2, 0, 0, 8, 2, 0, 2, -2, 4, -2, 4, -2, 0, 0], [0, -12, 0, 6, -28, 0, -16, 4, 0, 12, -24, 40, -24, 16, 2, -6], [10, 1, -5, 0, 0, 0, -4, 0, -9, 4, -11, 7, 0, 7, 0, 0], [0, -8, -6, 0, 0, -12, -10, 0, -6, 10, -18, 8, -16, 8, 0, 0], [0, 0, 0, -2, 8, 0, 0, 3, 0, 0, 8, -8, 8, 0, 3, 1], [10, 4, -18, 0, 0, -10, -4, 0, -18, 4, 0, -4, 0, -4, 0, 0], [0, 4, 0, 0, -10, 0, -16, -6, 0, -4, -6, 22, -6, 0, 6, 2], [-2, -1, 14, 0, 0, 14, 1, 0, 12, -1, -11, 12, -1, 12, 0, 0], [0, -8, 0, -16, -2, 0, -4, 8, 0, 8, -4, 8, -4, 6, -8, 8], [0, 0, 0, -12, 6, 0, 6, -5, 0, 0, 6, -12, 6, 0, -12, 7], [-6, 0, -16, 0, 0, -22, -6, 0, -6, 6, -9, 3, 3, 3, 0, 0], [0, -12, 0, 2, -30, 0, -18, -4, 0, 12, -24, 42, -24, 18, -2, -2], [-4, -5, -4, 0, 0, 6, -5, 0, 0, 5, -5, 0, -13, 0, 0, 0], [0, -8, 0, -2, 0, 0, 0, -2, 0, 8, -8, 8, -8, 0, 0, 4], [28, 4, -14, 0, 0, 0, 1, 0, 17, -1, 7, -6, 0, -6, 0, 0], [0, 7, 0, -4, 6, 0, 7, -4, 0, -7, -1, -6, -1, -14, -4, 2], [2, -14, -5, 0, 0, 3, 3, 0, -2, -3, -4, 7, -4, 7, 0, 0], [0, 0, 0, -3, 0, 0, 10, -3, 0, 0, -6, -4, -6, -6, -5, 5], [-18, -9, 0, 0, 0, -2, 0, 0, 2, 0, -2, 2, 2, 2, 0, 0], [0, 5, 0, -7, 14, 0, 0, -3, 0, -5, 7, -7, 7, -12, -6, 0], [-7, -23, 4, 0, 0, -4, -15, 0, 3, 15, -34, 19, -15, 19, 0, 0], [0, 16, 0, 9, 4, 0, -4, -5, 0, -16, 12, -8, 12, -8, -9, -4], [-12, -10, 24, 0, 0, 16, -16, 0, 16, 16, -34, 18, -18, 18, 0, 0], [0, -1, 0, -8, -10, 0, -11, -2, 0, 1, -10, 21, -10, 1, -8, 6], [52, 8, -26, 0, 0, 0, -4, 0, 2, 4, -4, 0, 0, 0, 0, 0], [0, 28, 0, -4, 0, 0, 0, 4, 0, -28, 14, -14, 14, -14, 0, 0], [18, -5, -18, 0, 0, 8, 3, 0, 16, -3, 1, 2, -1, 2, 0, 0], [0, -12, 0, 0, 10, 0, 8, 1, 0, 12, -2, -6, -2, 0, -1, 8], [18, -12, 0, 0, 0, -7, 0, 0, 7, 0, 4, -4, -4, -4, 0, 0], [0, -6, 0, -18, -4, 0, 0, 2, 0, 6, -2, 2, -2, 8, 4, 0], [0, -6, 0, 2, -8, 0, 14, 0, 0, 6, 0, -14, 0, 14, 6, 2], [0, 2, 0, 14, -16, 0, -10, -5, 0, -2, -10, 20, -10, 4, 9, -5], [5, 0, -8, 0, 0, -3, 1, 0, 5, -1, -2, 3, -4, 3, 0, 0], [0, 8, 0, 0, 2, 0, -8, 6, 0, -8, 8, 0, 8, -2, 6, -6], [0, 8, 0, 10, 6, 0, -2, -2, 0, -8, 16, -14, 16, 2, -1, -10], [0, -4, 0, -2, 20, 0, 20, -10, 0, 4, 6, -26, 6, -10, 0, 4], [0, 4, 5, 0, 0, -22, -9, 0, -11, 9, -5, -4, 8, -4, 0, 0], [5, -8, -5, 0, 0, -8, -6, 0, -16, 6, -20, 14, -7, 14, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_624_cn_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_624_2_cn_d();".
// 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_624_2_cn_d(:prec:=16)
    chi := MakeCharacter_624_cn();
    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_624_2_cn_d();".
// 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_624_2_cn_d( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_624_cn();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![81, 0, 0, 0, 2700, 0, 0, 0, 15606, 0, 0, 0, 300, 0, 0, 0, 1]>,<7,R![4, -16, 68, -112, 46, 16, 2, 4, 1]>],Snew);
    return Vf;
end function;