
// Make newform 38.7.d.a in Magma, downloaded from the LMFDB on 25 April 2024.
// To make the character of type GrpDrchElt, type "MakeCharacter_38_d();"
// To make the character of type GrpDrchElt with Codomain the HeckeField, type "MakeCharacter_38_d_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_38_7_d_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_38_7_d_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 := [8303121574870947536327197696, 0, 360077534420960567854418432, 0, 3765133606401310416173376, 0, 18825433555812367062720, 0, 54352282696688610576, 0, 97808951849137728, 0, 112838424559344, 0, 83109028728, 0, 37579488, 0, 9440, 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, 0, 0, 0, 0], [280167456988268007029073771259983506249256874024052760036356879282453729662728171694848, 0, 11412808587166388160164257252371436881179399404702572838782794053044253999257380898112, 0, 95932317740308672289002050158721898314743385709973348421838392998149894896579571712, 0, 370704128616191663355704205415883795948425830218969796186692256818781921507469584, 0, 802669495584929961377227660312396806169234057151266461158692956461803141469056, 0, 1048704270459849807598518922059663631563118554104870286467884419914795248976, 0, 842034082345568127712291920853306950595698615667728647118851780707111224, 0, 404650283810070951319181422489319213580845881948950753348173078366512, 0, 106147537616249779654587567641132026739566080582483103069718250068, 0, 11596179504074710206864888545119606602943144320648236064094881, 0], [36425697707328126618956213991752190917735692232471032084598092800, 47087703759818861134718361138835383126284232282311503082560232192, 0, 2434173630819309864526410946024498395219879484686850201634774208, 0, 22610961962496480517817961012036809374988062027747285608748608, 0, 94883344562496790013440731975222177637528389113381346548496, 0, 219361900606764411320345682150377386690692727817327831424, 0, 300643142727034102594302318798871396349338147130767824, 0, 249239739903106728515468123773704899074838014253256, 0, 122096289601664984755400330417249342035560972648, 0, 32341214747574915918224109589018411475346312, 0, 3545353781867728141698089216971258902289], [831574867741224012545859228008907063764360435050633326848960421188915008874533532068622998224972288, -207272160171356278663469566584132740508290297990018187826526707702849685099213874504962629470464, 33872784757354714247926655774753505655539216536945843810628835264932719663298962535831281776002432, -8299169833704826467687481690098368039960520282938520561240172222552604736205582645261157639616, 290502497747884897456546608589096173719863483472962873355633383582121007000874927269328550802432, -70562634615532866336515813220023302764809668306689190634939891290169657739205887506140578816, 1146911019324113618708619756877306029127000246597513479693632131305205485175218968531308061664, -275968810432714695729792242205016669953912165861345101060053466555959263289434591129435312, 2535143003935061434647179758565106660499512007495010534072314722696012759429076277015022336, -604721675735854212215397959600186344932677060575365026297349323463755123084294421825408, 3376668363459638859031189033607316814951542564203565851441999271651478248128163934798176, -799357546969740787527008150539642780971945275205396706181919319822753130714004544368, 2759802139647786374820429057557137740963973840994372668953941977131188991950642127504, -649128869509243983520503691493867123271174598478294628052919775945065640493702632, 1347857688660601532234531649068054369808929850401830888218709012936536483368227872, -315334638352699626531272822199112100227588020700651507131398877129081771699216, 358693025022275502563644850172774572971151515278445568901205669543725809644248, -83552016779074442026759688436577794799252704684634238271251779119306315324, 39673389360302873390279967216428960060231672157135621917995393145312541726, -9209355950667387100343775037022348376996571450414079892344576325312283], [-199217001219158651004920338238801965593666846489788080726641237649623064817294936525362726637056, 67891306967362030351611387679047736818961774644617814551761122732672677726568579923014290688, -8112653501150451579384432438427398013318924255792553344682022978786845284635788058798024334464, 2718365487620316563277917356730549636410258854549138736076047239617623562464979575912596672, -68736971093030574543258997045727392960521349939620673123435788523630113788591223182426225664, 23112556375870575282186640425818310764759144548538876722875824202479416226402190470403072, -267961814359532998889887358155510333527760589075426967822108757100597419786824395514495648, 90392666371672026115228379366202643286574571195985948594842275321309945394508546062704, -585340237765900529751412755371458903113630655626810671409812514908230158652541265330432, 198074574430348579173074994955842235484008208508144456697461291668442555874318513536, -771413763026911041463281911348931220156450595260193165319925820960940501045971357472, 261826906966832881600723272368045457245969628301800427835545142424747176781527856, -624665822531443120661835246029486749456335355103303710596350457863942301614906928, 212620003114721252381429312641292867104872125279493818556475524384233750571144, -302662142183763934730876129610544191966718127975072361852615535547088610368864, 103286812431280585172378913265349525131866367736865871972289183468418529872, -80007899558824980396096671781335800172174879364954738998220491914286029896, 27367185319054845079187582193441793252293712638268666318785384578875308, -8801095835711251090008759636383570333411943824241629314216443061531082, 3016493924227771732834515243046953284309391238262063508792851727911], [1153525042623274727061790096102099580757378416600148718847280579029613766978061106142058107392, -67891306967362030351611387679047736818961774644617814551761122732672677726568579923014290688, 46007659168442955952785927919931076504016367525598139074823681500382112451122246080654846848, -2718365487620316563277917356730549636410258854549138736076047239617623562464979575912596672, 376126186929704005784817554661137707898917603344016948086804538547911989454953667507381248, -23112556375870575282186640425818310764759144548538876722875824202479416226402190470403072, 1432182169995372861587675921691296568442967824431038282150606663564172839882366414903136, -90392666371672026115228379366202643286574571195985948594842275321309945394508546062704, 3145075440494800013498962693742726309653064452010133631479295410643655960153478061824, -198074574430348579173074994955842235484008208508144456697461291668442555874318513536, 4310513434385409956681618905577439543995941663595341191290887720178813881246343904, -261826906966832881600723272368045457245969628301800427835545142424747176781527856, 3730298555453481876814614706023678255513007151507891475697864381143557418073296, -212620003114721252381429312641292867104872125279493818556475524384233750571144, 1960874550332735494249914893858013262650054276283721254185028227039292479648, -103286812431280585172378913265349525131866367736865871972289183468418529872, 563978811653995031222994591068513847017029344713137094816968296851247672, -27367185319054845079187582193441793252293712638268666318785384578875308, 67042769531309540153173970987995679283581383160076319536642799305174, -3016493924227771732834515243046953284309391238262063508792851727911], [-1153525042623274727061790096102099580757378416600148718847280579029613766978061106142058107392, -67891306967362030351611387679047736818961774644617814551761122732672677726568579923014290688, -46007659168442955952785927919931076504016367525598139074823681500382112451122246080654846848, -2718365487620316563277917356730549636410258854549138736076047239617623562464979575912596672, -376126186929704005784817554661137707898917603344016948086804538547911989454953667507381248, -23112556375870575282186640425818310764759144548538876722875824202479416226402190470403072, -1432182169995372861587675921691296568442967824431038282150606663564172839882366414903136, -90392666371672026115228379366202643286574571195985948594842275321309945394508546062704, -3145075440494800013498962693742726309653064452010133631479295410643655960153478061824, -198074574430348579173074994955842235484008208508144456697461291668442555874318513536, -4310513434385409956681618905577439543995941663595341191290887720178813881246343904, -261826906966832881600723272368045457245969628301800427835545142424747176781527856, -3730298555453481876814614706023678255513007151507891475697864381143557418073296, -212620003114721252381429312641292867104872125279493818556475524384233750571144, -1960874550332735494249914893858013262650054276283721254185028227039292479648, -103286812431280585172378913265349525131866367736865871972289183468418529872, -563978811653995031222994591068513847017029344713137094816968296851247672, -27367185319054845079187582193441793252293712638268666318785384578875308, -67042769531309540153173970987995679283581383160076319536642799305174, -3016493924227771732834515243046953284309391238262063508792851727911], [2407984912333584132891165747036257183304810981383114477779583503177470762442294476544613556736, -66339049791882078229132617685151037305036603829511605168422148399787484033687083597372357888, 98402613676877092166735377226792353999506977380878823009630732513211024717325980214639122304, -2718365487620316563277917356730549636410258854549138736076047239617623562464979575912596672, 841242864129806886719211881240385364982005347980419069900571918778093459386714243419221504, -23112556375870575282186640425818310764759144548538876722875824202479416226402190470403072, 3312832392325826155309078208491884647243736444676959889657012613179286467847325847802208, -90392666371672026115228379366202643286574571195985948594842275321309945394508546062704, 7313385742154978903279003953714002217108933524598819235378328988123891441852490472192, -198074574430348579173074994955842235484008208508144456697461291668442555874318513536, 9739812413132610289393989080461912415016008118505123885732960368817003748412322272, -261826906966832881600723272368045457245969628301800427835545142424747176781527856, 7966547458442633773355557633712344742468887408034783613322927899079928402161488, -212620003114721252381429312641292867104872125279493818556475524384233750571144, 3896041698600196048334729209856439438769517309800732536595700066062440895584, -103286812431280585172378913265349525131866367736865871972289183468418529872, 1038544506042764759532697991654778401000887514948243597524790781504143256, -27367185319054845079187582193441793252293712638268666318785384578875308, 115065936005010201062154706514999661471065724645879978504846279306422, -3016493924227771732834515243046953284309391238262063508792851727911], [2407984912333584132891165747036257183304810981383114477779583503177470762442294476544613556736, 66339049791882078229132617685151037305036603829511605168422148399787484033687083597372357888, 98402613676877092166735377226792353999506977380878823009630732513211024717325980214639122304, 2718365487620316563277917356730549636410258854549138736076047239617623562464979575912596672, 841242864129806886719211881240385364982005347980419069900571918778093459386714243419221504, 23112556375870575282186640425818310764759144548538876722875824202479416226402190470403072, 3312832392325826155309078208491884647243736444676959889657012613179286467847325847802208, 90392666371672026115228379366202643286574571195985948594842275321309945394508546062704, 7313385742154978903279003953714002217108933524598819235378328988123891441852490472192, 198074574430348579173074994955842235484008208508144456697461291668442555874318513536, 9739812413132610289393989080461912415016008118505123885732960368817003748412322272, 261826906966832881600723272368045457245969628301800427835545142424747176781527856, 7966547458442633773355557633712344742468887408034783613322927899079928402161488, 212620003114721252381429312641292867104872125279493818556475524384233750571144, 3896041698600196048334729209856439438769517309800732536595700066062440895584, 103286812431280585172378913265349525131866367736865871972289183468418529872, 1038544506042764759532697991654778401000887514948243597524790781504143256, 27367185319054845079187582193441793252293712638268666318785384578875308, 115065936005010201062154706514999661471065724645879978504846279306422, 3016493924227771732834515243046953284309391238262063508792851727911], [-650306651561058833696968495240628749147629748983001986907224223218804732835104586680531235276638720, -202533119014615984833541881792766116892276751491498930579192819064551188754846666222777808632064, -26480758939381802608817528917758855902929476742200680019747581631122363938236045775889762205897600, -8299169833704826467687481690098368039960520282938520561240172222552604736205582645261157639616, -226156332885355547192010825377585846966358135461647302865864757411163779651152541897623411545600, -70562634615532866336515813220023302764809668306689190634939891290169657739205887506140578816, -889568690275975397332185855936662450473258222781908933360162927472152775715751472622450922080, -275968810432714695729792242205016669953912165861345101060053466555959263289434591129435312, -1960461794234032711477082129676976306907538490485215294851156987766812201013121252818192640, -604721675735854212215397959600186344932677060575365026297349323463755123084294421825408, -2605190269593015287271908698432908179112996445655901176150121230480987359086417430982880, -799357546969740787527008150539642780971945275205396706181919319822753130714004544368, -2125609356824928549567499814635408476228339411916793029150533106557294039892350438480, -649128869509243983520503691493867123271174598478294628052919775945065640493702632, -1036885516231867028412408916191812830009117178660199050524126854717526693399450080, -315334638352699626531272822199112100227588020700651507131398877129081771699216, -275725258883361862728193644897148531626011829572312434614538024718410645944600, -83552016779074442026759688436577794799252704684634238271251779119306315324, -30482968577115902243069139102795495347213346437715965299049205564995240070, -9209355950667387100343775037022348376996571450414079892344576325312283], [-2207330335740370269928644006896732487977039874211054837204212795996312747926767460226367199419739648, -18051922735450941042690336404163512487649555582620524557024989403324128145643459992345254953800960, -89892660054449356246656365682681574517425999790537848392966831614698236819890933394413207409347712, -743823481374638602612309155319909399665610420510315662767262978399168281853504458504831810523840, -765530918010692719944169141171340608753553555910003481790408122140204049262947669619805292864512, -6505310851580671702488818457231336674006653263288630057131422874599982437440669747984166371840, -3001243797297646390546570648009415955637002163485675874020000157635605863259761448855926183584, -26195796013418586933744189257912896682887950794211899423872199943685495097261373937467652080, -6592201459299273272200007983779288009123918781546445541529709991781804404186876271425459456, -58994232077466791210997593207461895475327262216799069021084345743441380895133530955637120, -8731865607497371217878474809510203574704619145877581360738630902114015306978878077030176, -79889791769478153735276941724797958828273853981997569827120741352600406742891809638320, -7102526530562338635807685151966201009370093929116575069100020598657404036633984293424, -66214756717448516060170055132701691800308496300312115046939158850782034279894667080, -3454647219166572187655280802434923193939743065239511478893286801842454486986780512, -32707489193515450108317751422184335589827114634019636472439997572366612089338640, -916217628911323225983675660543750277747085912420097099980201475598474149732168, -8781999444747400675253186344052982285463156570668593998693718005548682090860, -101057528904502350246477558363584233994810964394681086924963753251089917706, -977949564341802781473409088548367343344821798664219530188898995106597295], [-99031738088267688138929274071349933006454734036593966003896978535296725525158437709610334264832, -9564048342366974501213051600465980996400282150887840096566572889977210372042609326255439936256, -4033322920991004311715823255253733468407453944133477602803599648643231586092332906358684743808, -390892089219888052103663591550438866361617650668966153302446882813226475306838941282643892544, -34180422453050435268737089745533127626311216168138328087674491992541100899568134757459422208, -3341858900143356971594660884535723149163262247373137402879411850909894421320454783206482944, -133264816094768813014149841116909518479658810625497964769979075218516623473471014549796256, -13160936902931632595121084454601335945688371207511853610033208177395835925994794845146128, -291097581162702864868956896338858088401988795587400268889166609748793251346193893634304, -29055468394189567033942940819900166632951725889887132484815854660827123211535643375232, -383551624796262815753300146221676890306227326798298912064317466620380843582362506784, -38697422745563608275975233049479604202818062845718695115096296332843267816867761232, -310467761987994819392510315661731535600411173975897909560326296741399372098416816, -31653569830655813841040801222208086102770677506859640634735236071935479858074808, -150350633816715599618313107358343089352034036849394320299215253660024658944608, -15480879981969503608166537926160408229946202871466064274410511080781345052464, -39721960373585492682436838595133643162578925010120800951701761808717391112, -4126810838852004193051604384425671810751256347154705723780377741437697716, -4367026533089970774927792832697787327064181220540776497339900131112954, -457247250095813032515784310816951692599953507345257850510592265497777], [-69004429648841262900344965237125612812025679895396089400859972798428133170329125959297607901925376, -6296124118788752607761485480310401628008314264556464100668876616373683821630885864134706174256896, -2811026947826121491950233361401163006581037880574182724336116547109337756165473859878920210714624, -254941047558479486658744596450406966682938341809260073270995219247378633300212171077453962240064, -24112848708265709260573796716226310024804007335829465801093697443827852641422412810202376321024, -2188047344636629096032857080153593459895430960782506110229259500350087799669778042075876318464, -95211547263259812113516048524031875058628655485793793318185527430112005457921508655550732288, -8650732476579296689305991820216915362664963374462869947853043066856426106849841667608867408, -210461757384602567517163952121759176423011766810251966341284036150609806481893975707689472, -19148590846812870848719571790517394620806507741259484242703132056781251889109680080896512, -280292363828705016869453337590715741001976912858717439565415682620147694112393237238272, -25534320642010304930954047280726781620209361761319437961677001931918164137076344130832, -229034461513165574554209503238303954270824385846734923023219699764629809262772029568, -20887716708790117832203872727029062097021451703189272257564355154500468543835592088, -111822594888202974230882221574758821276504936224694723935806843479948793618988544, -10207739074874535727154093240069759707129614297066840178311327820023915458533424, -29747599809191321311110087307186866683017377057419696779227455444453245875136, -2717705879182740733015674203796435757469135109210479428909211501385122747796, -3289058982076982113682693923583550770948241516195659076204168556586153792, -300688020038087842894435569871951433501265280530108607705568224598886997], [-251933579801814145906260555097966811263608591436310425345019284071060205191563896708983301804816896, 24203929427305008320601238985328791329349202253203399058918111568289017137224843801915375972042496, -10262682732199388628783069227082064604517523328261693491078168811451241167018357450633254483313024, 994752867357749657700529980104957207727073072026368105381686645996934174640326442577537421811264, -86264737835033792258675584935642197144188985091745618175210150267390818735658706293380971700224, 8424166717692434285452817662331832324981029166553412542013872045982448599259379139059552241664, -333346417794341172179496350972013861785663829485152402300700527491419791286622179319850476768, 32801837600703050318013967548653041355568225455810081082789984540997954424811104540236592208, -721780472272680060442534638366080745442533771021858303027002793628655281383436324921696512, 71574976234210573335747832931567936645413545971502019488489441547271227945910780705680512, -943021091209259801973614050953332642372516456543055040417584360616722565120022171744352, 94238055305255597343909115332034027561000692575454271477303623426759612721552559378832, -757178092562469665498811259739758809285951302941243134363640202375593931649435756048, 76244539557751970394716192259594735961665410562388826138370923827319597320902704088, -363871648991553620526178253493589755492367573779547053054809242476967321321009824, 36911911074694310162599441730828373484151671502247577531954297316408401446168624, -95450518865684523726005349178421959269263209753909408965885430898255411085336, 9750286915194100541698950879798626511297158358676795301279174716996643309796, -10427574443838078669920496560523087899392187886987616007422775848374415662, 1071855073433481788585219334055283138186325181334454419889308904746152997], [-1104706508437858856530741971711595953542083612952703126908187365008614352779506694543666211806255616, 44523088619432221288919043441945448022963808194345646640181179789268294615805406619301786040641280, -44887173763356845120864126319873185785999868698744674111589100148045244516156778336776442468398464, 1836369776011068871761256204938549641458732600862026089472488014935141908815453446428286687640640, -381993524458288646237311204627484474219376259495696344926857206027524426538094929320390597182464, 15737160695485629936571594988199632538321259455282275068435468339927916841049193116798920656640, -1495960600593095188672253357369411931380576436790051552044306505836953537491853670247222123488, 62071027021272554885362602908520332404807019944244218781099645943099377283922833395907201360, -3280893297147400396741040810522533429552974369123943100798694228727241101878185762338551552, 137168889529731926141727452620798179213161795667099279810998795161904687389622071342066560, -4337235894075877147877868786197776874547536415154765132058772207292856381206314771676512, 182771676989533453359611533390871220385595070113255867910699320769014695163520806816400, -3519446338085378869268296777090253409615735240627192218039374967650017560748045767568, 149504974001226753485329204646818698661989095189903780421392243792164597281543654360, -1707184134458863725275761989442206944163136565923882463190939830128323821407459104, 73096026751354208795652064566088953999240223901563783956590402488080627236275920, -451473479953881582093110168897624508083041564573212364182416672190388643911896, 19475738840606164734535358726096179194657130775872509886354623531377342983860, -49659710638709440394980259481123489011635950995167105199395861076269306142, 2156657720372945726931473194336735455559085684497688778295612445273883365], [1104706508437858856530741971711595953542083612952703126908187365008614352779506694543666211806255616, 44523088619432221288919043441945448022963808194345646640181179789268294615805406619301786040641280, 44887173763356845120864126319873185785999868698744674111589100148045244516156778336776442468398464, 1836369776011068871761256204938549641458732600862026089472488014935141908815453446428286687640640, 381993524458288646237311204627484474219376259495696344926857206027524426538094929320390597182464, 15737160695485629936571594988199632538321259455282275068435468339927916841049193116798920656640, 1495960600593095188672253357369411931380576436790051552044306505836953537491853670247222123488, 62071027021272554885362602908520332404807019944244218781099645943099377283922833395907201360, 3280893297147400396741040810522533429552974369123943100798694228727241101878185762338551552, 137168889529731926141727452620798179213161795667099279810998795161904687389622071342066560, 4337235894075877147877868786197776874547536415154765132058772207292856381206314771676512, 182771676989533453359611533390871220385595070113255867910699320769014695163520806816400, 3519446338085378869268296777090253409615735240627192218039374967650017560748045767568, 149504974001226753485329204646818698661989095189903780421392243792164597281543654360, 1707184134458863725275761989442206944163136565923882463190939830128323821407459104, 73096026751354208795652064566088953999240223901563783956590402488080627236275920, 451473479953881582093110168897624508083041564573212364182416672190388643911896, 19475738840606164734535358726096179194657130775872509886354623531377342983860, 49659710638709440394980259481123489011635950995167105199395861076269306142, 2156657720372945726931473194336735455559085684497688778295612445273883365], [-4133734874611505536547571316674690331359043173020045334788492675247013857361269332586888258828420608, 42625463448636445937386765469926866150374983897526792312026312261770376336956410259859328957634304, -169108741488394150393820780255094409922321496601277057593605898988759667873923399522182428157740672, 1788410039565882134081200365698496345307453936526661992643076705608810421795437870285859318257216, -1452407561294661027021214086724530844578238480723286925697658610377523300516849207170577218153472, 15537060870916115607138319671921749949397079280115955830919038551722973679674290676568205769216, -5739009970944457751995053261484768102868485054381933983685292234011634925881084117858707063584, 61887112507713488576897999033309329378575553633075874816115424633996415594855872964401960272, -12690974514969440852614043914081124808265368395120437593417799175868554551580816096493240576, 137668273188076588896595455712363357567938463323824707160639610079630624106409041821557888, -16904402090929217564311976170671210904310021672680305341759607452529580943571229640735136, 184199359589138885625603143092579477822426390596067857278300785129428070977192998870928, -13812708601737191460792610082902725055032648137103416520954968318509430178207542602224, 151033680198976659041193977488029367896471343178099610104741138442134551303690858392, -6742972016924419559925158731723463982108698743567200773570504626053082498547197152, 73932080313086677260499682388699333346084375466311013617122901195470675248934576, -1793483872100620660690775676616752348692241972522826308245787294491834077976808, 19707120177933507056748310965307356861400051870713731588722599131948929025124, -198261691717310556603363293989146371885245841547978207251528289457346682706, 2182281780643043821287403625428989232270846959180989838800775139028842373], [4133734874611505536547571316674690331359043173020045334788492675247013857361269332586888258828420608, 42625463448636445937386765469926866150374983897526792312026312261770376336956410259859328957634304, 169108741488394150393820780255094409922321496601277057593605898988759667873923399522182428157740672, 1788410039565882134081200365698496345307453936526661992643076705608810421795437870285859318257216, 1452407561294661027021214086724530844578238480723286925697658610377523300516849207170577218153472, 15537060870916115607138319671921749949397079280115955830919038551722973679674290676568205769216, 5739009970944457751995053261484768102868485054381933983685292234011634925881084117858707063584, 61887112507713488576897999033309329378575553633075874816115424633996415594855872964401960272, 12690974514969440852614043914081124808265368395120437593417799175868554551580816096493240576, 137668273188076588896595455712363357567938463323824707160639610079630624106409041821557888, 16904402090929217564311976170671210904310021672680305341759607452529580943571229640735136, 184199359589138885625603143092579477822426390596067857278300785129428070977192998870928, 13812708601737191460792610082902725055032648137103416520954968318509430178207542602224, 151033680198976659041193977488029367896471343178099610104741138442134551303690858392, 6742972016924419559925158731723463982108698743567200773570504626053082498547197152, 73932080313086677260499682388699333346084375466311013617122901195470675248934576, 1793483872100620660690775676616752348692241972522826308245787294491834077976808, 19707120177933507056748310965307356861400051870713731588722599131948929025124, 198261691717310556603363293989146371885245841547978207251528289457346682706, 2182281780643043821287403625428989232270846959180989838800775139028842373], [-1378541943806511561735095298973054188351903119906624543921876062206045483318847254763064397301545472, 90900003567890111303603761565849109832055633466642807644710971855956393396593287773488915967713536, -56213019249568339996928931583844194233424904325451770164175494740706594073681789050613147436146048, 3691681805996872161470907206942077148256135893976156033172638791572877006334815543242453601417664, -484421072297157155461332152472988440616387540984972749451677136487203544656570967497184262018048, 31400406861171978799781739134602926167106761505460197663621478255395491436770356820568868971264, -1925090296182061599397941262886975439719481075879537664650627421532392158849062154222508057056, 122996614826407977617511755688192525667464299877982092947516378862522059343050351639311537968, -4286316782868217390156842804127752864025399449937467671529647256651088241488640687817993984, 269977656650105213362021525375110901779674095640205917950428460092137214706786063299960192, -5750720625508340271193541706970170971481230169166573561260875101756393149348785509725024, 357422408255609279640140957890452735391935823202526649726745176479087244037225385975792, -4732397003550895289107625619225987335356520671960003682750976243655918619632274787216, 290622008600794111521557099003200061803642657011688862783242636694945843578359055848, -2325653853002133331477820084902637238599609993615632818779764536287601964512603168, 141323250374057007168777851305685552449834800636379488378366202777208784138788784, -622297730629581435521438901797287882609114254475788716182718862476317380378072, 37475225460186901523543201384486471520287008971344196417974919096799449729996, -69148716175807353845011128277247922464289376843722966494970488175582643454, 4133130298771403589506107220768285518522850499642399268721572392248297187], [1378532465724198081147435443603471455104671092813627505407381394428768886326158520346500027659868672, 91314547888232823860930700699017375313072214062622844020364025271362092766791715522498841226654464, 56213019249568339996928931583844194233424904325451770164175494740706594073681789050613147436146048, 3708280145664281814406282170322273884336056934542033074295119136017982215807226708532975916696896, 484421072297157155461332152472988440616387540984972749451677136487203544656570967497184262018048, 31541532130403044532454770761042972772636380842073576044891358037975830752248768595581150128896, 1925090296182061599397941262886975439719481075879537664650627421532392158849062154222508057056, 123548552447273407008971340172602559007372124209704783149636485795633977869629220821570408592, 4286316782868217390156842804127752864025399449937467671529647256651088241488640687817993984, 271187100001576921786452321294311274469539449761356648003023158739064724952954652143611008, 5750720625508340271193541706970170971481230169166573561260875101756393149348785509725024, 359021123349548761215194974191532020953879713752937443139109015118732750298653395064528, 4732397003550895289107625619225987335356520671960003682750976243655918619632274787216, 291920266339812599488598106386187796050185006208645452039348476246835974859346461112, 2325653853002133331477820084902637238599609993615632818779764536287601964512603168, 141953919650762406421840396950083776650289976677780791392629000531466947682187216, 622297730629581435521438901797287882609114254475788716182718862476317380378072, 37642329493745050407596720761359627109885514380713464894517422655038062360644, 69148716175807353845011128277247922464289376843722966494970488175582643454, 4151549010672738363706794770842330215276843642543227428506261544898921753]];
    Rf_basisdens := [1, 2635069748326394662357248793947916209515044949687089134375505419189947141598489600, 72851395414656253237912427983504381835471384464942064169196185600, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 3104514350959904244957539987793399027850341630212418766677948665770387385762992651283865600, 3104514350959904244957539987793399027850341630212418766677948665770387385762992651283865600, 3104514350959904244957539987793399027850341630212418766677948665770387385762992651283865600, 776128587739976061239384996948349756962585407553104691669487166442596846440748162820966400, 776128587739976061239384996948349756962585407553104691669487166442596846440748162820966400, 2369520578370146914963842395683311808006773249259628623666944319149248172183604141092410419200, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 3104514350959904244957539987793399027850341630212418766677948665770387385762992651283865600, 1579680385580097943309228263788874538671182166173085749111296212766165448122402760728273612800, 4739041156740293829927684791366623616013546498519257247333888638298496344367208282184820838400, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800, 9478082313480587659855369582733247232027092997038514494667777276596992688734416564369641676800];
    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_38_d();"
function MakeCharacter_38_d()
    N := 38;
    order := 6;
    char_gens := [21];
    v := [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_38_d_Hecke();"
function MakeCharacter_38_d_Hecke(Kf)
    N := 38;
    order := 6;
    char_gens := [21];
    char_values := [[1, 0, -1, 0, 0, 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 := 7;
    raw_aps := [[0, 0, 0, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-2, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [0, 0, 11, 1, 0, -2, -1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0], [-10, 1, 0, 0, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], [-14, 0, 0, 3, -1, 8, -10, -58, -59, -1, 0, 0, 0, 0, 1, -1, 0, 0, -1, 1], [353, 2, 349, 4, -2, -5, -5, 71, -4, -5, 1, 0, 1, 0, 0, -2, 3, 0, 1, -1], [4, -9, -1167, 6, -10, 24, 17, -165, 92, 1, -3, 14, 15, -20, 4, 8, 4, 2, 7, 5], [1017, 1, -718, -12, -4, -7, 16, 241, -220, 0, -4, -10, 6, 2, 2, -5, 4, 1, 14, 5], [834, -3, -833, -16, 9, 114, 227, 65, -116, -7, -8, 6, 2, 13, -18, -9, -7, -14, 1, -6], [4603, 30, 4600, -113, 3, 513, 37, 279, -12, -21, 18, -6, -76, 9, 0, -9, -15, 0, -12, -18], [-3207, -74, 6438, -15, -24, -379, -318, -645, 671, 26, -52, 48, 22, -96, 25, 25, 23, 23, 38, 38], [2721, 49, -5536, -13, 6, 84, -9, -4592, 4555, -37, 74, -12, -100, 24, 4, 4, -57, -57, -84, -84], [7192, -29, -3616, -92, 125, 139, -1053, 25, -3099, 8, 46, -14, -79, 71, -139, 0, 0, -38, -46, -32], [68, -2, 3533, -66, -189, -435, -292, -280, 124, -89, 86, 212, -64, -60, 23, 46, 6, 3, 44, -21], [-36004, -187, 36168, 83, -38, -208, -5, 594, -1240, 72, -146, 22, 351, -270, 76, 38, 72, 144, 191, 236], [-7893, 58, -7870, -187, -63, 525, 289, 4264, 28, 114, -91, 50, -120, -5, 0, 37, 68, 0, -181, 91], [87567, 479, -43669, 195, -35, 104, 946, 86, -2805, -56, 119, -139, -126, 205, -104, 0, 0, -175, -119, 173], [8395, 124, -8337, 86, 18, 1257, 1627, 6962, -14280, -122, 272, -766, -103, 38, -36, -18, -122, -244, -168, -64], [26745, -35, 26844, 1445, 35, 799, -721, 14122, -35, 118, -19, -121, 673, 134, 0, -207, -80, 0, 89, 19], [-58116, 54, 29035, 562, -749, 41, 262, -94, 23032, 149, 90, -790, -500, -4, -41, 0, 0, 59, -90, 103], [111, 260, -21157, -260, -1626, -3110, -2111, 20796, -10665, -547, 644, 1802, -520, 84, 176, 352, -194, -97, -228, -436], [-113796, -296, 57115, -208, 1537, 347, -1036, -306, -12120, -11, 120, 1190, 284, -186, -347, 0, 0, -131, -120, 423], [175777, -870, 0, 150, 1924, 2504, -552, 22659, 22523, -136, 0, 0, 0, 0, -53, 53, -225, 225, -89, 89], [23298, -166, 22725, 1222, -3736, -3282, -3307, -24115, -223, -1162, 589, 2476, 869, -350, 0, 1216, -16, 0, -111, -589], [339849, 353, -170564, 2138, -1991, -319, 3068, 299, 32032, 247, 234, -1672, -2851, 533, 319, 0, 0, 13, -234, -1032], [17421, -4, -18380, -959, 359, 5371, 16841, 35389, -69808, -113, -128, 2922, 3536, 955, -718, -359, -113, -226, -472, -1072], [152964, -68, -304612, 282, 3038, 10226, 6982, -14760, 14516, -244, 488, -6076, 76, -624, 684, 684, -388, -388, 414, 414], [256068, 2632, -513052, -212, -24, 20836, 17520, 2444, -4008, -1564, 3128, 48, -3552, 2136, -1408, -1408, -128, -128, -2022, -2022], [-617661, -357, 309269, 1472, -4528, -2924, -4636, -1961, -28753, -458, 111, -1604, 1871, -1850, 2924, 0, 0, -569, -111, 419], [-63847, -2949, 126696, 436, -788, 9669, 11815, -98578, 99039, 461, -922, 1576, 1794, -4976, 1512, 1512, 375, 375, -38, -38], [-298974, -1872, -298921, 7322, -1801, -7614, -3805, 151895, 2595, 1869, -1816, 232, 5868, -2542, 0, -1337, 1763, 0, 3935, 1816], [966, 3616, 576171, 1060, 2738, -28258, -19229, -87112, 41626, -3950, 4784, -3370, -2556, 744, -632, -1264, -1668, -834, -1184, -2984], [-30667, -228, 25428, -4077, 941, 1486, 1132, 15247, -25190, 211, -1244, -3980, 3081, 3849, -1882, -941, 211, 422, -1892, -5028], [632559, -507, -628901, 2380, -1310, 8215, 25935, -39975, 78387, -97, -1421, 2917, 5278, -2887, 2620, 1310, -97, -194, 2491, 3561], [-485, 263, 1358032, -7811, 2609, -70035, -33827, 104211, -49462, 837, -1498, -3224, -8074, -5111, -615, -1230, 1322, 661, -794, 352], [-13842, 35, 31412, -3760, -4182, -8990, -9048, -10363, 10123, -240, 480, 8364, -8000, -410, 5502, 5502, 346, 346, 1624, 1624], [-1890, 1776, 1081616, -10108, -1133, 57513, 26248, 437002, -220341, -3087, 4109, 4334, -11884, 1615, 3201, 6402, -2044, -1022, -5845, -4977], [-2445828, -844, 0, -1195, 3759, 25356, -16816, 42472, 38707, -3765, 0, 0, 0, 0, -629, 629, -248, 248, -1793, 1793], [88042, -984, 93500, -6565, 928, -14790, 9377, -405836, 2385, 9696, -4238, -4354, -4327, 3073, 0, -7780, -1220, 0, 1453, 4238], [574534, 1870, -286916, -8950, -305, 6829, 63832, 3434, 133377, 999, 65, -7134, 3822, 3499, -6829, 0, 0, 934, -65, 1701], [743166, -67, -1488562, 2245, -14210, -87243, -72760, 31613, -32599, -986, 1972, 28420, 2518, -2106, 3846, 3846, 810, 810, -2101, -2101], [1387335, -2972, 1385231, 20070, -1122, 99527, -11829, -511060, 9460, -118, -1986, 2624, 17303, -11564, 0, 4126, 4090, 0, 8424, 1986], [-2062046, 8706, 0, -10334, -27378, -6012, -13204, -235498, -239706, -4208, 0, 0, 0, 0, 4148, -4148, 468, -468, 1086, -1086], [125611, 10538, -60372, 13918, -15543, -5869, -139323, -5216, 759130, 4428, 2903, -9674, 1246, -2313, 5869, 0, 0, 1525, -2903, 9295], [3595135, 9493, 0, 13405, -16966, -41420, 3957, 324262, 313147, -11115, 0, 0, 0, 0, 3896, -3896, 1591, -1591, 3546, -3546], [604384, -9934, -597494, 1973, -2228, -24094, -51919, -412932, 822053, 348, -7748, 5920, -11879, -11907, 4456, 2228, 348, 696, 7493, 7238], [-54247, 4303, 22675, 17297, -6806, -13683, 110907, -15088, 829499, 5619, 12037, 6877, -6892, -3051, 13683, 0, 0, -6418, -12037, -3278], [-1149799, 9141, 565802, -7516, 16370, -10162, 199782, -8172, -118088, 12354, 10582, 26532, 11837, 2410, 10162, 0, 0, 1772, -10582, -5841], [-1041864, 18151, 2068554, 12927, 1126, -115223, -124750, -846407, 835743, -10664, 21328, -2252, 4526, 14974, -18286, -18286, -4592, -4592, -18251, -18251], [37209, -14251, 0, 39697, -26514, -111965, 23726, -458970, -459860, -890, 0, 0, 0, 0, -375, 375, -5759, 5759, 11014, -11014], [-9404, 2845, 22372, 858, 20137, 85495, 48583, 1885715, -948285, 13160, -9136, -26738, -1987, 28039, -6601, -13202, -8048, -4024, -1624, 3756], [-2577905, -11019, 0, 9715, 1668, -66675, 49580, -399880, -388968, 10912, 0, 0, 0, 0, -7771, 7771, -3771, 3771, 4524, -4524], [219302, -21726, 213704, -60127, 53537, 76981, 46322, -102097, -12351, -6080, 482, -28828, -22577, 6753, 0, -4119, 5116, 0, 19574, -482], [2762989, -9404, -2775122, 8807, -9377, -59465, -153804, 966317, -1976276, -7219, 18212, 5994, -50245, -18211, 18754, 9377, -7219, -14438, -18782, -19352], [678556, -272, 689757, -38638, 3204, -99453, 21628, -1339554, 12043, 13945, -2744, -5826, -18762, -842, 0, -8448, -8457, 0, 6818, 2744], [-2249, 27209, 7154384, 44982, 33558, 75038, 11610, 519292, -282860, -29298, 28078, -29220, 17773, 15910, 4338, 8676, 2440, 1220, -35016, -31547], [-1760245, 39481, 884851, 12168, 3498, 11976, 144428, 33261, 2477041, -7808, -8357, -8478, -22495, 24904, -11976, 0, 0, 549, 8357, 1649], [-669, -263, -8990024, 53380, -5960, -161014, -90456, 2224300, -1099720, -14582, 17706, 21474, 53643, -36318, 15514, 31028, -6248, -3124, -12796, -15251], [7330221, 8449, 0, -5643, 25664, -95476, 153707, -218812, -222127, -3315, 0, 0, 0, 0, 9218, -9218, -6111, 6111, -13462, 13462], [-2460812, -13384, -2460801, 92452, -10868, 153267, -41536, -1170440, 33959, 14609, -14598, 10028, 69892, -33948, 0, 9188, 14587, 0, 23546, 14598], [-2348, 9868, -8466969, 4226, 18992, -226310, -111137, -547692, 286392, 10300, -10928, -36812, -5642, -15420, -17820, -35640, 1256, 628, 4976, 7952], [-1010051, 71803, 1990644, 40007, 27126, 233038, 198421, 171338, -195087, -23749, 47498, -54252, 32516, 96108, -15844, -15844, -20867, -20867, -38478, -38478], [-6434849, -89205, 3225403, -43897, 35249, -11314, 194376, -50742, 2773807, 15954, -15473, 46563, 87122, -66215, 11314, 0, 0, 31427, 15473, 31911], [-5940005, 50236, 0, -21243, 29740, 234693, -189990, 1084441, 1052213, -32228, 0, 0, 0, 0, -2015, 2015, 13765, -13765, 3140, -3140], [1695022, 27944, -1692926, -37989, 46391, 52651, -152200, -1872799, 3787579, -4622, 19330, -102434, -108677, 65933, -92782, -46391, -4622, -9244, -10928, -2526], [6355185, -182, 6369321, -64472, -75332, 293475, 38865, -485433, 11308, 33581, -19445, 41748, -33559, 2828, 0, 8164, 5309, 0, -30255, 19445], [-8387460, 29697, 16760522, -89571, 106388, -30437, -190616, 1436171, -1418281, 17890, -35780, -212776, -143362, 95174, -50468, -50468, -10358, -10358, 10691, 10691], [12609625, -85467, -6311650, -108520, -17073, 35653, -71844, -25719, -1330730, 17859, -1280, -52726, 77051, -26999, -35653, 0, 0, 19139, 1280, 4184], [-43803, 13627, -3944263, 51653, -154949, -433662, -196828, 5225614, -2614255, 26500, -18165, 158625, 38026, 37731, 3676, 7352, -16670, -8335, -52771, -17303], [-9800979, -52863, 0, -10055, 124934, -488801, 645458, 437206, 488328, 51122, 0, 0, 0, 0, -26631, 26631, -9363, 9363, -10834, 10834], [8144269, -40385, 0, -26342, -55036, 303967, -374493, 528478, 528331, -147, 0, 0, 0, 0, 34352, -34352, -17309, 17309, 20916, -20916], [9963, 63465, -7177012, 53914, 55194, -186404, -175096, -1444386, 707736, -54324, 72342, -74298, -9551, -7392, -19104, -38208, -36036, -18018, -16380, -44361], [7141848, 55975, -7175698, -28211, 30194, -694686, -1242809, -942932, 1973738, 20752, 17064, 10290, 166467, 84186, -60388, -30194, 20752, 41504, -15081, -13098], [-4230548, 71028, 8300616, -105790, -38502, -458756, -526128, 1433128, -1433170, -42, 84, 77004, -211664, 141972, -53718, -53718, -35228, -35228, -80282, -80282], [13939460, -70239, -27826990, -29618, -13189, -225611, -193958, -2606451, 2630492, 24041, -48082, 26378, -11154, -92396, 32667, 32667, 32908, 32908, 50006, 50006], [-26334806, -59438, 13154427, -132188, 89481, -14371, 417906, -36069, 5192090, 8089, 8096, 103852, 128696, -27973, 14371, 0, 0, -7, -8096, -17863], [-5061851, -175794, 5102836, 24967, -42111, -200713, -179013, -1229240, 2409404, 38206, -113479, -22458, 202760, -200761, 84222, 42111, 38206, 76412, 96335, 79191], [-89790, 50920, -13891361, 91951, -99728, -360316, -118911, -1534418, 725138, 89032, -86328, 49566, 41031, 175878, -50162, -100324, -5408, -2704, -87844, -758], [-5356703, 98513, 2652938, 57426, 8985, 36099, -971984, 61197, 2116286, -57547, 60296, -27114, -201899, 121493, -36099, 0, 0, -117843, -60296, -108374], [8700882, -17644, 8669479, -32880, -21270, 227951, -8350, -8423072, -24379, -33935, 2532, 13878, -4106, -7024, 0, 6486, 28871, 0, 20714, -2532], [-28510568, -64846, 0, -118630, 48162, -465342, 673746, 1957976, 2050614, 92638, 0, 0, 0, 0, 49824, -49824, -2842, 2842, -20806, 20806], [8000206, 125840, -3948985, 272589, -67124, -136264, 121311, -85298, -1258966, -5004, 31470, 69140, -39093, -53828, 136264, 0, 0, -36474, -31470, 97232], [-10314240, -91036, -10293351, 451664, -138391, -283326, -196677, -1532037, 95837, 83611, -62722, 125094, 308824, -74948, 0, 111797, 41833, 0, -8535, 62722], [2676844, -112248, 2758300, 33969, -80673, 190956, 32907, 261822, 178131, 193767, -112311, 10404, 121446, -96675, 0, -59865, 30855, 0, 156477, 112311], [8003998, -25190, -3947881, 102390, 34899, 18127, -705998, -13277, 4694466, -42769, -22988, 16772, -55050, -36265, -18127, 0, 0, -19781, 22988, 65467], [20073569, -8134, -20058272, -57439, 48383, -1041409, -2066228, 771683, -1416914, 21869, -55278, -74676, 139649, 49305, -96766, -48383, 21869, 43738, 46222, 37166], [-19132673, -64767, 38377092, 42872, -109414, -658226, -462394, 4015758, -3993985, 21773, -43546, 218828, 129290, -85988, 6116, 6116, 110470, 110470, 77646, 77646], [-35823802, -75472, 0, 153305, 19400, -524981, 192840, 1169972, 1008895, -161077, 0, 0, 0, 0, 18677, -18677, -44767, 44767, 99118, -99118], [-56021, 43577, 33853149, -338554, 114112, 1572712, 757772, -1982827, 933207, -47382, 58497, -54286, -382131, 80146, 59826, 119652, -22230, -11115, -148309, -103403], [-634969, 154877, 0, -200489, 120434, 805709, -520086, -983648, -1040192, -56544, 0, 0, 0, 0, 14209, -14209, 33749, -33749, 17650, -17650], [-41968076, -578, 0, -131697, 472317, 71160, 515476, -528862, -530505, -1643, 0, 0, 0, 0, 6841, -6841, -69884, 69884, 8689, -8689], [15641190, 195480, -15602078, -115483, 126354, 471666, 566675, -1148326, 2572669, -26158, 8788, 45222, -295525, 310963, -252708, -126354, -26158, -52316, 2083, 12954], [7654714, 109213, -15455540, -73796, 90296, 1142822, 1007098, -5309273, 5323457, 14184, -28368, -180592, -119224, 246794, -35038, -35038, 20870, 20870, -58872, -58872], [42761, -113789, -3216904, 279278, 376314, 1329906, 783256, 3666875, -1805590, 150774, -158176, -456060, 393067, 87677, -79746, -159492, 14804, 7402, 228894, 193535], [-17251, -57437, 11359764, 221030, 301243, -1845861, -921081, -14354289, 7243432, 28345, 21322, -254900, 278467, -54563, 46343, 92686, -99334, -49667, 43510, 11094], [-45884550, -342603, 46031215, -139300, 61473, 1673838, 2993693, -1112773, 2427688, 51563, -353882, -185784, -106726, -203303, -122946, -61473, 51563, 103126, 276055, 198228], [1461445, 32838, 1457807, -90114, -452162, 1007877, -125697, 7420481, -151884, -44209, 40571, 272008, -135599, 148246, 0, 91854, -36933, 0, -232367, -40571], [-21683010, -25046, 43659674, 276817, -76710, 2233750, 2518755, 3747650, -3781911, -34261, 68522, 153420, 485112, -118614, -94963, -94963, 9766, 9766, 112566, 112566], [43606444, -30390, 43444554, -451827, 122346, -610514, 193351, 2123628, -73995, -241840, 79950, 64134, -166771, -87895, 0, 250614, 81940, 0, -52379, -79950], [-14449773, 338656, 14347889, 77134, -67066, -561543, -1433819, 8565769, -17195458, -101711, 223731, -208050, -169749, 261522, 134132, 67066, -101711, -203422, -213663, -203595], [-22354240, 194278, -22351979, 423084, -855213, 1566538, -628091, 13197977, -15209, -13375, 15636, 364062, 105668, 17470, 0, -127089, -17897, 0, -69023, -15636], [103702025, -317958, -103584574, 106317, -55799, -228185, -636257, 5823518, -11848252, 103322, -119737, -559228, 323542, -424275, 111598, 55799, 103322, 206644, 170255, 220773], [44742726, 67877, -89291634, 132975, -117532, 63491, 255634, -9079183, 9050001, -29182, 58364, 235064, 207586, 77390, -22346, -22346, -118762, -118762, 67727, 67727], [44937337, 82287, -89654910, 110243, -11092, -703608, -599809, 3763756, -3772524, -8768, 17536, 22184, 202950, 147038, -176883, -176883, -91506, -91506, 101114, 101114], [-91591844, 210425, 0, -221467, -411810, -425971, 97510, 5131463, 5013433, -118030, 0, 0, 0, 0, 15156, -15156, 109334, -109334, 69059, -69059], [-898773, -229271, 0, -6156, -57808, -2132131, 1941119, -5794750, -5924839, -130089, 0, 0, 0, 0, -131776, 131776, 106263, -106263, 69680, -69680], [72229, 355321, 22923812, -25000, -115582, 1345374, 177708, 2566977, -1477606, -355516, 458962, 43548, -380321, 136165, -72034, -144068, -206892, -103446, -107612, -283287], [-59934324, -554696, 60226582, -63417, 138091, 505949, 755558, -5931813, 11683605, 84174, -227084, 17856, -136105, -491279, -276182, -138091, 84174, 168348, 301758, 376432], [46836698, -181167, 47033179, -443018, -2011, -535626, 271177, 25340765, 296424, 264177, -67696, 56842, -80954, -99943, 0, 111673, -128785, 0, 101741, 67696], [42038623, 264163, -84064060, -447520, -12064, -1647480, -2259254, -19997036, 19908877, -88159, 176318, 24128, -1071358, 352008, -243924, -243924, -165324, -165324, -81566, -81566], [35643914, -34867, -72063464, -254560, -224322, -119076, -41730, -651729, 705521, 53792, -107584, 448644, -401536, 37850, 104518, 104518, -146052, -146052, -334026, -334026], [105671, -163437, 108456303, 549526, 418638, -54680, 70224, -32109067, 16162397, 64188, -100775, -425060, 712963, -188126, -6422, -12844, 73174, 36587, 238943, 169859], [-38231683, 168378, 38025872, 295443, -329081, -1430450, -2077718, 2447507, -5114452, 23081, 115454, 578816, -124715, -127065, 658162, 329081, 23081, 46162, -149092, -182730], [-102466536, 84494, 0, -103546, 221988, 2138958, -1798876, 206344, 1534, -204810, 0, 0, 0, 0, -40616, 40616, -18686, 18686, -7274, 7274], [49482664, -209761, -49523136, 234291, -182618, 580892, 1929337, -9298770, 18204662, 97496, 46322, 506072, 78863, -444052, 365236, 182618, 97496, 194992, 5351, 57024], [10356707, -307100, -5094193, -62344, -146048, -85686, -2713559, -251242, 16608115, 53253, -55938, -60362, 369604, -307180, 85686, 0, 0, 109191, 55938, 221574], [-198121, 368409, 75882428, 194822, 411929, -3335975, -1908559, 2698015, -1559002, -186321, 248588, -395896, -173587, 295935, 16033, 32066, -124534, -62267, -520296, -384442], [20839810, 333300, 0, -704544, 359108, -131734, 1328354, 15179180, 15287272, 108092, 0, 0, 0, 0, 110464, -110464, 126252, -126252, -66484, 66484], [-10706081, -121475, 0, 293561, 559138, -3460771, 3664100, -3634764, -3570712, 64052, 0, 0, 0, 0, -169839, 169839, -7169, 7169, 31124, -31124], [-13108658, -175306, -13363860, 53787, -221348, 3785016, -45635, 14625198, -144001, -124884, -130318, 85224, 170147, -111201, 0, -50900, 385520, 0, 207089, 130318], [-14591321, 274522, -14883546, 1267397, -374971, -635759, -1139993, -3448283, -453224, -618879, 326654, 304224, 415938, 160999, 0, 233477, -34429, 0, -342344, -326654], [-17291283, -794297, 35844986, 528159, 471878, 2173948, 2660413, -544220, 759312, 215092, -430184, -943756, 1486502, -1158410, 324157, 324157, 316066, 316066, 846302, 846302], [-68870713, -351047, 138186638, 120179, -97946, -2745991, -2295266, 12311076, -12194776, 116300, -232600, 195892, 472958, -469494, 156997, 156997, -21163, -21163, 338906, 338906], [117505573, 111975, -234555022, 87585, -65942, -1657209, -1984278, 28817612, -29057910, -240298, 480596, 131884, -305426, -256646, -25599, -25599, 84531, 84531, -12236, -12236], [-31381312, 21496, 0, -293894, 702736, 3612734, -2451780, -14763770, -14430328, 333442, 0, 0, 0, 0, 13348, -13348, -74762, 74762, -82162, 82162], [-25081, 83539, -176712196, 74951, 388917, -3744309, -1633751, 20480969, -10176646, 321987, -428626, -769362, -8588, 87671, -380445, -760890, 213278, 106639, 165186, 296906], [-25400107, 74378, 25680923, 36902, 123082, 4986921, 9594905, -18272836, 36877048, 166526, -127374, -132642, -123213, 37476, -246164, -123082, 166526, 333052, 287358, 447342], [-73349, 291193, -147552130, -53638, -336532, 294384, -540, -28949883, 14177528, 103364, -12872, 15324, -344831, 788683, -321208, -642416, -180984, -90492, 47158, 30015], [-211221, 696305, -70608746, 412784, -1140394, -4906946, -2947716, -34494205, 16688380, -342598, 423000, 997908, -283521, 855249, -142486, -284972, -160804, -80402, -684638, -553819], [-33380671, -204797, 0, -308807, -158258, -3027658, 3413391, 11469922, 12034157, 564235, 0, 0, 0, 0, -238316, 238316, -89279, 89279, -117592, 117592], [241779, -293191, -2002381, 1174435, 223821, -523388, 36598, 29933976, -15003647, 54614, -299893, -227023, 1467626, -117347, -3202, -6404, 490558, 245279, 292893, 296393], [-256784033, 390435, 128540560, 572618, -738246, -36596, 4711256, -219378, -34980196, 49704, 222902, -701650, -189231, 3524, 36596, 0, 0, -173198, -222902, 346791], [12808192, 556252, 13138091, -2122750, -443881, 826106, 948677, -13416905, 230065, 261731, 68168, 139476, -1389418, 99834, 0, -164929, -398067, 0, -422989, -68168], [-242912, 484862, 15204152, 234184, -850921, -3753051, -2160756, 3932550, -2189855, -89479, 207995, 698450, -250678, 476197, -152471, -304942, -237032, -118516, -456787, -332391], [17164609, 148465, 0, -961294, 2082492, 2976797, -450843, 18371668, 18436713, 65045, 0, 0, 0, 0, -340176, 340176, -217523, 217523, 258916, -258916], [116505930, 102342, -117117874, -370637, 186683, -4912308, -13471523, 11675456, -23147359, -12695, 256731, -1356450, -2103774, 472979, -373366, -186683, -12695, -25390, -440685, -624639], [-79038881, 750544, -78949877, 339994, -159836, 958485, -44043, 3843554, 140260, 47514, 41490, 19126, -179647, -51256, 0, -121584, -130494, 0, -536214, -41490], [-98463778, 379207, 195687870, -413993, 1415106, -3022437, -4633008, -6221241, 6330505, 109264, -218528, -2830212, -609458, 976942, -441868, -441868, -175152, -175152, -510579, -510579], [72183513, 413559, -144627060, 209157, 221688, -1780850, -1959231, 31035878, -31118803, -82925, 165850, -443376, 252464, 661268, -235912, -235912, -503981, -503981, -212942, -212942], [190715455, -151023, 0, 1714366, -74050, -3265200, 2098020, -1976184, -2072105, -95921, 0, 0, 0, 0, 584858, -584858, -8076, 8076, -310618, 310618], [138675158, -179312, 139413128, -1705537, -657436, 1720944, 892389, -11860568, 31105, 930130, -192160, 48960, -1116545, 706865, 0, -559516, -545810, 0, -160197, 192160], [-44351275, 781542, 43088687, -216504, -42980, -2797895, -5810111, -27545881, 55346414, 113, 743507, 389288, -646589, 998046, 85960, 42980, 113, 226, -1002991, -1262475], [-85212146, -525318, 85495630, 360277, -111924, -2471292, -2704633, -11738028, 22747755, 185258, 27964, 787414, 1338613, -885595, 223848, 111924, 185258, 370516, 220389, 468742], [-21775263, 254870, -22049520, 1135897, -2165353, -1611165, -1447972, 11164235, -267670, -109519, -164738, 831712, 443807, -6587, 0, -501929, 438995, 0, 88908, 164738], [-84014472, -793622, 169601088, 508390, -949996, -1718736, -146186, 6712230, -6655148, 57082, -114164, 1899992, 1130944, -1473080, 229594, 229594, 169404, 169404, 843154, 843154], [-75073463, 552503, 37758226, 37570, 1141640, -222984, -1998184, 586588, 15270848, -535278, -375684, 1364624, 93125, 210904, 222984, 0, 0, -159594, 375684, -92289], [-23018, 427446, -56367248, 2328732, -1178017, -4881445, -2967316, -7664814, 3175299, -428607, 538683, 1202196, 1901286, 995685, 24179, 48358, -220152, -110076, -364567, -451625], [-135704982, 1365984, 67975313, 2470860, -1671730, -1926886, -3211644, -576356, 5522770, 195946, 75110, 255156, -102384, -501246, 1926886, 0, 0, 120836, -75110, 441590], [100684423, 311646, -100494603, -913196, 414824, 3125437, 7633522, 8317534, -14793578, -284958, -901606, 520562, 1276910, 1224842, -829648, -414824, -284958, -569916, 403234, -95138], [-9039141, -1269466, 19121846, 1560535, 125476, -14798349, -12684946, -9131623, 9470795, 339172, -678344, -250952, 3799414, -1860588, 349041, 349041, 133095, 133095, 860954, 860954], [-79477701, -626351, 39450758, -475263, 72469, -629631, 534805, -315089, -4083390, 4625, -27122, 702100, 533334, -342211, 629631, 0, 0, 31747, 27122, -571560], [196192795, 1291417, 0, -223712, -395180, -3634964, 4738972, -22069276, -21854095, 215181, 0, 0, 0, 0, 11348, -11348, -266336, 266336, -637738, 637738], [277040403, -17414, -276356476, 499409, -201933, 7433903, 14835700, 7315665, -15074384, -7603, -81372, -596430, 362391, -516823, 403866, 201933, -7603, -15206, 378848, 676324], [-31874700, -799522, -32630380, 2710615, 1068316, -7766262, -2020447, 30847256, 28637, -1272938, 517258, 92980, 2147227, -784317, 0, 1254276, 238422, 0, 846821, -517258], [-104404853, 422661, 52172223, 1523483, -295665, -1599022, 1406422, -1529452, -34758825, 802412, 570269, 1303357, 817544, -959183, 1599022, 0, 0, 232143, -570269, 742005], [23615266, -945673, -46442048, 952186, -152200, -8343910, -6220600, -15322555, 15832017, 509462, -1018924, 304400, 2923296, -872422, -83528, -83528, 535370, 535370, 903704, 903704], [-229234426, -277874, 0, -684272, -459696, 9035582, -7648470, 34165566, 34583108, 417542, 0, 0, 0, 0, 174742, -174742, 24966, -24966, -581268, 581268], [-1383190, 1239378, -228213361, -1386464, -220504, 4327336, 1906222, -26982710, 13351152, 539408, 59648, -175092, -2625842, 1418870, -395596, -791192, -1198112, -599056, -1627916, -843782], [-232826106, 339716, 232483763, -957070, 419634, 2186357, 33562, 19583846, -37180631, -21127, -711402, -3914670, -4848, 1296786, -839268, -419634, -21127, -42254, 173966, -363470], [127228931, -366418, 126876126, 525809, -1642821, 8292585, -1212585, -18704294, 292952, -480518, 127713, 1454654, 768992, -645757, 0, 1266487, 225092, 0, -126599, -127713], [70796, -1028414, -321723733, -4238080, 1903833, 11752827, 6537298, -14451658, 7853978, 172233, -268192, -1118448, -3209666, -1180024, 785385, 1570770, 191918, 95959, 217866, 243029], [342530469, 1211864, -171097195, -1409752, -1424372, -896786, 7734093, 379652, 68897587, -290033, -245136, -527586, 2352584, 134516, 896786, 0, 0, -44897, 245136, 46046], [155150, -464612, -175517497, 2890764, 1071567, 15553299, 7503146, -42322738, 21741878, -340967, 598718, -421138, 3355376, -1244234, 650429, 1300858, -515502, -257751, 227084, -185817], [243217091, -1507811, -121998769, 278619, 1225147, 124252, 12543404, -626386, 36763935, 1058562, -204451, 1100895, -124756, -830837, -124252, 0, 0, 1263013, 204451, 278115], [210850341, 996047, -424747428, -1796478, -47350, 12333635, 11653093, 38924102, -38389809, 534293, -1068586, 94700, -2524370, 3060680, -1039280, -1039280, -978217, -978217, -989080, -989080], [201125436, 120198, -100400305, -1428048, 1922975, 509495, -117390, 94696, -5383292, -213569, 164522, 1413480, 1029810, 259218, -509495, 0, 0, -378091, -164522, 111257], [239025478, -66962, -119215573, 2963938, -964875, -146309, 9744734, 149346, 91623238, -267083, -419606, -818566, -2490380, -270260, 146309, 0, 0, 152523, 419606, 327249], [-61029563, -838264, 61153489, 1405380, -895264, 5470195, 8673947, -36003982, 69260902, 196444, 699862, 99082, -3260789, -2243644, 1790528, 895264, 196444, 392888, -189746, 320370]];
    aps := ConvertToHeckeField(raw_aps);
    chi := MakeCharacter_38_d_Hecke(Universe(aps));
    return ExtendMultiplicatively(weight, aps, chi);
end function;


// To make the newform (type ModFrm), type "MakeNewformModFrm_38_7_d_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_38_7_d_a(:prec:=20)
    chi := MakeCharacter_38_d();
    f_vec := qexpCoeffs();
    Kf := Universe(f_vec);
    // SetVerbose("ModularForms", true);
    // SetVerbose("ModularSymbols", true);
    S := CuspidalSubspace(ModularForms(chi, 7));
    S := BaseChange(S, Kf);
    maxprec := NextPrime(997) - 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_38_7_d_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_38_7_d_a( : sign := -1)
    R<x> := PolynomialRing(Rationals());
    chi := MakeCharacter_38_d();
    // SetVerbose("ModularSymbols", true);
    Snew := NewSubspace(CuspidalSubspace(ModularSymbols(chi,7,sign)));
    Vf := Kernel([],Snew);
    return Vf;
end function;