Matrix
A collection of vectors!
Why we said is a "collection" of "vectors"
Matrix Multiplication
Discrete System
Can we link differential equnations to discrete system?
Programming
Matrix is a collection of vectors
[1 2]
[3 4]
[2 3]
[4 5]
[3 5]
[7 9]
[-1 -1]
[-1 -1]
[10 13]
[22 29]
Build Matrix by Columns
[1 3]
[2 4]
Retrieve element in a matrix
[2]
[4]
(2, 4)
Error in lines 1-1
Traceback (most recent call last):
File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute
flags=compile_flags) in namespace, locals
File "", line 1, in <module>
File "sage/structure/element.pyx", line 3694, in sage.structure.element.Matrix.__mul__ (build/cythonized/sage/structure/element.c:22621)
raise TypeError("unsupported operand parent(s) for *: '{}' and '{}'".format(parent, parent))
TypeError: unsupported operand parent(s) for *: 'Full MatrixSpace of 2 by 1 dense matrices over Integer Ring' and 'Full MatrixSpace of 2 by 1 dense matrices over Integer Ring'
20
[22]
Hint for today's lab
The rule for matrix multiplication
Only rows multiplies columns
The result of ith row multiplies nth column will be storate in (i,n) of output matrix
[1 2]
Object
What is . for? e.g., mat1.column(0)
Get the properties of the variable
We can pack a lot of properties in one variable!!!
(3, 3)
<type 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>