
// Make newform 820.2.bg.a in Magma, downloaded from the LMFDB on 10 September 2025.
// To make the character of type GrpDrchElt, type "MakeCharacter_820_bg();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_820_2_bg_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".
// To make the character of type GrpDrchElt, type "MakeCharacter_820_bg();"
function MakeCharacter_820_bg()
    N := 820;
    order := 10;
    char_gens := [411, 657, 621];
    v := [10, 10, 7];
    // 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;

function MakeCharacter_820_bg_Hecke( : Kf := Kf)
    return MakeCharacter_820_bg();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_820_2_bg_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_820_2_bg_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_820_bg();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,2,sign)));
    Vf := Kernel([<3,R![1, 0, 785, 0, 32869, 0, 194144, 0, 415716, 0, 459977, 0, 302875, 0, 126467, 0, 34268, 0, 5983, 0, 646, 0, 39, 0, 1]>],Snew);
    return Vf;
end function;