2 views

Uploaded by reivajmc

Sagemath shortcuts

- Roger Baker
- 01542412.pdf
- Quant Assign 1
- Senarai Tugasan Tutorial
- Btech and UG Programs Health Sciences Syllabus SRM University
- Annual XI Comp Sc 2
- 33-s4 Srt Analysis of Cable-stayed
- Maths D (Fast Track) Year 10 (2 YEARS)
- (1993) 'the Growing Importance of LA in Undergrad Mathematics'
- 422816240311Chapter 7 - Solving Linear Systems of Equations
- Kalman1960 - Copy
- SyllabusCSE
- Hp 49g+ User's Guide English
- Obj. 24 Systems of Linear Equations (Presentation)
- Computer Mathematics
- Syllabus Outline Prelim ARS
- GMAT Quant Topic 1 (General Arithmetic) Solutions
- Chapter 2 Review
- Course Outline Part a (1)
- 74781953-WHAT-TO-STUDY-STPM-MATHEMATICS-T-S-PAPER-1.pdf

You are on page 1of 2

Indices start at � • v[i] • A*B

When specifying rows, columns, or entries of a Entry in position i of vector v Product of matrices A and B, if de�ned

matrix, count by starting with �. • A+B

• A[i,j]

Entry in row i and column j of A Sum of matrices A and B, if de�ned

Row vs Column Vectors

Sage does not differentiate between row and col- • A.row(m) • A.echelon_form()

umn vectors. Vectors are interpreted as needed mth row of A as vector Echelon form of matrix A

so operations are de�ned, if possible. • A.column(m) • A.rref()

mth column of A as vector Reduced echelon form of matrix A

Specify the ring • A.inverse()

Sage needs to know which space our matrices • A.rows()

List of rows of A as list Inverse of matrix A (if de�ned)

and vectors are de�ned in, even when de�ning a

particular matrix. The Sage keys for common sets • A.determinant()

• A.columns()

are Returns determinant of matrix A

List of columns of A as list

RR = reals, QQ = rationals, ZZ = integers • A.transpose()

Specifying the ring is optional but highly recom- • A.submatrix(m,n,nrows,ncols)

Returns transpose of matrix A

mended. nrows ⇥ ncols submatrix of A beginning at

entry A[m, n] • A.rank()

Returns rank of matrix A

D������� M������� ��� V������ • A.matrix_from_rows(list)

• A = Matrix(FF, [[row0],[row1],...]) Forms new matrix from rows of A listed in

De�nes speci�c matrix with entries in the V����� Operations

list

ring F • v.norm()

• A.matrix_from_columns(list) Norm of vector v

ex: A = Matrix(RR,

[[1,2,3],[4,5,6]])

1 2 3 Forms new matrix from columns of A listed

de�nes A = in list • v.norm(1)

4 5 6 Sum of entries of vector v

• v = vector(FF, list)

S������ Matrices • v.len()

De�nes speci�c vector with entries in the

Number of entries of v

ring F • random_matrix(FF,m,n)

ex: v = vector(RR, [1,0,8,6]) Random m ⇥ n in �eld F • v.dot_product(u)

ex: A = random_matrix(QQ,2,4) Dot produce of vectors v and u

A is random 2 ⇥ 4 matrix with entries in Q • v.cross_product(u)

M����� Property Testing

• identity_matrix(n) Cross produce of vectors v and u

Return boolean value (true or false)

n ⇥ n identity matrix:

• A.is_invertible() R�� Operations

ex: I4 = identity_matrix(4)

• A.is_symmetric() I4 is 4 ⇥ 4 identity matrix • A.swap_rows(n,m)

• A.is_singular() Interchange rows n and m

• Augment matrices A and B: A.augment(B)

• A.is_orthogonal() ex: A = Matrix([[1,2],[3,4]]) • A.rescale_row(n, c)

• A.is_scalar() N = A.augment(identity_matrix(2)) Multiply entries of row n by c

• A.is_one() returns • A.add_multiple_of_row(n,m,c)

• A.is_zero() Add c times row m to row n

1 2 1 0

• A.is_diagonalizable() N=

3 4 0 1

M ATH 150 S AGE M ATH L INEAR A LGEBRA C HEAT S HEET Last Updated July 29, 2017

• A.augment(B) Example system with solution x = 1, y = 5 • Solve equation

Augment matrices A and B solve(x^2-4==0, x)

ex: A = Matrix([[1,2],[3,4]]) 3x y=2

solve(x^2-4==0, x)

N = A.augment(identity_matrix(2)) x y=6

returns • Roots of polynomial

Method �: De�ne augmented matrix and reduce (x^2-3*x).roots(x)

1 2 1 0 A = Matrix([[3,-1,2],[-1,-1,6]])

N= • Factor polynomial

3 4 0 1 S = A.rref()

S (x^2+8*x-9).factor()

• A.stack(B)

Stack matrix A over B prints • Limits

ex: A = Matrix([[1,2],[3,4]]) [ 1 0 -1 ] limit(x^2+5*x, x=2)

N = A.stack(identity_matrix(2)) [ 0 1 -5 ]

• Derivatives

returns 2 3 diff(x^2+4*x, x)

1 2 Method �: De�ne coef�cient matrix and vector,

63 47 then solve • Antiderivative

N =6 41 05

7

A = Matrix([[3,-1],[-1,-1]]) integral(x^2+4*x, x)

0 1 b = vector([2,6]) • De�nite Integral

S = A.solve_right(b) integral(x^2+4*x, x, 0, 4)

V����� Spaces and Properties S

• VectorSpace(FF, n) prints • Simplify Expressions

n dimensional vector space over F (-1, -5) ((x^2-4)/(x+2)).simplify_rational()

ex: V = VectorSpace(RR,2) ((x-2)*(x+6)).expand()

de�nes V = R2 C�������� and Basic Math

• V.dimension() • Sage constants: pi, e, i, oo, log2 P�������

Dimension of space V • Products See Sage documentation for a complete list of

• V.basis() a = 4*9 plot options, such as titles, colors, line widths,

Canonical basis of space V • Powers �lls, and much more.

• V.is_subspace(W) a = 8^2

• plot(x^2,(x,-4,20))

Test if W is a subspace of V • Roots

• MatrixSpace(FF, m, n) a=sqrt(16) • circle( (3,5), 2 )

Space of m ⇥ n matrices over F • line([(1,5),(3,7)])

ex: V = MatrixSpace(QQ,2,3) S�����

• List: [1,2,3] • polygon([(0,0), (1,3), (2,5), (0,4)])

space of 2⇥3 matrices with rational entries

• Tuple: (1,2,3) • L = plot(x^2, (x,-2,2), rgbcolor=(1,0,0))

E����������� and Eigenvalues N = plot(x^4, (x,-2,2), rgbcolor=(0,0,1))

• Set: {1,2,3}

• A.eigenvalues() show(L+N)

List of eigenvalues of A • range(n)

List 0, 1, 2, . . . , n 1 • bar_chart([3,5,-1,2,8,4,3,2,5] )

• A.eigenvectors_right()

List of triples: • range(m,n) • M = [[1,3,4,2],[2,4,1,0]]

(eval, evector, multiplicity) List m, m + 1, . . . , n 1 matrix_plot(M, colorbar=True)

• A.characteristic_polynomial() • Comments: Start line with # • L = [[1,3],[2,5],[2,7],[1.8,2.9]]

Characteristic polynomial of A • Comparison: ==, <, >, <=, >=, != scatter_plot(L)

- Roger BakerUploaded bylatintoss
- 01542412.pdfUploaded byAravindVR
- Quant Assign 1Uploaded byRam Kishore
- Senarai Tugasan TutorialUploaded byNurul Hidayah Husin
- Btech and UG Programs Health Sciences Syllabus SRM UniversityUploaded byleexpro
- Annual XI Comp Sc 2Uploaded byAk Hawk
- 33-s4 Srt Analysis of Cable-stayedUploaded byEdward van Martino
- Maths D (Fast Track) Year 10 (2 YEARS)Uploaded byYenny Tiga
- (1993) 'the Growing Importance of LA in Undergrad Mathematics'Uploaded byCaio Viega
- 422816240311Chapter 7 - Solving Linear Systems of EquationsUploaded byPrizt Mey Ginting
- Kalman1960 - CopyUploaded byKevinXavier
- SyllabusCSEUploaded byKunalAgarwal
- Hp 49g+ User's Guide EnglishUploaded byThebe Setshedi
- Obj. 24 Systems of Linear Equations (Presentation)Uploaded bySandra Miller
- Computer MathematicsUploaded byHeavenCrow
- Syllabus Outline Prelim ARSUploaded byviewfactor
- GMAT Quant Topic 1 (General Arithmetic) SolutionsUploaded bymeashish25
- Chapter 2 ReviewUploaded bytree5215
- Course Outline Part a (1)Uploaded bydavy123
- 74781953-WHAT-TO-STUDY-STPM-MATHEMATICS-T-S-PAPER-1.pdfUploaded byGEG Kulim
- DSMUploaded byMec Inov
- I PU Mock Paper ComputerScience 2017 2018Uploaded byVenkanna Huggi H
- A0088205E_zhikang - FlattenedUploaded byLee Zhi Kang
- Exercise Prod Design PracticingUploaded byLaura Alós
- ECE1250S14_M2LectProbs.pdfUploaded byel_ruso__83
- 6667_01_rms_20120816Uploaded byhoang123a10
- Fast Visual Tracking Using Motion Saliency in VideoUploaded byVincent_Fung_139
- Mathcad_MatrixNotesUploaded bymojeebmashal
- zoho.pdfUploaded byloga surya
- Syllabus Outline Prelim ARSUploaded bykarthivisu2009

- Introduccion a SAGEUploaded bydonis999
- ingles.pdfUploaded byreivajmc
- Algebra LinealUploaded byreivajmc
- Calculo-Diferencial-e-Integral-por-Frank-Ayres-JrUploaded byGustavo
- 130Uploaded byreivajmc
- Hemingway Paris era una fiestaUploaded byyorca23
- Digital SignalUploaded byreivajmc
- Sage for lineal Algebra.pdfUploaded byreivajmc
- Tarea 6Uploaded byreivajmc
- Cst Hfss MatlabUploaded byreivajmc
- electronica analogica de comunicacionesUploaded byreivajmc
- Training Low Noise Amplifier Part 2Uploaded byPratik
- mitola1993Uploaded bymsh20_4
- uwbUploaded byreivajmc
- Conquer Radio Frequency eBookUploaded byThemba Kaonga
- RubiUploaded byreivajmc
- Reloj MSP430Uploaded byreivajmc
- MSP 430Uploaded byreivajmc
- MSP 430Uploaded byreivajmc
- Tecnocultura FinalUploaded byreivajmc
- bpskUploaded byreivajmc
- QUÉ ES EL PODER (1)Uploaded byreivajmc
- Cst Hfss MatlabUploaded byreivajmc
- Comunicaciones Por Medio de Fibra ÓpticaUploaded byreivajmc
- Comunicaciones Por Medio de Fibra ÓpticaUploaded byreivajmc
- Diseño de cajas acusticasUploaded byJunior Diaz
- cepeUploaded byvictoria_2013
- Quick Reference CardsUploaded byreivajmc
- vivaldi modif.pdfUploaded byreivajmc

- Ref.3 - Y.2012 Functional Requirements and Architecture of NGN Release 1Uploaded byharit_ec
- Scanright IpcUploaded byNicolaescu Gabriel
- Manual, Burny 10 LCD Plus - English 20-06-2010.pdfUploaded byex-2156
- A 922 Type Service Fuser ErrorUploaded bycababac
- Adobe InDesign CS6 ManualUploaded byJagan Patil
- zoho2.pdfUploaded byPrincy
- Intro to ASPUploaded byjasbamra
- The Development of BluetoothUploaded bykolawole_adegbuyi
- Deltek Cobra - Cumulative vs Current Period ActualsUploaded bytensix
- Autocad CommandUploaded bySATT
- Topical Test LINEAR LAWUploaded bySalmizam Izam
- 38731308 C Programming and Data StructuresUploaded bySwathi Priya
- Data Warehousing OLAP Tool SelectionUploaded byDeepanshu
- CUDNN Library (1)Uploaded byAriel Lenis
- Embarcadero - Mobile TutorialsUploaded byAlexanVO
- The Digital Marketing CanvasUploaded byvicente_ortiz_007
- Tim Hieu File LinuxUploaded bymbkfet
- MINORS HASH TABLE IN COMPUTER CHINESE CHESS.pdfUploaded byBinh An
- Maximizing SolidWorks PerformanceUploaded byMohamed Samir
- CCNA-MCQ-1.pdfUploaded bysreesree.b
- Apple Web Design GuideUploaded byShinu P Abraham
- Block 1 BLIS 04 Unit 1Uploaded byravinderreddyn
- Q Paper PracticalUploaded bySanjay L. Rathod
- Resumen Parte JavaeeUploaded byOswaldo Montalvo
- CHS TOSUploaded byBenjie Fiel Andriano
- wincuplUploaded bykbcoon21
- marketing mix analysis in RPL, PunalurUploaded byEby Raju
- The Gigabyte Z87_Haswell Overclocking(OC) GuideUploaded bysmanscott
- David David Pop-Up Store | Idol MagazineUploaded byroseswingler
- webapp2Uploaded byrgconxol