
// Make newform 1512.2.k.a in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1512_k();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1512_k_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_1512_2_k_a();".
// 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_1512_2_k_a();".
// 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 := [169, 0, -104, 0, 1134, 0, -1244, 0, 2139, 0, -1052, 0, 230, 0, -24, 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], [237296969, 0, -1154216584, 0, 747498217, 0, -695756145, 0, 319235369, 0, -69689225, 0, 7316240, 0, -305389, 0], [-10061233, 0, -572101, 0, 779859, 0, -3789335, 0, 2285409, 0, -552649, 0, 61469, 0, -2694, 0], [81211, 0, 3898775, 0, -779859, 0, 3789335, 0, -2285409, 0, 552649, 0, -61469, 0, 2694, 0], [6370193, 0, -16270592, 0, 38849348, 0, -39217560, 0, 15624254, 0, -3040296, 0, 293628, 0, -11520, 0], [691999581, 0, -1455012369, 0, 4125515812, 0, -3939691239, 0, 1529685268, 0, -295900503, 0, 28712659, 0, -1139534, 0], [-44292248, 0, -1464953121, 0, 1088455103, 0, -2709051014, 0, 1427099575, 0, -320576374, 0, 33944011, 0, -1429545, 0], [0, 2564873142, 0, -8231666126, 0, 13830825760, 0, -7303260208, 0, 1832626360, 0, -243643736, 0, 16643678, 0, -458582], [15626169, 0, 23842785, 0, -27036722, 0, 154953525, 0, -86408618, 0, 19736021, 0, -2103563, 0, 88700, 0], [0, -10467201680, 0, 18464795563, 0, -27619863991, 0, 19868045926, 0, -6828867199, 0, 1228806350, 0, -113264303, 0, 4302859], [0, 225114682, 0, 21762817, 0, 854627793, 0, -1172875960, 0, 504132793, 0, -101747496, 0, 10071623, 0, -403473], [0, 1131065416, 0, -407547934, 0, 3953470823, 0, 3036067465, 0, -2588222763, 0, 666756659, 0, -75367115, 0, 3300067], [0, 4770443028, 0, -815095868, 0, 7906941646, 0, 6072134930, 0, -5176445526, 0, 1333513318, 0, -150734230, 0, 6600134], [0, -8003320, 0, -175583178, 0, 316469269, 0, -561779405, 0, 271352435, 0, -58426783, 0, 6021151, 0, -248063], [0, 1098391515, 0, -6407093879, 0, 138651525, 0, -16587964242, 0, 9941641297, 0, -2332684002, 0, 252302706, 0, -10755599], [0, -140493626, 0, -1309963695, 0, 2039706321, 0, -3743153672, 0, 1835444329, 0, -399318104, 0, 41505147, 0, -1723809]];
    Rf_basisdens := [1, 192947092, 1663337, 1663337, 3710521, 192947092, 192947092, 627078049, 6653348, 2508312196, 86493524, 627078049, 627078049, 21623381, 627078049, 86493524];
    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_1512_k();"
function MakeCharacter_1512_k()
    N := 1512;
    order := 2;
    char_gens := [1135, 757, 785, 1081];
    v := [2, 2, 1, 1];
    // 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_1512_k_Hecke();"
function MakeCharacter_1512_k_Hecke(Kf)
    N := 1512;
    order := 2;
    char_gens := [1135, 757, 785, 1081];
    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], [-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 := 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, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 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, 0, 0, 0, -1, 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, -1, 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, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, -1], [0, 0, 0, 0, -1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-1, 1, -1, 0, 0, 0, -1, 0, 1, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 1, 0, 0, 1, 0], [1, 0, 1, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, 0, 2, 0, 2, -1, 0, 1, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0, 0, -2], [0, 0, 0, 0, 0, 0, 0, 1, 0, -2, 0, 0, 1, 0, 1, 0], [0, 1, 0, 2, 0, 0, 1, 0, 0, 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, 0, -10, -2, -10, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-3, -10, -4, 0, 0, 0, 10, 0, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, 11, 0, -2, -2, 0, 4, 0], [13, -13, -1, 0, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, -6, 0, 0, 3, 0, 3, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, -8, 0, 0, -2, 0], [0, -3, 0, 2, -8, -8, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-19, -6, -5, 0, 0, 0, 6, 0, -8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -4, 0, -3, 0, 6, -4, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 0, -13, 1, 0, 3], [0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, -2, -4, 0, -6], [-16, -5, 4, 0, 0, 0, 5, 0, 6, 0, 0, 0, 0, 0, 0, 0], [0, 4, 0, 0, 6, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 5, 0, 4, 6, 0, 9], [31, -2, -7, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, 0, 12, 0, -2, -1, 0, 6, 0], [-17, -1, 1, 0, 0, 0, 1, 0, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, 9, 0, 6, -2, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 2, 0, -4, 2, 0, 3], [0, 3, 0, -10, -13, -1, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -4, 0, 0, 11, 0, 4, -3, 0, -2], [36, -10, -5, 0, 0, 0, 10, 0, 4, 0, 0, 0, 0, 0, 0, 0], [0, -7, 0, -5, -6, 4, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-3, -10, -1, 0, 0, 0, 10, 0, -8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, -2, 0, -1, -2, 0, 2], [0, 4, 0, 1, 2, -8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -3, 0, -10, 0, -6, -3, 0, -1, 0], [0, -5, 0, -6, -16, 0, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 7, 0, 0, -5, 0, -7, -2, 0, -1], [0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, -2, 5, 0, 2], [0, 0, 0, 0, 0, 0, 0, -2, 0, -6, 0, 0, -2, 0, -5, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 3, 0, -1, -3, 0, -6], [0, -10, 0, -6, 17, -10, -10, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -9, 0, -1, -2, -1, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-7, 7, 7, 0, 0, 0, -7, 0, 3, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 0, 4, 2, 0, -5, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 6, 0, -2, 3, 0, -1, 0], [0, -11, 0, -12, 1, -7, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, -10, 0, -2, -2, 0, 1, 0], [-21, -4, -1, 0, 0, 0, 4, 0, -2, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 8, 0, 7, -2, 0, 5], [2, 0, 4, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, 0, 16, 0, 5, 4, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 6, 0, 7, 1, 0, 6], [0, 1, 0, -6, 4, -10, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, -13, 0, 0, -2, 0, -2, 0], [0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 5, 0, -8, -1, 0, 4], [13, -7, 1, 0, 0, 0, 7, 0, 5, 0, 0, 0, 0, 0, 0, 0], [0, 13, 0, 1, 0, 0, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -3, 0, -8, 0, 5, -3, 0, -4, 0], [0, 13, 0, 16, -10, 1, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0], [21, 3, -1, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 5, 0, -4, -2, 0, 10], [0, 0, 0, -8, -12, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 4, 0, 8, -12, 13, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -1, 0, -19, 0, -6, -1, 0, 3, 0], [0, -11, 0, -8, 1, -6, -11, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -3, 0, 0, 3, 0, 3, 2, 0, -1], [0, 0, 0, 0, 0, 0, 0, -3, 0, -4, 0, -1, -3, 0, 2, 0], [0, 0, -8, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 7, 0, -3, -2, 0, -5], [0, 12, 0, 12, 4, 7, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-20, 3, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 0, 12, 18, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [9, -9, -1, 0, 0, 0, 9, 0, -4, 0, 0, 0, 0, 0, 0, 0], [0, -5, 0, 0, -2, 3, -5, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -7, 0, 8, -7, 5, -7, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, 0, -1, 0, 2, -7, 0, -6], [-42, 6, -6, 0, 0, 0, -6, 0, 10, 0, 0, 0, 0, 0, 0, 0], [-2, -8, 0, 0, 0, 0, 8, 0, 4, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, 0, -2, 0, -2, 4, 0, -5, 0], [0, 0, 0, 0, 0, 0, 0, -7, 0, 10, 0, 14, -7, 0, 3, 0], [-28, 0, 0, 0, 0, 0, 0, 0, -12, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 2, 0], [0, 0, 0, 4, -8, 13, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -6, 0, 10, 9, -2, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 4, 0, 0, -2, 0, -4, 2, 0, -9], [15, -12, 4, 0, 0, 0, 12, 0, -12, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, -4, 0, -1], [0, 1, 0, -2, 3, -3, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 1, 0, -9, 0, -1, 1, 0, -3, 0], [0, 0, 0, 0, 0, 0, 0, 3, 0, 0, -4, 0, -3, -2, 0, -12], [0, 0, 0, 0, 0, 0, 0, -6, 0, 2, 0, 10, -6, 0, -1, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, 0, 5, 0, 2, -6, 0, 5], [0, 0, 0, 0, 0, 0, 0, -4, 0, 4, 0, 0, -4, 0, 4, 0], [-8, 9, -1, 0, 0, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -2, 0, -3, 0, -5, -2, 0, 2, 0], [0, 1, 0, -9, 10, 5, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, -4, 0, 12, 0, 7, -4, 0, 2, 0], [0, 0, 0, 0, 0, 0, 0, 4, 0, -10, 0, -10, 4, 0, -3, 0], [0, -6, 0, 4, 11, 2, -6, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, -9, 0, -6, -12, 0, -9, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -7, 0, 0, 8, 0, -3], [-4, 4, 4, 0, 0, 0, -4, 0, 0, 0, 0, 0, 0, 0, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1512_k_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1512_2_k_a();".
// 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_1512_2_k_a(:prec:=16)
    chi := MakeCharacter_1512_k();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 2));
    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_1512_2_k_a();".
// 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_1512_2_k_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1512_k();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![16, 0, -91, 0, 83, 0, -17, 0, 1]>],Snew);
    return Vf;
end function;