
// Make newform 400.3.bg.f in Magma, downloaded from the LMFDB on 05 June 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_400_bg();"
// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_400_3_bg_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".
// To make the character of type GrpDrchElt, type "MakeCharacter_400_bg();"
function MakeCharacter_400_bg()
    N := 400;
    order := 20;
    char_gens := [351, 101, 177];
    v := [20, 20, 13];
    // 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_400_bg_Hecke(Kf)
    return MakeCharacter_400_bg();
end function;


// To make the Hecke irreducible modular symbols subspace (type ModSym)
// containing the newform, type "MakeNewformModSym_400_3_bg_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_400_3_bg_f( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_400_bg();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,3,sign)));
    Vf := Kernel([<3,R![491165492224000000, -6396499270656000000, 281548457270784000000, -10153781067129920000000, -40330480208404115200000, 1077557554840356032000000, 17820056056341647070800000, 153814162444539027707400000, 871261280945820775196650000, 2995302398649442902180500000, 6290453292765231994383040000, 8536566246467761938665045000, 8315461338112564916299655000, 6820058937558551669969440000, 5128925379019307140616263250, 3181273473911339164529162250, 1452265956203662045657952625, 419465572592302798909165500, 7226195377780228760390850, -68254140954122882804364200, -54605628534289667137092945, -25898800632535863998037120, -2958744767016117287390040, 1655990168534646227966940, 1046404894595407868983681, 732629548327497672615680, 213392026673034341484600, -48663666606891400050190, -29760262877939427714035, -39469407516384709332004, 8602816400691001986500, 96972754729899073830, 1734652691568473183185, -11256152926802592000, -66617094522700119082, -8799396550629749980, -8790637116468980060, 1331389067273722160, 202601445569439410, -18535409738433760, 43574272536348125, -5268808074908800, -936488695402180, 195811793484300, -179731028680119, 15443209029810, 7791525723420, -1257149326420, 551874202830, -16185034680, -15082638780, 1656296320, -523470300, -30024840, 30026602, -2229160, 814300, 26510, -31530, 852, -1175, 30, 20, 0, 1]>],Snew);
    return Vf;
end function;