
// Make newform 1470.2.m.f in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1470_m();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1470_m_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_1470_2_m_f();".
// 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_1470_2_m_f();".
// 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 := [390625, 0, 0, -100000, 1250, 0, 8800, -1440, 2, -288, 352, 0, 2, -32, 0, 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], [17286250000, -5904875000, -176434375, -2959145625, 988282000, -9130200, 133354345, -99781289, 19988016, -183704, 10867065, -3356569, -30736, -513400, 151945, 23], [-88433203125, 21019390625, 743925000, 14571370000, -4050419125, -20484575, -655014680, 489526928, -71108757, 2515873, -53602520, 13822768, 334507, 2464225, -711160, -12176], [7283671875, -7983125000, 436350000, -1294480625, 1382043875, -80373000, 61131440, -86582961, 29256259, -1954056, 4897520, -4866801, 200771, -230600, 234160, -7153], [-6183828125, 9931171875, 2208303125, 1662561875, -1656298125, -290692925, -100536475, 97051123, -21020637, -6615837, -6617515, 5695603, 1210867, 417475, -277595, -52781], [-3498281250, 3362187500, -278928125, 555072500, -565159000, 64163100, -25413395, 36913924, -14275106, 1205964, -2187965, 2002804, -196524, 91100, -94195, 10532], [-2325781250, 1367131250, -182746250, 401156375, -226977250, 35441490, -19619686, 17642267, -6093858, 759218, -1500066, 799959, -110818, 69810, -36198, 5499], [-16529921875, -8980093750, 5544903125, 2922380000, 1529546125, -834999350, -125413435, -18736688, 63233197, -17542518, -9726795, -6082048, 2971213, 543850, 289765, -124784], [-10391250000, 3063921875, -4479975000, 2128850625, -356214000, 765575875, -118375880, 46597281, -45725264, 15219891, -7551160, 1413601, -2683056, 411075, -35880, 128033], [-29524375000, 435328125, 7330671875, 4664830000, -45651000, -1280351475, -180286285, 99497552, 62805512, -23549603, -16782845, -596208, 4513448, 759725, 115, -221264], [4653906250, -3672203125, 2448231250, -823538750, 654882250, -430608425, 46384230, -46480158, 31497002, -8656053, 3173970, -2394398, 1495498, -145225, 116510, -72414], [-448000000, 8384375, 65686250, 73925875, -2887200, -11581465, -3089990, 1584467, 515392, -205673, -265270, 1427, 40928, 12455, -230, -2029], [107188750000, -19156796875, -12093690625, -17288645000, 3498498000, 1997199925, 726564415, -508697448, -32747888, 36024597, 63213055, -10487208, -7558352, -2860075, 550015, 374136], [-73231250000, -20797375000, 11838115625, 12378994375, 3333950000, -2104753400, -527876935, 85472887, 168261072, -34237368, -43000695, -13513273, 7167888, 2116200, 616665, -372809], [-4410859375, 36653359375, -14467050000, 244135000, -6401757375, 2424194175, -46705520, 314783384, -226586671, 49110799, -2981040, 23323064, -8294559, 575, -1106320, 377912], [559140625, -7407050000, 3471705000, -26643375, 1207441825, -590045520, 10534952, -55705439, 50671601, -11953936, 677992, -4520623, 2025921, -10640, 201256, -95903]];
    Rf_basisdens := [1, 263500000, 1317500000, 263500000, 1317500000, 164687500, 65875000, 1317500000, 1317500000, 1317500000, 329375000, 8500000, 1317500000, 1317500000, 1317500000, 263500000];
    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_1470_m();"
function MakeCharacter_1470_m()
    N := 1470;
    order := 4;
    char_gens := [491, 1177, 1081];
    v := [4, 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_1470_m_Hecke();"
function MakeCharacter_1470_m_Hecke(Kf)
    N := 1470;
    order := 4;
    char_gens := [491, 1177, 1081];
    char_values := [[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], [-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, -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, -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, 0, 0, 0], [0, 0, -1, 0, -1, 0, 1, -1, 1, 0, 1, -1, 0, 0, 0, -1], [0, 0, 0, 0, 1, -1, 0, 1, 0, 0, 0, 1, 1, 0, -1, 0], [0, 1, 0, 0, -2, -1, 1, -1, 3, 0, 0, -1, 1, 0, 1, -1], [-4, 0, -1, -1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, -1, -1], [0, -1, 0, 1, 0, -1, -1, 0, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 1, 0, -1, 0, 2, 1, 0, 0, -2, 0, 0, 0, 0, -1], [0, 1, 0, 1, -1, 2, 0, 1, 2, 1, 1, 0, 1, 1, -1, 0], [0, 1, -1, -1, -2, -1, -1, -1, 0, -1, 0, -2, 0, 1, 0, 1], [0, 1, -1, 0, 0, 2, -1, 0, 2, 1, 2, 0, 1, 1, 0, 1], [0, 1, 0, 0, 3, 0, 1, 0, -3, 0, 0, 0, 0, 0, 0, -1], [0, -1, 0, -2, 3, 2, -1, 0, -3, 0, -4, 0, 0, -2, 0, 1], [1, 2, -1, 1, -3, 0, 2, -1, 4, 1, -2, -1, 0, 1, 0, -2], [4, 1, 0, 1, 3, 0, 0, 3, -3, -1, -1, 2, 2, -2, 1, 0], [0, -1, 1, -1, 4, 0, -3, -4, -2, -1, 2, 0, 0, 0, 1, -1], [-4, -2, 1, -1, -1, 2, 2, 2, 0, 1, 0, -1, 1, 1, -1, -2], [0, 1, -2, 0, -2, 0, 2, -2, 2, -1, 1, 0, -1, 1, 0, -2], [0, 1, 0, 0, 1, -2, 3, -1, 0, 0, 0, 1, 2, 0, -2, 1], [0, 1, -1, 1, 4, -2, 3, -4, 2, 1, -2, 0, 1, 1, -1, 1], [0, 1, -1, -1, -2, 0, -5, -2, 0, -1, 0, -2, -1, 1, 1, 1], [-4, -2, 2, 0, 3, 0, -2, 3, -3, 2, 0, 4, 1, -1, 0, 2], [-4, 2, -1, -1, -1, -4, 2, 1, 0, 1, -2, 1, 1, -1, 1, -2], [0, -1, 0, -1, 2, 10, 0, -2, 2, -1, -1, 0, -1, -1, 1, 0], [0, -2, 0, -2, 0, -2, 2, 4, 0, 0, 0, 0, 0, 2, 0, -2], [-4, -1, 1, 0, -9, 2, -3, 3, 0, 1, 0, -9, 2, 0, -2, -1], [0, -1, 2, -1, -1, -4, -1, 1, -1, -1, 0, 0, 0, 0, 1, -2], [-1, 1, 0, 1, 6, -2, 1, 4, -10, 0, 0, 4, 0, 1, 0, -1], [0, -1, -1, -1, 0, -2, 1, -4, 0, -1, 0, 0, 1, 1, -1, -1], [0, 0, -1, -2, -1, -2, -9, 1, 3, 0, 9, 0, -1, -1, 2, 1], [4, 0, -3, 3, -3, -1, 0, 1, 0, -3, 0, -3, 0, -3, 0, 0], [4, 0, -1, -1, 4, 0, 1, 4, -4, 0, 1, 2, -2, 2, -1, -1], [0, -1, -1, 1, 8, -4, -5, -8, 1, -1, 4, 0, 2, 2, -1, 1], [0, 1, 0, -3, -1, 0, 4, -1, 1, -1, 3, -2, 2, -2, -3, 0], [-4, -2, -1, -1, 4, -2, -2, -4, 0, 1, 2, -4, -1, -1, -1, 2], [0, 1, -2, 1, -2, 0, 1, 3, -1, 2, 4, 3, -1, 1, -1, -1], [-8, -1, 0, 1, -4, -8, -1, 1, 3, 0, -4, 1, -1, 1, -1, 1], [0, 1, 3, 2, -4, 3, -1, -2, 0, 3, 0, -4, -1, -2, 1, 1], [0, 1, -2, 3, -1, 2, -2, 1, 4, 1, 3, 0, -1, -1, -3, 2], [0, 2, 2, 0, -2, 10, -2, 2, -4, 2, 4, 0, -1, -1, 0, -2], [0, -3, -2, 0, 2, 0, -2, 2, -2, 3, 1, 2, 1, -1, 0, -2], [-5, -1, 3, -3, 0, -3, -1, 6, -6, -3, -6, 6, 1, -3, 1, 1], [3, 1, 0, 1, 0, 0, 3, -10, 0, 0, 0, 0, -2, -1, 2, 1], [4, -4, 1, -1, 2, 0, -1, 2, -2, 4, 3, 3, -1, 1, -1, 1], [4, 1, 1, -2, 3, 0, -1, 3, -3, -1, -2, 6, -2, 2, -2, 1], [0, -1, 3, 0, 3, 4, -7, -1, 0, 3, 0, 3, -4, 0, 4, -1], [-4, -3, 1, -1, 4, -2, -3, 6, -10, -1, 2, 6, -1, -1, -1, 3], [0, 1, 3, 1, -2, 0, 1, -2, 2, -1, 0, -2, 0, 0, 1, 3], [0, -2, 0, -2, 4, 0, -2, 6, -10, 0, -8, 6, 2, -2, 2, 2], [0, 0, -1, 3, -6, 0, -1, 6, 0, 0, 1, 0, 0, 0, -3, 1], [0, 0, -2, -2, -4, 8, -2, 4, -5, 0, 2, 0, 0, 0, 2, 2], [0, -1, 1, 1, 2, 2, -7, -2, -4, -1, 6, 0, -3, -3, -1, -1], [8, 0, 1, 1, -1, 5, 0, -4, 5, -1, -2, -4, 2, 1, 2, 0], [4, -2, -1, 2, -4, 3, -2, 8, -4, 1, -6, 8, -1, 2, -1, 2], [-8, -1, -1, -3, 6, 0, 1, 6, -6, 1, 2, 8, 0, 0, -3, -1], [0, 1, 0, 2, 6, -4, -4, -6, -3, 1, 5, 0, 0, 0, -2, 0], [-7, 4, 1, -3, 3, 7, -4, 6, 0, 1, 0, 3, -3, 3, 3, 4], [0, 0, 3, 3, 0, 0, -6, 0, 0, 0, -6, -2, -2, 2, 3, 3], [0, -2, 3, 0, 6, 1, -2, -2, 0, 3, 0, 6, -1, 0, 1, -2], [0, 2, 4, 0, -6, -1, -2, 6, 0, 4, 0, -6, 1, 0, -1, 2], [-4, -4, 2, 2, -2, -2, -4, 6, -4, -2, -8, 6, -4, 2, -4, 4], [0, -3, 3, 0, 1, 8, 3, -1, 5, -3, -6, 0, 0, 0, 0, -3], [4, 3, -2, 3, 0, -4, -7, 10, 0, -2, 0, 0, 3, -3, -3, 3], [-5, -1, -4, 1, -10, 4, 5, 6, 0, -4, 0, -10, 2, -1, -2, -1], [4, 1, 1, 6, 3, 0, 7, 3, -3, -1, 6, 8, 0, 0, 6, 1], [0, 3, 2, -3, 2, -1, -3, -8, 0, 2, 0, 2, -2, 3, 2, 3], [8, 0, 0, 2, -6, -6, -12, 0, 0, 0, 0, -6, 0, -2, 0, 0], [8, 0, 2, 4, 6, 0, 2, 6, -6, 0, 2, 4, 3, -3, 4, 2], [-4, 0, -3, 0, -9, 3, 8, 2, 0, -3, 0, -9, 1, 0, -1, 0], [0, -1, 2, -4, 6, 2, -6, -6, 10, -1, 5, 0, 3, 3, 4, -2], [-4, 1, 1, 0, 3, -6, 1, -1, -2, -1, 6, -1, 2, 0, 2, -1], [-5, 0, 3, -1, 5, -3, 0, 12, -17, -3, -6, 12, -1, -1, -1, 0], [0, -3, -3, -2, 5, -8, -7, -5, -1, -3, 4, 0, -2, -2, 2, 3], [4, 2, -3, -1, -1, -4, -6, -8, 0, -3, 0, -1, -1, 1, 1, 2], [0, -1, -4, -2, 6, 8, -5, -6, -1, -1, 4, 0, 0, 0, 2, 4], [4, 2, 1, 1, -12, 2, 2, 4, 8, -1, -2, 4, 1, 1, 1, -2], [8, 1, 2, 2, -4, 0, -5, -4, 4, -1, -6, 2, 3, -3, 2, 2], [-8, 2, -2, -2, -1, 0, 2, -1, 1, -2, 0, 7, 2, -2, -2, -2], [4, -2, 2, 2, 0, 0, -10, 0, 0, 2, -8, 8, -2, 2, 2, 2], [4, 3, -1, -2, 5, 0, 9, 5, -5, -3, 6, 0, 4, -4, -2, -1], [-8, 2, -1, -1, -4, 0, 5, -4, 4, -2, 3, 4, 2, -2, -1, -1], [-4, 3, 0, 1, 5, 4, 1, 9, 0, 0, 0, 5, 1, -1, -1, 3], [-12, 2, -3, -2, -9, 0, 3, -9, 9, -2, 1, -15, 0, 0, -2, -3], [-4, 4, -2, 0, -4, -8, 4, 2, 2, 2, 0, 2, 4, 0, 4, -4], [0, 2, -4, -2, -2, 8, -4, 2, 10, 2, 6, 0, 0, 0, 2, 4], [9, 1, 1, 3, -14, -5, -1, 4, 0, 1, 0, -14, -1, -3, 1, 1], [0, -1, 1, -1, 4, 0, -7, -4, 8, -1, 6, 0, 4, 4, 1, -1], [-8, 0, 0, -6, 10, 0, 0, -2, -8, 0, 0, -2, -2, -6, -2, 0], [4, 0, -6, 0, 4, 4, 0, -6, 2, 6, 8, -6, 0, 0, 0, 0], [0, 1, 1, 2, -9, 0, 3, -9, 9, -1, 2, -8, -4, 4, 2, 1], [0, 2, 2, 4, -2, -2, -2, 4, 0, 2, 0, -2, 6, -4, -6, 2], [-8, -2, 3, -1, 8, 0, -3, 8, -8, 2, -1, 9, 5, -5, -1, 3], [0, 5, -1, 2, 7, 8, 3, -7, 11, 5, 2, 0, -2, -2, -2, 1], [-8, -4, -3, 2, -6, 8, 0, -1, 0, -3, 0, -6, 2, -2, -2, -4], [0, 4, -1, 0, 10, 0, 1, 10, -10, -4, -3, 8, -2, 2, 0, -1], [0, 4, -4, 1, 7, -4, 4, -7, 1, 4, 0, 0, 0, 0, -1, 4], [0, -1, 0, 1, 6, 3, -3, 2, 0, 0, 0, 6, -2, -1, 2, -1], [-12, -1, -3, -3, -8, 0, 7, -8, 8, 1, 8, -12, -5, 5, -3, -3], [-12, 2, 1, 0, 2, 10, -2, -9, 0, 1, 0, 2, 2, 0, -2, 2], [-1, 1, 0, -7, 0, -4, 3, -2, 0, 0, 0, 0, -2, 7, 2, 1], [8, 3, -1, 1, -6, -6, -7, 6, 0, -1, 0, -6, -1, -1, 1, 3], [0, 0, -3, 3, 0, 12, -10, 0, 2, 0, 10, 0, -2, -2, -3, 3], [20, -2, 0, -4, -4, 0, 0, -4, 4, 2, 2, -4, 2, -2, -4, 0], [8, 2, -5, 0, -2, 12, 2, -8, 10, 5, 6, -8, -4, 0, -4, -2], [0, 1, -5, -3, 2, 2, 1, -2, 0, 5, 6, -2, 1, -3, 1, -1], [8, -3, 0, 0, 0, -11, -5, -13, 0, 0, 0, 0, 3, 0, -3, -3], [0, 0, 3, 3, -2, 8, -1, 2, 4, 0, 1, 0, 0, 0, -3, -3], [0, 4, -2, -4, 3, 0, -10, -3, 0, 4, 14, 0, 4, 4, 4, 2], [8, -1, -3, 0, 5, 10, -1, 7, -12, 3, 6, 7, -2, 0, -2, 1], [0, -1, 5, 7, 6, -5, -1, 7, -13, -5, -12, 7, -2, 7, -2, 1], [-4, -5, 2, 0, -1, 3, 3, -5, 0, 2, 0, -1, 1, 0, -1, -5], [-4, -1, 2, 8, -6, 0, -2, -6, 6, 1, -1, -4, 1, -1, 8, 2], [8, -5, 0, -1, 9, 0, -8, 9, -9, 5, -3, 14, -2, 2, -1, 0], [-16, 0, -1, -5, 4, 0, -4, 4, -4, 0, -4, 8, 0, 0, -5, -1], [-8, -1, -4, -1, 0, 3, -3, 4, 0, -4, 0, 0, 4, 1, -4, -1], [8, 1, 0, 6, 1, 4, 1, 14, -15, 0, 4, 14, -2, 6, -2, -1], [-4, 0, 2, 5, -5, -2, 0, 9, -4, -2, -14, 9, -7, 5, -7, 0], [0, -1, 6, 2, -8, 20, 6, 8, 5, -1, -7, 0, -2, -2, -2, -6], [0, 2, -2, 1, -8, -8, 2, 8, -6, 2, 0, 0, 0, 0, -1, 2], [0, 5, 0, 1, -10, -7, 5, 2, 8, 0, 6, 2, 6, 1, 6, -5], [0, 1, 3, 4, 4, -1, 1, 2, -6, -3, -6, 2, -3, 4, -3, -1], [-8, 2, -2, -6, 8, 6, 2, 2, -10, 2, 8, 2, -8, -6, -8, -2], [0, -5, 0, 2, 10, 10, 4, -10, -4, -5, -9, 0, -3, -3, -2, 0], [-8, -2, -5, 2, 9, 0, 4, 9, -9, 2, 6, 7, 0, 0, 2, -5], [0, -7, 2, 5, 1, 0, 3, -1, -5, -7, -10, 0, 2, 2, -5, -2], [-8, -5, -1, 0, -9, 0, -7, -9, 9, 5, -2, -8, -2, 2, 0, -1], [4, 1, -7, 0, -1, 4, 1, -3, 4, 7, 6, -3, 0, 0, 0, -1], [12, 2, 1, 2, -8, -8, -2, 6, 0, 1, 0, -8, -2, -2, 2, 2], [0, -1, 1, 4, -1, -8, 9, 1, 1, -1, -10, 0, 2, 2, -4, -1], [8, -4, 2, -2, 6, 6, -4, -6, 0, -2, -4, -6, 4, -2, 4, 4], [-16, -1, -4, -3, 7, 0, 16, 7, -7, 1, 17, 2, 0, 0, -3, -4], [4, -2, -2, 6, 4, 7, 4, -7, 0, -2, 0, 4, -5, -6, 5, -2], [0, -5, -1, 2, -8, -2, -1, 8, 2, -5, -4, 0, 7, 7, -2, 1], [0, 1, -3, 0, 10, 0, -1, 10, -10, -1, -2, 17, 2, -2, 0, -3], [-8, 1, 5, -5, -6, 5, -1, 14, 0, 5, 0, -6, -2, 5, 2, 1], [4, 2, -2, 2, -16, 0, 2, -4, 20, 2, 8, -4, 2, 2, 2, -2], [0, -2, -2, -1, 2, -5, -2, -16, 14, 2, 4, -16, 6, -1, 6, 2], [0, 0, 6, -6, 8, -16, -2, -8, 12, 0, 2, 0, 4, 4, 6, -6], [0, 0, -5, 3, 10, -20, 3, -10, -8, 0, -3, 0, 4, 4, -3, 5], [0, 4, 2, 0, -6, 0, -10, -6, 6, -4, -14, -15, -3, 3, 0, 2], [-4, 5, -5, -1, -4, 0, 5, -10, 14, 5, 2, -10, -3, -1, -3, -5], [12, 1, 3, 0, -3, -10, 3, 5, 0, 3, 0, -3, -2, 0, 2, 1], [-8, 2, 2, -6, 8, 0, 10, 8, -8, -2, 8, 14, 1, -1, -6, 2], [-8, 0, -8, 0, -4, 0, 0, -4, 4, 0, 0, -2, 2, -2, 0, -8], [-4, -4, -1, -5, 12, 0, 4, 10, 0, -1, 0, 12, -1, 5, 1, -4], [16, 2, -3, 5, 1, 11, 2, -8, 7, 3, -2, -8, 0, 5, 0, -2], [-4, -2, -1, -5, 12, 0, -7, 12, -12, 2, -5, 6, 4, -4, -5, -1], [-12, -1, 3, -3, -8, -8, -1, 0, 8, -3, 2, 0, -1, -3, -1, 1], [4, -4, -6, -2, 10, -9, -10, -3, 0, -6, 0, 10, 3, 2, -3, -4], [0, 2, -2, 3, -5, 8, -2, 5, 5, 2, 4, 0, -2, -2, -3, 2], [-4, -3, -4, -1, 0, 6, -3, -7, 7, 4, 16, -7, -9, -1, -9, 3], [-4, 1, 2, 3, 4, -6, 1, -9, 5, -2, -8, -9, -1, 3, -1, -1], [-16, 0, -9, -5, 1, 6, 0, -16, 0, -9, 0, 1, 5, 5, -5, 0], [0, 2, -3, -5, 2, 0, -5, 2, -2, -2, -7, 10, 6, -6, -5, -3], [0, 2, -5, -6, 3, -10, 7, -3, 7, 2, -5, 0, 5, 5, 6, 5], [4, 1, -7, -1, 2, 0, -9, 2, -2, -1, -10, -2, 2, -2, -1, -7], [8, 2, 3, 0, -2, 10, 2, 2, 0, -3, -2, 2, -2, 0, -2, -2], [0, 2, 3, -4, 0, -12, -5, 0, 4, 2, 7, 0, 2, 2, 4, -3], [-4, 4, 0, -4, 8, 4, 8, -8, 0, 0, 0, 8, -4, 4, 4, 4], [-11, -2, 0, -3, 1, -7, -2, 5, -6, 0, -8, 5, -1, -3, -1, 2], [-16, 0, -2, -4, 0, 14, 8, 4, 0, -2, 0, 0, -2, 4, 2, 0], [0, 3, -5, -3, -4, -10, -1, 4, -6, 3, 4, 0, 3, 3, 3, 5], [8, 0, 4, 6, -6, -4, 2, 6, 0, 4, 0, -6, 2, -6, -2, 0], [4, 6, 1, -1, -1, -10, -18, 2, 0, 1, 0, -1, 5, 1, -5, 6], [16, -3, -4, 5, 3, 0, 4, 3, -3, 3, 7, -10, -2, 2, 5, -4], [4, -3, 4, -3, 2, 4, -3, -8, 6, -4, -16, -8, 3, -3, 3, 3], [0, 2, -1, 7, -10, -8, 7, 10, -2, 2, -5, 0, -4, -4, -7, 1], [8, -1, 1, -5, 0, -13, 17, -6, 0, 1, 0, 0, 0, 5, 0, -1], [0, -1, 6, -2, -8, 20, -2, 8, 1, -1, 1, 0, -6, -6, 2, -6], [0, -3, 5, -4, -4, -2, 9, 4, -14, -3, -12, 0, 1, 1, 4, -5], [0, -2, -1, 5, 6, 0, -3, 6, -6, 2, -1, 2, -10, 10, 5, -1], [-8, -2, -1, -4, 14, -3, -2, -4, -10, 1, -4, -4, -1, -4, -1, 2], [-4, 2, -1, -4, 11, 0, -11, 11, -11, -2, -13, 11, 2, -2, -4, -1], [4, 3, 3, 5, -2, 0, 5, -2, 2, -3, 2, -2, -2, 2, 5, 3], [12, 8, 0, 0, 4, 0, 0, 4, -4, -8, -8, 18, 6, -6, 0, 0], [-24, 0, 7, -4, 11, 0, -4, 11, -11, 0, -4, 19, 0, 0, -4, 7], [0, 3, 5, 2, 17, -2, 5, 9, 0, 5, 0, 17, 4, -2, -4, 3], [0, 7, 7, 2, 12, 0, -3, 12, -12, -7, -10, 18, -3, 3, 2, 7], [-12, 3, 5, 5, 2, 12, -3, 2, 0, 5, 0, 2, 5, -5, -5, 3], [0, 4, 7, 0, -11, -14, 11, 11, 1, 4, -7, 0, -3, -3, 0, -7], [0, 3, 1, 7, -14, -7, 3, -7, 21, -1, 0, -7, 0, 7, 0, -3], [0, 1, 0, 0, 14, -3, 1, -19, 5, 0, 16, -19, 3, 0, 3, -1], [4, 0, 7, 2, -2, 1, 0, 6, -4, -7, 2, 6, 1, 2, 1, 0], [-8, -4, 4, -4, 0, 0, 4, 0, 0, 4, 8, 0, -1, 1, -4, 4], [5, -2, 5, 7, -5, 5, -14, -6, 0, 5, 0, -5, -3, -7, 3, -2], [0, -1, -6, -3, 14, 1, -3, 10, 0, -6, 0, 14, -4, 3, 4, -1], [0, -1, -2, -6, 0, -2, -3, 0, -12, -1, 2, 0, 1, 1, 6, 2], [0, -1, -3, 0, 11, 0, -7, -11, -1, -1, 6, 0, 4, 4, 0, 3], [-8, 1, 4, 2, -1, 10, 3, 3, 0, 4, 0, -1, 0, -2, 0, 1], [-4, 1, 3, 2, 5, -10, 1, -9, 4, -3, -18, -9, 4, 2, 4, -1], [-4, 1, -5, 2, -3, 0, 13, -3, 3, -1, 12, -18, 4, -4, 2, -5], [0, 3, 7, -1, -2, 4, 7, 2, 2, 3, -4, 0, 2, 2, 1, -7], [0, 0, 2, -6, 10, 0, 12, -8, 0, 2, 0, 10, -6, 6, 6, 0], [0, -7, -6, 0, -6, -1, 15, 3, 0, -6, 0, -6, 1, 0, -1, -7], [16, 6, 0, 6, 2, 0, -7, 2, -2, -6, -13, 8, 0, 0, 6, 0], [12, 0, 0, 6, 6, 1, 0, 3, -9, 0, 0, 3, 5, 6, 5, 0], [-4, 8, 5, 0, -7, 1, 8, -2, 9, -5, 6, -2, -5, 0, -5, -8], [-8, 4, 5, 1, 7, 8, 8, 18, 0, 5, 0, 7, 1, -1, -1, 4], [0, -2, -4, 2, -14, 0, 4, 14, 9, -2, -6, 0, 3, 3, -2, 4], [0, -1, 4, 1, -1, -18, 8, 1, -14, -1, -9, 0, -1, -1, -1, -4], [-8, 2, 0, 2, -3, -9, 2, 1, 2, 0, 16, 1, -1, 2, -1, -2], [-8, 1, 1, 8, 0, 0, -5, 0, 0, -1, -6, -1, -6, 6, 8, 1], [-4, 3, 3, 1, 2, 0, -7, 2, -2, -3, -10, -10, -1, 1, 1, 3], [-8, -4, 2, -8, 12, 1, -4, -8, -4, -2, -4, -8, -1, -8, -1, 4], [-4, -2, -5, 3, 8, 0, 5, 8, -8, 2, 7, 1, -3, 3, 3, -5], [0, -1, 3, -4, 1, 12, -1, 11, -12, -3, -2, 11, -8, -4, -8, 1], [0, -2, -4, 0, -12, -10, -4, 12, 0, -2, 2, 0, 10, 10, 0, 4], [0, -2, 1, -5, 12, 4, -15, -12, -10, -2, 13, 0, 0, 0, 5, -1], [-16, -6, -3, 0, 10, 19, -4, -2, 0, -3, 0, 10, -3, 0, 3, -6], [0, -4, -2, 2, -8, 6, -18, 8, -8, -4, 14, 0, -3, -3, -2, 2], [4, 5, 3, -1, -4, 0, 5, -14, 18, -3, 18, -14, 5, -1, 5, -5], [16, 4, 2, 0, 0, 16, 4, -2, 2, -2, 16, -2, 0, 0, 0, -4], [-16, -6, 2, -2, 16, 0, -2, 16, -16, 6, 4, -4, -2, 2, -2, 2], [0, -4, -2, 4, 14, 4, -2, -14, -1, -4, -2, 0, 2, 2, -4, 2], [0, 2, -10, 2, 8, 6, 6, -14, 0, -10, 0, 8, -4, -2, 4, 2], [0, -4, -2, -2, 4, -22, -14, -4, 8, -4, 10, 0, 1, 1, 2, 2], [-8, -5, 0, 3, 12, 11, 5, 0, 0, 0, 0, 12, 0, -3, 0, -5], [-4, -6, 4, -5, -13, 4, -6, 7, 6, -4, -10, 7, -3, -5, -3, 6], [-12, -4, -1, -4, -13, 0, 2, -13, 13, 4, 6, -22, -3, 3, -4, -1], [-4, 4, 1, -6, 11, 0, -1, 11, -11, -4, -5, 25, -6, 6, -6, 1], [0, 5, -1, -1, -10, -22, -9, 10, -4, 5, 14, 0, -5, -5, 1, 1], [-8, 7, -1, -1, 6, -8, 7, -18, 12, 1, -6, -18, 1, -1, 1, -7], [24, 1, 1, 1, -6, 24, 1, 10, -4, -1, 18, 10, -1, 1, -1, -1], [0, 3, 0, 3, 5, 0, 11, -5, -7, 3, -8, 0, 6, 6, -3, 0], [8, -6, -5, -3, -11, -11, 6, -6, 0, -5, 0, -11, 0, 3, 0, -6], [0, 1, -2, -8, -2, -14, -14, 2, -4, 1, 15, 0, 3, 3, 8, 2], [4, 2, 6, 2, -16, 8, 2, 8, 8, -6, 12, 8, -6, 2, -6, -2], [-16, 0, -1, -3, 2, 0, -19, 2, -2, 0, -19, 11, -1, 1, -3, -1], [-20, -6, 0, 3, 3, -19, -6, 0, -3, 0, -14, 0, -4, 3, -4, 6], [-4, -5, -10, -6, 0, 0, 10, 0, 0, 5, 15, 0, 3, -3, -6, -10], [8, -6, 0, -2, -18, 0, -8, -18, 18, 6, -2, -28, 4, -4, -2, 0], [2, 5, -3, 1, 0, 0, -13, 0, 0, -5, -18, 2, 7, -7, 1, -3], [0, -2, -2, -2, 4, 4, 14, -4, 0, -2, 0, 4, -6, 2, 6, -2], [-8, -1, -2, -2, 15, -6, -1, -2, -13, 2, 8, -2, 0, -2, 0, 1], [0, -4, 0, 0, 0, 0, 0, 0, 0, 4, 4, -7, 6, -6, 0, 0], [5, 8, -1, 4, 4, 0, 8, -10, 6, 1, -2, -10, 1, 4, 1, -8], [0, 1, 6, 0, 14, -20, -10, -14, 11, 1, 11, 0, 2, 2, 0, -6], [0, 0, 2, -2, 4, -16, 30, -4, 0, 0, -30, 0, 0, 0, 2, -2], [-8, -3, 5, -4, -1, -4, -3, 1, 0, -5, -14, 1, 0, -4, 0, 3], [0, 2, 9, 1, 2, -28, 1, -2, 10, 2, 1, 0, 8, 8, -1, -9], [16, -6, 0, -4, 2, -18, -18, -14, 0, 0, 0, 2, -2, 4, 2, -6], [0, 0, -4, 0, 20, -2, -4, -20, -16, 0, 4, 0, 0, 0, 0, 4], [20, 9, 0, -3, 8, -19, -1, -13, 0, 0, 0, 8, -4, 3, 4, 9], [0, 3, 3, 0, -5, 0, 5, -5, 5, -3, 2, -10, 8, -8, 0, 3], [8, -1, 3, -2, -5, 14, -1, -13, 18, -3, 18, -13, -4, -2, -4, 1], [0, -4, -3, 2, -11, 10, 13, 11, 1, -4, -17, 0, -7, -7, -2, 3], [0, 1, -1, -2, -13, -12, -1, 13, 25, 1, 2, 0, 4, 4, 2, 1], [12, 6, -2, 6, -4, 8, 6, 0, 4, 2, -20, 0, -2, 6, -2, -6], [-9, -6, 1, 5, 9, 11, -10, 12, 0, 1, 0, 9, 3, -5, -3, -6], [0, 2, 6, 0, -14, 10, 2, 14, -16, 2, 0, 0, -3, -3, 0, -6], [0, -2, -2, 8, 2, 4, -6, -18, 0, -2, 0, 2, 4, -8, -4, -2], [16, 1, -5, 10, -7, 0, 9, -7, 7, -1, 8, -3, -8, 8, 10, -5], [16, -6, 2, -3, 2, -19, -10, 10, 0, 2, 0, 2, 0, 3, 0, -6], [0, -1, -2, -1, -9, 18, 6, 9, -6, -1, -7, 0, 3, 3, 1, 2], [28, -2, 7, -2, -7, 0, 4, -7, 7, 2, 6, -4, -5, 5, -2, 7], [0, -1, 6, 5, 4, -11, -1, 8, -12, -6, -8, 8, 6, 5, 6, 1], [-16, -3, -1, -1, 0, -9, -3, 8, -8, 1, 2, 8, -6, -1, -6, 3], [4, -4, -1, 1, 11, -2, -4, 19, -30, 1, 14, 19, 5, 1, 5, 4], [12, 7, -7, -11, 8, 20, 7, 6, -14, 7, -2, 6, 3, -11, 3, -7], [0, 12, 0, 6, 18, 4, 0, 10, 0, 0, 0, 18, 2, -6, -2, 12], [-8, -4, 4, -5, 16, 0, 8, 16, -16, 4, 12, 16, -4, 4, -5, 4], [0, -8, -2, -5, -3, -3, 8, 17, 0, -2, 0, -3, -2, 5, 2, -8], [20, -5, -4, 3, -10, 15, -5, -3, 13, 4, 0, -3, 2, 3, 2, 5], [4, 1, 2, -4, 2, 0, 2, 2, -2, -1, 1, -10, -3, 3, -4, 2], [0, 7, 9, 0, -1, 24, 13, 1, -18, 7, -6, 0, -1, -1, 0, -9], [0, 7, 5, 1, -5, 8, 25, 5, -7, 7, -18, 0, -2, -2, -1, -5], [-8, -7, -6, 3, -4, -14, -7, 7, -3, 6, -12, 7, 3, 3, 3, 7], [4, 5, -5, 9, 10, -6, 5, 2, -12, 5, 22, 2, 1, 9, 1, -5], [0, -1, -9, -7, 12, 20, 11, -12, 8, -1, -12, 0, -2, -2, 7, 9], [-8, -2, 7, 4, -6, 16, -22, -9, 0, 7, 0, -6, -4, -4, 4, -2], [12, 5, -12, 3, 10, -6, -9, -2, 0, -12, 0, 10, -3, -3, 3, 5], [0, 4, 4, 10, -14, 12, 16, 14, 10, 4, -12, 0, -2, -2, -10, -4], [4, -4, 3, -3, 8, 10, -4, -2, -6, -3, -18, -2, -3, -3, -3, 4], [-4, -3, 11, -4, 5, 0, 11, -9, 0, 11, 0, 5, 0, 4, 0, -3], [0, -3, -3, -2, 15, -4, 15, 3, 0, -3, 0, 15, 2, 2, -2, -3], [0, -3, 3, -2, 3, -4, 11, -3, -23, -3, -14, 0, 0, 0, 2, -3], [-14, -5, 2, -2, -12, 0, 6, -12, 12, 5, 11, 8, -5, 5, -2, 2], [0, -2, 3, -2, 7, 18, -9, -7, -5, -2, 7, 0, -11, -11, 2, -3], [-16, -2, -3, -4, 18, 18, 6, -21, 0, -3, 0, 18, -6, 4, 6, -2], [0, -2, 0, 6, -6, 0, -12, -6, 6, 2, -10, -20, -8, 8, 6, 0], [4, -3, -4, 9, 2, -10, -3, -13, 11, 4, 12, -13, 5, 9, 5, 3], [0, -3, 1, -10, 12, 18, -3, -12, 8, -3, 0, 0, -1, -1, 10, -1], [4, 6, 5, 2, 4, -3, 6, 16, -20, -5, -14, 16, 5, 2, 5, -6], [32, -5, 6, -2, 8, 0, -22, 8, -8, 5, -17, -4, 11, -11, -2, 6], [5, 10, 6, 6, -8, 7, 10, 6, 2, -6, -12, 6, -8, 6, -8, -10], [1, -1, 2, -6, 5, 2, 5, 17, 0, 2, 0, 5, -9, 6, 9, -1], [12, 12, -1, 7, -4, 0, 17, -4, 4, -12, 5, 3, 5, -5, 7, -1], [20, -1, 5, -1, -2, 0, -13, -2, 2, 1, -12, -28, 2, -2, -1, 5], [-2, -9, -9, -3, 2, 0, -3, 2, -2, 9, 6, 1, 0, 0, -3, -9], [-8, 4, -6, -4, 16, -6, 4, -28, 12, 6, 0, -28, 2, -4, 2, -4], [0, -3, -3, 5, 10, -10, -3, 4, -14, 3, 4, 4, 5, 5, 5, 3], [0, 4, -5, -12, 13, -6, 7, -13, 17, 4, -3, 0, 5, 5, 12, 5], [13, 11, 12, -5, -6, 17, 11, 15, -9, -12, -8, 15, 1, -5, 1, -11], [16, 3, -2, 2, -12, 0, 34, -12, 12, -3, 31, -28, 8, -8, 2, -2], [0, -3, 0, -2, 10, -28, -8, -10, -7, -3, 5, 0, 8, 8, 2, 0], [8, -4, 0, 4, 8, -15, 4, -10, 0, 0, 0, 8, 11, -4, -11, -4], [4, 3, 1, -1, -18, 0, -1, -18, 18, -3, -4, -2, 3, -3, -1, 1], [12, 1, 7, 7, 4, -6, 1, 16, -20, -7, -10, 16, 11, 7, 11, -1], [-16, 1, -4, -6, -10, 12, 3, 2, 0, -4, 0, -10, -2, 6, 2, 1], [0, -1, -7, -10, 1, -12, 13, 3, 0, -7, 0, 1, 2, 10, -2, -1], [0, -2, 8, 2, -18, -16, 0, 18, 2, -2, -2, 0, 0, 0, -2, -8]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1470_m_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1470_2_m_f();".
// 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_1470_2_m_f(:prec:=16)
    chi := MakeCharacter_1470_m();
    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_1470_2_m_f();".
// 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_1470_2_m_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1470_m();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<11,R![512, 512, -1088, -160, 382, 8, -40, 0, 1]>,<13,R![18496, 13056, 4608, -394624, 1910048, -2597824, 1900160, -648992, 107444, -12480, 21504, -5632, 740, -16, 32, -8, 1]>],Snew);
    return Vf;
end function;