Skip to main content

Sage and Linear Algebra Worksheet: FCLA Section RREF

Robert Beezer
Department of Mathematics and Computer Science
University of Puget Sound
Fall 2019

To specify a matrix, first specify that your entries are rational numbers, QQ in Sage parlance. This is extremely important, though an explanation is best saved for later. Then the number of rows and columns. Follow this with a list of rows for the matrix, where each row is another list. We use square brackets, [, ] to organize lists. To actually see A we just write it as the last line.

Then use the .rref() method to compute the reduced row-echelon form.

Demonstration 1.

Use a new cell, enter A.rref(), and execute the cell.

Here is a larger example.

Demonstration 2.

As above, use a new cell to compute the reduced row-echelon form of B.

This work is Copyright 2016–2019 by Robert A. Beezer. It is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.