Sage: Open Source Mathematics Software
David Roe
Worksheet inspired by William Stein's FoCM 2011 Plenary talk: http://sagenb.org/home/pub/2909/

6 6 |
|
|
|
|
|
|
265252859812191058636308480000000 265252859812191058636308480000000 |
The goal of Sage is to create a viable open source alternative to Magma, Maple, Mathematica and Matlab.
Sage is:
|
|
|
|
|
|
Why not Magma, Maple, Matlab or Mathematica?
Sage's competitors obviously provide some outstanding strengths. What drives Sage's developers to compete with them?
|
|
|
|
|
|
Ways to use Sage
|
|
Sage's Documentation
|
|
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/schemes/elliptic_curves/constructor.py Type: <type ‘function’> Definition: EllipticCurve(x=None, y=None, j=None) Docstring:
|
|
|
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py Type: <type ‘instancemethod’> Definition: R.completion(p, prec=20, extras=None) Docstring:
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py Type: <type ‘instancemethod’> Definition: R.completion(p, prec=20, extras=None) Docstring:
|
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py Source Code (starting at line 867): def cyclotomic_polynomial(self, n):
"""
Return the nth cyclotomic polynomial as a polynomial in this
polynomial ring. For details of the implementation, see the
documentation for
:func:`sage.rings.polynomial.cyclotomic.cyclotomic_coeffs`.
EXAMPLES::
sage: R = ZZ['x']
sage: R.cyclotomic_polynomial(8)
x^4 + 1
sage: R.cyclotomic_polynomial(12)
x^4 - x^2 + 1
sage: S = PolynomialRing(FiniteField(7), 'x')
sage: S.cyclotomic_polynomial(12)
x^4 + 6*x^2 + 1
sage: S.cyclotomic_polynomial(1)
x + 6
TESTS:
Make sure it agrees with other systems for the trivial case::
sage: ZZ['x'].cyclotomic_polynomial(1)
x - 1
sage: gp('polcyclo(1)')
x - 1
"""
if n <= 0:
raise ArithmeticError, "n=%s must be positive"%n
elif n == 1:
return self.gen() - 1
else:
return self(cyclotomic.cyclotomic_coeffs(n), check=True)
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py Source Code (starting at line 867): def cyclotomic_polynomial(self, n):
"""
Return the nth cyclotomic polynomial as a polynomial in this
polynomial ring. For details of the implementation, see the
documentation for
:func:`sage.rings.polynomial.cyclotomic.cyclotomic_coeffs`.
EXAMPLES::
sage: R = ZZ['x']
sage: R.cyclotomic_polynomial(8)
x^4 + 1
sage: R.cyclotomic_polynomial(12)
x^4 - x^2 + 1
sage: S = PolynomialRing(FiniteField(7), 'x')
sage: S.cyclotomic_polynomial(12)
x^4 + 6*x^2 + 1
sage: S.cyclotomic_polynomial(1)
x + 6
TESTS:
Make sure it agrees with other systems for the trivial case::
sage: ZZ['x'].cyclotomic_polynomial(1)
x - 1
sage: gp('polcyclo(1)')
x - 1
"""
if n <= 0:
raise ArithmeticError, "n=%s must be positive"%n
elif n == 1:
return self.gen() - 1
else:
return self(cyclotomic.cyclotomic_coeffs(n), check=True)
|
Traceback (click to the left of this block for traceback) ... Traceback (most recent call last): File " |
Question Break 1 (of 2)
???
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/magma_free.py Type: <type 'instance'> Definition: magma_free(code, strip=True, columns=0) Docstring:
Evaluate MAGMA code without requiring that MAGMA be installed
on your computer by using the free online MAGMA calculator.
EXAMPLES:
sage: magma_free("Factorization(9290348092384)") # optional - internet
[ <2, 5>, <290323377887, 1> ]File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/magma_free.py Type: <type 'instance'> Definition: magma_free(code, strip=True, columns=0) Docstring:
Evaluate MAGMA code without requiring that MAGMA be installed
on your computer by using the free online MAGMA calculator.
EXAMPLES:
sage: magma_free("Factorization(9290348092384)") # optional - internet
[ <2, 5>, <290323377887, 1> ] |
|
|
|
|
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py Source Code (starting at line 867): def cyclotomic_polynomial(self, n):
"""
Return the nth cyclotomic polynomial as a polynomial in this
polynomial ring. For details of the implementation, see the
documentation for
:func:`sage.rings.polynomial.cyclotomic.cyclotomic_coeffs`.
EXAMPLES::
sage: R = ZZ['x']
sage: R.cyclotomic_polynomial(8)
x^4 + 1
sage: R.cyclotomic_polynomial(12)
x^4 - x^2 + 1
sage: S = PolynomialRing(FiniteField(7), 'x')
sage: S.cyclotomic_polynomial(12)
x^4 + 6*x^2 + 1
sage: S.cyclotomic_polynomial(1)
x + 6
TESTS:
Make sure it agrees with other systems for the trivial case::
sage: ZZ['x'].cyclotomic_polynomial(1)
x - 1
sage: gp('polcyclo(1)')
x - 1
"""
if n <= 0:
raise ArithmeticError, "n=%s must be positive"%n
elif n == 1:
return self.gen() - 1
else:
return self(cyclotomic.cyclotomic_coeffs(n), check=True)
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/rings/polynomial/polynomial_ring.py Source Code (starting at line 867): def cyclotomic_polynomial(self, n):
"""
Return the nth cyclotomic polynomial as a polynomial in this
polynomial ring. For details of the implementation, see the
documentation for
:func:`sage.rings.polynomial.cyclotomic.cyclotomic_coeffs`.
EXAMPLES::
sage: R = ZZ['x']
sage: R.cyclotomic_polynomial(8)
x^4 + 1
sage: R.cyclotomic_polynomial(12)
x^4 - x^2 + 1
sage: S = PolynomialRing(FiniteField(7), 'x')
sage: S.cyclotomic_polynomial(12)
x^4 + 6*x^2 + 1
sage: S.cyclotomic_polynomial(1)
x + 6
TESTS:
Make sure it agrees with other systems for the trivial case::
sage: ZZ['x'].cyclotomic_polynomial(1)
x - 1
sage: gp('polcyclo(1)')
x - 1
"""
if n <= 0:
raise ArithmeticError, "n=%s must be positive"%n
elif n == 1:
return self.gen() - 1
else:
return self(cyclotomic.cyclotomic_coeffs(n), check=True)
|
'n = Integer(5)' 'n = Integer(5)' |
[1, 5] [1, 5] |
A Quick Tour
1.8446744073709552e+19 1.8446744073709552e+19 |
0.023598509904439558 0.023598509904439558 |
sin(18446744073709551616) sin(18446744073709551616) |
<type 'sage.symbolic.expression.Expression'> <type 'sage.symbolic.expression.Expression'> |
0.0235985099044395586343659228761347751887971250470813595052082575127870\ 367195714805353268175666623235437729751383647524917627871288325844860738\ 774780555533262957487022395763401807856585404052810226503822554355095528\ 028310586788053564221509928173361541766973214641915324432036026757696249\ 788261667623001542396934455889240433419116118797637288382051695173924449\ 181581804029311144948276644785620162298683748498605311140905034937489190\ 912440501083085575276067441836443904976066614700407935079718694250167780\ 060282736897308702214472463724083609963439955539184511211192964943428037\ 445515558183613980406937553891459323066921748683325795142578242683676201\ 615993420650011493920650606656966134469661959900199302403661301884174196\ 373458046150133147119106730368104179014971275456878541846106129727392370\ 953571120197087441563843741360076443085933594082080125509731439475852770\ 875606175218014179445677770819225855418035844180363843045553659301208637\ 1338941013691045701740737164131815074217522503906093271710053729660 0.02359850990443955863436592287613477518879712504708135950520825751278703671957148053532681756666232354377297513836475249176278712883258448607387747805555332629574870223957634018078565854040528102265038225543550955280283105867880535642215099281733615417669732146419153244320360267576962497882616676230015423969344558892404334191161187976372883820516951739244491815818040293111449482766447856201622986837484986053111409050349374891909124405010830855752760674418364439049760666147004079350797186942501677800602827368973087022144724637240836099634399555391845112111929649434280374455155581836139804069375538914593230669217486833257951425782426836762016159934206500114939206506066569661344696619599001993024036613018841741963734580461501331471191067303681041790149712754568785418461061297273923709535711201970874415638437413600764430859335940820801255097314394758527708756061752180141794456777708192258554180358441803638430455536593012086371338941013691045701740737164131815074217522503906093271710053729660 |
[1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510, 43867/798, -174611/330, 854513/138, -236364091/2730, 8553103/6, -23749461029/870, 8615841276005/14322, -7709321041217/510] [1/6, -1/30, 1/42, -1/30, 5/66, -691/2730, 7/6, -3617/510, 43867/798, -174611/330, 854513/138, -236364091/2730, 8553103/6, -23749461029/870, 8615841276005/14322, -7709321041217/510] |
'\\left(\\begin{array}{rrrr}\n\\frac{1}{6} & -\\frac{1}{30} &
\\frac{1}{42} & -\\frac{1}{30} \\\\\n\\frac{5}{66} &
-\\frac{691}{2730} & \\frac{7}{6} & -\\frac{3617}{510}
\\\\\n\\frac{43867}{798} & -\\frac{174611}{330} &
\\frac{854513}{138} & -\\frac{236364091}{2730}
\\\\\n\\frac{8553103}{6} & -\\frac{23749461029}{870} &
\\frac{8615841276005}{14322} &
-\\frac{7709321041217}{510}\n\\end{array}\\right)'
'\\left(\\begin{array}{rrrr}\n\\frac{1}{6} & -\\frac{1}{30} & \\frac{1}{42} & -\\frac{1}{30} \\\\\n\\frac{5}{66} & -\\frac{691}{2730} & \\frac{7}{6} & -\\frac{3617}{510} \\\\\n\\frac{43867}{798} & -\\frac{174611}{330} & \\frac{854513}{138} & -\\frac{236364091}{2730} \\\\\n\\frac{8553103}{6} & -\\frac{23749461029}{870} & \\frac{8615841276005}{14322} & -\\frac{7709321041217}{510}\n\\end{array}\\right)'
|
|
x^4 + 8067801164850701/533715*x^3 - 58285217560700198615240633/1403923430910*x^2 + 8132809004828014213156640/4258567740427*x + 55574407859795565506560000/73612385227381 x^4 + 8067801164850701/533715*x^3 - 58285217560700198615240633/1403923430910*x^2 + 8132809004828014213156640/4258567740427*x + 55574407859795565506560000/73612385227381 |
|
|
[(-1.51163123214893e10, 1), (-0.113796311512103, 1), (0.159804146544381, 1), (2746.38784246979, 1)] [(-1.51163123214893e10, 1), (-0.113796311512103, 1), (0.159804146544381, 1), (2746.38784246979, 1)] |
Real Double Field Real Double Field |
sqrt(2) + 5/3 sqrt(2) + 5/3 |
|
|
Univariate Polynomial Ring in x over Integer Ring Univariate Polynomial Ring in x over Integer Ring |
x + 1/3 x + 1/3 |
Traceback (click to the left of this block for traceback) ... TypeError: no canonical coercion from <type 'str'> to Univariate Polynomial Ring in x over Rational Field Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_53.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("UyA9IFFRWyd4J10KUy5jb2VyY2UoJzEvMycp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmp89sEzk/___code___.py", line 3, in <module>
exec compile(u"S.coerce('1/3')" + '\n', '', 'single')
File "", line 1, in <module>
File "parent.pyx", line 1067, in sage.structure.parent.Parent.coerce (sage/structure/parent.c:8016)
File "parent.pyx", line 1094, in sage.structure.parent.Parent.coerce (sage/structure/parent.c:7958)
TypeError: no canonical coercion from <type 'str'> to Univariate Polynomial Ring in x over Rational Field
|
Univariate Polynomial Ring in x over Rational Field Univariate Polynomial Ring in x over Rational Field |
|
|
Rational Field Rational Field |
|
|
Rational Field Rational Field |
Symbolic Ring Symbolic Ring |
Category of euclidean domains Category of euclidean domains |
<class 'sage.categories.euclidean_domains.EuclideanDomains'> <class 'sage.categories.euclidean_domains.EuclideanDomains'> |
<type 'sage.rings.integer_ring.IntegerRing_class'> <type 'sage.rings.integer_ring.IntegerRing_class'> |
|
|
[Category of euclidean domains, Category of principal ideal domains, Category of unique factorization domains, Category of gcd domains, Category of integral domains, Category of commutative rings, Category of domains, Category of rings, Category of rngs, Category of commutative additive groups, Category of semirings, Category of commutative additive monoids, Category of commutative additive semigroups, Category of additive magmas, Category of monoids, Category of semigroups, Category of magmas, Category of sets, Category of sets with partial maps, Category of objects] [Category of euclidean domains, Category of principal ideal domains, Category of unique factorization domains, Category of gcd domains, Category of integral domains, Category of commutative rings, Category of domains, Category of rings, Category of rngs, Category of commutative additive groups, Category of semirings, Category of commutative additive monoids, Category of commutative additive semigroups, Category of additive magmas, Category of monoids, Category of semigroups, Category of magmas, Category of sets, Category of sets with partial maps, Category of objects] |
0.0235985099044395586343659228762? 0.0235985099044395586343659228762? |
0.023598509904439558634365922876 0.023598509904439558634365922876 |
0.023598509904439558634365922877 0.023598509904439558634365922877 |
[(-1.5116312321489265648220103115283?e10, 1), (-0.11379631151210255188658154882301?, 1), (0.15980414654438143948220086785611?, 1), (2746.3878424697929411908606679704?, 1)] [(-1.5116312321489265648220103115283?e10, 1), (-0.11379631151210255188658154882301?, 1), (0.15980414654438143948220086785611?, 1), (2746.3878424697929411908606679704?, 1)] |
[-1.511631232148927?e10, -0.1137963115121026?, 0.1598041465443815?, 2746.387842469793?] [-1.511631232148927?e10, -0.1137963115121026?, 0.1598041465443815?, 2746.387842469793?] |
[1.0*I, -1.0*I] [1.0*I, -1.0*I] |
-1.511631232148927?e10 -1.511631232148927?e10 |
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/matrix/constructor.py Type: <type ‘function’> Definition: matrix(*args, **kwds) Docstring:
|
x^4 + 8067801164850701/533715*x^3 - 58285217560700198615240633/1403923430910*x^2 + 8132809004828014213156640/4258567740427*x + 55574407859795565506560000/73612385227381 x^4 + 8067801164850701/533715*x^3 - 58285217560700198615240633/1403923430910*x^2 + 8132809004828014213156640/4258567740427*x + 55574407859795565506560000/73612385227381 |
Components of Sage

|
|
|
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/gp.py Source Code (starting at line 809): def _sage_(self):
"""
Convert this GpElement into a Sage object, if possible.
EXAMPLES::
sage: gp(I).sage()
i
sage: gp(I).sage().parent()
Maximal Order in Number Field in i with defining polynomial x^2 + 1
::
sage: M = Matrix(ZZ,2,2,[1,2,3,4]); M
[1 2]
[3 4]
sage: gp(M)
[1, 2; 3, 4]
sage: gp(M).sage()
[1 2]
[3 4]
sage: gp(M).sage() == M
True
"""
return pari(str(self)).python()
File: /sagenb/sage_install/sage-4.7.2/local/lib/python2.6/site-packages/sage/interfaces/gp.py Source Code (starting at line 809): def _sage_(self):
"""
Convert this GpElement into a Sage object, if possible.
EXAMPLES::
sage: gp(I).sage()
i
sage: gp(I).sage().parent()
Maximal Order in Number Field in i with defining polynomial x^2 + 1
::
sage: M = Matrix(ZZ,2,2,[1,2,3,4]); M
[1 2]
[3 4]
sage: gp(M)
[1, 2; 3, 4]
sage: gp(M).sage()
[1 2]
[3 4]
sage: gp(M).sage() == M
True
"""
return pari(str(self)).python()
|
<type 'sage.rings.integer.Integer'> <type 'sage.rings.integer.Integer'> |
Number Theory
2 * 4017089 * 353424991 2 * 4017089 * 353424991 |
15511210043330985984000000 15511210043330985984000000 |
[22, 10, 6, 3, 2, 1, 1, 1, 1] [22, 10, 6, 3, 2, 1, 1, 1, 1] |
340032 340032 |
(10680579, 3^6 * 7^2 * 13 * 23) (10680579, 3^6 * 7^2 * 13 * 23) |
658 658 |
4/7 4/7 |
920271755026045466855962781668256054307294052810239793953285763517412985\ 262323501978822916547103339332198764311128926694429965192014469337180574\ 258854255101965669713692722439368861237049443900118466267242229358838809\ 496460215546742114497122936318794382420922229797018587870350451317915617\ 184990942766797810155029441933075045772129188981041614489343545384206438\ 995186836592262593125170223430127680062490663477743842242002004914231357\ 899486287124678626100600066102278733540933447719703464029124680195026177\ 412964857500689657276787365748796835192363570613191348609145244276270764\ 465804777408575949440508551447566418811489630464191115045309280131652547\ 731782793747141150484980319367430611463990946023472819466195667158678183\ 681130408875817996838721729445775753916663228712954510481120704923859087\ 275241592392223665876910286300131474621294645735699401736284697581755151\ 900016413451408993670931908590802671856117921704294651978579681174352991\ 410791557056622496173369118595092855785844134417338169649142692589187435\ 301742615221458864914330678814703958326474085781955660425664604942849123\ 726120485051272439872545976606903238042522371480831216853001064737946906\ 898017475046619462994720059814429480949267645638531717278315386109140567\ 421507374975384275021240249642090800336572787686941682199463463099066866\ 702204042926855402821066676615841472011557402435218180206292340119241672\ 141006748199826744593298451761269206891815323035747468238859771982766512\ 554781263236924319788525197851803361705413947686093663891147724061366833\ 494127467087092245969359401102159299184733830143890656327648052676575908\ 655135939782442443116808542177355365928232190011995697704315727188881084\ 528176142957772556227153624081222658008489322761962675453544265567233476\ 857358975517683731089773908740330164186182660688614126800469264172995743\ 679921180655438244719647115856821466186517301168907732792274321379544884\ 573350740004120158204881150331945483918135267242867162717503464701181877\ 399958004314416087296985163324282563458624844066236399562733354725457411\ 347627828347256593033627186674151973687980402192233716371343312564266298\ 874305195901960277032311918990723575237081597193774377829718464719281814\ 341332773477437283460627207869478917449115162489982657581564116298023459\ 732495270075351700956243598913730840133454971118265085585706676644886436\ 331834764264219387054191767502487300255270790939231320204783038516420542\ 008888313103784838110884255487585083733240938734797302734376936793420810\ 867020185209718779670927269908884747550412550772822753523086679809536245\ 524746452957745548238178302717520159051754876562006809869627325035982116\ 186671112647935832871470323287962444698515988848621901187755088113589185\ 457016501136471407349024158013999313263656227842088073986822774216895311\ 418550769982898380687461265543773217506522881285332749712463895138180510\ 378178497047690889118184846592767949868064656342862993393444237184906674\ 722873849811294966439997475566061223014020274110963671727713854372115721\ 224489228469570767118124546455721433201289716309063821673453815865659403\ 167483160827068775845409484961883982333993500194238336824233008140594931\ 590134175918949793856506343243088419472771218165592793359389269115106835\ 490432906902871027335713152227618464826154317860618134546336344159741794\ 139420247061299867257344715523461677386135094707607583386378705799210071\ 685144173415484815139532963734550586141746926780137597372467246969311252\ 404574068882891540550303875935489428805492623836212595940806996986432453\ 55453826567378500963781681659096276126857969078217677288980 Time: CPU 0.32 s, Wall: 0.32 s 92027175502604546685596278166825605430729405281023979395328576351741298526232350197882291654710333933219876431112892669442996519201446933718057425885425510196566971369272243936886123704944390011846626724222935883880949646021554674211449712293631879438242092222979701858787035045131791561718499094276679781015502944193307504577212918898104161448934354538420643899518683659226259312517022343012768006249066347774384224200200491423135789948628712467862610060006610227873354093344771970346402912468019502617741296485750068965727678736574879683519236357061319134860914524427627076446580477740857594944050855144756641881148963046419111504530928013165254773178279374714115048498031936743061146399094602347281946619566715867818368113040887581799683872172944577575391666322871295451048112070492385908727524159239222366587691028630013147462129464573569940173628469758175515190001641345140899367093190859080267185611792170429465197857968117435299141079155705662249617336911859509285578584413441733816964914269258918743530174261522145886491433067881470395832647408578195566042566460494284912372612048505127243987254597660690323804252237148083121685300106473794690689801747504661946299472005981442948094926764563853171727831538610914056742150737497538427502124024964209080033657278768694168219946346309906686670220404292685540282106667661584147201155740243521818020629234011924167214100674819982674459329845176126920689181532303574746823885977198276651255478126323692431978852519785180336170541394768609366389114772406136683349412746708709224596935940110215929918473383014389065632764805267657590865513593978244244311680854217735536592823219001199569770431572718888108452817614295777255622715362408122265800848932276196267545354426556723347685735897551768373108977390874033016418618266068861412680046926417299574367992118065543824471964711585682146618651730116890773279227432137954488457335074000412015820488115033194548391813526724286716271750346470118187739995800431441608729698516332428256345862484406623639956273335472545741134762782834725659303362718667415197368798040219223371637134331256426629887430519590196027703231191899072357523708159719377437782971846471928181434133277347743728346062720786947891744911516248998265758156411629802345973249527007535170095624359891373084013345497111826508558570667664488643633183476426421938705419176750248730025527079093923132020478303851642054200888831310378483811088425548758508373324093873479730273437693679342081086702018520971877967092726990888474755041255077282275352308667980953624552474645295774554823817830271752015905175487656200680986962732503598211618667111264793583287147032328796244469851598884862190118775508811358918545701650113647140734902415801399931326365622784208807398682277421689531141855076998289838068746126554377321750652288128533274971246389513818051037817849704769088911818484659276794986806465634286299339344423718490667472287384981129496643999747556606122301402027411096367172771385437211572122448922846957076711812454645572143320128971630906382167345381586565940316748316082706877584540948496188398233399350019423833682423300814059493159013417591894979385650634324308841947277121816559279335938926911510683549043290690287102733571315222761846482615431786061813454633634415974179413942024706129986725734471552346167738613509470760758338637870579921007168514417341548481513953296373455058614174692678013759737246724696931125240457406888289154055030387593548942880549262383621259594080699698643245355453826567378500963781681659096276126857969078217677288980 Time: CPU 0.32 s, Wall: 0.32 s |
Click to the left again to hide and once more to show the dynamic interactive window |
Number Fields
Number Field in a with defining polynomial x^6 + 40*x^3 + 1372 Number Field in a with defining polynomial x^6 + 40*x^3 + 1372 |
-40*a^3 - 1372 -40*a^3 - 1372 |
Galois group of Number Field in a with defining polynomial x^6 + 40*x^3 + 1372 Galois group of Number Field in a with defining polynomial x^6 + 40*x^3 + 1372 |
6 6 |
1/36*a^4 + 1/18*a 1/36*a^4 + 1/18*a |
0 0 |
Subgroup [(), (1,4,6)(2,5,3), (1,6,4)(2,3,5)] of Galois group of Number Field in a with defining polynomial x^6 + 40*x^3 + 1372 Subgroup [(), (1,4,6)(2,5,3), (1,6,4)(2,3,5)] of Galois group of Number Field in a with defining polynomial x^6 + 40*x^3 + 1372 |
3 3 |
[(1,5)(2,4)(3,6), (1,2)(3,4)(5,6), (1,3)(2,6)(4,5)] [(1,5)(2,4)(3,6), (1,2)(3,4)(5,6), (1,3)(2,6)(4,5)] |
Galois group PARI group [120, -1, 5, "S5"] of degree 5 of the Number Field in a with defining polynomial x^5 - x + 2 Galois group PARI group [120, -1, 5, "S5"] of degree 5 of the Number Field in a with defining polynomial x^5 - x + 2 |
3 3 |
3 3 |
|
|
Class group of order 4 with structure C2 x C2 of Number Field in a with defining polynomial x^2 + 30 Class group of order 4 with structure C2 x C2 of Number Field in a with defining polynomial x^2 + 30 |
[Fractional ideal class (5, a), Fractional ideal class (3, a)] [Fractional ideal class (5, a), Fractional ideal class (3, a)] |
Elliptic Curves
|
|
1 1 |
[(-1 : -1 : 1), (-1 : 0 : 1), (0 : -1 : 1), (0 : 0 : 1), (1 : -1 : 1), (1 : 0 : 1), (2 : -3 : 1), (2 : 2 : 1), (6 : -15 : 1), (6 : 14 : 1)] [(-1 : -1 : 1), (-1 : 0 : 1), (0 : -1 : 1), (0 : 0 : 1), (1 : -1 : 1), (1 : 0 : 1), (2 : -3 : 1), (2 : 2 : 1), (6 : -15 : 1), (6 : 14 : 1)] |
|
|
100000000000000000000000001917684156174529696959920 100000000000000000000000001917684156174529696959920 |
Graph Theory
|
|
|
|
Permutation Group with generators [(12,26)] Permutation Group with generators [(12,26)] |
2 2 |
[13, 0, 1, 2, 3, 4, 5, 19, 20] [13, 0, 1, 2, 3, 4, 5, 19, 20] |
|
|
|
|
Permutation Group with generators [(13,27)(14,28), (12,26)] Permutation Group with generators [(13,27)(14,28), (12,26)] |
Programming in Sage
|
|
|
|
121827446329895738728628753088007 121827446329895738728628753088007 |
'hello world' 'hello world' |
Need for speed

|
|
14 14 |
|
|
Traceback (click to the left of this block for traceback) ... AttributeError: 'int' object has no attribute 'divisors' Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_sage_input_169.py", line 10, in <module>
exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("bi5kaXZpc29ycygp"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))
File "", line 1, in <module>
File "/tmp/tmpQ4JLm8/___code___.py", line 2, in <module>
exec compile(u'n.divisors()
File "", line 1, in <module>
AttributeError: 'int' object has no attribute 'divisors'
|
[1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60] [1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30, 60] |
2666668666667000000 2666668666667000000 |
5 loops, best of 3: 2.44 s per loop 5 loops, best of 3: 2.44 s per loop |
[1/3, 67/21, 127/21, 187/21, 247/21, 307/21, 367/21] [1/3, 67/21, 127/21, 187/21, 247/21, 307/21, 367/21] |
14 14 |
[2, 3, 4, 5] [2, 3, 4, 5] |
2666668666667000000 2666668666667000000 |
|
|
125 loops, best of 3: 2.16 ms per loop 125 loops, best of 3: 2.16 ms per loop |
94.4444444444444 94.4444444444444 |
We get even better timings if we choose a better algorithm
|
|
|
625 loops, best of 3: 2.75 µs per loop 625 loops, best of 3: 2.75 µs per loop |
14 14 |
625 loops, best of 3: 741 ns per loop 625 loops, best of 3: 741 ns per loop |
-407788678951258603 -407788678951258603 |
True True |
Solving Equations
|
|
|
Time: CPU 5.03 s, Wall: 5.02 s Time: CPU 5.03 s, Wall: 5.02 s |
(1, 500) (1, 500) |
-4/5 -4/5 |
(-3517028760688029064375524206860558503260764579046769622751008301275401\ 420955261319182505472655403446871133375351213855350226815464192625416785\ 427799378224204797564876553778968477994716339775767237820732075201307990\ 308197757240294234285563184763491733437556772520094928741981494332871024\ 651254158873412391649819482714094296169547438994929321661878392738308404\ 302422041338086509328881011853757898318105389946174930237408436906944079\ 223742786833914611551409557282902026689939169134355557855057198503380254\ 232298641549695798842795869295699735107799201002441206465535505058980204\ 950835831794506538432167500292525930179580649014029441779675269515653952\ 412480597561602652331926698481809226942792117185857783063808851623050866\ 691080434331157140193997647056564055323726374249881283029300372215738412\ 042918521096448177111817100358266846323723274543880364648172938561865371\ 929056955043176312431479911712917380077097901887716153891517164989985540\ 840321675523448055303601794177709757529516100039489830377747503199111171\ 567328320217277853953924414907309586892529729676752209887301451274362449\ 437898145988592956277583816139788377093357552496933776948081224203156447\ 925227374841051073109821248667385181018001296971075164387365769779414082\ 743792702935093826539113749666422742791582865874227648824847568656015797\ 308951586142050635510616384914735047939100560830346367036281042499099093\ 587436174460147424354398136945622916521762837511897546642955136118061989\ 276592413853260210146325042267865046486205868884565141198378935711191095\ 339677561251599756523993225002326911920613591375951568107131173033272054\ 209577856132806465246801784225456996705420023960118520687844642932420757\ 463894793643138793520132790318668818665509323889749881958253860610185138\ 652298499093125007922510871073642155237071601926820225661792045138028040\ 026493480523906620291352797182396206857111808133310431261496891125281019\ 791926011490935247820428687898616399735896224340600057359854531576146926\ 251200089897481071278163938930472956127703898532177384677382415384545588\ 699642998424638569295639063787810784484358257504405272277075561916922908\ 257264535243509728643865291508953639079652724169694694026175524388621142\ 937766905589219346239259093036752861934164525952986127809144111422162660\ 187325167212561920817228095582629617487246379658007221535383208075836149\ 083679376805804530940354095353962448272508728028384915074672326844898676\ 575610800665429165430814274592676665502787407335232444362008294879391683\ 83811194688142700374028190883369685908216732077/406778287548421232666331\ 161732867083284451766898265331336067813926311992369988856628099086734855\ 735667115529095643017475187509536025110579820674273512710409816506781413\ 949219095421900994613025586328298832520783087510115995249000462483853695\ 254032218916775883778046276732513287003348820832286627339151659920216118\ 602434782892082868740908234817764021744897598451761291562171363826753518\ 869638462172176786920750397046439419756522146331329906325922062334126886\ 845307227747533166221063380004741504866680087220033007960420359539342564\ 917059907398615028523186317797636660999604624165361705540811548027344347\ 944843318379754195828447139714059075956823953574961456072422821379853471\ 265957417978467907648030343371041680488666213418782854500371449004464628\ 137151693278248611405436919105441634514379785943438321498699491374429974\ 941411916188300692918447066207671860293291735706044903379459163329722215\ 462487004764606673950227898048328401073006835733854423499982247502117755\ 480969561242112088131965551967459900917790184504128348366688399796247714\ 348331657116276519708370377748220107893500318506080007877295044619391333\ 807678344042981270732923845847840661087831919093000529797399599904218182\ 992292585508525349195563753868289669013772157736583348697099384043469144\ 344547635488272911439832922066075313432817036914368704456808129124539273\ 223910518127512694139126508695831281678860513712181333729105725904365496\ 018849941845190976573970615503284681408750206307284620020356423014190813\ 611899820786073110923736507592224098870834184189350561093842374187901309\ 709249334375710994985735557672788610080629408146012015171554449734793702\ 597134820310225203084105776449433119524680976123866181969647041370142480\ 229859354877697883210865623491026410955602205911593318386075749335920440\ 095933187160459299339643209960996075895440125644540573643065630406530215\ 220384502737018981682502335606698154233159446864117915813842827734973170\ 373721996301841763236329935471494386783276795049901144295223363777310171\ 682399431489512674283791187221666388715006803961777072989016656984486829\ 254799709389454885066301520728637334573706302170617918018593936439994981\ 310508468063757045909826757786706357829130980704081337842853100001277249\ 846738997785268785823852018104843245188926381179282263086482208903119981\ 671229274976649707235429823900190171387464844391690441164936391687051774\ 383726627139496012306231401783236358878349778653017133170776393229190077\ 739628990310160502280814134853096788081965867629862390376323081486388081\ 447209515623489102340) (-351702876068802906437552420686055850326076457904676962275100830127540142095526131918250547265540344687113337535121385535022681546419262541678542779937822420479756487655377896847799471633977576723782073207520130799030819775724029423428556318476349173343755677252009492874198149433287102465125415887341239164981948271409429616954743899492932166187839273830840430242204133808650932888101185375789831810538994617493023740843690694407922374278683391461155140955728290202668993916913435555785505719850338025423229864154969579884279586929569973510779920100244120646553550505898020495083583179450653843216750029252593017958064901402944177967526951565395241248059756160265233192669848180922694279211718585778306380885162305086669108043433115714019399764705656405532372637424988128302930037221573841204291852109644817711181710035826684632372327454388036464817293856186537192905695504317631243147991171291738007709790188771615389151716498998554084032167552344805530360179417770975752951610003948983037774750319911117156732832021727785395392441490730958689252972967675220988730145127436244943789814598859295627758381613978837709335755249693377694808122420315644792522737484105107310982124866738518101800129697107516438736576977941408274379270293509382653911374966642274279158286587422764882484756865601579730895158614205063551061638491473504793910056083034636703628104249909909358743617446014742435439813694562291652176283751189754664295513611806198927659241385326021014632504226786504648620586888456514119837893571119109533967756125159975652399322500232691192061359137595156810713117303327205420957785613280646524680178422545699670542002396011852068784464293242075746389479364313879352013279031866881866550932388974988195825386061018513865229849909312500792251087107364215523707160192682022566179204513802804002649348052390662029135279718239620685711180813331043126149689112528101979192601149093524782042868789861639973589622434060005735985453157614692625120008989748107127816393893047295612770389853217738467738241538454558869964299842463856929563906378781078448435825750440527227707556191692290825726453524350972864386529150895363907965272416969469402617552438862114293776690558921934623925909303675286193416452595298612780914411142216266018732516721256192081722809558262961748724637965800722153538320807583614908367937680580453094035409535396244827250872802838491507467232684489867657561080066542916543081427459267666550278740733523244436200829487939168383811194688142700374028190883369685908216732077/406778287548421232666331161732867083284451766898265331336067813926311992369988856628099086734855735667115529095643017475187509536025110579820674273512710409816506781413949219095421900994613025586328298832520783087510115995249000462483853695254032218916775883778046276732513287003348820832286627339151659920216118602434782892082868740908234817764021744897598451761291562171363826753518869638462172176786920750397046439419756522146331329906325922062334126886845307227747533166221063380004741504866680087220033007960420359539342564917059907398615028523186317797636660999604624165361705540811548027344347944843318379754195828447139714059075956823953574961456072422821379853471265957417978467907648030343371041680488666213418782854500371449004464628137151693278248611405436919105441634514379785943438321498699491374429974941411916188300692918447066207671860293291735706044903379459163329722215462487004764606673950227898048328401073006835733854423499982247502117755480969561242112088131965551967459900917790184504128348366688399796247714348331657116276519708370377748220107893500318506080007877295044619391333807678344042981270732923845847840661087831919093000529797399599904218182992292585508525349195563753868289669013772157736583348697099384043469144344547635488272911439832922066075313432817036914368704456808129124539273223910518127512694139126508695831281678860513712181333729105725904365496018849941845190976573970615503284681408750206307284620020356423014190813611899820786073110923736507592224098870834184189350561093842374187901309709249334375710994985735557672788610080629408146012015171554449734793702597134820310225203084105776449433119524680976123866181969647041370142480229859354877697883210865623491026410955602205911593318386075749335920440095933187160459299339643209960996075895440125644540573643065630406530215220384502737018981682502335606698154233159446864117915813842827734973170373721996301841763236329935471494386783276795049901144295223363777310171682399431489512674283791187221666388715006803961777072989016656984486829254799709389454885066301520728637334573706302170617918018593936439994981310508468063757045909826757786706357829130980704081337842853100001277249846738997785268785823852018104843245188926381179282263086482208903119981671229274976649707235429823900190171387464844391690441164936391687051774383726627139496012306231401783236358878349778653017133170776393229190077739628990310160502280814134853096788081965867629862390376323081486388081447209515623489102340) |
|
|
Symbolic Calculus
|
|
2D Graphics
|
|
|
|
|
|
3D Graphics
|
|
|
|
|
|
|
|