
// Make newform 930.2.bg.c in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_930_bg();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_930_bg_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_930_2_bg_c();".
// 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_930_2_bg_c();".
// 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 := [22801, 0, 87030, 0, 119819, 0, 78445, 0, 27831, 0, 5650, 0, 654, 0, 40, 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], [-5305687, -399691, -17488620, 0, -21934333, 0, -11868388, 0, -3223672, 0, -465200, 0, -34078, 0, -995, 0], [-5305687, 399691, -17488620, 0, -21934333, 0, -11868388, 0, -3223672, 0, -465200, 0, -34078, 0, -995, 0], [-9519995679, -57955195, -33191196434, 0, -39892235189, 0, -21531538578, 0, -5894779186, 0, -848372834, 0, -60936406, 0, -1718215, 0], [-60353341, -417191490, 0, -897995920, 0, -964195377, 0, -491123375, 0, -128278850, 0, -17833820, 0, -1255235, 0, -35137], [629548325710, 333142485860, 2341805119727, 716941913112, 2839828170627, 530052448287, 1528473900512, 189862300797, 417331391399, 36673149074, 60033458523, 3886690373, 4317955532, 212701722, 122061303, 4706363], [19056870289, 58124761677, -129164149267, 197852507369, -345988251222, 250592861739, -251203570253, 135681134706, -80082068726, 36341854502, -12631799300, 5071614425, -965113480, 352789665, -28483734, 9650638], [-19056870289, 58124761677, 129164149267, 197852507369, 345988251222, 250592861739, 251203570253, 135681134706, 80082068726, 36341854502, 12631799300, 5071614425, 965113480, 352789665, 28483734, 9650638], [-37865539764, -208311686164, -237999896656, -555179622305, -379074973941, -511836087780, -239145005005, -231449324654, -71548827545, -56809024793, -10871633372, -7648870428, -810462753, -527379797, -23520213, -14497489], [182944699149, 1032393521, 726054749449, -144925963951, 1010440320854, -265463223951, 602976117018, -165209593315, 176377443691, -47944489040, 26544967084, -7073628552, 1965702296, -512817013, 56597065, -14478243], [182944699149, -1032393521, 726054749449, 144925963951, 1010440320854, 265463223951, 602976117018, 165209593315, 176377443691, 47944489040, 26544967084, 7073628552, 1965702296, 512817013, 56597065, 14478243], [-629548325710, 197325706574, -2341805119727, 611088826276, -2839828170627, 559793172711, -1528473900512, 248919218015, -417331391399, 59878418150, -60033458523, 7890718627, -4317955532, 532756418, -122061303, 14361573], [-380612791010, -16918969901, -1535151469322, -51333701789, -2037008132382, 78462317246, -1142199468692, 105575851065, -316849927239, 41420862070, -45803303838, 7234550077, -3295930907, 583469063, -93061753, 17698863], [2189120839, -250765164, 6976190606, -1576158256, 7827119286, -2510430291, 4141850575, -1583741755, 1139273455, -473833295, 166237007, -71997572, 12135678, -5367303, 347813, -155763], [-56922410053, 266436447841, -108835747389, 753032129674, -33086722719, 762428949519, 12058565248, 367130459360, 8533241181, 93150879295, 1760165928, 12720484853, 154650727, 880169462, 4963521, 24148127], [128116849205, 242101854347, 664183281629, 778981292867, 925390564434, 995569958642, 518510001419, 573447658409, 141439012653, 164774809153, 19944416126, 24542952957, 1394553554, 1805674948, 38199376, 51769460]];
    Rf_basisdens := [1, 799382, 799382, 115910390, 120706682, 17502468890, 17502468890, 17502468890, 17502468890, 17502468890, 17502468890, 17502468890, 17502468890, 115910390, 17502468890, 17502468890];
    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_930_bg();"
function MakeCharacter_930_bg()
    N := 930;
    order := 15;
    char_gens := [311, 187, 871];
    v := [15, 15, 8];
    // 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_930_bg_Hecke();"
function MakeCharacter_930_bg_Hecke(Kf)
    N := 930;
    order := 15;
    char_gens := [311, 187, 871];
    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], [0, 0, 0, 0, 0, 0, -1, 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, 1, 0, 0, 1, 1, 1, -1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [1, -1, 0, 0, 0, -1, 2, 1, -1, 0, 0, 0, 0, 0, 0, 0], [-1, -1, 1, -1, 0, -1, 2, 1, 1, 2, -2, 1, 0, 0, 0, 1], [-1, -1, 1, 1, -2, 0, -2, -2, 1, -1, 1, 0, 0, 0, 1, 1], [0, 0, 0, 0, -1, 0, -1, -5, -4, -2, 4, 0, 0, 0, 2, 0], [0, 0, -1, 0, -2, 0, 2, -1, -2, 0, 1, 0, 2, 1, 0, -1], [0, 0, 1, 1, -2, 1, 1, -2, -2, 0, -1, 0, 0, 2, 1, -1], [0, -1, 1, 1, -1, 2, -1, 2, 2, 1, 1, 1, 0, 0, -3, 2], [3, 1, 1, 2, 2, 0, 0, 0, -1, 1, 2, -1, -2, 2, -2, 0], [-1, -3, 2, 0, 2, -2, -2, 3, 4, -1, 0, -1, -1, 0, 0, 1], [1, -2, 2, 0, 1, -2, 1, 4, 1, 1, -3, 1, -1, -1, 1, 1], [-3, 0, -1, -1, -3, 0, -1, 0, 0, -2, 0, 0, 3, 0, 1, -2], [-5, -1, 2, -2, 1, -2, -4, 2, 3, -2, -2, 0, 0, -1, 2, 0], [2, -3, 2, 1, 1, -1, 6, 1, 0, 3, -1, 2, -2, 1, 0, 1], [-2, 3, -1, -2, -3, -1, 0, -1, -3, -4, -2, -1, 1, 0, -1, -1], [-4, 2, -1, -2, -1, 0, -2, -3, 4, -3, -2, 0, 1, 0, 5, -1], [4, 3, -3, -2, 4, -3, -3, -3, -1, -2, -1, -2, 1, -2, 4, -3], [4, -3, 5, 3, 9, -2, 4, 4, 2, 8, -5, 1, -5, 2, -2, 3], [-2, -3, 2, -2, 1, 1, 8, 7, 3, 7, -3, 5, -2, 3, -6, 2], [-2, -1, 1, 2, -4, 2, -4, -3, 0, -4, 3, 0, 2, 0, 4, 1], [4, 4, -2, -2, 3, 1, 0, 1, -2, 0, 1, -2, 0, 1, -4, -2], [4, -4, 4, 3, 11, 2, 8, 9, 3, 8, -4, 3, -2, 2, -8, 2], [3, 0, 0, 0, 1, 2, -2, -1, 1, -3, 6, 0, 2, -1, -3, -1], [1, 1, 1, 0, 0, 1, 8, -1, -8, 0, -4, 0, 0, 1, 2, -2], [1, 4, -5, 1, -1, 3, -1, -4, -4, -6, 4, -2, 3, 0, -2, -2], [0, -3, 7, 0, 2, 0, 2, 0, 4, 0, -4, 4, -6, 3, 2, 3], [-5, 1, 3, 0, 0, -1, -4, 3, 3, -4, -1, 1, -3, -1, 2, 0], [5, 6, -3, 1, 2, 0, -7, -5, -4, -7, 2, -4, -2, -3, 2, -1], [3, 4, -5, -2, -6, 0, -5, -2, -6, -4, 9, -2, 2, -3, 0, -2], [-10, -1, 1, 4, -12, 2, -2, -8, -5, -10, 11, -1, -1, 1, 4, 3], [6, -2, 1, -1, 8, -1, 7, 2, 1, 1, -2, 0, 0, -2, 1, 0], [-6, 3, -7, -1, -10, 3, -6, -11, 2, -3, 10, 0, 8, -4, 4, 0], [8, 5, -1, 0, 11, 2, 11, 4, -4, 9, -6, 0, -3, 3, -3, -2], [3, 1, -1, -1, 6, 1, 3, 1, -2, 4, 3, -1, 2, 1, 1, 1], [-5, 2, -5, -4, 0, -3, -1, 6, 5, 2, -5, 0, 3, -3, 3, -2], [0, 3, -3, -1, -1, -2, -2, 0, 0, 1, 2, -2, 0, -3, 0, 0], [-3, -3, 1, -2, -2, 0, 2, 2, 1, 2, -2, 3, -2, 0, -4, 1], [3, -2, 1, 0, 2, -1, 0, 3, 6, 7, -2, 0, -5, 4, -4, 6], [-9, 2, -5, 1, -14, 2, -3, -9, -5, -11, 12, -1, 2, 1, 5, 0], [-2, -2, 5, 1, 1, -1, 0, 3, 8, 4, -8, 0, -2, 1, -5, -1], [0, 4, -6, 0, 7, -2, -1, 6, 11, 7, -16, -3, 1, 0, -3, -2], [5, -1, 3, 6, 8, 4, -2, 6, 2, 4, 1, -1, -2, 1, -5, 5], [-2, 3, -2, 2, 3, 1, -11, -7, 3, -8, 5, -3, 0, -1, 8, -2], [-3, 4, -1, 0, -9, 3, -11, -4, 7, -7, -2, 0, -2, 3, 6, -1], [2, 3, -2, 0, 19, -2, 2, 5, 3, 5, -2, -2, 1, -3, 0, 0], [-5, 3, -2, 0, -11, -2, -5, -11, -6, -9, 5, -2, 1, -3, 7, 0], [11, -2, 1, 1, 14, 0, 9, 10, -8, 5, -8, 0, -1, 1, -14, 1], [3, -3, 4, 3, -2, 0, 5, -1, -9, 5, 5, 3, -5, 2, -4, 1], [0, 1, -6, 0, 4, 3, -6, 6, 4, -4, 2, 0, 6, -1, -4, 0], [-8, 5, -3, -1, 0, 2, -5, 1, 4, -6, -2, -2, 3, -2, -2, 0], [3, 2, 3, 1, -10, 2, 6, -4, -6, -4, 12, -1, -2, 1, -3, 0], [4, 6, -6, -5, 7, -4, -9, -1, 7, -6, -8, -1, 1, -5, 0, -1], [16, 0, -4, -2, 2, 2, 2, -5, -7, 7, 3, -2, 4, -2, -2, -6], [6, -3, 0, 2, -10, 1, 7, -15, -13, -1, 9, 0, -2, 5, 7, 0], [7, 12, -8, -4, 0, -1, -1, 6, -7, -14, -2, -4, 4, -5, 1, -6], [2, 4, -7, -3, 2, 5, 2, -7, -1, -4, 2, 2, 0, 2, 0, 3], [-10, -3, -1, 1, -21, 0, -6, -10, -13, -14, 15, -3, 4, -4, 6, 0], [-11, 0, 1, 4, -14, 7, -5, -12, -14, -13, 14, 0, -1, 1, 10, 0], [-4, 1, -1, -2, -9, 0, -4, -6, -1, -5, 1, -2, 1, 0, 6, 0], [-1, -1, 1, 2, 5, 2, 5, 9, 6, 13, 0, 0, 2, 0, -14, 1], [2, -4, 6, 2, 2, 2, 0, 1, 3, 6, -8, 2, -1, 5, 2, 2], [4, 1, 3, 5, 3, 3, -14, 0, 11, 7, 10, -3, -3, 0, 8, 3], [6, 2, 0, 4, 5, 2, -2, -2, 1, -2, 4, -6, 2, 2, 0, -6], [-13, -5, 5, -2, -13, -6, 4, -4, -5, -8, 1, 1, -2, -1, 8, -1], [6, -14, 16, -2, 9, -4, 8, 17, 8, 17, -12, 7, -9, 5, -5, 7], [0, -7, 7, 3, 4, -4, 8, 6, 1, 10, -14, 3, -11, 5, 1, 5], [6, -6, 5, 0, 3, -1, 8, 0, -6, 4, -4, -3, -4, 1, 1, -2], [13, -1, 3, 4, 13, 1, 19, 11, -9, 9, -12, -1, 0, 5, 0, -2], [-5, 8, -3, 4, -10, 0, -14, -13, -8, -9, 16, -8, 4, -1, 5, -1], [5, 5, -3, 0, 12, 2, 11, 6, -7, 2, -1, 0, 1, 2, -3, -3], [-2, -2, 0, 8, -1, 4, 0, 1, 1, 9, -6, -2, -2, 8, 0, 4], [18, -1, -2, -4, 1, -1, 10, -2, -5, 9, 6, 1, -1, 0, -6, 1], [26, 0, -1, -6, 22, -7, 14, 27, 1, 18, -19, -1, 0, 1, -9, -7], [5, 1, -1, 1, 3, 1, 10, 4, 5, 13, -5, -1, 0, 0, -2, -1], [-7, 3, 0, -4, -1, -4, -1, 7, 11, -2, -18, 3, -6, 1, 12, -3], [-1, -6, 2, 0, 5, -3, 3, 0, 1, 8, -3, 1, 2, -1, 0, 4], [10, 0, -3, 0, 2, 1, 13, 14, 9, 8, 9, -2, 3, -3, -14, -2], [-8, -2, 2, 0, -18, 0, 6, -10, -2, -8, 3, 5, -2, 7, 12, 5], [1, 2, -6, -1, 7, 4, -5, 13, 5, -6, -1, 3, 7, -3, -6, 0], [7, 6, -3, -4, 9, 3, 9, 0, -5, -5, -4, 0, -2, 1, 2, -5], [11, -3, -1, 1, -4, 3, -10, 0, -2, -1, 9, 2, 0, -1, -4, 2], [8, 3, 0, 0, 5, 4, -6, 1, 2, 2, 5, -4, -5, 0, -3, 5], [-12, -4, 8, -1, -14, 0, 6, 4, -15, -3, 5, 3, -2, -1, 7, 0], [1, -1, -1, -1, -3, 0, -11, 1, -4, -3, 5, -4, 1, 0, 7, -6], [1, 1, 4, 5, 1, -3, -2, -4, -2, 1, 2, -7, -9, 4, 1, 0], [-6, 3, -3, 1, -12, -4, -14, -11, 4, 0, 5, -4, 0, -3, 5, 0], [8, 3, -3, -2, 10, 7, 1, 3, -1, 0, 13, -2, 10, -4, -14, -4], [-14, -4, 2, -1, -18, -5, -9, -4, -8, -9, 1, -1, 2, -2, 6, 3], [7, -3, 4, -1, 4, -10, 7, 9, 3, 8, -9, -4, -1, 1, -7, -1], [11, 3, -8, 1, 3, 1, 3, -9, -17, 1, 14, -5, 1, 0, -8, -3], [7, 4, 1, 0, 10, -1, 6, -2, 0, 8, -1, -2, -1, 1, -2, 3], [-3, 6, -12, -6, 2, 0, -8, -3, 6, -1, -4, -6, 12, -6, 7, 0], [6, -1, 0, 2, -3, 5, -4, -2, -2, 0, 21, -1, 2, 2, -1, -1], [-9, 4, -6, -3, -7, 3, -15, 3, 10, 1, 4, 2, 4, -2, 4, -1], [2, -2, 1, 2, 5, -1, 3, 0, 2, 1, 0, 0, 0, 1, 2, 3], [-2, 0, -4, 0, 5, 0, -1, -8, -6, 2, 3, -1, 8, -9, 5, -1], [-2, 6, -6, -2, 1, 0, -1, -3, 16, -19, 5, -2, 6, 0, -4, 0], [6, 0, 3, 2, 8, 2, 8, -9, -4, 9, 15, 3, -4, 3, -14, 0], [-3, 4, -2, 4, 0, -4, -2, -14, 2, 4, 5, -10, 6, -6, 18, -4], [0, 1, 7, 3, 5, 1, -2, 8, -3, -8, -11, -1, -5, 0, -8, 5], [4, -2, 3, 1, -4, 1, 1, -7, 1, -7, 16, 1, -1, 1, -10, 1], [-8, -11, -4, -7, -9, -1, 5, -4, 2, 5, 9, 2, 9, -5, 0, 7], [5, 1, 3, 1, -11, 4, -11, -3, 12, -3, 1, 0, -3, 1, -1, 0], [-2, 4, -2, 5, 1, 0, 3, 1, -10, 3, 12, -4, -3, 3, -12, 5], [3, 1, 2, -1, 0, -4, 13, 13, 3, 6, -1, 0, -3, 3, -9, -1], [-5, 8, -8, -2, -1, -3, -2, 1, -1, -3, -3, -2, 5, -5, 3, -5], [-16, 0, -2, 2, 6, -5, -6, -15, 4, 6, 3, -2, 0, -5, -1, 0], [0, -10, -1, -7, -7, 0, 10, -4, 3, 6, -6, 10, -2, 4, -2, 3], [2, 5, -8, -5, 7, -3, 6, 16, 0, 6, -6, 0, 7, -4, -2, -9], [-3, -9, 4, -1, 4, -8, 2, 11, 4, 6, -10, 2, -1, -2, 4, 1], [0, 9, -9, -11, 0, -7, -11, -1, 3, 7, 3, 2, 1, -8, 16, 2], [-7, -2, 4, -2, -2, -5, -10, 11, 7, -5, -13, 5, 2, 0, 9, -2], [-3, 0, 1, 0, 3, 1, 15, 24, 4, 16, 0, 2, -2, 2, -22, 0], [3, -8, 0, 8, -7, 5, 5, 0, -5, -1, 1, 3, 3, 2, 2, 4], [0, -1, 8, 0, -5, -3, 5, 16, -4, 9, -3, -1, 0, -3, -5, -7], [0, -7, 7, 8, 6, 2, 5, 5, 12, 1, -2, 8, -5, 8, -11, 8], [0, -2, -5, 1, -12, 4, -10, -20, -11, -15, 18, -3, 7, -7, 6, -1], [18, 3, -5, -4, 25, 1, 9, 17, 10, 11, -16, 1, 0, -3, -1, 2], [-1, -6, 6, 0, 0, 2, 12, -4, -6, -8, -8, 1, -5, 7, -2, 3], [12, -4, 7, 6, 12, -1, 28, 5, -2, 11, 0, -3, -7, 1, 0, 0], [2, 1, 0, 3, 0, -2, 2, 0, -7, 1, -1, -7, 2, 3, 3, -2], [-13, -7, 8, -1, 6, -5, -10, 1, 25, 6, -10, 5, -6, 0, 19, 6], [6, 8, 5, 5, 17, 0, 5, 5, -2, 4, 5, -15, -5, 0, 5, -2], [-9, 0, 1, 1, -8, 0, -21, -6, -5, -13, 12, 0, 5, 0, 17, -6], [-1, 0, 0, 2, -11, 1, -12, -5, 2, -12, 7, 2, 1, -5, -3, -5], [-7, -1, 0, 0, -18, -2, -8, -14, -7, -15, 8, -3, 1, -4, 10, -1], [-11, -3, 4, 6, -10, 6, -10, -13, 8, -4, 11, 1, 2, 2, 12, 3], [6, -1, 3, 5, -13, 3, 14, -6, -25, 1, 6, 1, 0, 6, -4, -5], [-5, 8, -7, -5, -15, -9, -2, -12, -15, -15, 16, -4, 0, -5, 7, -9], [-8, -6, 2, 13, 1, 3, -10, 10, -5, -3, 2, -3, -1, 0, -6, 1], [-8, 3, 1, -2, 6, 4, -18, 11, 16, 8, -8, 3, 1, -3, 1, 1], [-26, 1, -2, -1, -18, -1, -13, -26, -17, -17, 4, 0, -4, 5, 13, 4], [-5, 5, -8, 1, -2, 1, -2, 11, 25, 5, -3, -3, 9, -4, -6, -5], [0, -12, 7, 0, -2, 3, 11, 6, 6, 8, -5, 8, -2, 10, -2, 5], [-13, 3, -10, -7, 6, 2, -3, 7, 18, 5, -2, 6, 7, -7, 8, 3], [-19, 3, 4, 14, -4, 0, -10, 11, 3, -2, 1, -3, -6, 7, -18, 2], [8, -1, 3, 4, -18, 1, 22, -10, -14, -7, 10, -3, -3, -1, -5, -1], [2, -3, 0, 2, 4, 5, 0, -1, 6, 2, -1, 1, 1, 1, -1, 1], [8, 0, -1, -5, 13, 1, 7, 12, -3, 0, -4, 0, 6, -5, 1, 1], [1, 9, -14, 8, -1, 10, -8, 3, 11, -1, 10, -2, 6, -1, -12, 0], [0, -5, 7, 2, 6, 2, 6, 10, 4, 12, -18, 2, -16, 9, 2, 5], [15, 6, -3, -3, 7, 7, -1, 9, -2, -4, 6, -1, 2, 5, -14, -3], [0, 5, -8, 2, 6, -1, 8, -10, -15, -12, 9, -4, 0, 1, 1, 3], [1, 13, -23, -10, -4, 6, -10, -5, 2, -11, 4, 3, 10, -10, 3, -10], [-30, -3, -4, 0, -34, 2, -29, -34, 1, -28, 33, 0, 4, 3, 29, 0], [-21, -4, 7, -7, 1, -13, -1, 17, 9, 3, -4, 1, 3, -6, -6, 7], [24, -11, 12, 6, 36, -6, 25, 12, 5, 35, -17, 4, -12, 6, -5, 5], [7, 8, -9, -8, 12, -7, 31, 36, -3, -3, -9, -4, 5, -8, -23, -7], [6, 7, -2, 4, -5, 6, -28, -6, -6, -6, 16, -7, 2, -6, 0, -2], [-7, -5, 6, 7, -8, 1, -4, -15, -8, -6, 11, 0, 1, 0, 1, 5], [17, -11, -1, -5, 14, 0, 20, 12, -4, 18, -17, 4, 6, 6, -13, 0], [3, -11, 7, -1, -21, 0, 3, -22, -1, 8, -1, 11, -13, 3, -2, 6], [-9, 1, 1, 0, -16, -1, 8, -6, -18, -2, 9, -1, 0, -1, -1, -2], [-23, 9, -2, -1, -24, 0, -40, -23, 13, -20, 9, -9, 0, -8, 8, 2], [-11, -9, -5, -6, 2, 6, -3, -11, 15, 1, 11, 7, 2, 1, 10, 6], [-11, 3, -2, -5, -2, -1, -15, -2, 17, -10, -10, 1, 2, 0, 19, -2], [4, 12, -20, 0, -8, 8, -8, -18, -4, -8, 16, -4, 8, 4, 0, -4], [-2, -1, 8, 2, 0, -1, 25, 5, -3, 21, -8, 5, -4, 7, -1, -2], [0, -2, 1, 3, -5, 3, -5, -2, 25, -6, 7, -1, 7, -2, 0, 2], [4, 7, -7, -5, -4, 4, 17, 6, -15, 6, 6, 1, 0, -1, -8, 0], [5, 12, -9, 0, 0, 5, -4, 16, 11, 0, 3, -3, 6, -9, -3, -8], [-2, -12, 13, -1, 9, -8, 16, 12, -3, 17, -24, 6, -7, -1, -1, 6], [2, 1, -2, 1, 15, 2, 2, 25, 16, 8, -15, 1, 1, 0, -18, 0], [-7, 1, 8, 12, 13, 4, 8, 11, 12, 1, 7, 0, -8, -4, 2, 9], [6, -17, 10, 2, 9, -8, 15, 7, 3, 15, -10, 8, -9, 0, -6, 9], [-26, 4, -10, 0, -44, 2, -11, -29, -22, -18, 38, -4, 6, 0, 15, 2]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_930_bg_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_930_2_bg_c();".
// 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_930_2_bg_c(:prec:=16)
    chi := MakeCharacter_930_bg();
    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_930_2_bg_c();".
// 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_930_2_bg_c( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_930_bg();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<7,R![3575881, -1299117, 2547497, -776964, -488632, 1080114, -169206, -206897, 78833, 1771, -5634, 1172, -7, -98, 48, -11, 1]>],Snew);
    return Vf;
end function;