
# q-expansion of newform 18.26.a.d, downloaded from the LMFDB on 25 August 2026.

# We generate the q-expansion using the Hecke eigenvalues a_p at the primes.
# Each a_p is given as a linear combination
# of the following basis for the coefficient ring.

def make_data():

    from sage.all import prod, floor, prime_powers, gcd, QQ, primes_first_n, next_prime, RR

    def discrete_log(elts, gens, mod):
        # algorithm 2.2, page 16 of https://arxiv.org/abs/0903.2785
        def table_gens(gens, mod):
            T = [1]
            n = len(gens)
            r = [None]*n
            s = [None]*n
            for i in range(n):
                beta = gens[i]
                r[i] = 1
                N = len(T)
                while beta not in T:
                    for Tj in T[:N]:
                        T.append((beta*Tj) % mod)
                    beta = (beta*gens[i]) % mod
                    r[i] += 1
                s[i] = T.index(beta)
            return T, r, s
        T, r, s = table_gens(gens, mod)
        n = len(gens)
        N = [ prod(r[:j]) for j in range(n) ]
        Z = lambda s: [ (floor(s/N[j]) % r[j]) for j in range(n)]
        return [Z(T.index(elt % mod)) for elt in elts]
    def extend_multiplicatively(an):
        for pp in prime_powers(len(an)-1):
            for k in range(1, (len(an) - 1)//pp + 1):
                if gcd(k, pp) == 1:
                    an[pp*k] = an[pp]*an[k]
    from sage.all import PolynomialRing, NumberField
    R = PolynomialRing(QQ, "x")
    f = R(poly_data)
    K = NumberField(f, "a")
    betas = [K.gens()[0]**i for i in range(len(poly_data))]
    convert_elt_to_field = lambda elt: sum(c*beta for c, beta in zip(elt, betas))
    # convert aps to K elements
    primes = primes_first_n(len(aps_data))
    good_primes = [p for p in primes if not p.divides(level)]
    aps = map(convert_elt_to_field, aps_data)
    if not hecke_ring_character_values:
        # trivial character
        char_values = dict(zip(good_primes, [1]*len(good_primes)))
    else:
        gens = [elt[0] for elt in hecke_ring_character_values]
        gens_values = [convert_elt_to_field(elt[1]) for elt in hecke_ring_character_values]
        char_values = dict([(
            p,prod(g**k for g, k in zip(gens_values, elt)))
            for p, elt in zip(good_primes, discrete_log(good_primes, gens, level))
            ])
    an_list_bound = next_prime(primes[-1])
    an = [0]*an_list_bound
    an[1] = 1
    
    from sage.all import PowerSeriesRing
    PS = PowerSeriesRing(K, "q")
    for p, ap in zip(primes, aps):
        if p.divides(level):
            euler_factor = [1, -ap]
        else:
            euler_factor = [1, -ap, p**(weight - 1) * char_values[p]]
        k = RR(an_list_bound).log(p).floor() + 1
        foo = (1/PS(euler_factor)).padded_list(k)
        for i in range(1, k):
            an[p**i] = foo[i]
    extend_multiplicatively(an)
    return PS(an)
level = 18
weight = 26
poly_data = [0, 1]

# The basis for the coefficient ring is just the power basis
# in the root of the defining polynomial above.
hecke_ring_character_values = None
aps_data = [[4096], [0], [292754850], [3580644032], [-15111573238212], [1221071681246], [-2518250853863682], [-7992693407413060], [99645642629247624], [2080672742244316890], [-4937672075835729208], [19829154107621718182], [-224696060863159376442], [-72221008334482349884], [-189872435947262116992], [2645676034335389555874], [16454608826354674865340], [-35546954389065591688738], [106703750402023286661692], [-73672004836753334994312], [-262402855870448192600374], [-1002642123108883497568840], [-1558588706101147601425596], [-2181670205644666928498490], [-440165308375605500117758], [5025816466960161774796338], [-15231132413116222331069104], [24723232336147920033402828], [-28577088988318093284377890], [17323993971537134780614254], [323348791716576759188607032], [363273194835322968636254148], [656741995091887721031840198], [672509382550429897533038900], [798626851788367611214144530], [-1036330071584944559083620688], [-3363461783241608608462639138], [800443041447900266135244236], [5179823242791965026125053928], [3408798534214068994276285914], [12361024688698930704034878900], [3385164534828342405435586982], [-38113957824947567554261304832], [63884180703822232991912580866], [87368006040135342497540658738], [27676620242123935779517509200], [-20847903083577826132074696148], [290505533386818563228819293496], [-323765484141151392384515736012], [-511098914973490127945336061130], [120130126304444209044165968694], [-334916172666816135840861227760], [-353238065443818531917291264878], [-1076032866769126355578367407572], [-6562583967503843506745344002], [-2038182223470016481986689918456], [-1302160522888136340250317085590], [2733839991949733137863539874632], [-483846314350783888045698250618], [7578181846561495517766147813798], [-1304434491439386969086272188124], [404020502709184111649020217394], [6956357800191461593641789968972], [-2749129675327262552220956664552], [9393826054165747022559281525306], [-18654308209875405963563764351782], [-47163781801817945578817539796908], [18579198145633341445687710671762], [72763534013983239336546468426828], [119713153310662149501665461172990], [-69972192766965298114216548511746], [-60636380182960699846231012546920], [222539020474954078793437113883832], [-115379037444157928855453128576234], [54721271115824728643987001232340], [198130235804850432121820030644224], [-41909845321846669225922789666910], [264500123588690669041519135510382], [-233767300936591282822426062362082], [-548496823177581017135624232086470], [-34148785064504972165534477181900], [-571127103800155816180376306961898], [-526390134723870291871627203483552], [-700632574301627294943077833946254], [529541654604072070517635380303680], [-449791662673666726459370336261076], [988741383815979666157442298918030], [2937914277687192365379714637804202], [2140525027959792616926373228533498], [871981642334975910289460071533896], [601153293155119002064347246614628], [3018699874292001662597616809366160], [-5241370870305969000022812125815648], [3081718487948239959008711046845388], [-1649097663464128569886061991397300], [247161957888888246235477031242344], [-6267402973696626529374656671052070], [-16467814298848987768468210680621402], [-3459694783961808162550045993821244], [-2311437134526535589106620558384818], [-4047334922803775020615783216832788], [-23218054883231600463322359258967302], [27010338963400068415819849216359204], [2321473693728163505552505103927350], [25583722042821969797735720325394532], [19595205810817421364210568449600002], [-5987831358650520269606268482263572], [-15716947258953599775220709327304306], [79098851335309816832348952108964200], [-95006682874378385207823018835136998], [-398587862997334707781842445952488], [-68259166061553629525878447816482874], [-115083955043153613382258401408047082], [43478815224056928334670830594502420], [127302304840934802861189531170911952], [9454543403990471340033090140450958], [83194129319516678576267459887173836], [-234992376923267636261945884504215432], [175276167419837039852972666725586394], [248210923181680568866088596848499380], [-337344626185093997481693109988706538], [299045278083755968511631108057137186], [-56905753018342847398645992229273182], [-138059318608008810683341429326886596], [116343401636597869482314516363153852], [-630496108854672239912864889128752422], [-752844206531290013884619972757612010], [128708338148014055482426233596706720], [439640403014661990020280106912359152], [-1182972839455373499151802930663061394], [-813836209109271403260581175421937860], [1026404717966456615983650940018406664], [-1431289868745681589834987341407705128], [868697364765238978722489426637904582], [-55125041735747488479950148401063082], [-498681290163075047483867421085669630], [-479467075069234394831982973972914126], [1225991268601262504497844427317785052], [3124026412077859875121245244821958218], [-4169817606066517781210447388440213850], [793102070048914691958419782033801412], [-222198174710479314351753670329363582], [4631970447944072825758187339637239216], [-5608247057407023424364288876684069412], [-3613872098779731001127310017964909010], [3537376720410106475168267527165873560], [-5364845071392356567234945097128773354], [-1128496743793694551469396165199518442], [-6056196108892862280076980446802522700], [-530955720164695754922819655018178016], [-5830309273066978489741632008566613938], [-7572931148111953596017518767692186802], [-2591835602524118130535196525434274884], [-7966855366804736523718840428158884872], [-4865060093322396452272875413329082428], [-11003578324621745173180777082364528912], [11057704152594982349084256433684402640], [-18243517061806833392500470861432119730], [9540743151227158461904626592145854442], [7721273734829139385807772619384175578], [18918250718864429673385694384071381428], [16149432380240809458308479187123933814], [-26464511224833886691526891667470597328], [-27360073491450817073869859079538213092], [-30474292269377662507323577670195830242], [-3845160303598337599377811072781299176], [-43004297389375054036719249923463629848], [-15231705037264846651824030671288370298], [3999809648095677112938741502062542930], [25396807781218724419213622876314560594], [-34018140534957813646415228977153195620], [-40098109226437829792533016996675469058], [7449079611364228990346162456957028648], [75427591134539482427840883632622966986], [52334864254128985652466092993859852440], [-82712589657100032306172216999100782170], [16528385428130452078987272512540861732], [92828306765304861736273953040232250498], [48128370525127733845437811636748633936], [72779616291307358039855592539031786350], [-88079730485498066405960361494214313528], [-105241912404833314945832896317361157772], [-98320423343467849476507701084650959274], [132429588594799363661663198901757825398], [-145656730945696008219107044610234976816], [-10705696778406896650847403696520282830], [-58956270803544736065146711485890120658], [90602149428266164761472161231935984156], [-56575255680001712636429433775612404790], [-156153399868413667397938707326612247552], [136490010352561650312677262561364407746], [98283615077810481885359796116337815244], [-90049805754143127662373501228088860628], [-454335264911403478373145909603885725622], [477289446210690147804245096951896185828], [200131240960884489274251033724544900694], [344762311171955161456982188470490155122], [426906597412077986614831564824034511246], [-41967379888857082555031524431457868802], [458147326580784667947695268395255002344], [-410646478390119642997320665837944628550], [-26697618425108532096397951559759491768], [524545952247463976668946130888886306502], [569282291969884488107765100638917647650], [119003738173358631956151941735006157180], [-1027111587276085828508752618772727326502], [30525171882570109573093915021035031160], [620389093522592831096523578689499524404], [-386141089617116522185241924044294140330], [491716026851710660020412874220056563652], [-1513171124049878924945170343820258391918], [-112854859408366713816578536310079080142], [-165075428451825311069876171102418875104], [-990677937728765794657047455280278881572], [-1655196102083462241318926031523402817160], [-1580831661266340803216460316221629280598], [1476499147585820255468982275863535282072], [-444526120408098943768789988553148047042], [-181455048068760895678213586525038818792], [1286599203380902916087420593862353681194], [-2179432060918993055883687786861436920298], [-1006773500314057550841869560343772456640], [2690184799863864907828172321181513514350], [-4417897560229059832964254203973357271224], [3634981166471815168430355980428652436228], [2881703598907349904595247260873568305430], [2678853953200326561939578393891910936774], [-2670259444584050373977120331697138603440], [1778523446204891908384570541376216102512], [4562255609085883145046672595584752804748], [-5204247808896646964046664520886295068514], [-4734234835690577970029153610135873773860], [1192012714803315402284669924201817267992], [4953042022736315453153411432444744166198], [-2353001210674914690830594224105205053564], [2422337093916540241288298978298832529088], [5610590691152520530659931586661473417650], [-1225591583597628286687605595399533326766], [6018043810783761586125737484226273067820], [1195186287546908806180227621806087874648], [-7285791013984747448333330519707242286236], [6150395021498356968181650751844457506852], [-9756105518373753989146879915428047759104], [-5005111399365906547090587688666986839410], [4085913766496890331524563096201115677294], [-10132320144909683706701354611424488719960], [-10082488363538019134659129539021247622008], [4383818697467059067071465527840023080068], [14979033659381889969653281865635406890100], [-2714808252876455321882347071637236090096], [-12152643545842924458023387301931367851858], [-11970142927644699298103281031059095551202], [-1192665236774225852368526888030255042952], [-283996223991932286718309477355398832950], [-475275119557748008911665677866021186006], [-17684343153296965405213641394156594851660], [-11783393223187769863417162409867328679738], [-2610404298756876461218891622619661925308], [23276933126916068549500839189048630409938], [-17450245967947820597365002796253881336198], [-5368519692027127040047367965501699430344], [-10702612334311527638145337785668352486012], [24216175305484447384417701900981662134070], [15484908171716372106796634447056615373726], [-4351193434441701621159616004202905964402], [41066328114744438132603880846213230951740], [39719055269126185445202248653934184067770], [10072291618557631765524883438708064813478], [-7233418115934524710766678188962248378764], [840479684775628377166560352324083026274], [-29626487297379928217607095115764184568018], [-38128632851490076728902206415944806895348], [22281612296742518594137409661992648340506], [-2395413309543973233124304800959062096920], [12245317454810829082580220641191843470962], [-20872270996885267407005342919549154572544], [-58433400961562551082469345567418718410932], [-40488774332213961796605596444464391649250], [68672867707067761776113581918504455324362], [10715871276002671502286962370775914314868], [-85236423737967324435744966565466473874736], [26982490462029014395042754588831954710352], [51018792545048328296740814816274404656008], [67519110833063018946122016526942531735142], [-74786482037212718810210521437247663506268], [64609914183981635597999418065146260062448], [13270983768489408614681949604775197620146], [-45661088582150911666986338208663261085902], [68035217290772815636315001517130224974000], [-35290771601876980569686250967277479395330], [-37294724283046660764509003643967719134982], [6217810354032762338135944475503363861428], [-35418698498523979778370281402180418964506], [-181418391596212294780983623853762843895092], [74080255846236928902420054168695284863566], [89354553245537130400801302245811389021610], [13385380035314108264189333497148874672152], [67985131121196186195381641887492067099874], [88798750235981527545011485177896598571340], [-40281446241243934873304019570383693815828], [-234505543622810950021198614000064605146614], [-313824849986341030410359377668249787847142], [-115256043846372716724406514022741710464360], [-43081262710250555772893338795919938289196], [176817579318506006228113819860575515360532], [18317769391389784466946269223907109856002], [-35323855656421525326696832247500193006052], [59349781324677808817653537467443170267070], [147378650436755351576530337295560576272200], [399548517634534681894347240896041518593126], [241123566680075807232114370125880630827984], [330108518590568144592820897858259128897410], [347137542036120924518461380813367442836398], [264813087411916428073877089438565319338156], [-330171550509739251923798863992320297288952], [-370362226203229680456529816812209519834710], [60918480255499111625344955503315391607060], [696314316353623922214213633303014262969168], [281010797091007359983884881094310021128706], [203092071209524398658435893863919597532110], [-116540488393301151373743751820263774428628], [409716336137498083918496916473048957919002], [-336842223715300956384918253042695585275622], [245512803193838076514283572816629845885576], [609360527108445251836753393245898253582214], [275049330043343947202485098007373267467922], [-942158160240617052455454056021298305787700], [-195675638733918991029344601319045710138604], [-540276070067882350476460016550756354781152], [175529384221795641137209667870616186182274], [887013980812431459245570211905751744942302], [577385590019677012304587401910836870973578], [1050920465884729365480057480665684916428120], [-495749017261935982080270066821356359120156], [1046990363610731901470485270797315124560692], [-225557796914057096837714779230357410244372], [939574429744887349252723761488545235111390], [712016365880683234329151357774726625410494], [685623563832203262227895694626249642078122], [880947060724721475086974883146757470122632], [-391346513895037495994305462539513423451594], [1617436738116327800198723127946020341097078], [1394866620505274467865198065189525706465490], [132522574798877836877135316336518226505232], [-1572948195800071915565830494519983170629126], [-1573712482917282776816266697264229688806060], [1850298329753201539219704197416354733935862], [-1262432119704746629290300611067782066909068], [1186750374632860475048277909260485630662528], [976551843693812624719879607346380802283458], [904093243323918468748067526106219104383852], [-2590391770055936989624786135113319479295318], [1440368335066914906501623065766406883750218], [872904393602065515047277067063093668614696], [-2006444038291025352082849386200970229006570], [-2598334064801241555549369335895239294347866], [-1124274219944069406907597419720093008827200], [55097877836725781622102126139748350511628], [-202383287967206418943217119230798915473442], [2531744122422169508019623708361539814240024], [-1977939401391581187979987133778386973726778], [238070770629949523775679197654882928864278], [1950063679589894244791476550858495648188368], [-88544302056562474709145620785706352952020], [-824868916078943440882516472363839861449988], [-640889084220576887716174172758124317742614], [-4533568662117175002910157015106110436790902], [-967916318925859854232613867711318759269984], [2880380280348819647891046415081401318425882], [2712348223183137712252366911336584131397748], [875639661154808801273471812327014774309860], [4014541171318205514359284881021479285371824], [-1731421624400141972157919545545708303833950], [4108767183638552907826356343606754381146832], [-5592452693062619230731038947457057539613938], [1722674263838057470673410476121398269140740], [3854074669217764055646927868459408034238048], [-1796877553512143927007780913753617709960414], [-5567643147878016435142254875731919026631490], [-573009082628184751368093137547460521902758], [-6073590223098631233484760638611359265715062], [-9225537892943709459435590652825183522665466], [5437418173279923243252860299133391155205872], [2645447918147325948989959342580193594317598], [-3241192211377641559082915391566972927432020], [-678992580547086554754230280654272936520216], [-5045822740758243953543019306803047515614248], [4456350365909914461668993283924867458443622], [-11717600803950000282135633150105069053006524], [-233617393923286457974147910366387443347792], [-5791528108534289905083886799862523958225470], [13118984454000164363967498050122871771521794], [-5900226153069501699697350670273917491894580], [11625443788419966033165267250420856827696892], [10364063482096635013840994510555235860447928], [2007533457787711748368801908447993926675066], [7816181268812245305270918780118477191573080], [2068962928759287790857042566641755767761350], [7042204995604155781897117306571266206321572], [-5549100216463775438299136564926549172723982], [-7531060586241531291275600492326240065902050], [-1355774280749640894237571884432958965445266], [-9613673334774889118803525278104222620050328], [1852632102583417611221511975544585482502998], [-13806251563923542821628379606015608614114830], [-6149725309755574241042700792217260327090688], [6143150437815286345605906625980975059410142], [-495349852637307676289733896559297774548802], [-21603842612385891615110643954540584990309284], [-10543572788927417403847636457409296035493580], [14133127710735637088499858445236581477726546], [3508245875791449324287357366641417797600498], [-6756136581090718292698075682947944496649076], [-10337867062911227782051305716162849580774388], [-171355716881819106861334393536228676993558], [-22394006148418803537720561888048449824998582], [10872563718041414067166106981650047171417600], [16971911606358311503559503222476421815276512], [8766509280107103853317314249723720361097758], [31491625016387432663535784343405934500488104], [15916783255798788774290063775890473023421290], [1225372956888324876088410077980638230581862], [23302059068844594872620709027454264730387728], [-33229065631567947343154219202328435298128500], [-6040184644601077752071819890053137255173174], [37147735374486664063534248829366224731105898], [-3839312667764479982219019069752264659187676], [-14790575975272594642144797615114122627555130], [-26862367906257420637184441685142317528548428], [13627429966514089443115793647421885147563560]]
