# Notes on using sage

## To see already prepared worksheets

Worksheets from the lectures are also accessible through the lecture page.

## To get in to start a new worksheet

• Open a browser at the address http://arcikam.kam.mff.cuni.cz:12080/
• Log in by using your own credentials or by using a public account. Id: Guest, pw: 8GxPsCOs. Id is case sensitive. Do not change pw!
You shall also register to receive an account, since the anonymous account will soon be blocked - as soon as most of you will register.
• Then just click "New worksheet", give it a name and you may start experimenting.

## A short list of useful commands for linear algebra

The list will be gradually updated. For more commands see a quick reference sheet that covers much more than we will need in our course.
• To define a vector or a matrix

b=vector([1,0,5,3]);
A=matrix(QQ,[[1,4],[3,4],[5,1]]);

or equivalently. A=matrix(QQ,3,2,[1,4,3,4,5,1]);

The first optional parameter is the field. We will need the following ones:
ZZ - integers, QQ - rationals, RR - real numbers, CC - complex numbers, GF(k) - the unique finite field with k elements.

The optional second and third parameters are the numbers of rows and columns.

• To get a reduced row echelon form

A.rref() or A.echelon_form()

• To transpose, multiply or invert matrices

transpose(A)
A*B
A^{-1}
or A.inverse()

• To combine two matrices together

A.augment(B) - horizontally
A.stack(B, subdivide=True) - vertically

The optional parameter subdivide=True is for aestheticeal purposes only - it draws a line between the parts.

## Official documentation

http://www.sagemath.org