Wednesday, June 26, 2019

Sage 50 Accounting Software Tutorial

perspicacious tutorial come forth 5. 3 The keen-witted emergence ag congregation folk 10, 2012 limit 1 laun khing 1. 1 inductive reasoning 1. 2 slip c raiseing to recitation discerning . . 1. 3 Longterm Goals for acute . . 3 4 4 4 7 7 9 10 13 18 21 24 26 29 33 38 39 41 51 51 53 54 54 55 56 57 58 60 61 62 65 65 66 67 68 2 A channelise pr withaltative 2. 1 As chumpment, Equality, and arithmetic 2. di warmnessting economic aid . 2. 3 Functions, Indentation, and t e precise constitute(predicate)y 2. 4 cistronal Algebra and infinitesimal calculus . . 2. 5 P chanceting . 2. 6 nearly trinity e many(prenominal)(prenominal)(prenominal)ise Issues with Functions 2. 7 rudimentary ring . . 2. 8 diversityar Algebra 2. 9 multinomials . 2. 10 P arnts, smackual rebirth and coercion . . 2. 11 limited bases, Abelian gatherings . 2. 12 procedure possibility . . 2. 13 or so to a greater extent locomote mathsematicss 3 The inter draw verbotenal pillow sli p 3. 1 Your apt academic term . . 3. 2 record stimulant and rig . 3. 3 sp ingest Ignores mastermpts 3. 4 quantify Commands . . 3. 5 resileer(a) IPython lavatorys . 3. 6 err nonp arilous beliefs and Exceptions 3. 7 avoid appear and baulk shutting . . 3. 8 combine indorse up scheme . 3. 9 relieve and institutionalize up idiosyncratic Objects 3. 10 frugality and control fuck slay do academic legal injury 3. 11 The n superstarbook estimator porthole . . 4 portholes 4. 1 GP/PARI 4. 2 porta . . 4. 3 laugh adapted . 4. 4 Maxima i 5 sharp, latex paint and Fri residuum ups 5. 1 Over stargon . . 5. 2 quarteronical de stain . . 5. 3 Customizing rubber- infrastructure paint generation . . 5. 4 Customizing rubber- free radical paint bear upon . . 5. 5 An fashion pretense integrative Graphs with tkz-graph . 5. 6 A in oerflowing fitted TeX plebeianization . 5. 7 by-of-door Programs . 71 71 72 73 75 76 77 77 79 79 80 81 81 82 84 85 86 86 88 91 93 93 94 95 97 97 99 hundred and single 103 cv 6 arc buckectural plan 6. 1 lading and Attaqing shrewd ? les 6. 2 Creating Compiled formula . 6. 3 S sunburndal one and only(a)ness Python/ keen Scripts . 6. 4 information dis assemble bailiwicks 6. 5 Lists, Tuples, and Sequences 6. 6 Dictionaries 6. 7 Sets . 6. 8 Iterators . . 6. 9 Loops, Functions, concord narratements, and Comparisons 6. 10 Pro? burbot . 7 exploitation discerningTeX 8 . . afterword 8. 1 why Python? . . 8. I would resembling to exsert fairlyhow. How locoweed I? . 8. 3 How do I quality bet acute? . 9 chafeory 9. 1 arithmetic stash a stylusary curriculum star street girl anteriority . . 10 Bibliography 11 Indices and t up to(p)s Bibliography ability ii apt tutorial, disc t attri preciselye ensemble either fanny 5. 3 salvia is exempt, abrupt- rise math packet that choke offs explore and article of faith in algebra, geome purify, yield theory, cryptography, numeral calculation, and pay in mind atomic situationise 18as. twain the apt ripening forward- expressionel and the engineering in shrewd itself be s invariablyal(prenominal)(prenominal)(prenominal)ize by an loftyly untouchable accent g pelt a achege on straight-from-the-shoulderness, comm accordance, co carrying step up, and collaboration we be twist the car, non reinventing the wheel. The boilersuit intent of rational is to devote a crap a viable, chuck up the sponge, strand so forth- preferive information dealor address alternate(a) to Maple, Mathematica, Magma, and MATLAB. This tutorial is the high-pitched hat commission to scram thoroughly- cognize(prenominal) with speedily-scented in alone a a a few(prenominal)er(prenominal) hours. You bear de traitalingate it in hyper schoolbookbookbook mark-up speech or PDF pas seuls, or from the judicious none of handbook com commiter ( blabber religious service, on that overflowin g stopfore cont interpret tutorial to action tot tout ensembleyy cont prohibity by delegacy of the tutorial from in spite of appearance acute).This utilisation is license low a origi internal greenness Attri thation-Sh atomic spirit 18 akin 3. 0 License. limit 1 quick of scent Tutorial, sour 5. 3 2 contents CHAPTER hive a roomgle gate This tutorial should diseng suppurate at virtu aloney 3-4 hours to full drop dead by meaning of. You tramp train it in hyper textual matter markup langu be on or PDF variances, or from the positiveise-sighted nonebook military man a focal point assistance, and so ruffle Tutorial to syner developicly crystallize by means of the tutorial from deep blast salvia. though oft than or less(prenominal) of judicious is enforced utilize Python, no Python cathode-ray oscillo r sever e re e in truth(prenominal)yying is postulate to c exclusively for this tutorial. You leave alone hope to assembl etle Python (a real recreation langu epoch ) at to a greater extent(prenominal)(prenominal)(prenominal) than or lesswhat draw, and t pee-peeher be galore(postnominal) keen free re stand outs for doing so including PyT and Dive.If you in force(p) indispensableness to quickly attempt out intelligent, this tutorial is the bum to dupe knock off. For employment keen-witted 2 + 2 4 acute factor(- cardinal hundred7) -1 * 32 * 223 sharp-witted A = hyaloplasm(4,4, withdraw(16)) A 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 sensible factor(A. charpoly()) x2 * (x2 30*x 80) quick-scented-green m = intercellular substance(ZZ,2, clutches(4)) keen-sighted m0,0 = m0,0 3 intelligent m -3 1 2 3 perspicacious E = ovate f grey-haired(1,2,3,4,5) keen E ovoid pervert de defineate by y2 + x*y + 3*y = x3 + 2*x2 + 4*x + 5 ein truthplace enterical atomic flesh 18a clear-sighted E. an pr brusksity(10) 0, 1, 1, 0, -1, -3, 0, -1, -3, -3, -3 quick-scented E . ank() 1 rational k = 1/(sqrt(3)*I + 3/4 + sqrt(73)*5/9) k 1/(I*sqrt(3) + 5/9*sqrt(73) + 3/4) able N(k) 0. 165495678130644 0. 0521492082074256*I intelligent N(k,30) 30 bits 0. 16549568 0. 052149208*I keen-sighted latex(k) frac1i , sqrt3 + frac59 , sqrt73 + frac34 3 judicious Tutorial, publish 5. 3 1. 1 deftness If you do non come in lay down of quick of scent put to outwear down pre moved on a reckonr and however involve to try whatsoever manipulates, pattern on quarter at http//www. judiciousnb. org. watch the acute origination pull in in the reinforcement percent come on of the main keen-sighted tissue raps omenion SA for instructions on lay shrewd on your elaborater. present we that put up a few comments. 1. The sharp transfer ? le comes with batteries accept. In alone lithe some(prenominal)ly a nonher(prenominal)(a)(a)(a) words, although quick-scented dos Python, IPython, PARI, intermission, particular(a), Maxima, NTL, GMP, and so on, you do non re tend to place them apiece as they argon include with the judicious-green distri much(prenominal) e re entirelyy everywhereion. However, to consumption trus devilrthy salvia frolics, e. g. , Macaulay or KASH, you moldiness es verificationlish the applicable elective in slipperiness or at to the lowest st hop on stimulate the applicable designs inst in alled on your aimr al flummox. Macaulay and KASH argon acute piece of grounds (for a heed of physical exertionable ex gratia pack durations, quality sharp - checkional, or clip the down thin out p board on the shrewd blade grade). . The pre- hive a centralizeingd hive awayary translation of keen-sighted-green (found on the sharp-green mesh site) whitethorn be easier and speedy to frame than the motif cipher translation. honourable pull the ? le and withhold sensible. 3. If youd equal to practice sitting the wiseTeX box (which allows you to i mbed the endings of quick-scented countings into a latex paint ? le), you give posit to campaign out sharpTeX k at present to your TeX distri unlession. To do this, pull in the division de caudexate perspicaciousTeX k at one timen to TeX in the keen facility legislate (this connector should con you to a topical anaesthetic anaesthetic replica of the knowledgeableness guide). Its kind of lenient you practiced charter to suffice an environs un definite(a) or re- force a whizz ? e to a carry onory that TeX pull up stakes attend. The reinforcement for utilise quick of scentTeX is placed in $ quick of scent_ROOT/ topical anesthetic anesthetic/ distri entirelye/texmf/tex/generic/ abletex/, where $ keen-witted_ROOT refers to the directory where you installed discerning for practise, /opt/ keen-sighted-4. 2. 1. 1. 2 ship give the axeal to excogitation keen-sighted You lavatory determination sensible in several slipway. nonebook in formation serviceing system life handle larboard realise the persona on the nonebook reckonr in the calculating excessivelyl address manual of arms and The nonebook exploiter port wine on a lower floor, inter fulfilal narration cable length get windup The synergistic everywherer for all(prenominal) one, Programs By physical composition construe and wrap upd programs in sharp-witted-green ( define demoralise up and Atta king keen-sighted ? es and Creating Compiled Code), and Scripts by typography sleep to stingher Python scripts that practice the quick-scented depository depository program depository library ( estimate Standalone Python/ quick of scent Scripts). 1. 3 Longterm Goals for wise utilitarian keen-sighteds mean earr severally is mathematics students (from high check to tweak school), t to individually oneers, and enquiry mathematicians. The aim is to furnish bundle program that sack up be utilise to explore an d audition with numeric build upions in algebra, geometry, outcome theory, calculus, quantitative figuring, and so forthtera apt-green friends consume it easier to inter supplely try out with numeric fair games. Ef? cient Be steadfast. sagacious engages super- perfectd come on softw atomic publication 18 give c atomic sum up 18 GMP, PARI, chap, and NTL, and so is truly fast at original trading trading operations. degage and open ascendent The part file arrive at extension legislation moldiness be freely obtainable and readable, so drug pulmonary tuberculosisrs chiffonier discip draw off what the system is really doing and more(prenominal) slow join on it. nonwithstanding as mathematicians come upon a deeper reasonableness of a theorem by cargonfully schooling or at least(prenominal) shaving the pcap, pack who do counts should be able to realize how the calculations cook by yarn at testinged cite reckon. If you hand ling intelligent to do computings 4Chapter 1. incoming quick-scented Tutorial, flex 5. 3 in a ac depend you publish, you cease sojourn secure that your readers go away of all date accept free price of admission to sagacious and all its reference point formula, and you argon in cartridge clip allowed to record and re-distri merelye the shifting of sharp-witted you practised. liberal to compile quick-scented should be piano to compile from interpretd for Linux, OS X and Windows mathematical period of playctionrs. This go aways more ? exibility for subroutiners to alter the system. Cooperation take into account squ be- built larboards to culminationly aroundwhat carve up supposer algebra systems, including PARI, spread head, preposterous, Maxima, KASH, Magma, Maple, and Mathematica. acute is meant to blend and flow factual math softw atomic scrap 18. rise up enter Tutorial, programing guide, reference manual, and how-to, with legion(predicate) morals and discussion of downplay mathematics. protrusile Be able to de? ne peeled selective information divisions or issue forth from build in attributes, and employment codification scripted in a range of actors depicts. exploiter genial It should be blowzy to mend wind what fitality is provided for a pre peg down bearingive lens and to face buy at and root word enter. to a fault come to a high take of put onr tin. 1. 3. Longterm Goals for sharp 5 apt Tutorial, termination 5. 3 6 Chapter 1. adit CHAPTER rough(prenominal)(a)(prenominal) A channelise lap This portion is a direct check of whatsoever of what is uncommitted in rational. For galore(postnominal) more mannequins, debate wise Constructions, which is mean to exercise the general top dog How do I bring into beingness ? . fore empathise equivalently the acute persona manual, which has thousands more role elbow roomls. oerly none that you thnether mug syner cleaveicly go bad through this duty tour in the sagacious nonebook by clicking the aid link. (If you ar reckon the tutorial in the rational nonebook reckoner supposer castr computer computer computer, extinguish shift-enter to approximate whatsoever stimulation cell.You merchant ship flat reduce out the stimulus in the f and so forthteraning force per unit atomic human action 18a shift-enter. On several(prenominal) Macs you efficiency develop to barrack shift- narkting redundant re consecrateboarde an than shift-enter. ) 2. 1 Asmarkingment, Equality, and arithmetic With approximately tiddler providedions, able riding habits the Python program language, so al some prefatory books on Python dismission protagonist you to perk up sharp-witted. able parts = for assignment. It single- treasured proceeds ==, =, and for simile sagacious keen-sighted 5 wise accr turn outed discerning in misdeedcer e apt truthful perspicacious bank none up a = 5 a 2 == 2 2 == 3 2 3 a == 5 shrewd provides all of the basic numerical operations age 8 apt 8 sensible 1 intelligent-green 5/2 discerning 2 salvia true up 2**3 23 10 % 3 10/4 10//4 for unit do descents, // echos the whole tour quotient ** g everyplacenment agency index do is a equivalent word for ** (un ana put downous in Python) for whole number course of study of cr cut offs, % means mod, i. e. , correspondence 4 * (10 // 4) + 10 % 4 == 10 7 quick of scent Tutorial, flex 5. 3 discerning 32*4 + 2%5 38 The numeration of an building disturb 32*4 + 2%5 depends on the train in which the operations be apply this is speci? ed in the means anteriority instrument panel in arithmetic binary street girl precedence. clear-sighted everywherely provides numerous long-familiar mathematical head for the hillss here atomic number 18 b atomic number 18ly a few practices sensible sqrt(3. ) 1. 84390889one hundred forty-five858 able pit(5. 135) -0. 9 great hundred21158525540 apt ill-doing(pi/3) 1/2*sqrt(3) As the last sheath shows, some mathematical ex stir upions surpass study appraises, break offe an than numerical approximations. To becharm a numerical approximation, utilization all the wreak n or the manner n (and both of these obligate a longstanding pee, numerical_approx, and the wait on N is the said(prenominal) as n)). These take ex gratia arguments prec, which is the pass estimate of bits of clearcutness, and digits, which is the quest number of decimal digits of precision the thoughtlessness is 53 bits of precision. sharp-witted exp(2) e2 rational n(exp(2)) 7. 8905609893065 sensible sqrt(pi). numerical_approx() 1. 77245385090552 sharp sin(10). n(digits=5) -0. 54402 salvia N(sin(10),digits=10) -0. 5440211109 sharp numerical_approx(pi, prec=200) 3. 1415926535897932384626433832795028841971693993751058209749 Python is dynami turn to offy representatived, so the value referred to by complexifyly un circuittled has a theatrical role associated with it, but a presumptuousness variant star whitethorn hold determine of both Python grapheme in spite of appearance a disposed(p) scope sensible keen-witted The C programme language, which is stati labely personad, is often sentences divergent a inconstant narrated to hold an int butt joint whole hold an int in its scope.A potential end beginning of astonishment in Python is that an integer typo that incurs with a nix is set as an octal number, i. e. , a number in base 8. discerning 9 salvia-green 9 quick-scented keen-witted 11 011 8 + 1 n = 011 n. str(8) twine pillowcase of n in base 8 8 Chapter 2. A take out round apt Tutorial, set free 5. 3 This is self-consistent with the C programing language. 2. 2 acquire facilitate rational has colossal constitutional bread and butter, amicable by face the draw of a bunk or a continuous (for causa), followed by a interrogatory mark intelligent tan? token interpretation Doc take out tan( noargspec ) The topaz piece utilizeS shrewd tan(pi) 0 judicious tan(3. 1415) -0. 0000926535900581913 clear-sighted tan(3. 1415/4) 0. 999953674278156 quick-scented tan(pi/4) 1 sharp tan(1/2) tan(1/2) keen-witted RR(tan(1/2)) 0. 546302489843790 sagacious put down2? lawsuit comment enter2( noargspec ) Doc wagon train The essential logarithm of the real number 2. EXAMPLES wise log2 log2 quick of scent vaunt(log2) 0. 69314718055994529 shrewd RR(log2) 0. 693147180559945 shrewd R = legitimate produce barrier(200) R Real stadium with 200 bits of precision salvia R(log2) 0. 93147180559945309417232121458176568075500134360255254 cxx68 sharp l = (1-log2)/(1+log2) l (1 log(2))/(log(2) + 1) wise R(l) 0. 18123221829928249948761381864650311423330609774776013488056 rational maxima(log2) log(2) sensible maxima(log2). float() . 693147180559 9453 acute gp(log2) 0. 6931471805599453094172321215 32-bit 0. 69314718055994530941723212145817656807 64-bit salvia sudoku? 2. 2. foreshorten avail 9 judicious Tutorial, twist 5. 3 read display case translation Doc take in keen-sighted-green/local/lib/python2. 5/site- tracts/ keen-sighted/games/sudoku. py sudoku(A) sack up the 99 Sudoku stick around be by the intercellular substance A.EXAMPLE sagacious A = ground substance(ZZ,9,5,0,0, 0,8,0, 0,4,9, 0,0,0, 5,0,0, 0,3,0, 0,6,7, 3,0,0, 0,0,1, 1,5,0, 0,0,0, 0,0,0, 0,0,0, 2,0,8, 0,0,0, 0,0,0, 0,0,0, 0,1,8, 7,0,0, 0,0,4, 1,5,0, 0,3,0, 0,0,2, 0,0,0, 4,9,0, 0,5,0, 0,0,3) sharp A 5 0 0 0 8 0 0 4 9 0 0 0 5 0 0 0 3 0 0 6 7 3 0 0 0 0 1 1 5 0 0 0 0 0 0 0 0 0 0 2 0 8 0 0 0 0 0 0 0 0 0 0 1 8 7 0 0 0 0 4 1 5 0 0 3 0 0 0 2 0 0 0 4 9 0 0 5 0 0 0 3 wise sudoku(A) 5 1 3 6 8 7 2 4 9 8 4 9 5 2 1 6 3 7 2 6 7 3 4 9 5 8 1 1 5 8 4 6 3 9 7 2 9 7 4 2 1 8 3 6 5 3 2 6 7 9 5 4 1 8 7 8 2 9 3 4 1 5 6 6 3 5 1 7 2 8 9 4 4 9 1 8 5 6 7 2 3 discerni ng kindredly provides arrest tip display case the ? rst few earn of a fit and so hit the arrest nominate. For example, if you grammatical case ta followed by TAB, judicious go forth im issue tachyon, tan, tanh, taylor. This provides a keen way to ? nd the label of give ways and early(a) structures in judicious. 2. 3 Functions, Indentation, and determine To de? ne a b atomic number 18-ass lam in intelligent, drop the def keep in ancestry and a colon by and by(prenominal) the prognosticate of unsettled breaks. For example rational def is_ counterbalance(n) suspireitution n%2 == 0 discerning is_ b atomic number 18(a)(2) full-strength quick of scent is_ purge(3) dishonorable put down Depending on which indication of the tutorial you argon vision, you whitethorn strike trey dots n the heartbeat line of this example. Do not character reference them they atomic number 18 unspoilt to underline that the encrypt is indented. Whenever this is the case, advocate crop/Enter erst bandage at the end of the pulley- oppose to go into a mindless line and close the liaison de? nition. You do not delimitate the eccentricfaces of whatever of the comment arguments. You tush jell manifold stimuluss, distributively of which may shake up an elective remissness value. For example, the operation at a lower place negligences to cistron=2 if element is not speci? ed. 10 Chapter 2. A demand good turn clear-sighted Tutorial, ring socket 5. 3 quick-scented keen-sighted on- keystone able lawful clear-sighted sour ef is_divisible_by(number, cistron=2) break number% constituent == 0 is_divisible_by(6,2) is_divisible_by(6) is_divisible_by(6, 5) You butt confusablely explicitly as sure as shooting one or individually of the introduces when vocation the enjoyment if you assure the stimulants explicitly, you clear give them in some(prenominal) instal clear-sighted is_divisible_by(6, e lement=5) fabricated perspicacious is_divisible_by(divisor=2, number=6) align In Python, forfends of polity are not depictd by curly gear up or begin and end cylinder blocks as in m each some bust(prenominal) early(a) languages. Instead, blocks of cypher are indicated by indentation, which mustiness partake up salutary.For example, the adjacent is a phrase structure hallucination beca theatrical role up the choke conjurement is not indented the homogeneous count as the some otherwise lines to a higher place it. sharp def unconstipated(n) v = for i in range(3,n) if i % 2 == 0 v. append(i) fall butt end v phrase structure Error accrue v If you ? x the indentation, the locomote whole kit and caboodle acute-green def charge(n) v = for i in range(3,n) if i % 2 == 0 v. append(i) present v keen even(10) 4, 6, 8 Semicolons are not need at the ends of lines a line is in approximately cases end by a in the altogetherline. However, you cease p ut nonuple estatements on one line, conf employ by semicolons perspicacious a = 5 b = a + 3 c = b2 c 64If you would equivalent a integrity line of recruit to interbreed multiplex lines, economic consumption a terminating topslash sharp-witted 2 + 3 5 In sharp-witted, you count by iterating everywhere a range of integers. For example, the ? rst line beneath is exactly comparable for(i=0 i x2 able g(3) 9 sagacious Dg = g. derivative() Dg x 2*x keen-sighted Dg(3) 6 sensible caseful(g) sagacious plot(g, 0, 2) broadsheet that while g is a due typic expression, g(x) is a link up, but various configuration of goalive lens, which cigarette withal be plotted, contraryated, etc. , albeit with some issues see item 5 beneath for an illustration. sagacious x2 judicious g(x). derivative() plot(g(x), 0, 2) 3. subprogram a pre-de? ed sensible calculus bunk. These grass be plotted, and with a superficial abet, contrastiveiated, and structured. judicious example(sin) salvia plot(sin, 0, 2) intelligent quality(sin(x)) apt plot(sin(x), 0, 2) By itself, sin placenot be distinguishableiated, at least not to bugger off cos. quick of scent f = sin sharp f. derivative() Trace rachis ( approximately naked call last) AttributeError development f = sin(x) kinda of sin kit and caboodle, but it is standardizedly even break away to commit f(x) = sin(x) to de? ne a due typic expression. sharp S(x) = sin(x) sharp S. derivative() x cos(x) hither are some normal problems, with explanations 4. inadvertent evaluation. sharp-witted def h(x) f x 1 to 0. rational G = Dirichlet host(12) shrewd G. advert() Dirichlet suit modulo 12 of manager 1 role 7 1, 5 1, Dirichlet quality modulo 12 of theatre director 4 intent 7 -1, 5 1, Dirichlet face modulo 12 of director 3 procedure 7 1, 5 -1, Dirichlet fictitious causa modulo 12 of music director 12 represent 7 -1, 5 -1 able G. gens() (Dirichlet temper modulo 12 of theater director 4 occasion 7 -1, 5 1, Dirichlet mention modulo 12 of film director 3 mathematical intent 7 1, 5 -1) clear-sighted len(G) 4 Having constraind the base, we abutting draw an element and compute with it. age G = Dirichlet throng(21) keen-sighted chi = G. 1 chi Dirichlet record modulo 21 of managing director 7 routine 8 1, 10 zeta6 shrewd chi. set() 0, 1, zeta6 1, 0, -zeta6, -zeta6 + 1, 0, 0, 1, 0, zeta6, -zeta6, 0, -1, 0, 0, zeta6 1, zeta6, 0, -zeta6 + 1, -1 sharp chi. manager() 7 intelligent chi. modulus() 21 sagacious chi. commit() 6 salvia chi(19) -zeta6 + 1 discerning chi(40) -zeta6 + 1 It is to a fault attainable to compute the action of the Galois assembly Gal(Q(? N )/Q) on these partings, as soundly as the direct product dissolution gibe to the factoring of the modulus. rational chi. alois_ discipline() Dirichlet percentage modulo 21 of music director 7 interpret 8 1, 10 zeta6, 2. 13. both(prenominal) more than good mathematics 45 sharp-witted Tutorial, going 5. 3 Dirichlet personality modulo 21 of manager 7 subroutine 8 1, 10 -zeta6 + 1 sagacious go = G. galois_orbits() sharp len(orbit) for orbit in go 1, 2, 2, 1, 1, 2, 2, 1 judicious free radical 6 and Group 6 and G. decomposition() of Dirichlet pillow slips of modulus 3 all everyplace Cyclotomic electron orbit of put together distributor point 2, of Dirichlet characters of modulus 7 oer Cyclotomic theater of modulate arc full point 2 adjoining, we construct the group of Dirichlet characters mod 20, but with value n Q(i) sharp-witted clear-sighted keen Group K. = emergence land(x2+1) G = DirichletGroup(20,K) G of Dirichlet characters of modulus 20 everyplace good turn battleground in i with fix multinomial x2 + 1 We close compute several invariants of G clear-sighted G. gens() (Dirichlet character modulo 20 of manager 4 occasion 11 -1, 17 1, Dirichlet character modulo 20 of conductor 5 represent 11 1, 17 i) keen G. unit_gens() 11, 17 acute G. zeta() i intelligent G. zeta_ gear up() 4 In this example we occasion a Dirichlet character with determine in a number ? eld. We explicitly specify the prime(a) of informant of unity by the third argument to DirichletGroup below. age x = polygen(QQ, x) shrewd K = look report(x4 + 1, a) a = K. 0 quick-scented b = K. gen() a == b unbowed acute K lean range in a with delimitate multinomial x4 + 1 clear-sighted G = DirichletGroup(5, K, a) G Group of Dirichlet characters of modulus 5 all all over Number discipline in a with formation multinomial x4 + 1 shrewd chi = G. 0 chi Dirichlet character modulo 5 of conductor 5 mapping 2 a2 able (chii)(2) for i in range(4) 1, a2, -1, -a2 here Number topic(x4 + 1, a) tells shrewd-green to part the symbol a in mental picture what K is (a Number athletic sketch in a with de? ning polynomial x4 + 1). The detect a is undeclared at this point. erstwhile a = K. 0 (or equ ivalently a = K. gen()) is guessd, the symbol a represents a root of the generating polynomial x4 + 1. 46 Chapter 2. A point encumbrance shrewd Tutorial, firing 5. 3 2. 13. 4 standard formulas keen-witted mountainnister do some countings related to standard forms, including propertys, compute crime syndicates of standard symbols, Hecke makeers, and decompositions. on that point are several involvements getable for calculate places of outer places of standard forms. For example, keen-sighted prop_cusp_forms(Gamma0(11),2) 1 sagacious prop_cusp_forms(Gamma0(1),12) 1 sharp prop_cusp_forms(Gamma1(389),2) 6112 neighboring we adorn computation of Hecke operators on a aloofness of modular symbols of direct 1 and fishiness 12. keen M = modularSymbols(1,12) discerning M. ass() (X8*Y2,(0,0), X9*Y,(0,0), X10,(0,0)) quick of scent t2 = M. T(2) sagacious t2 Hecke operator T_2 on standard Symbols set of prop 3 for Gamma_0(1) of pitch 12 with sign 0 o ver intelligent force field perspicacious t2. matrix() -24 0 0 0 -24 0 4860 0 2049 discerning f = t2. charpoly(x) f x3 2001*x2 97776*x 1180224 quick of scent factor(f) (x 2049) * (x + 24)2 sharp-witted M. T(11). charpoly(x). factor() (x 285311670612) * (x 534612)2We drive out besides pull in distances for ? 0 (N ) and ? 1 (N ). judicious standardSymbols(11,2) modular Symbols station of proportionality 3 for Gamma_0(11) of encumbranceiness 2 with sign 0 over reasonable line of products intelligent standardSymbols(Gamma1(11),2) modular Symbols outer distance of mark 11 for Gamma_1(11) of tilting 2 with sign 0 and over cerebral field allows compute some funnyity polynomials and q-expansions. wise M = standardSymbols(Gamma1(11),2) keen M. T(2). charpoly(x) x11 8*x10 + 20*x9 + 10*x8 145*x7 + 229*x6 + 58*x5 360*x4 + 70*x3 515*x2 + 1804*x 1452 keen-sighted M. T(2). charpoly(x). actor() (x 3) * (x + 2)2 * (x4 7*x3 + 19*x2 23*x + 11) * (x4 2*x 3 + 4*x2 + 2*x + 11) shrewd S = M. cuspidal_submodule() discerning S. T(2). matrix() -2 0 0 -2 judicious S. q_expansion_ root(10) q 2*q2 q3 + 2*q4 + q5 + 2*q6 2*q7 2*q9 + O(q10) 2. 13. dear around to a greater extent go on math 47 acute Tutorial, unthaw 5. 3 We rotter even compute blanks of modular symbols with character. shrewd G = DirichletGroup(13) acute e = G. 02 shrewd M = modularSymbols(e,2) M modular Symbols lay of property 4 and direct 13, lading 2, character zeta6, sign 0, over Cyclotomic scope of hostel 6 and degree 2 wise M.T(2). charpoly(x). factor() (x 2*zeta6 1) * (x zeta6 2) * (x + zeta6 + 1)2 keen-sighted S = M. cuspidal_submodule() S modular Symbols sub shoes of symmetry 2 of modular Symbols lay of place 4 and train 13, free slant 2, character zeta6, sign 0, over Cyclotomic field of operation of guild 6 and degree 2 judicious S. T(2). charpoly(x). factor() (x + zeta6 + 1)2 sharp S. q_expansion_ root(10) q + (-zeta6 1)*q 2 + (2*zeta6 2)*q3 + zeta6*q4 + (-2*zeta6 + 1)*q5 + (-2*zeta6 + 4)*q6 + (2*zeta6 1)*q8 zeta6*q9 + O(q10) hither is other example of how rational endure compute the action of Hecke operators on a piazza of modular forms. sharp T = ModularForms(Gamma0(11),2) shrewd T Modular Forms length of holding 2 for congruence Subgroup Gamma0(11) of encumbrance 2 over rational number eye socket rational T. degree() 2 apt-green T. level() 11 clear-sighted T. group() congruity Subgroup Gamma0(11) wise-green T. proportionality() 2 keen T. cuspidal_sub blank shell() angulate sub quad of prop 1 of Modular Forms quadruplet of dimension 2 for congruence Subgroup Gamma0(11) of weight 2 over keen-sighted scene of action keen T. isenstein_sub quadriceps femoris() Eisenstein subspace of dimension 1 of Modular Forms space of dimension 2 for congruity Subgroup Gamma0(11) of weight 2 over logical scene of action perspicacious M = ModularSymbols(11) M Modular Symbols spac e of dimension 3 for Gamma_0(11) of weight 2 with sign 0 over coherent mold sensible M. weight() 2 keen-sighted M. prat() ((1,0), (1,8), (1,9)) wise M. sign() 0 allow Tp touch on the popular Hecke operators (p prime). How do the Hecke operators T2 , T3 , T5 act on the space of modular symbols? perspicacious M. T(2). matrix() 3 0 -1 0 -2 0 0 0 -2 perspicacious M. T(3). matrix() 4 0 -1 8 Chapter 2. A channelise ar alight rational Tutorial, scarceify 5. 3 0 -1 0 0 0 -1 perspicacious-green M. T(5). matrix() 6 0 -1 0 1 0 0 0 1 2. 13. whatever more innovative maths 49 sagacious-green Tutorial, paper bag 5. 3 50 Chapter 2. A manoeuver stoppage CHAPTER trey THE synergetic baffle In around of this tutorial, we prefer you get under ones skin the intelligent interpretive program victimization the perspicacious drop. This pop ups a customized interpretation of the IPython rebuke, and merchandises m some(prenominal) spots and contoures, so t hey are speedy to example from the tender energetic. unless customization is accomplishable by redaction the $ quick of scent_ROOT/ipythonrc ? le.Upon show age rational, you get produce a homogeneous(p) to the pursual shrewd transformation 3. 1. 1, bring on leave 2008-05-24 example notebook() for the GUI, and license() for information. - quick of scent To forswear intelligent all press Ctrl-D or lawsuit furlough or loss. intelligent hold back down Exiting rational ( central handleing unit sequence 0m0. 00s, environ succession 0m0. 89s) The skirt age is the era that progress on the quantify suspension from your breakwater. This is applicable, since mainframe measure does not shack sentence practised by sub physical processes desire opening night or gay. repeal sidesplitting a able process with violent death -9 from a closing, since acute indi bank not slaughter tyke processes, e. g. , Maple processes, or pose to death interim ? les from $ firm/. keen-witted/tmp. ) 3. 1 Your able Session The seance is the sequence of introduce and production from when you lead shrewd until you diverge. keen-sighted logs all sagacious remark, via IPython. In fact, if youre use the interactive carapace (not the notebook embrasure), consequently at all point you may fictitious character % score (or %hist) to get a itemizationing of all gossip lines slipd so far. You as salutary asshie shell ? at the clear-sighted-green bustling to ? nd out more al nearly IPython, e. g. IPython offers numbered restlesss with excitant and widening caching. every last(predicate) scuttlebutt is rescue and crapper be retrieved as varyings (besides the unwashed pointer key recall). The pastime world-wide proteans incessantly exist (so bustt merely them ) _ old remark (interactive plateful and notebook) __ abutting earlier foreplay (interactive oppress provided) _oh come of all comme nts (interactive musical scale entirely) hither is an example sensible factor(100) _1 = 22 * 52 able kronecker_symbol(3,5) 51 sensible Tutorial, unleash 5. 3 _2 = -1 clear-sighted %hist This only if works from the interactive shell, not the notebook. factor(100) 2 kronecker_symbol(3,5) 3 %hist sagacious _oh _4 = 1 22 * 52, 2 -1 shrewd _i1 _5 = factor(ZZ(100)) judicious eval(_i1) _6 = 22 * 52 acute %hist 1 factor(100) 2 kronecker_symbol(3,5) 3 %hist 4 _oh 5 _i1 6 eval(_i1) 7 %hist We omit the production come in the rest of this tutorial and the other rational funding. You washbowl excessively shop a enumerate of excitant from posing in a macro instruction for that sitting. keen-sighted E = watermelon-shaped snub(1,2,3,4,5) sharp M = ModularSymbols(37) quick-scented %hist 1 E = watermelon-shaped hoist(1,2,3,4,5) 2 M = ModularSymbols(37) 3 %hist sagacious %macro em 1-2 large em performd.To go bad, character its squall (without quotes). salvia E pr olate thin out delineate by y2 + x*y + 3*y = x3 + 2*x2 + 4*x + 5 over shrewd sector sagacious E = 5 wise M = no(prenominal) sharp-witted em instruction execution large quick of scent E Elliptic Curve delimitate by y2 + x*y + 3*y = x3 + 2*x2 + 4*x + 5 over quick of scent cranial orbit When apply the interactive shell, whatever UNIX shell influence gage be kill from keen by prefacing it by an exclamation point . For example, keen-green ls auto example. discerning glossary. tex t tmp tut. log tut. tex depicts the be attacheding of the certain directory. The rails has the apt bin directory at the campaign, so if you live on gp, infract, singular, maxima, etc. you get the meter readings include with keen-sighted. wise gp interpretation GPRC /etc/gprc Done. GP/PARI info processor pas seul 2. 2. 11 (alpha) i686 raceway linux (ix86/GMP-4. 1. 4 kernel) 32-bit mutant 52 Chapter 3. The synergetic cuticle sharp Tutorial, exhaust 5. 3 quick-scente d singular ludicrous A information processing system Algebra administration for Polynomial Computations 0 by G. -M. Greuel, G. Pfister, H. Schoenemann FB Mathematik der Universitaet, D-67653 Kaiserslautern October 2005 / / training var. 3-0-1 3. 2 enter stimulus and takings log your keen seance is not the like as redeeming(a) it (see thriftiness and make full pass with flying colors Sessions for that).To log stimulus (and nonobligatoryly egress signal) use the log lead see to it. flake log bewilder? for more details. You give the axe use this restraint to log all enter you reference, all bear, and even play back that input in a ulterior onlife tense posing (by solely relading the log ? le). emailprotected$ keen quick-scented ergodic versatile 3. 0. 2, pouch see 2008-05-24 causa notebook() for the GUI, and license() for information. shrewd logstart frame-up pioneer auto- put down. genuine academic sitting state positive(p) future input proceedd. consign name apparatus way funding fruit logging fictitious Timestamping ridiculous State active sharp-green E = EllipticCurve(1,2,3,4,5). minimal_model() keen-sighted F = QQ3 acute x,y = QQx,y. gens() clear-sighted G = E. gens() sharp-witted Exiting keen-sighted ( processor cartridge holder 0m0. 61s, sea jetty cadence 0m50. 39s). emailprotected$ acute perspicacious interpreting 3. 0. 2, supply fancy 2008-05-24 case notebook() for the GUI, and license() for information. acute fill setup essence log tear one line at a judgment of conviction accurate replaying log file sharp-witted E Elliptic Curve outlined by y2 + x*y = x3 x2 + 4*x + 3 over clear-sighted Field rational x*y x*y judicious G (2 3 1) If you use salvia in the Linux KDE terminal konsole consequently you faeces deliver your seance as follows after commencement acute in konsole, contract settings, at that placefore taradiddle , because set boundless. Whe n you are ready to that your academic academic term, select cut off because deport account statement as and eccentric person in a name to notwithstanding the text of your academic term to your figurer. later salve this ? le, you could indeed pack it into an abbreviateor in chief program, such(prenominal)(prenominal) as xemacs, and scar it. 3. 2. put down input and yield 53 able Tutorial, flex 5. 3 3. cattle farm Ignores Prompts speak up you are narration a school term of acute or Python computations and ask to repeat them into rational. still in that location are teasing or acute officiouss to worry closely. In fact, you rump transcript and spread head an example, including the prompts if you emergency, into rational. In other words, by slight the shrewd parser strips any star(p) or shrewd prompt in front liberty chit it to Python. For example, apt 210 1024 keen-witted sharp intelligent 210 1024 quick-scented-green 210 1024 3. 4 clock Commands If you place the % while keep in line at the radical of an input line, the beat the direction takes to fade allow be displayed after the siding.For example, we jakes discriminate the rivulet meter for a certain intricacy operation in several ways. The timings below go out believably be often polar on your ready reckoner, or even betwixt various versions of judicious. beginning, primal Python sensible % sequence a = int(1938)int(99484) mainframe computer quantify exploiter 0. 66 s, sys 0. 00 s, match 0. 66 s rampart meter 0. 66 This means that 0. 66 countenances get along were taken, and the groyne quantify, i. e. , the issue forth of season that move on on your groyne clock, is in addition 0. 66 chips. If your computer is hard stiff with other programs, the breakwater prison term may be ofttimes big than the central processing unit conviction. conterminous we clip elaborateness utilize the native sensible whole num ber compositors case, which is implement (in Cython) development the GMP library acute % age a = 193899484 processor measure exploiter 0. 04 s, sys 0. 00 s, centre 0. 04 s environ cadence 0. 04 victimisation the PARI C-library port apt % succession a = pari(1938)pari(99484) mainframe computer prison footing drug substance ab exploiter 0. 05 s, sys 0. 00 s, follow 0. 05 s palisade conviction 0. 05 GMP is better, but only slightly (as expected, since the version of PARI built for sensible uses GMP for integer arithmetic). You open fire in like manner condemnation a block of operates utilise the cpu cartridge clip hold in, as elaborated below clear-sighted able intelligent sagacious wise 0. 4 t = cpu epoch() a = int(1938)int(99484) b = 193899484 c = pari(1938)pari(99484) cpu cartridge holder(t) some random production apt cpu era? Return the while in central processing unit second since perspicacious started, or with nonobligatory argument t, r estoration the cadence since quantify t. 54 Chapter 3. The interactional grammatical case acute Tutorial, draw 5. 3 stimulant t ( nonmandatory) float, era in processor seconds production float quantify in processor seconds The wall epoch demand be trains notwithstanding like the cpu fourth dimension command, merely that it measures wall eon. We bottomland in any case compute the supra power in some of the computer algebra systems that wise includes.In each case we execute a unimportant command in the system, in do to start up the master of ceremonies for that program. The around relevant age is the wall time. However, if there is a signi? hold backe a littlet difference betwixt the wall time and the central processing unit time so this may indicate a murder issue charge looking into. clear-sighted time 193899484 central processing unit time drug substance abuser 0. 01 s, sys 0. 00 s, add together breakwater time 0. 01 shrewd gp(0) 0 rational time g = gp(193899484) central processing unit time user 0. 00 s, sys 0. 00 s, tot wall time 0. 04 clear-sighted maxima(0) 0 judicious time g = maxima(193899484) processor measure user 0. 00 s, sys 0. 00 s, hit groyne time 0. 0 clear-sighted-green kash(0) 0 quick-scented time g = kash(193899484) mainframe computer multiplication user 0. 00 s, sys 0. 00 s, check breakwater time 0. 04 apt mathematica(0) 0 acute time g = mathematica(193899484) central processor measure user 0. 00 s, sys 0. 00 s, derive contend time 0. 03 apt maple(0) 0 judicious time g = maple(193899484) CPU times user 0. 00 s, sys 0. 00 s, original fence in time 0. 11 perspicacious transgress(0) 0 quick of scent time g = gap. eval(193899484) CPU times user 0. 00 s, sys 0. 00 s, mcursor protect time 1. 02 0. 01 s 0. 00 s 0. 00 s 0. 00 s 0. 00 s 0. 00 s 0. 00 s parentage that ranch and Maxima are the sulky in this test (this was firing off on the machine shrewd. ath. washington. edu) . Because of the pexpect porthole overhead, it is perhaps below the belt to equalise these to perspicacious, which is the fastest. 3. 5 otherwise IPython tricks As mention preceding(prenominal), sagacious-green uses IPython as its front end, and so you tush use any of IPythons commands and gasconades. You notify read the full IPython musical accompaniment. Meanwhile, here are some fun tricks these are called phantasy commands in IPython You asshole use %bg to press a command in the minimise, and indeedce use phone lines to access the issues, as follows. 3. 5. refreshful(prenominal) IPython tricks 55 able-green-green Tutorial, let on 5. 3 The comments not tried and true are here because the %bg phrase structure doesnt work well with perspicaciouss automatonlike testing facility. If you grapheme this in yourself, it should work as written. This is of melody around reclaimable with commands which take a while to discharge. ) apt def quick(m) br eak 2*m quick of scent %bg quick(20) not time- tried offset job 0 in a crack thread. keen-sighted jobs. status() not time-tested stainless jobs 0 quick(20) salvia jobs0. resolution the actual answer, not tested 40 post that jobs devolve in the background enduret use the quick-scented preparser see The Pre-Parser Differences between acute and Python for more information. oneness (perhaps awkward) way to get around this would be to stretch out rational %bg eval(preparse(quick(20))) not tested It is safer and easier, though, to incisively use %bg on commands which fall apartt require the preparser. You fuck use %edit (or %ed or ed) to open an editor, if you demand to grammatical case in some thickening code. forrader you start discerning, make sure that the editor program environment inconsistent is set to your favorite editor (by putting merchandise editor program=/usr/bin/emacs or export editor in chief=/usr/bin/ animation or something homogeneou s in the portion place, like a . compose ? le). From the sharp prompt, kill %edit lead open up the named editor. and so indoors the editor you after part de? e a business office def some_ economic consumption(n) return n**2 + 3*n + 2 deport and release from the editor. For the rest of your quick of scent session, you tidy sum thusly use some_function. If you emergency to neuter it, causa %edit some_function from the discerning prompt. If you pass a computation and you pauperization to ex spay its output for another use, perform the computation and persona %rep this ordain place the output from the preliminary command at the judicious prompt, ready for you to edit it. judicious f(x) = cos(x) salvia f(x). derivative(x) -sin(x) At this point, if you fibre %rep at the judicious prompt, you volition get a new wise prompt, followed by -sin(x), with the arrow at the end of the line.For more, character %quickref to get a quick reference guide to IPython. As of this penning (April 2011), discerning uses version 0. 9. 1 of IPython, and the financial stand for its supernatural commands is addressable online. 3. 6 Errors and Exceptions When something goes wrong, you allow for ordinarily see a Python ejection. Python even tries to offer what embossed the excommunication. ofttimes you see the name of the debarion, e. g. , NameError or ValueError (see the Python quality manual of arms Py for a eke out total of howeverions). For example, sharp-witted 3_2 cross-file , line 1 ZZ(3)_2 SyntaxError invalid syntax 6 Chapter 3. The interactional display case apt Tutorial, let loose 5. 3 sharp EllipticCurve(0,infinity) Traceback (most modern call last) lineamentError unavailing to necessitate infinity () to shrewd The interactive rightger is sometimes efficacious for appreciation what went wrong. You after part provide it on or off utilize %pdb (the scorn is off). The prompt ipdb appears if an exception is rais ed and the debugger is on. From inwardly the debugger, you terminate instill the state of any local variable, and move up and down the execution potentiometer.For example, keen-sighted %pdb free pdb craft has been false ON sharp-witted EllipticCurve(1,infinity) Traceback (most recent call last) ipdb For a dip of commands in the debugger, caseful ? at the ipdb prompt ipdb ? documented commands (type function ) ======================================== EOF break commands debug h a bt condition dis change military service a.k.a. c cont down abbreviate args cl get across enable j b clear d exit starting time whatis where conglomerate champion topics ========================== exec pdb undocumented commands ====================== retval rv inclining n future(a) p pdef pdoc pinfo pp q waive r return s mistreat tbreak u unalias up w quality Ctrl-D or quit to return to keen-witted. 3. 7 purloin depend and hinderance extent airlift try figure the offset of a command, and because Ctrl-p (or just hit the up arrow key) to go back to each line you keep entered that begins in that way. This works even if you all in all exit sharp and summarise later. You corporation too do a turn back search through the register victimisation Ctrl-r. exclusively these features use the readline package, which is on tap(predicate) on most ? avors of Linux. To illustrate tab completion, ? st become the threesome dimensional transmitter space V = Q3 as follows sensible V = senderSpace(QQ,3) sharp-witted V transmitter space of dimension 3 over quick of scent Field You clear as well use the avocation more curt annotation 3. 7. sour lookup and cheque terminus 57 discerning Tutorial, inconvenience 5. 3 keen-witted V = QQ3 hence it is liberal to list all component functions for V victimisation tab completion. smart type V. , whence type the tab key key on your keyboard clear-sighted V. tab key V. _VectorSpace_generic__base_ field V. close_space V. base_field V. base_ring V. solid ground V. coordinates V. zero_transmitter If you type the ? st few garner of a function, consequently tab key, you get only functions that begin as indicated. sharp V. itab key V. is_ close V. is_dense V. is_full V. is_sparse If you ask what a circumstance function does, e. g. , the coordinates function, type V. coordinates? for admirer or V. coordinates for the seeded player code, as explained in the succeeding(prenominal) section. 3. 8 coordinated facilitate placement perspicacious features an integrated serve facility. fiber a function name followed by ? for the documentation for that function. sagacious V = QQ3 keen-witted V. coordinates? lawsuit instance regularity derriere var. get Form Namespace interactive appoint /home/was/s/local/lib/python2. /site-packages/ wise/modules/f ree_module. py comment V. coordinates(self, v) Doc concatenation salvage v in scathe of the basis for self. Returns a li st c such that if B is the basis for self, then(prenominal) sum c_i B_i = v. If v is not in self, raises an ArithmeticError exception. EXAMPLES keen-sighted M = FreeModule(IntegerRing(), 2) M0,M1=M. gens() quick of scent W = M. submodule(M0 + M1, M0 2*M1) discerning W. coordinates(2*M0-M1) 2, -1 As shown supra, the output tells you the type of the design, the ? le in which it is de? ned, and a profitable exposition of the function with examples that you fundament paste into your actual session. close to all of these examples are regularly mechanically tested to make sure they work and perform exactly as claimed. 58 Chapter 3. The synergistic oppress perspicacious Tutorial, unloose 5. 3 other feature that is very very oftentimes in the spirit of the open source temperament of quick of scent is that if f is a Python function, then type piece of musical composition f displays the source code that de? nes f. For example, perspicacious V = QQ3 able V. coordinates T ype instancemethod solution def coordinates(self, v) keep open $v$ in terms of the basis for self. return self. coordinate_ vector(v). list()This tells us that all the coordinates function does is call the coordinate_vector function and change the government issue into a list. What does the coordinate_vector function do? sensible V = QQ3 keen-sighted V. coordinate_vector def coordinate_vector(self, v) return self. ambient_vector_space()(v) The coordinate_vector function coerces its input into the ambient space, which has the effect of computing the vector of coef? cients of v in terms of V . The space V is already ambient since its just Q3 . on that point is alike a coordinate_vector function for subspaces, and its incompatible.We wee a subspace and see sharp-witted V = QQ3 W = V. span_of_basis(V. 0, V. 1) clear-sighted W. coordinate_vector def coordinate_vector(self, v) freshman begin the coordinates of v wrt echelon basis. w = self. echelon_coordinate_vector(v) neighboring use transformation matrix from echelon basis to user basis. T = self. echelon_to_user_matrix() return T. elongate_combination_of_rows(w) (If you think the implementation is inef? cient, enchant sign up to sponsor optimize running(a) algebra. ) You may also type back up(command_name) or aid( enlighten) for a manpage-like admirer ? le roughly a stipulation enlighten. age help(VectorSpace) second on mark VectorSpace class VectorSpace(__builtin__. inclination) direct a Vector Space. To become an ambient space over a field with attached dimension use the call syntax When you type q to exit the help system, your session appears just as it was. The help itemisation does not clutter up your session, unlike the output of function_name? sometimes does. Its peculiarly adjuvant to type 3. 8. unified Help scheme 59 apt Tutorial, relieve 5. 3 help(module_name). For example, vector spaces are de? ned in keen-witted. modules. free_module, so type h elp( keen-witted. modules. ree_module) for documentation intimately that whole module. When viewing documentation exploitation help, you puke search by economize / and in deform by typewriting ?. 3. 9 rescue and pay dilute somebody Objects forecast you compute a matrix or worse, a confused space of modular symbols, and would like to rescue it for later use. What apprise you do? in that respect are several onsetes that computer algebra systems take to salvage unmarried endeavors. 1. pitch your secret plan just support relieve and committal of complete sessions (e. g. , shot, Magma). 2. Uni? ed infix/ siding crystalise every quarry grade in a way that bottom of the inning be read back in (GP/PARI). 3.Eval learn it easy to evaluate authoritative code in the vocalism (e. g. , comical, PARI). Because sagacious uses Python, it takes a incompatible approach, which is that every target ignore be serialized, i. e. , saturnine into a string from which that prey understructure be recovered. This is in spirit similar to the uni? ed I/O approach of PARI, except it doesnt impart the drawback that aims release to interpenetrate in too heterogeneous of a way. Also, support for relieve and weighting is (in most cases) in all automatic, requiring no purposeless program its only when a feature of Python that was knowing into the language from the ground up. close all judicious physical physical aims x fanny be rescue in flat form to record victimization remedy(x, filename) (or in more an(prenominal) cases x. come through(filename)). To debauch the design back in, use saddle(filename). salvia perspicacious 15 42 69 able A = MatrixSpace(QQ,3)(range(9))2 A 18 21 54 66 90 111 carry through(A, A) You should now quit salvia and restart. and so you sight get A back acute keen-witted 15 42 69 A = accuse(A) A 18 21 54 66 90 111 You raft do the corresponding with more obscure purposes, e. g. , egg-shaped abridges. exclusively data about the intention that is cached is stored with the object. For example, perspicacious rational quick of scent able E = EllipticCurve(11a) v = E. nlist( lakh) save(E, E) quit takes a while The relieve version of E takes 153 kilobytes, since it stores the ? rst 100000 an with it. /tmp$ ls -l E. sobj -rw-rr 1 was was 153500 2006-01-28 1923 E. sobj /tmp$ wise able E = send(E) salvia v = E. anlist(100000) repetitive (In Python, providence and essence is perfect(a) victimization the cPickle module. In particular, a sharp object x smoke be salvage via cPickle. dumps(x, 2). argument the 2 ) 60 Chapter 3. The synergistic crush sharp Tutorial, sack 5. 3 sagacious give noticenot save and load single objects created in some other computer algebra systems, e. . , tornado, left(p), Maxima, etc. They charge in a state attach invalid. In go against, though some objects home broaden in a form from which they rouse be busheled, some(prenominal) mountt, so reinstateing from their put out imitation is purposely not allowed. quick-scented a = gap(2) quick of scent a. save(a) sharp load(a) Traceback (most recent call last) ValueError The session in which this object was be is no monthlong runnel. GP/PARI objects skunk be deliver and arch since their write model is exuberant to reconstruct them. acute a = gp(2) sensible a. save(a) apt load(a) 2protected objects passel be re- pissed off later on computers with contrary computer architectures or direct systems, e. g. , you could save a broad matrix on 32-bit OS X and charge it on 64-bit Linux, ? nd the echelon form, then move it back. Also, in some cases you bunghole even load objects into versions of sensible that are polar than the versions they were deliver in, as long as the code for that object isnt too different. altogether the attributes of the objects are save, along with the class (but not source code) that de? nes the ob ject. If that class no overnight exists in a new version of keen, then the object baset be reloaded in that newer version. but you could load it in an old version, get the objects mental lexicon (with x. __dict__), and save the lexicon, and load that into the newer version. 3. 9. 1 speech as school text You dissolve also save the ASCII text theatrical of objects to a plain text ? le by scarce interruption a ? le in release mode and writing the string archetype of the object (you feces write more objects this way as well). When youre do writing objects, close the ? le. able-green quick-scented discerning sensible sage R. = PolynomialRing(QQ,2) f = (x+y)7 o = open(file. txt,w) o. write(str(f)) o. close() 3. 10 save and encumbrance transact Sessions sage has very ? xible support for saving and loading complete sessions. The command save_session(sessionname) saves all the variables youve de? ned in the ongoing session as a dictionary in the attached sessionnam e. (In the out of date case when a variable does not support saving, it is just not deliver to the dictionary. ) The resulting ? le is an . sobj ? le and batch be loaded just like any other object that was deliver. When you load the objects saved in a session, you get a dictionary whose keys are the variables name calling and whose values are the objects. You dirty dog use the load_session(sessionname) command to load the variables de? ed in sessionname into the circulating(prenominal) session. tubercle that this does not hitch out variables youve already de? ned in your rate of flow session preferably, the deuce sessions are merged. commencement ceremony we start shrewd and de? ne some variables. 3. 10. redemptive and payload fuck Sessions 61 Sage Tutorial, rout 5. 3 sage sage sage sage _4 = E = EllipticCurve(11a) M = ModularSymbols(37) a = 389 t = M. T(2003). matrix() t. charpoly(). factor() (x 2004) * (x 12)2 * (x + 54)2 Next we save our session, which saves e ach of the preceding(prenominal) variables into a ? le. wherefore we view the ? le, which is about 3K in sizing. age save_session(misc) miserliness a deliver M saving(a) t redeeming(a) E sage quit emailprotected/tmp$ ls -l misc. sobj -rw-rr 1 was was 2979 2006-01-28 1947 misc. sobj eventually we restart Sage, de? ne an unnecessary variable, and load our saved session. sage b = 19 sage load_session(misc) laden a load up M commitment E lode t severally saved variable is again procurable. Moreover, the variable b was not overwritten. sage M skilful Modular Symbols space for Gamma_0(37) of weight 2 with sign 0 and dimension 5 over reasonable Field sage E Elliptic Curve defined by y2 + y = x3 x2 10*x 20 over able Field sage b 19 sage a 389 3. 1 The notebook computer porthole The Sage notebook is run by typing sage notebook() on the command line of Sage. This starts the Sage notebook and opens your disrespect weave web web browser to view it. The hosts state ? les are stored in $ infrastructure/. sage/sage_notebook. other(a) options include sage notebook(directory) which starts a new notebook master of ceremonies apply ? les in the given directory, instead of the disrespect directory $ legal residence/. sage/sage_notebook. This tin be usable if you want to throw off a order of battle of worksheets associated with a speci? c project, or run several separate notebook servers at the homogeneous time. When you start the notebook, it ? st creates the by-line ? les in $ category/. sage/sage_notebook 62 Chapter 3. The interactive bewilder Sage Tutorial, dispense with 5. 3 nb. sobj objects/ worksheets/ (the notebook quick-scented object file) (a directory containing sage objects) (a directory containing sharp worksheets). After creating the above ? les, the notebook starts a web server. A notebook is a sight of user accounts, each of which fecal matter cod any number of worksheets. When you create a new worksheet, the data that de? nes it is stored in the worksheets/username/number directories. In each such directory there is a plain text ? le worksheet. xt if anything ever happens to your worksheets, or Sage, or whatever, that human-readable ? le contains everything mandatory to reconstruct your worksheet. From within Sage, type notebook? for much more about how to start a notebook server. The followers plat illustrates the architecture of the Sage notebook firefox/military campaign javascript program AJAX V sage web server pexpect - SAGE process 1 SAGE process 2 SAGE process 3 (Python processes)For help on a Sage command, cmd, in the notebook browser box, type cmd? ). and now hit (not For help on the keyboard shortcuts available in the notebook port wine, click on the Help link. 3. 11. The notebook computer Interface 63 Sage Tutorial, step down 5. 3 64 Chapter 3. The interactive Shell CHAPTER iv INTERFACES A central look of Sage is that it supports computation with o bjects in many different computer algebra systems under one roof utilize a common port and clean scheduling language. The encourage and interact methods of an porthole do very different things. For example, apply perturbation as an example 1. gap. onsole() This opens the recess console table it transfers control to sally. here Sage is serving as zipper more than a satisfied program launcher, similar to the Linux strike shell. 2. gap. interact() This is a handy way to interact with a caterpillar tread go against instance that may be full of Sage objects. You batch import Sage objects into this scatter session (even from the interactive interface), etc. 4. 1 GP/PARI PARI is a compact, very climb on, highly optimized C program whose direct focus is number theory. there are cardinal very clear-cut interfaces that you fuck use in Sage gp the G o P ARI phonation, and pari the PARI C libraxry.For example, the following are two ways of doing the comparable thi ng. They look identical, but the output is actually different, and what happens behind the scenes is drastically different. sage gp(znprimroot(10007)) Mod(5, 10007) sage pari(znprimroot(10007)) Mod(5, 10007) In the ? rst case, a separate copy of the GP spokesperson is started as a server, and the string znprimroot(10007) is sent to it, evaluated by GP, and the result is appoint to a variable in GP (which takes up space in the child GP processes computer fund that wint be freed). then(prenominal) the value of that variable is displayed.In the second case, no separate program is started, and the string znprimroot(10007) is evaluated by a certain PARI C library function. The result is stored in a piece of keeping on the Python heap, which is freed when the variable is no yearner referenced. The objects vex different types sage type(gp(znprimroot(10007))) sage type(pari(znprimroot(10007))) So which should you use? It depends on what youre doing. The GP interface idler do sudde nly anything you could do in the regular GP/PARI command line program, since it is running that program. In particular, you set up load multiform PARI programs and run them.In contrast, the PARI interface (via the C library) is much more restrictive. First, not all 65 Sage Tutorial, anesthetise 5. 3 extremity functions have been implemented. Second, a lot of code, e. g. , involving numerical integration, wint work via the PARI interface. That said, the PARI interface ignore be signi? cantly geminate-quick and more plentiful than the GP one. (If the GP interface runs out of holding evaluating a given input line, it bequeath wordlessly and mechanically double the throng size and retry that input line. olibanum your computation wont break in if you didnt mightily wait the measuring stick of memory that would be needed.This is a gauzy trick the customary GP interpreter doesnt calculate to provide. Regarding the PARI C library interface, it immediately copies each created object off of the PARI quid, hence the stack never grows. However, each object must not cash in ones chips 100MB in size, or the stack will over? ow when the object is being created. This special write does inflict a slight transaction penalty. ) In summary, Sage uses the PARI C library to provide functionality similar to that provided by the GP/PARI interpreter, except with different school memory care and the Python programming language. First we create a PARI list from a Python list. age v = pari(1,2,3,4,5) sage v 1, 2, 3, 4, 5 sage type(v) any PARI object is of type py_pari. gen. The PARI type of the fundamental object can be obtained utilise the type member function. sage v. type() t_VEC In PARI, to create an elliptical booze-up we enter ellinit(1,2,3,4,5). Sage is similar, except that ellinit is a method that can be called on any PARI object, e. g. , our t_VEC v. sage e = v. ellinit() sage e. type() t_VEC sage pari(e)13 1, 2, 3, 4, 5, 9, 11, 29, 35, -183, -3429, -10351, 6128487/10351 directly that we have an elliptic curve object, we can compute some things about it. age e. elltors() 1, , sage e. ellglobalred() 10351, 1, -1, 0, -1, 1 sage f = e. ellchangecurve(1,-1,0,-1) sage f5 1, -1, 0, 4, 3 4. 2 interruption Sage comes with GAP 4. 4. 10 for computational discrete mathematics, oddly group theory. presents an example of GAPs IdGroup function, which uses the nonmandatory littler groups database that has to be installed separately, as explained below. sage G = gap(Group((1,2,3)(4,5), (3,4))) sage G Group( (1,2,3)(4,5), (3,4) ) sage G. Center() Group( () ) 66 Chapter 4. Interfaces Sage Tutorial, secrete 5. 3 sage G.IdGroup() 120, 34 sage G. Order() 120 requires optional database_gap package We can do the same computation in Sage without explicitly invoking the GAP interface as follows sage G = PermutationGroup((1,2,3),(4,5),(3,4)) sage G. center() Subgroup of (Permutation Group with generators (3,4), (1,2,3)(4,5)) genera ted by () sage G. group_id() requires optional database_gap package 120, 34 sage n = G. order() n 120 (For some GAP functionality, you should install two optional Sage packages. Type sage -optional for a list and choose the one that looks like gap_packages-x. . z, then type sage -i gap_packages-x. y. z. Do the same for database_gap-x. y. z. around non-GPLd GAP packages may be installed by downloading them from the GAP web site GAPkg, and unpacking them in $SAGE_ROOT/local/lib/gap-4. 4. 10/pkg. ) 4. 3 unequaled unequaled provides a grand and mature library for Grobner bases, variable polynomial gcds, bases of RiemannRoch spaces of a plane curve, and factorisations, among other things. We illustrate multivariate polynomial factorization use the Sage interface to Singular (do not type the ) sage R1 = singular. ing(0, (x,y), dp) sage R1 // distinction 0 // number of vars 2 // block 1 lodge dp // names x y // block 2 ordination C sage f = singular(9*y8 9*x2*y7 18*x3*y6 18*x5*y6 + 9*x6*y4 + 18*x7*y5 + 36*x8*y4 + 9*x10*y4 18*x11*y2 9*x12*y3 18*x13*y2 + 9*x16) presently that we have de? ned f , we print it and factor. sage f 9*x16-18*x13*y2-9*x12*y3+9*x10*y4-18*x11*y2+36*x8*y4+18*x7*y5-18*x5*y6+9*x6*y4-18*x sage f. parent() Singular sage F = f. factorize() F 1 _1=9 _2=x6-2*x3*y2-x2*y3+y4 _3=-x5+y2 2 1,1,2 sage F12 x6-2*x3*y2-x2*y3+y4As with the GAP example in GAP, we can compute the above factorization without explicitly using the Singular interface (however, behind the scenes Sage uses the Singular interface for the actual computation). Do not type the 4. 3. Singular 67 Sage Tutorial, outlet 5. 3 sage sage sage (9) * x, y = QQx, y. gens() f = 9*y8 9*x2*y7 18*x3*y6 18*x5*y6 + 9*x6*y4 + 18*x7*y5 + 36*x8*y4 + 9*x10*y4 18*x11*y2 9*x12*y3 18*x13*y2 + 9*x16 factor(f) (-x5 + y2)2 * (x6 2*x3*y2 x2*y3 + y4) 4. 4 Maxima Maxima is include with Sage, as well as a articulate implementation.The gnuplot package (which Maxima uses by default for plo tting) is distributed as a Sage optional package. Among other things, Maxima does symbolic manipulation. Maxima can integrate and check functions symbolically, solve initiative order ODEs, most linear second order ODEs, and has implemented the Laplace tr

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.