
// Make newform 1764.2.b.n in Magma, downloaded from the LMFDB on 19 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_1764_b();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_1764_b_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_1764_2_b_n();".
// 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_1764_2_b_n();".
// 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 := [782, -4784, 14608, -26200, 27780, -16824, 4132, 2544, -3159, 1312, -104, -112, 54, 0, 4, 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], [-115526876966468324, 581795728509992600, -1414776392578940182, 1741603948057338728, -1157428177735265097, 345859102636619816, 132548534496325226, -213323163203640222, 91208721367956313, -9975218138394550, -8346277362814708, 3386328542280566, -100263474949006, 221129789385746, -4470673662808, 68460609096708], [-472453024841471228, 2032044391115129084, -3193825681085770178, 954240083858638532, 1222036940832765734, -1490194499653969402, 733013280422225699, 13792080161554432, -283670421349742603, 66290267686202447, -19398225654807318, -23754738088595688, -4941371389549504, -2464634453668515, -912489737968762, -327417918828952], [-1867599546248460713688, 8336186753002420522326, -19451040555700317738042, 26793508912799306677644, -19889480124946128542187, 7200798187189625037522, 1242927061655737977845, -3359157263983789674166, 1831404745105328437098, -234348639348792239443, -95362399007409087852, 90531377909982386585, 6652426924136514709, 7531743358669999721, 1339604670703050332, 1555384052304487487], [487073062122041378648, -2036176636502016272590, 4835892465797678085258, -6370293219085152249418, 4520871847151325019132, -1523787615264866790274, -373255694762441913900, 794214729102405745630, -391414509363635876612, 48407068192275527973, 26627463087863738529, -17423386714752992097, -672215985049491150, -1345989061870001853, -169063652800363986, -318349714014117155], [-358146927872032900, 1919144838354128326, -5446994131157254103, 8024738563480367422, -6132682691001785589, 2307827064302842291, 327835676897206279, -1035407239122975332, 563049199499742674, -76289123157682859, -31321770680120666, 26886219324590582, 1749715980623946, 2174756443991264, 383840295516265, 473856923359748], [-5087914532726904122076, 24339909928772330731036, -62326650020669503237070, 90036644526399417686818, -68798329378779488859130, 25844146842968921774278, 3479438641302538497722, -11527558565646261639380, 6416571148191675290724, -874281158143623647920, -328132761419129144004, 318208926056455796405, 23828334411265339223, 26478219286468497838, 4995786690360147679, 5500492503984100227], [-5496866961938737811274, 26778488614860426571854, -70636213458116768776102, 101240151222016002112922, -76671489479188666427654, 28339859091945305749350, 4252322434555389872600, -12970938757912323132088, 7026897442921298831606, -950764010116474908521, -388470965209901181124, 339010718516081477989, 22550928196542473072, 27689331148288188771, 4913373504941792009, 5952725304690144831], [-21432466723742801850, 117379544690231687414, -309216748734375465357, 442421329376818071598, -334207906277498618299, 123088666360044540971, 19005489443147365107, -56420217111824698700, 30589633647423284589, -4078856972771178701, -1665246494940919959, 1483369668724706806, 101698244496858797, 121685367454370832, 21577079064058868, 25902327859007496], [-8239028835957057526486, 39340148768838995107316, -98761332546754697649693, 134668567438981170920014, -98539036507797617339480, 34736847577918930053593, 6901825506220311144657, -16933879259688981418781, 8796643036979951155484, -1119851439923064088482, -527646370388946126359, 412304745350307442286, 23464216531976602108, 33052494395288935583, 5144247759478178881, 7311390845285256291], [-24957690805039740937, 123913467597404059828, -327276480336990007534, 464281601916429123172, -348322567732844885217, 127442752230905249876, 20748972299418636178, -59195530313521122086, 31667827257227959771, -4207419896042615164, -1803486805708866118, 1507636575022232512, 94685759422792651, 121945297597469092, 20754861575511394, 26598978070628094], [-8762536382973257608560, 42615858527687211502860, -108297352271035265759942, 150268019875044278229648, -111495933370675259317678, 40100295800739031719712, 7168427247637577844956, -19013659824524795362304, 10081844323059287945776, -1305900993760500402942, -577012814267616188201, 480593764804618359742, 30128663474405533398, 38949945226253425308, 6459958212915796841, 8448544333599963272], [1231061099793606132, -5959302325712781184, 15258438472298117941, -21484874797011548774, 16126119659137989335, -5888232645967983481, -950033829183946954, 2732180783018590880, -1472274308570746587, 195369841406174707, 81359376829844749, -71097289196119918, -4747356334044193, -5815471027979606, -1015254487117297, -1244394735841324], [40106176486555581423, -192955113465912973604, 488427055994476300206, -681018271981825579836, 508101002775460820933, -183745007679448037388, -31309069072667929038, 86397532556884843782, -46102238907939724050, 6064169002183889708, 2600106172853103294, -2212341935495582864, -143011704542588177, -180300822619285700, -30709761853974942, -38837071408467006], [-15209681969564397709940, 73063629911885826958694, -190857346846836674542978, 272728671644159240844356, -206238287624443883630230, 76153154961304809095912, 11538713375264870681853, -34925501838727448675442, 18900925418135661838222, -2549704930836326331342, -1046558893404974928844, 911342693405039975939, 60446949971898835049, 74380372178245371088, 13146545739463821814, 15998972551103279917], [-2256954365421484403296, 11345194533084915125680, -29458323721466198065049, 41586859446763682767190, -31237695433043179805246, 11414646474950630716223, 1853689065595543927095, -5288343572174182331263, 2851912517811313200749, -375855880039528846246, -157048626672931238306, 137786151121143971234, 9250267627009115113, 11269452242416570801, 1962337849022174960, 2407697249379471303]];
    Rf_basisdens := [1, 14997061542603511, 66415558260101263, 130639403097619184321, 18662771871088454903, 14997061542603511, 130639403097619184321, 130639403097619184321, 464908907820708841, 130639403097619184321, 464908907820708841, 130639403097619184321, 14997061542603511, 464908907820708841, 130639403097619184321, 18662771871088454903];
    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_1764_b();"
function MakeCharacter_1764_b()
    N := 1764;
    order := 2;
    char_gens := [883, 785, 1081];
    v := [1, 2, 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_1764_b_Hecke();"
function MakeCharacter_1764_b_Hecke(Kf)
    N := 1764;
    order := 2;
    char_gens := [883, 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]];
    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, 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, 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, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 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, -1, 0, 0, 1, 0, 0, 0, 0, 1, -1], [0, 0, 0, -1, 1, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 3, 1, 0, 0, 2, 0, 0, 0, -2, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 1, 0, 0, -1, 0, 0, 0, 0, 1, -1], [-4, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [2, -2, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0], [0, 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, 0, 0, 0], [6, -10, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, -8, 0, 0], [0, 0, 0, 7, -1, 0, 0, 4, 0, 0, 0, 6, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -1, 0, 0, -1, 0, 0, 0, 0, -2, -2], [0, 0, 4, 0, 0, -1, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0], [0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 0, 0, 0, 0, 1, 1], [0, 0, 0, 0, 0, -2, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0], [0, 0, 0, 0, 0, 0, -3, 0, 0, 3, 0, 0, 0, 0, 3, -3], [0, 0, 0, 9, -7, 0, 0, -12, 0, 0, 0, 2, 0, 0, 0, 0], [-6, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0], [14, -16, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, -4, 0, 0], [0, 0, 0, 0, 0, 1, 0, 0, -2, 0, 0, 0, -1, 0, 0, 0], [6, -14, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, -16, 0, 0], [0, 0, 0, -11, 0, 0, 0, -11, 0, 0, 0, -11, 0, 0, 0, 0], [2, -6, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, -8, 0, 0], [0, 0, 0, 0, 0, -10, 0, 0, 0, 0, 0, 0, -7, 0, 0, 0], [0, 0, 0, 0, 0, 0, -13, 0, 0, -13, 0, 0, 0, 0, 4, 4], [0, 0, 0, 0, 0, -3, 0, 0, 0, 0, 0, 0, 16, 0, 0, 0], [0, 0, 0, -9, -1, 0, 0, -12, 0, 0, 0, -10, 0, 0, 0, 0], [0, 0, 0, -2, 6, 0, 0, -8, 0, 0, 0, 8, 0, 0, 0, 0], [4, -4, 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0], [0, 0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0, 0, 0, 0, 0, 0, 0, 12, 0, 0, 12, 0, 0], [0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 11, 0, 0, 0, 0], [60, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 7, 0, 0, 0, 0, 0, 0, -2, 0, 0, 0], [0, 0, 0, -7, 16, 0, 0, 41, 0, 0, 0, 9, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -14, 0, 0, -14, 0, 0, 0, 0, -3, -3], [0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, -24, 0, 0, 0], [0, 0, 0, 1, 5, 0, 0, 16, 0, 0, 0, 6, 0, 0, 0, 0], [-36, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, -5, 0, 0, 5, 0, 0, 0, 0, -3, 3], [0, 0, 0, 0, 0, 19, 0, 0, 0, 0, 0, 0, -10, 0, 0, 0], [0, 0, 0, 0, 0, 0, -12, 0, 0, -12, 0, 0, 0, 0, -1, -1], [14, -12, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 4, 0, 0], [0, 0, 0, -9, -3, 0, 0, -18, 0, 0, 0, -12, 0, 0, 0, 0], [0, 0, 0, 0, 0, 0, 15, 0, 0, 15, 0, 0, 0, 0, -6, -6], [0, 0, 0, 0, 0, 0, 4, 0, 0, 4, 0, 0, 0, 0, -7, -7], [0, 0, 0, 0, 0, 16, 0, 0, 0, 0, 0, 0, -19, 0, 0, 0], [0, 0, 0, 0, 0, 0, 8, 0, 0, -8, 0, 0, 0, 0, -4, 4], [0, 0, 0, 16, 2, 0, 0, 14, 0, 0, 0, -14, 0, 0, 0, 0], [0, 0, 0, 0, 0, -6, 0, 0, 0, 0, 0, 0, 11, 0, 0, 0], [6, -12, 0, 0, 0, 0, 0, 0, 0, 0, 12, 0, 0, -12, 0, 0], [0, 0, 0, 11, 1, 0, 0, 10, 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0, 0, 0], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 0, 17, 15, 0, 0, 2, 0, 0, 0, -2, 0, 0, 0, 0], [0, 0, -12, 0, 0, -9, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0], [26, 8, 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, 6, 0, 0, 0], [0, 0, 0, 0, 0, 0, -2, 0, 0, 2, 0, 0, 0, 0, -6, 6], [0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, -15, 0, 0, 0], [0, 0, -12, 0, 0, -9, 0, 0, 6, 0, 0, 0, 3, 0, 0, 0], [0, 0, 0, 0, 0, 0, -6, 0, 0, 6, 0, 0, 0, 0, -4, 4], [0, 0, 0, 0, 0, 0, -11, 0, 0, -11, 0, 0, 0, 0, 10, 10], [0, 0, 0, -13, 9, 0, 0, -22, 0, 0, 0, 22, 0, 0, 0, 0], [0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_1764_b_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_1764_2_b_n();".
// 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_1764_2_b_n(:prec:=16)
    chi := MakeCharacter_1764_b();
    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_1764_2_b_n();".
// 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_1764_2_b_n( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_1764_b();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<5,R![14, 0, 8, 0, 1]>,<11,R![92, 0, 20, 0, 1]>,<19,R![1288, 0, -88, 0, 1]>,<29,R![1372, 0, -84, 0, 1]>,<53,R![448, 0, -80, 0, 1]>],Snew);
    return Vf;
end function;