
// Make newform 930.2.bg.e 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_e();".
// 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_e();".
// 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 := [58081, 0, -107433, 0, 89940, 0, -43398, 0, 13244, 0, -2652, 0, 345, 0, -27, 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], [8734563, 161849, -12690614, 0, 8551395, 0, -3303859, 0, 792237, 0, -120641, 0, 10935, 0, -481, 0], [-8734563, 161849, 12690614, 0, -8551395, 0, 3303859, 0, -792237, 0, 120641, 0, -10935, 0, 481, 0], [59040737512289, -36427645933254, -82401300908132, 36965828626322, 59633015429809, -13843669424702, -24026211151887, 2063158037274, 5888432618929, 95062455881, -889423402658, -89278933653, 78024201152, 13836683352, -3144854790, -879144720], [-59040737512289, -36427645933254, 82401300908132, 36965828626322, -59633015429809, -13843669424702, 24026211151887, 2063158037274, -5888432618929, 95062455881, 889423402658, -89278933653, -78024201152, 13836683352, 3144854790, -879144720], [44600586148174, -42378380647903, -151545537147092, 36965828626322, 147677522073294, -13843669424702, -67024837757108, 2063158037274, 17346636905054, 95062455881, -2731917586661, -89278933653, 249798214715, 13836683352, -10804470307, -879144720], [-230349536745774, -52214246429899, 366581167649995, 73208859844642, -250479400389093, -46192300263954, 94843723502693, 16738334520669, -22120938532531, -3768012967205, 3239592599263, 534721065978, -280055462260, -44779737057, 11368095320, 1761178984], [1379612638329, -325676753988, -2207888439990, 543750044164, 1593931115935, -353492024798, -646303508562, 125474461758, 160572232380, -27330788147, -25050172064, 3745368043, 2300277459, -302430222, -100754402, 11502471], [211873877520, -244982313329, -543057264054, 341914111652, 481477613042, -247439898049, -215754323582, 99693822207, 56873654394, -24433330369, -9279789799, 3690553538, 888074667, -323751872, -41079768, 13049190], [-4537175879612, -809518665534, 7360174536264, 1975431901078, -4993951496763, -1818260803239, 1871226083985, 842415020205, -430177674564, -225774923500, 61795072449, 37026555855, -5203789126, -3519708183, 204032769, 158509246], [-4742373628393, -4114840286229, 7360174536264, 5782517133443, -4993951496763, -3673028978218, 1871226083985, 1351068112770, -430177674564, -312045159727, 61795072449, 45907529277, -5203789126, -4015307501, 204032769, 167082381], [-4742373628393, 4114840286229, 7360174536264, -5782517133443, -4993951496763, 3673028978218, 1871226083985, -1351068112770, -430177674564, 312045159727, 61795072449, -45907529277, -5203789126, 4015307501, 204032769, -167082381], [39005609, -835256245, 0, 1198809225, 0, -776643695, 0, 289073175, 0, -67041955, 0, 9868500, 0, -862640, 0, 36243], [-40266853821, -19677898873, 57407971584, 30540143304, -38360465617, -20721790443, 14846523620, 7764423585, -3575813034, -1784969604, 543806285, 256411089, -48696648, -21592486, 2057746, 846609], [-33115752912402, -106868595929830, 119928992729707, 168334643403717, -126129629458253, -117622505367539, 62256078466158, 45498484447973, -17387689074968, -10824464034847, 2948465510484, 1621765377709, -288319318279, -144306881117, 13352156499, 6135024293], [-41759097040057, 126156859383031, 22259305461325, -176885437933337, 10381297760156, 119958555534177, -11418624916134, -46468851901548, 4060764738779, 11169729283807, -788893843317, -1686020685713, 84880417141, 149688381624, -4449079069, -6229064855]];
    Rf_basisdens := [1, 323698, 323698, 11901469429298, 11901469429298, 11901469429298, 11901469429298, 49383690578, 49383690578, 410395497562, 410395497562, 410395497562, 78011218, 1702885882, 11901469429298, 11901469429298];
    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, -1, 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 := 2;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0], [-1, 0, 0, 1, 1, 0, -1, 0, 0, 1, -1, 0, 1, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0], [-1, 0, -1, 1, 0, -1, 0, -1, 0, 0, -1, -1, 0, 0, -1, 0], [-1, 0, 0, -1, 0, 1, 1, 0, 1, -1, -1, 0, 1, -2, 0, 0], [-1, 0, -1, 2, 2, 0, -1, 0, -1, 0, -1, 1, 2, 0, 0, 0], [-1, 0, 0, -1, 1, 0, -2, 0, 2, 0, 0, 0, 1, -2, 0, 0], [0, 1, 1, 0, -1, 0, 0, -1, 0, -1, 1, 0, 0, 0, 0, 0], [-2, 0, -2, 2, 1, -1, 0, -1, -1, 0, -4, 0, 2, 0, -1, 0], [0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, -1, -1, -1, 0], [-2, 1, 0, -1, -2, 1, 3, 1, 0, 1, -1, -1, 0, -1, 2, -2], [-1, -2, 0, -2, 0, 0, -1, -1, 2, 0, 4, -2, 2, -1, 0, 2], [2, 0, -2, 2, -2, -1, -2, -3, 0, -3, 4, 1, 1, -1, -1, 2], [-1, 1, 0, 2, 1, 0, -3, 0, 0, 2, 1, 3, 0, 0, 0, -1], [-1, -2, -4, 2, 0, -3, -2, -4, 0, 0, 1, -2, 2, 0, -1, 2], [2, 1, 0, -1, 0, -1, 1, 1, 3, -1, 1, -3, -2, 1, 1, 0], [-2, -2, -2, 1, 1, 0, 0, -2, 1, 0, -3, 1, 5, -1, -1, 1], [-6, -1, -2, 3, 3, -1, -7, -4, 0, 1, -2, 0, 5, -2, -2, 2], [-2, -1, -3, 2, -1, -2, -1, -5, -4, -2, 0, 0, 1, 2, -1, 2], [1, 0, 0, 3, 5, 0, -3, 2, -1, 7, -3, -2, -1, 0, 2, 0], [10, 0, 1, -5, -2, 0, 4, 4, 0, -3, 3, 0, -5, 0, 1, 0], [1, 3, 5, -2, 4, 1, 2, 5, -2, 7, -7, -2, 1, 4, 1, -2], [-7, -2, -3, 2, 3, 0, -1, -1, 0, 3, -7, 1, 5, 0, 0, -2], [2, 0, 3, -2, 0, 3, -2, 2, 6, 0, 4, 4, 2, -3, 3, 1], [5, 0, -1, -3, -8, -3, 0, -3, -2, -3, 6, -1, -10, 1, -1, 2], [-1, 2, 4, 2, -1, 3, -2, 1, 1, 2, 2, 2, -1, 2, 0, 1], [2, 0, 0, -1, -2, 1, 5, 1, -1, -1, 2, 0, -2, 1, 0, -2], [-4, 0, 0, 3, 2, 0, -7, -1, -1, 3, 1, 5, 5, 1, 1, 1], [2, 4, 5, -2, -7, 1, 2, 1, -1, 0, 5, -2, 0, 4, 0, -1], [3, 0, -3, 2, -2, -1, 4, -4, -1, -7, -1, 2, -2, 2, -3, 0], [-2, 2, 3, -4, 4, 0, -1, 2, -1, -3, 3, -3, -4, 0, 1, -1], [3, 2, 3, -5, -6, -2, 3, 1, 3, -5, 2, -3, -4, 3, -1, -1], [8, -1, 4, -4, -3, 1, -1, 0, 4, 1, 6, 1, -7, 0, 6, 1], [3, 4, 3, -4, 3, 3, 3, 2, -1, -2, -4, 1, -7, 1, -1, -4], [-2, 2, 0, 1, -1, 4, 4, -1, -1, 1, -8, 1, -2, -2, -4, -1], [2, 3, -1, -1, 4, -2, 8, 4, -2, 3, -10, -4, -5, 1, 2, -5], [1, 2, 1, -2, -2, -1, 2, 2, -5, 4, 0, -2, -2, 6, 5, -1], [11, 0, 6, -3, -1, 3, -5, 3, 3, -2, 6, 2, -7, -1, 3, 0], [3, 2, 0, 0, 2, -1, 1, -2, -1, -5, 3, 2, 0, -3, 3, -1], [4, -1, 2, -3, 2, 0, 0, 0, 2, 2, 3, 0, 0, 1, 3, 0], [10, 2, 6, -3, 3, 3, -3, 4, 1, -2, 2, 8, 4, 1, 2, -4], [-2, 3, 1, -5, 0, 6, 3, 5, 2, 4, -4, -1, -7, -5, 3, -5], [9, 0, 5, -9, -4, 0, 4, 4, 4, -9, 4, 1, -3, 0, 0, 0], [0, -1, 1, -2, 1, 4, -8, 2, -2, 1, -6, 4, 2, -2, 3, 0], [6, 8, 5, -9, -13, 4, 15, 2, 0, -7, 1, -2, -7, 0, 1, -4], [2, 0, 1, 9, 5, 1, -14, 0, 1, 3, 0, 14, 4, -1, 0, 1], [4, -1, 0, 8, 2, -1, 2, 1, -3, 4, -10, 4, -6, 3, 1, -3], [-2, -1, 0, -5, -1, -1, -1, -1, 1, -1, 8, -5, 3, 1, 1, 1], [5, -3, -1, -2, 2, -1, 7, 1, 2, 1, 0, -6, -6, -1, 1, -1], [7, -1, 0, -4, 4, 1, -4, 2, 1, 2, 3, 4, -4, 3, -3, 0], [2, -3, 0, -1, 6, 2, -4, 3, -1, 9, -1, -2, 1, -3, 1, -1], [-2, -2, 1, 0, 1, 4, 1, 2, 3, 3, -2, -1, 1, -3, 1, -2], [-4, -2, -6, 8, 3, -3, -10, -4, -1, 2, -11, -2, 2, -1, -2, 2], [-9, 3, 0, 7, 6, 4, 2, 4, 1, 11, -6, 2, -1, 3, 4, -4], [5, -4, -2, 0, 6, 0, -2, 0, 6, 3, 4, -2, -3, -2, 2, 4], [-9, -3, -10, 7, 3, -4, 2, -9, -3, -8, -9, 5, 4, -1, -5, -1], [-4, 2, 3, 8, 6, 0, -10, 1, 0, 6, -11, 2, 7, 0, 0, 2], [7, -2, 4, 6, 4, 1, 7, 3, 3, -9, 6, 5, 9, 0, 7, -4], [-8, -2, -2, 1, 0, -6, -1, -2, 1, 1, 1, -13, 1, 5, -1, 2], [8, -4, -3, -3, -12, 1, 4, -4, 1, -5, 8, 5, -5, -2, -1, 3], [7, -1, 1, -9, -5, 3, 11, 7, 2, 1, -3, -5, -14, -1, 0, -6], [-14, -3, -3, -3, 4, -3, -6, -1, 0, 10, -12, -12, 7, 0, -5, -2], [12, -4, 1, -11, -6, -1, 9, 1, 4, -11, 15, 3, -11, -4, 0, 0], [-21, -7, -10, 5, 2, -3, 1, -5, -4, 1, -10, -6, 6, 1, -6, 3], [-15, -4, -12, 2, 1, -2, 0, -14, -4, -6, 1, -4, 5, 2, -8, 8], [-9, -1, -5, 2, -8, 0, -4, -4, -4, -7, -9, -1, 3, -4, -3, 0], [2, -6, -2, 8, 5, -3, -1, 1, 4, 2, 0, 7, 8, -3, 1, 0], [3, 1, -1, -3, -14, -1, -6, 0, -2, -7, 16, 10, -8, 1, 0, -1], [-8, -6, 0, 2, 5, 1, -4, 2, -1, 4, -1, 4, 12, -2, -1, -1], [4, 1, 1, -4, 1, 1, -3, 0, 0, -5, -5, 2, 2, -7, -2, 2], [-10, -3, -5, 19, 10, -4, 2, -3, -4, -10, 4, 11, 13, 4, -4, 2], [2, 6, 5, -14, -8, -1, 5, 0, 5, -1, 5, -5, -5, -5, -3, -1], [-15, -6, -14, 11, 3, -12, -13, -14, -8, 14, -13, -10, 1, 8, -6, 8], [-2, 3, 2, 2, -12, -1, 5, -4, -1, -7, 8, 2, -3, -2, -2, 3], [1, -3, 2, -11, -7, 5, 0, 5, 0, -3, -1, 1, -4, 0, 8, -2], [-1, -8, -6, 11, -11, -7, 5, -8, -3, 4, 4, 2, 3, 6, -2, 4], [-14, 0, -1, -4, 1, 1, -7, 0, -2, 11, -7, -9, 6, 1, 0, 0], [2, -1, 0, -3, -3, 2, 1, -2, 1, 0, 2, -1, -3, -1, -2, 1], [-18, -8, -9, -6, -8, 3, 0, -8, 1, 14, 8, -15, 6, -4, -1, 9], [-8, 5, 0, -3, 6, 1, 8, -2, -3, 1, -4, -18, 0, 4, -1, -3], [0, -4, -10, 5, -1, -6, -2, -9, 0, 10, 5, -15, 6, -1, -3, 3], [-6, 2, -1, -5, -5, -5, 8, 0, -1, 1, 0, -8, 0, 3, -4, -5], [-3, 1, -6, 3, -3, -8, 0, -6, -8, -4, 0, -4, -1, 8, -7, 7], [4, -1, 1, 11, -1, 2, -11, 2, 1, 6, 3, 7, 4, -2, 4, 1], [2, -1, 0, -5, 0, -2, 0, -6, -5, -8, -4, 6, 11, 4, -1, 4], [-5, 4, 3, 1, -2, 2, 3, 6, -5, 2, -7, 0, 1, 1, 3, -6], [13, 1, 8, -8, 2, 4, -4, 10, 5, -2, 10, 6, -6, -2, 6, 2], [-23, 0, -14, 7, 2, -7, 9, -7, -7, 1, -15, -5, 17, 3, -11, 4], [-1, -7, 1, 6, 3, -4, -11, -11, 2, -2, 7, -3, 9, -1, -6, 12], [-6, -4, -3, 0, -6, -6, 1, -4, 2, -12, 5, -13, -2, 4, -2, 3], [-5, 3, 4, 3, 17, 4, -7, 3, 1, 2, -10, 6, 11, -5, -1, -4], [-12, -8, -12, -6, -6, -4, 5, -9, 0, 4, -7, -24, 2, -4, -7, 1], [-6, -7, -3, 3, -14, 1, -3, -9, -2, -2, 3, 6, 6, -4, -6, 6], [-5, -4, -6, 1, -8, -8, -7, -8, -4, 4, 0, -13, -16, 8, -4, 8], [1, -4, 6, -8, 10, 1, -2, 3, 6, -6, 5, 3, 2, -9, 2, -2], [-11, -1, -8, -4, -1, -2, -6, -7, -5, -2, -12, -1, 6, -5, -6, 0], [-11, 2, -3, 1, -14, 3, -8, 0, -3, 5, -1, 8, -6, -5, -6, 3], [15, 3, 0, -7, -13, -1, 0, -4, 5, -7, 12, 1, -15, 0, 1, 5], [-6, 2, 0, 0, 4, 6, 4, 0, 0, -11, 7, 20, 6, 0, 2, 0], [-13, -3, -10, -7, -3, 4, -4, -7, 4, 6, 1, -9, 10, -11, 1, 4], [10, 0, 2, -9, -5, -4, 1, -2, -4, -1, 7, -10, -7, 8, 2, 0], [6, 5, 10, -6, -11, 5, 19, 17, -2, 0, 3, -2, -17, 7, 10, -5], [9, -1, -4, -12, -12, -2, 11, -3, -2, -23, 8, -2, -14, 3, -1, 3], [-12, -2, -2, 1, -21, -3, 18, -2, -2, 9, -4, -9, 6, 4, -1, 1], [11, 1, 0, 14, 11, -7, -13, 0, 0, 5, -10, 13, 0, 6, 1, -7], [-11, -2, -11, 11, 7, -4, -7, 3, -4, 14, -11, -6, 13, 4, -4, -5], [-7, 7, 6, -7, -3, 6, 5, 7, -5, 12, -2, -6, -3, -1, 5, -6], [9, 2, 3, -8, -14, 2, -4, -1, 6, 7, 5, -5, -11, -3, 5, 4], [-4, 2, -3, 10, -5, -2, -5, -7, -4, -7, 9, 16, 16, -2, -6, 6], [-5, -1, -10, 14, 13, -6, -19, -2, -6, 14, -1, 3, 14, 1, -1, -3], [-9, -3, 5, -3, 2, 4, -10, 0, 5, 7, 22, 10, 16, -1, 3, 4], [0, -4, -7, 7, 11, -5, -10, -3, 2, 10, -11, -4, -1, 2, 1, 1], [8, -1, 9, -16, 10, 1, 7, 17, 10, -7, -5, -7, -2, -2, 9, -9], [5, 2, 1, 13, -1, -1, -14, -2, 0, 5, 17, 23, 7, 0, -2, 0], [-11, -6, -6, 13, 15, 2, -4, -5, 5, -10, -14, 12, 11, -10, -3, 3], [6, -1, -3, -11, 0, 1, 7, -1, -1, 1, -4, -22, -20, 1, 0, -3], [-3, 3, -3, 15, 4, 0, 7, -3, -3, -9, -2, 4, 13, 4, 2, -5], [3, 3, 1, -7, -4, 5, 8, 9, 2, -2, 1, 18, -8, -1, 4, -8], [-6, 4, 0, 10, 2, -1, 1, 4, -1, 2, -3, -8, -12, 2, 1, 0], [-7, -1, -1, 10, 10, -1, -3, 0, 0, 5, -4, 9, 12, -9, 4, -4], [-10, -8, -18, 17, 7, -9, -6, -19, 4, -2, -6, 2, 19, -9, -5, 10], [11, 3, 2, -8, -3, 1, 2, 7, -8, -2, 4, 13, -5, 1, 5, -4], [-3, 6, 11, -8, 12, 12, -2, 10, 4, 15, -17, 11, -11, -5, 6, -5], [0, -2, 2, -8, -7, 4, 16, 7, 8, -4, -8, -16, -11, -1, 8, -7], [9, 0, 3, -14, 14, 6, 6, 3, -1, -10, 8, 15, -1, -3, 0, -6], [-8, -3, 0, 12, 2, -2, -16, -4, -2, 10, 4, 5, 9, -4, 4, 5], [-21, 0, -7, 26, 15, -12, -23, -9, -14, 5, -8, 17, 33, 7, -7, 2], [-7, 0, 0, 13, 23, -2, -5, 3, 4, -2, -9, -4, 12, -5, 2, 4], [8, 3, 8, 2, -3, -2, -4, 2, 1, -1, 10, 6, -3, 4, 4, 1], [23, -8, -8, -8, 4, -1, 10, -6, 3, -29, -1, 4, -6, -6, -4, 4], [11, 7, 19, -14, -1, 14, 6, 9, 2, -8, 5, 15, -21, -5, 7, -5], [-6, 3, 3, 2, -7, 0, 1, -1, 3, -3, 10, 7, -2, -1, 0, -2], [-2, 0, -1, -9, -18, -4, 8, -1, 3, -14, 0, -8, -7, 3, -1, -3], [-1, -8, -2, 18, 21, 1, -17, 0, -2, 8, -9, 17, 20, 7, -6, 1], [12, 6, 12, 1, -16, 0, -2, 3, -2, 3, 24, 6, -4, 8, 9, 3], [11, -1, 0, -11, 0, -2, 6, 4, -2, 11, 3, -15, -17, 0, 2, -2], [2, 11, 6, -24, -23, 6, 17, 11, -7, 5, 6, -9, -10, 1, 7, -6], [19, 7, 17, -26, -15, 9, 3, 1, 9, -4, 10, -16, -8, -1, 1, 1], [-19, 7, 9, -1, 11, 11, 5, 12, 6, -1, -17, -12, 15, -2, 3, -18], [-34, 0, -5, 21, 29, -6, -11, -6, -6, 15, -23, 6, 24, 5, -6, 6], [4, 5, 1, -28, -8, 10, 13, 9, 4, -8, -11, -3, -15, -9, 5, -9], [19, 8, 20, -15, 8, 13, 1, 20, 2, 0, 3, 10, -18, 0, 7, -6], [10, 0, 2, 11, 6, -2, -5, -3, -1, 5, 7, 19, 13, 3, 3, 3], [-11, 18, 14, -3, -7, 14, -3, 10, -13, 7, -18, 0, -3, 14, 1, -10], [-4, 6, 10, 11, 2, 8, -8, 2, 2, 8, -7, 10, 0, 1, 4, -2], [-10, 1, 0, -14, -1, -3, 1, 1, 2, -15, 0, -14, 12, 1, -2, 0], [-2, 4, 0, -9, -6, 1, -3, -2, -2, 7, 0, -11, 2, 2, -3, -4], [33, 4, 1, 19, 9, -1, -11, 1, -3, -14, 17, 33, -20, 6, -1, -2], [5, -6, -5, -3, 3, -4, 9, -3, 8, -10, 13, 1, -11, -1, 2, 10], [-2, 2, 2, 6, -3, 4, 0, 7, 5, 9, 9, -8, -7, -5, 2, -5], [10, 8, 2, -11, -20, -4, 2, -5, -4, -14, 7, 7, -1, 6, -7, -4], [12, -1, -5, 5, 13, 2, 3, 0, -5, -4, -23, -3, -4, -1, -1, 2], [28, 3, 15, -5, 9, 6, 1, 15, 6, -8, 16, 14, -18, 0, 9, 3], [21, 2, 13, -27, -10, 9, -8, 5, 9, 10, 7, -14, -10, -7, 7, 2], [26, -5, 3, -10, -8, -1, -7, 4, 4, -4, 15, -9, -26, 11, 2, 2], [-22, -3, -12, 18, 1, -7, -9, -2, -7, 18, -16, -7, 14, 0, 0, -2], [31, -2, -1, -16, -29, 0, 26, -7, 1, -19, 19, 0, -14, -2, 0, 1], [28, 10, 16, -27, 0, 6, 16, 11, 4, -8, 24, 10, -19, -1, 12, -3], [4, 0, 4, -10, -4, 4, -16, 4, 0, -4, -4, 4, 0, 0, 4, 8], [18, 0, 5, -4, -16, 0, 25, 2, 0, -16, 0, 5, -9, 0, 5, 0], [-14, 1, -3, 4, 0, 5, -16, 4, 4, 9, 6, 18, 21, -8, -2, -3], [0, 3, -5, -11, -9, -1, 16, -4, -4, -13, -19, -10, 0, 4, -3, -1], [-19, -8, 0, -3, 1, 3, 9, 6, -3, 23, -15, -4, 10, -6, -3, -3], [-20, 10, 3, -11, -4, 13, 12, 6, -13, 9, -25, -10, -7, 13, 0, -16], [24, 16, 24, -11, 4, 11, 14, 17, 4, -20, 4, 17, -31, 7, 6, -5], [-1, -8, -7, 14, 11, -6, -31, -9, 0, 14, 0, -6, 18, -1, -2, 14], [-9, 7, 9, 26, -14, 2, -17, 6, 3, 9, -7, 0, 3, 2, 4, -5], [6, 2, 2, -1, 15, 4, 8, 10, 8, -4, -8, 15, 0, 0, 2, 0]];
    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_e();".
// 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_e(: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_e();".
// 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_e( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_930_bg();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<7,R![1, -35, 28781, 13800, -36110, -7650, 32714, -15485, 1339, -205, 824, -120, -35, -30, -4, 5, 1]>],Snew);
    return Vf;
end function;