12.07.2015 Views

Sage Reference Manual: Matrices and Spaces of Matrices

Sage Reference Manual: Matrices and Spaces of Matrices

Sage Reference Manual: Matrices and Spaces of Matrices

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Sage</strong> <strong>Reference</strong> <strong>Manual</strong>: <strong>Matrices</strong> <strong>and</strong> <strong>Spaces</strong> <strong>of</strong> <strong>Matrices</strong>, Release 6.2[12 15 14 13][16 19 18 17]sage: E = elementary_matrix(QQ, 4, col1=2, scale=1/2); E[ 1 0 0 0][ 0 1 0 0][ 0 0 1/2 0][ 0 0 0 1]sage: A*E[ 0 1 1 3][ 4 5 3 7][ 8 9 5 11][12 13 7 15][16 17 9 19]sage: E = elementary_matrix(QQ, 4, col1=2, col2=1, scale=10); E[ 1 0 0 0][ 0 1 10 0][ 0 0 1 0][ 0 0 0 1]sage: A*E[ 0 1 12 3][ 4 5 56 7][ 8 9 100 11][ 12 13 144 15][ 16 17 188 19]An elementary matrix is always nonsingular. Then repeated row operations can be represented by products<strong>of</strong> elementary matrices, <strong>and</strong> this product is again nonsingular. If row operations are to preserve fundamentalproperties <strong>of</strong> a matrix (like rank), we do not allow scaling a row by zero. Similarly, the corresponding elementarymatrix is not constructed. Also, we do not allow adding a multiple <strong>of</strong> a row to itself, since this could also leadto a new zero row.sage: A = matrix(QQ, 4, 10, range(40)); A[ 0 1 2 3 4 5 6 7 8 9][10 11 12 13 14 15 16 17 18 19][20 21 22 23 24 25 26 27 28 29][30 31 32 33 34 35 36 37 38 39]sage: E1 = elementary_matrix(QQ, 4, row1=0, row2=1)sage: E2 = elementary_matrix(QQ, 4, row1=3, row2=0, scale=100)sage: E = E2*E1sage: E.is_singular()Falsesage: E*A[ 10 11 12 13 14 15 16 17 18 19][ 0 1 2 3 4 5 6 7 8 9][ 20 21 22 23 24 25 26 27 28 29][1030 1131 1232 1333 1434 1535 1636 1737 1838 1939]sage: E3 = elementary_matrix(QQ, 4, row1=3, scale=0)Traceback (most recent call last):...ValueError: scale parameter <strong>of</strong> row <strong>of</strong> elementary matrix must be non-zerosage: E4 = elementary_matrix(QQ, 4, row1=3, row2=3, scale=12)Traceback (most recent call last):...33

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!