Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168759
Image: ubuntu2004



SAGE

Creating a viable free open source alternative to
Maple, Mathematica, and Matlab

William Stein, Associate Professor, University of Washington



Poll

How many of you use mathematics software such as Mathematica, Maple, Matlab, Magma PARI, etc.?


History

  • I started Sage at Harvard in January 2005.
  • Existing math software not good enough (free or commercial).
  • Sage-1.0 released February 2006 at Sage Days 1 (San Diego).
  • Sage Days Workshops 1, 2, ..., 11, at UCLA, UW, Cambridge, Bristol, Austin, France, San Diego, Seattle, etc.
  • Sage won first prize in Trophees du Libre (November 2007)
  • Funding from UW, NSF, DoD, Microsoft, Google, Sun, private donors, etc.

Microsoft's Interest in Sage

  1. Support research in cryptography, combinatorics, graph theory, linear algebra, signal processing, etc.


  2. Improve the viability of using Windows for higher performance computing (HPC); Sage is mathematical software that could run on a large cluster with no license fee issues.

Sage is 100% Free

Active user community; 964 members of the sage-support mailing list.

Free webapp -- sagenb.org -- has about 3000 users (and there are other servers at universities around the world..)



sagemath.org


sagenb.org

Advantages of Sage

  1. Python -- general purpose language; huge user base compared to Matlab, Mathematica, Maple and Magma
  2. Cython -- blazingly fast compiled code
  3. Integrated web servers -- (twisted, etc.)
  4. General purpose programming language (not some ad hoc math language)
  5. Free and Open source

Drawbacks of Sage

  1. Maple, Mathematica, and Matlab all have excellent native Microsoft Windows support; Sage doesn't yet.
  2. Sage is new and rapidly growing
  3. Can't be bought -- Sage can't be incorporated into any closed source products



So What is Sage?

  • Well over 300,000 lines of new Python/Cython code
  • A Distribution of mathematical software (over 60 third-party packages); builds from source without dependency (over 5 million lines of code)
  • Nearly 150 developers: developer map
  • Exact and numerical linear algebra, optimization (numpy, scipy, R, and gsl all included)
  • Group theory, number theory, combinatorics, graph theory
  • Symbolic calculus
  • Coding theory, cryptography and cryptanalysis
  • 2d and 3d plotting
  • Statistics (Sage includes R)
  • Overall range of functionality rivals that of Maple, Matlab, and Mathematica

Reference Manual (over 3000 pages, all new)


PART 2 -- Examples

The first example from the Python tutorial:

the_world_is_flat = 1 if the_world_is_flat: print "Be careful not to fall off!"
Be careful not to fall off!

Symbolic expressions:

x, y = var('x,y') type(x)
<class 'sage.calculus.calculus.SymbolicVariable'>
a = 1 + sqrt(2) + pi + 2/3 + x^y a
x^y + pi + sqrt(2) + 5/3
show(expand(a^3))
<html><div class="math">{x}^{{3 y}} + {{3 \pi} {x}^{{2 y}} } + {{3 \sqrt{ 2 }} {x}^{{2 y}} } + {5 {x}^{{2 y}} } + {{3 {\pi}^{2} } {x}^{y} } + {{{6 \sqrt{ 2 }} \pi} {x}^{y} } + {{10 \pi} {x}^{y} } + {{10 \sqrt{ 2 }} {x}^{y} } + \frac{{43 {x}^{y} }}{3} + {\pi}^{3} + {{3 \sqrt{ 2 }} {\pi}^{2} } + {5 {\pi}^{2} } + {{10 \sqrt{ 2 }} \pi} + \frac{{43 \pi}}{3} + \frac{{31 \sqrt{ 2
3} + \frac{395}{27} }}}

Solve equations

var('a,b,x') show(solve(x^3 + a*x^2 + b == 0, x)[0])
<html><div class="math">x = {\left( \frac{{-\sqrt{ 3 } i}}{2} - \frac{1}{2} \right) {\left( \frac{\sqrt{ {b \left( {27 b} + {4 {a}^{3} } \right)} }}{{6 \sqrt{ 3
- \frac{{27 b} + {2 {a}^{3} }}{54} \right)}^{\frac{1}{3}} } + \frac{{\left( \frac{{\sqrt{ 3 } i}}{2} - \frac{1}{2} \right) {a}^{2} }}{{9 {\left( \frac{\sqrt{ {b \left( {27 b} + {4 {a}^{3} } \right)} }}{{6 \sqrt{ 3 }}} - \frac{{27 b} + {2 {a}^{3} }}{54} \right)}^{\frac{1}{3}} }} - \frac{a}{3} }}}

Example: A Huge Integer Determinant

a = random_matrix(ZZ,200,x=-2^127,y=2^127) time d = a.determinant(); d
2416497820361370388123383955577577680723194259147094503536041541766672185383857614838374290624633492056793610736341426051504453095450214000475427591337149255091690791667690160169983484118651032962983758756214409647615725340948969113773979039363120287051188777437815000911540924059899685201457361771138762543141823558489142384037722952577860809629325881917066027420667363408753295640031399805643322536667324120549268506951783272715680032274950089815645394539639869852012451346690257636397456699016366359469719556276320998724322776826629537434956023026947755858894338669400506836939977907617680233942085676212238994758698441065159782885105905749605914804070935581547459158330386266992785592045616359018138111038892809036287714263465898041267723002338900927589680348503641507296769939411081538390876749291824550411255729123800520415314833099050344967085775718682807363828612203750773050146601742251195892218864983959063242213161558748629428566924435167168331002469780564522560891888203665428763674235951785782376412630227224081048260734997047670178752284673560294196218464506582142144901179152377329515089155496858623890798108433350281344322212839915592607946785457703425249733558972474402196830642355057560564137811357646221394591721190298641319463495530670448304243116467258460321862224460000202349343841713446647481406865596711676419895802211753653728309682519669281567424648028579462362425064215095811694336743031392030525904637902392032037720648623999156036746954408947557041757263219722477302060817248012573380453784066486141510632678783712945489481510363291224579959353441372680247191800986052074624207924680525827630635864626827619301075312000210211273833474173373637536998971829060992173795132468662266899229906868711654047265114268106972833788295757900000486640257316447645804775094511634495073709386911686013832952016177002857442684211142397763514475288714011381693504876249755051022002389557628426544432511893270568864481581118028336689533500838591845874788817111806726777368334663759540768904122304137554506462940282803152529784695365946558925736068483485357833490016245554039618965905783330160163202604530388461788529046447438472604671033312017138030460745698797218042638232625328983707139109172824650228065132287052151098919018418634427420122977641949960842295182881673740552528823381698038338131783638412994633357855298843466554179209538273152110003687969802942520179777568929580144665057674198527075287678630608832646049837271613640664981999274695356826658984285307866038418668960100627284732309950879586909726237698304912065319961022002165296025438054068704036096121479441105522394126105101348346525479236380329689332959814271061522050892179170770274791629001667012806843181596899817517480512217033777735466606027739604673656391401215311835873699225186977310845414096112882777270017646167046614773997568021479496271934254039814649543365504895668506500539869115596580997874797244645583100760131499594532060100363674870964130401812962490970955808278080213844206477636255917164806795654539339915199592891595438524629484802715804846049136125724957098536383656461603463733359365786258507522063290562270313557335881594624220035092980392860499947540823668581111914246689548746051312347325778512123468637203760949038416353903658325724942077373382133642192931605175408645786873621161673862071442298541289705523622359240353874158367459833180146408008127092995108663404501971123354889752946215340682671715359806840501475253795596617097545325742769841927505786423133937174167038413823423397753343196907537135601341052239056045787763453805157585808174750930070565665223937072595022396349281683894183623339887113051321093025968606970721006195025203978568543583706080453120216130966234686699269607688314360112247900835443559981885255290629736484790072605960376285571749103395369114765501475684587542920458554062170911376144537705415749145142652038114205133595227870124188214066153387638585440204597500106628273734146227441609943129610039491637503442724812833652769893313303779499200365625655073870271705896679221391498908366816954705733974541805350593401179622188798473027969545878884744610620695712655639567427862111922423847471025405586861712369650285037828101555507647096685846807593729035075803153884193371503770109009079472349017005627512905575705211084226620756974861482985691245034038054089166580796510590002763146180099282899157215792863523959518335093145395168179152969080796150631176422701034870853098668644856825801588273989065155568601936746061669545923428479085784833115339987165212916847640531650072646649736661574002969843972942495876825390837069969196161449598530776115816730801455610959801569433144986048277631160519391653832521129867595398707705927006428830540894916062458174575543427892704191936729398051339656109320471249448466004375972089131079706231101451947013703288559696275434039897966795132699788372405942953839893534588875065406911472391030482503918520719601927363428369592850792668565724931301636311935017438215132177539163105701040595512626717963093902825060972688637223404965618372490442876585205819165016026133996458455054271612749515364666671495882541830055707889501436816407256799887499654264309426200135691904060967018146272512670288026532367905675550819350825068659168830066417415979004674579443219469620092196709133569184914744242419024851720063670217337537901061478524544000054069549349716616484444074184445619237786055808166503717824452180634865572290112966679701704286713999051689171812385094956366617130929466316379508789023993413312071660885154381762424702205071921756683123684298720906989929550729920116447337549542373553040620798241198454639703241212264818011358891043265435079587335645492919050816567789456944706940960831404040107979266930031873477260267616868404845292413402969576654421705630159929046524390297563542934586257865782993698482342133590222476363307621803838797267051812108240771549769574825393604642798014914794133051973844637186767079721408591539970503925667297876891090450960470158229625633345785426782060784810751132977651981254938369741788101292916789025419458374846405919899716849809426113075555694112653330046878168047148333874320803658842513143351385653695575770455937317390806081634170237352789283722528576365366099857442509091134016179415418984242522135169710661887509472774338447608147237545387372155562636449511168833873336503667026232418810705197663360098199951531725469431094912977343279286891093228218713217969551833834032925867568488200632738191578730184099371255332753548950394665819888113346696815632663461585604168696457762195112136727019745214909682958417785432159169093096814543805626051262523315445449522287546374394986040391102809331950461023909732484197978935550330130184892135873484419603075631396039592602407679211207856561944653155680988268314693525867363056052996184741388168042348687722625028755103969464287207425227434065398521247342776326598306291159629940914499625611530714326956447496803944361099383204693376579538369937294345993317364414363039297789569833314823638061878695653281880728632952164197258942116826148743765135774231392902360341430108973954179398258945860744688488289901084348192952650326743175016858904586873772769517328336342044396590959614369809353964792753594626253777483305951323461799892870151462149385580366994189693989450456566714902155579161597641738018257413140202255271240401308577417384459734585356588854881124417870988841012437860991767067440246535532103088536787702941812981282806387780013069805659891079057412232332919950237402403852222119890131026153099074345040493442028670543382020199339256135436577767741869579963650884852401073925330682272081718599902992060729979079421910482529914325110938211545852939625026908837653126306556939364916617662129831385946029797255406441397217177665687516350688717342277202155966239885493194189805080116881240951336784893301858783247 Time: CPU 3.33 s, Wall: 5.93 s

We can also copy this matrix over to Maple and compute the same determinant there...

maple.with_package('LinearAlgebra') B = maple(a) t = maple.cputime() time c = B.Determinant() # new fast Determinant in maple (don't use "det"!) maple.cputime(t)
22.253
c == d
True

We can copy to Magma to. This ability to copy objects around is unique to Sage.

B = magma(a) t = magma.cputime() time e = B.Determinant() magma.cputime(t)
Time: CPU 0.00 s, Wall: 11.36 s 10.69

Example: A Symbolic Expression

x = var('x')
f = sin(3*x)*x+log(x) + 1/(x+1)^2 show(f)
{x \sin \left( {3 x} \right)} + \log \left( x \right) + \frac{1}{{\left( x + 1 \right)}^{2} }

Plotting functions has similar syntax to Mathematica:

plot(f,(0.01,2))


Sage can also has 2d plotting that is almost identical to MATLAB:

from pylab import * t = arange(0.0, 2.0, 0.01) s = sin(2*pi*t) P = plot(t, s) xlabel('time (s)'); ylabel('voltage (mV)') title('About as simple as it gets, folks') grid(True) savefig('sage.png') reset() # make things back like they were before doing from pylab import *


_fast_float_ yields super-fast evaluation of Sage symbolic expressions -- e.g., here it is 10 times faster than native Python!

show(f)
{x \sin \left( {3 x} \right)} + \log \left( x \right) + \frac{1}{{\left( x + 1 \right)}^{2} }
g = f._fast_float_(x) timeit('g(4.5r)')
625 loops, best of 3: 515 ns per loop
%python # %python, so no preparsing so uses pure python import math def g(x): return math.sin(3*x)*x + log(x) + 1/(1+x)**2
timeit('g(4.5r)')
625 loops, best of 3: 6.66 µs per loop

Example: Compare Answers with Maple

var('x') f = sin(3*x)*x+log(x) + 1/(x+1)^2 show(integrate(f))
\frac{\sin \left( {3 x} \right) - {{3 x} \cos \left( {3 x} \right)}}{9} + {x \log \left( x \right)} - \frac{1}{x + 1} - x

The command maple(...) fires up Maple (if you have it!), and creates a reference to a live object:

m = maple(f); m
sin(3*x)*x+ln(x)+1/(x+1)^2
type(m)
<class 'sage.interfaces.maple.MapleElement'>
m.parent()
Maple
m.parent().pid()
24038
os.system('ps ax |grep 24038')
24038 s007 Ss+ 0:00.01 /bin/sh /Users/wstein/bin/maple -t 24233 s015 S+ 0:00.00 sh -c ps ax |grep 24038 24235 s015 R+ 0:00.00 grep 24038 0

Use Maple objects via a Pythonic notation:

show(m.integrate('x'))
1/9\,\sin \left( 3\,x \right) -1/3\,\cos \left( 3\,x \right) x+\ln \left( x \right) x-x- \left( x+1 \right) ^{-1}
mathematica(f).Integrate(x)
-x - (1 + x)^(-1) - (x*Cos[3*x])/3 + x*Log[x] + Sin[3*x]/9

Example: Interactive Image Compression

This illustrates pylab (matplotlib + numpy), Sage plotting, html output, and @interact.

# first just play import pylab A = pylab.imread(DATA + 'seattle.png') graphics_array([matrix_plot(A), matrix_plot(A[0:,0:,2])]).show(figsize=[10,4])
import pylab A_image = pylab.mean(pylab.imread(DATA + 'seattle.png'), 2) @interact def svd_image(i=(20,(1..100)), display_axes=True): u,s,v = pylab.linalg.svd(A_image) A = sum(s[j]*pylab.outer(u[0:,j], v[j,0:]) for j in range(i)) g = graphics_array([matrix_plot(A),matrix_plot(A_image)]) show(g, axes=display_axes, figsize=(8,3)) html('<h2>Compressed using %s eigenvalues</h2>'%i)

Example: 3d Plots

var('x,y') plot3d(sin(x*y^2) -cos(x), (x,-2,2), (y,-2,2))
sphere((0,0,0)) + sphere((0,1,0), color='red', opacity=0.5) + icosahedron((1,1,0), color='orange')
L = [] @interact def random_list(number_of_points=(10..50), dots=True): n = normalvariate global L if len(L) != number_of_points: L = [(n(0,1), n(0,1), n(0,1)) for i in range(number_of_points)] G = list_plot3d(L,interpolation_type='nn', texture=Color('#ff7500'),num_points=120) if dots: G += point3d(L) G.show()

3d plotting (using jmol) is fast even though it does not use Java3d or OpenGL or require any special signed code or drivers.

# Yoda! -- over 50,000 triangles. from scipy import io X = io.loadmat(DATA + 'yodapose.mat') from sage.plot.plot3d.index_face_set import IndexFaceSet V = X['V']; F3=X['F3']-1; F4=X['F4']-1 Y = IndexFaceSet(F3,V,color='green') + IndexFaceSet(F4,V,color='green') Y = Y.rotateX(-1) Y.show(aspect_ratio=[1,1,1], frame=False, figsize=4) html('"Use the source, Luke..."')
"Use the source, Luke..."

Real World Example: Super Fast Code (using Cython)

to	sage-support 
date	Sat, Jan 31, 2009 at 11:15 AM
Hi,

I received first a MemoryError, and later on Sage reported:

uitkomst1=[]
uitkomst2=[]
eind=int((10^9+2)/(2*sqrt(3)))
print eind
for y in srange(1,eind):
 test1=is_square(3*y^2+1,True)
 test2=is_square(48*y^2+1,True)
 if test1[0] and test1[1]%3==2: uitkomst1.append((y,(2*test1[1]-1)/3))
 if test2[0] and test2[1]%3==1: uitkomst2.append((y,(2*test2[1]+1)/3))
print uitkomst1
een=sum([3*x-1 for (y,x) in uitkomst1 if 3*x-1<10^9])
print uitkomst2
twee=sum([3*x+1 for (y,x) in uitkomst2 if 3*x+1<10^9])
print een+twee

If you replace 10^9 with 10^6, the above listing works properly.

Maybe I made a mistake?

Rolandb

I rewrote Roland's code slightly so it wouldn't waste memory by constructing big lists... but the result was slow.

def f_python(n): uitkomst1=[] uitkomst2=[] eind=int((n+2)/(2*sqrt(3))) print eind for y in (1..eind): test1=is_square(3*y^2+1,True) test2=is_square(48*y^2+1,True) if test1[0] and test1[1]%3==2: uitkomst1.append((y,(2*test1[1]-1)/3)) if test2[0] and test2[1]%3==1: uitkomst2.append((y,(2*test2[1]+1)/3)) print uitkomst1 een=sum(3*x-1 for (y,x) in uitkomst1 if 3*x-1<10^9) print uitkomst2 twee=sum(3*x+1 for (y,x) in uitkomst2 if 3*x+1<10^9) print een+twee
time f_python(10^5)
28868 [(1, 1), (15, 17), (209, 241), (2911, 3361)] [(1, 5), (14, 65), (195, 901), (2716, 12545)] 51408 Time: CPU 0.74 s, Wall: 0.86 s
time f_python(10^6)
288675 [(1, 1), (15, 17), (209, 241), (2911, 3361), (40545, 46817)] [(1, 5), (14, 65), (195, 901), (2716, 12545), (37829, 174725)] 716034 Time: CPU 7.14 s, Wall: 7.65 s

While waiting to see if f_python(10^6) would finish, I decided to try the Cython compiler. I declared a few data types, put %cython at the top of the cell, and wham, it got over 200 times faster.

%cython from sage.all import is_square cdef extern from "math.h": long double sqrtl(long double) def f(n): uitkomst1=[] uitkomst2=[] cdef long long eind=int((n+2)/(2*sqrt(3))) cdef long long y, t print eind for y in range(1,eind): t = <long long>sqrtl(<long long> (3*y*y + 1)) if t * t == 3*y*y + 1: uitkomst1.append((y, (2*t-1)/3)) t = <long long>sqrtl(<long long> (48*y*y + 1)) if t * t == 48*y*y + 1: uitkomst2.append((y, (2*t+1)/3)) print uitkomst1 een=sum([3*x-1 for (y,x) in uitkomst1 if 3*x-1<10^9]) print uitkomst2 twee=sum([3*x+1 for (y,x) in uitkomst2 if 3*x+1<10^9]) print een+twee
time f(10^5)
28868 [(1L, 1L), (4L, 4L), (15L, 17L), (56L, 64L), (209L, 241L), (780L, 900L), (2911L, 3361L), (10864L, 12544L)] [(1L, 5L), (14L, 65L), (195L, 901L), (2716L, 12545L)] 2 Time: CPU 0.00 s, Wall: 0.00 s
time f(10^6)
288675 [(1L, 1L), (4L, 4L), (15L, 17L), (56L, 64L), (209L, 241L), (780L, 900L), (2911L, 3361L), (10864L, 12544L), (40545L, 46817L), (151316L, 174724L)] [(1L, 5L), (14L, 65L), (195L, 901L), (2716L, 12545L), (37829L, 174725L)] 2 Time: CPU 0.03 s, Wall: 0.03 s
time f(10^9)
288675135 [(1L, 1L), (4L, 4L), (15L, 17L), (56L, 64L), (209L, 241L), (780L, 900L), (2911L, 3361L), (10864L, 12544L), (40545L, 46817L), (151316L, 174724L), (564719L, 652081L), (2107560L, 2433600L), (7865521L, 9082321L), (29354524L, 33895684L), (109552575L, 126500417L)] [(1L, 5L), (14L, 65L), (195L, 901L), (2716L, 12545L), (37829L, 174725L), (526890L, 2433601L), (7338631L, 33895685L), (102213944L, 472105985L)] 2 Time: CPU 25.60 s, Wall: 26.50 s
7.14/0.03
238.000000000000

This is not a contrived example. This is a real world example that came up a this weekend. For C-style computations, Sage (via Cython) is as fast as C.

Example: Do some number theory

Plotting an elliptic curve over a finite field

p = 389 E = EllipticCurve(GF(p).random_element()) E.plot()

and finding its group structure...

E.abelian_group()
(Multiplicative Abelian Group isomorphic to C180 x C2, ((262 : 190 : 1), (228 : 0 : 1)))

Creating another random elliptic curve over a bigger finite field and compute its cardinality in seconds:

p = next_prime(10^60) E = EllipticCurve(GF(p).random_element()) show(E)
y^2 = x^3 + 425356051223648747023108902736172620897278673931104973974164x + 920733503445411966314417165378315096439996780491982901461664
time E.cardinality()
1000000000000000000000000000000753054185359723724596110573310 Time: CPU 0.00 s, Wall: 5.66 s

Some weight 3 modular forms on Γ1(12)\Gamma_1(12):

show(ModularForms(Gamma1(12),3,prec=20).basis())
[q6q43q5+6q6+5q7+12q89q96q116q12+14q1324q14+3q15+15q1731q19+O(q20),q24q4q5+3q6+5q7+4q86q92q106q11+12q1312q14+3q15+8q16+5q173q1831q19+O(q20),q32q4q5+2q6+q7+4q86q92q112q12+12q138q14+q15+5q1719q19+O(q20),1+528q10960q11+572q121176q14+3200q15420q164224q17216q18+2496q19+O(q20),q+3242972q1079459q11+96131216q12+170q137021172q14+6728227q152344772q16300089q176374q18+176159q19+O(q20),q2+24589q1049609q11+872227q1256269q14+4960027q1523059q16218249q17133q18+128969q19+O(q20),q3+3733q107603q11+14359q129313q14+78349q153553q1633443q1770q18+19763q19+O(q20),q4+883q101603q11+3319q121963q14+16009q15313q167043q1712q18+4163q19+O(q20),q5102772q10+3509q115005216q12+298972q14303227q15+122572q16+14509q17+354q187939q19+O(q20),q6703q10+1603q112869q12+1963q1416009q15+793q16+7043q17+22q184163q19+O(q20),q7131572q10+3509q115005216q12+327772q14327527q15+122572q16+14419q17+354q187849q19+O(q20),q8889q10+1609q1125027q12+1969q14160027q15+709q16+7049q17+4q184169q19+O(q20),q9318q10+5q114924q12+498q14503q15+138q16+22q17+74q1813q19+O(q20)]\begin{array}{l}[q - 6q^{4} - 3q^{5} + 6q^{6} + 5q^{7} + 12q^{8} - 9q^{9} - 6q^{11} - 6q^{12} + 14q^{13} - 24q^{14} + 3q^{15} + 15q^{17} - 31q^{19} + O(q^{20}),\\ q^{2} - 4q^{4} - q^{5} + 3q^{6} + 5q^{7} + 4q^{8} - 6q^{9} - 2q^{10} - 6q^{11} + 12q^{13} - 12q^{14} + 3q^{15} + 8q^{16} + 5q^{17} - 3q^{18} - 31q^{19} + O(q^{20}),\\ q^{3} - 2q^{4} - q^{5} + 2q^{6} + q^{7} + 4q^{8} - 6q^{9} - 2q^{11} - 2q^{12} + 12q^{13} - 8q^{14} + q^{15} + 5q^{17} - 19q^{19} + O(q^{20}),\\ 1 + 528q^{10} - 960q^{11} + 572q^{12} - 1176q^{14} + 3200q^{15} - 420q^{16} - 4224q^{17} - 216q^{18} + 2496q^{19} + O(q^{20}),\\ q + \frac{32429}{72}q^{10} - \frac{7945}{9}q^{11} + \frac{96131}{216}q^{12} + 170q^{13} - \frac{70211}{72}q^{14} + \frac{67282}{27}q^{15} - \frac{23447}{72}q^{16} - \frac{30008}{9}q^{17} - \frac{637}{4}q^{18} + \frac{17615}{9}q^{19} + O(q^{20}),\\ q^{2} + \frac{2458}{9}q^{10} - \frac{4960}{9}q^{11} + \frac{8722}{27}q^{12} - \frac{5626}{9}q^{14} + \frac{49600}{27}q^{15} - \frac{2305}{9}q^{16} - \frac{21824}{9}q^{17} - 133q^{18} + \frac{12896}{9}q^{19} + O(q^{20}),\\ q^{3} + \frac{373}{3}q^{10} - \frac{760}{3}q^{11} + \frac{1435}{9}q^{12} - \frac{931}{3}q^{14} + \frac{7834}{9}q^{15} - \frac{355}{3}q^{16} - \frac{3344}{3}q^{17} - 70q^{18} + \frac{1976}{3}q^{19} + O(q^{20}),\\ q^{4} + \frac{88}{3}q^{10} - \frac{160}{3}q^{11} + \frac{331}{9}q^{12} - \frac{196}{3}q^{14} + \frac{1600}{9}q^{15} - \frac{31}{3}q^{16} - \frac{704}{3}q^{17} - 12q^{18} + \frac{416}{3}q^{19} + O(q^{20}),\\ q^{5} - \frac{1027}{72}q^{10} + \frac{350}{9}q^{11} - \frac{5005}{216}q^{12} + \frac{2989}{72}q^{14} - \frac{3032}{27}q^{15} + \frac{1225}{72}q^{16} + \frac{1450}{9}q^{17} + \frac{35}{4}q^{18} - \frac{793}{9}q^{19} + O(q^{20}),\\ q^{6} - \frac{70}{3}q^{10} + \frac{160}{3}q^{11} - \frac{286}{9}q^{12} + \frac{196}{3}q^{14} - \frac{1600}{9}q^{15} + \frac{79}{3}q^{16} + \frac{704}{3}q^{17} + 22q^{18} - \frac{416}{3}q^{19} + O(q^{20}),\\ q^{7} - \frac{1315}{72}q^{10} + \frac{350}{9}q^{11} - \frac{5005}{216}q^{12} + \frac{3277}{72}q^{14} - \frac{3275}{27}q^{15} + \frac{1225}{72}q^{16} + \frac{1441}{9}q^{17} + \frac{35}{4}q^{18} - \frac{784}{9}q^{19} + O(q^{20}),\\ q^{8} - \frac{88}{9}q^{10} + \frac{160}{9}q^{11} - \frac{250}{27}q^{12} + \frac{196}{9}q^{14} - \frac{1600}{27}q^{15} + \frac{70}{9}q^{16} + \frac{704}{9}q^{17} + 4q^{18} - \frac{416}{9}q^{19} + O(q^{20}),\\ q^{9} - \frac{31}{8}q^{10} + 5q^{11} - \frac{49}{24}q^{12} + \frac{49}{8}q^{14} - \frac{50}{3}q^{15} + \frac{13}{8}q^{16} + 22q^{17} + \frac{7}{4}q^{18} - 13q^{19} + O(q^{20})]\end{array}

Questions?