Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
| Download
Project: Math 152 - Winter 2017
Views: 17362Math 152: Intro to Mathematical Software
2017-02-03
Kiran Kedlaya; University of California, San Diego
adapted from lectures by William Stein, University of Washington
Lecture 11: Linear Algebra (part 2)
Announcements:
Last call for the week 4 feedback survey! (See Wednesday's handout for the link.)
If you are still on the waitlist and still want to enroll, see me ASAP.
Today: more examples from the sage linear algebra quickref guide.
5
Vector space of dimension 3 over Rational Field
Sparse vector space of dimension 1000001 over Rational Field
0
3/4
Sparse vector space of dimension 1000001 over Rational Field
Sparse vector space of dimension 1000001 over Rational Field
True
True
0
[0 3]
[0 0]
43/3
(5, 5/3, 15/2)
43/3
(1/3, 12, 2)
[ 1.00000000000000 0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 1.00000000000000 0.000000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 1.00000000000000 0.000000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000 0.000000000000000]
[0.000000000000000 0.000000000000000 0.000000000000000 0.000000000000000 1.00000000000000]
ans =
1 0 0 0 0
0 1 0 0 0
0 0 1 0 0
0 0 0 1 0
0 0 0 0 1
[ 36 50]
[ 75 111]
Error in lines 3-3
Traceback (most recent call last):
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 982, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "sage/symbolic/expression.pyx", line 5066, in sage.symbolic.expression.Expression.__call__ (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/expression.cpp:30530)
return self._parent._call_element_(self, *args, **kwds)
File "/projects/sage/sage-7.5/local/lib/python2.7/site-packages/sage/symbolic/callable.py", line 464, in _call_element_
return SR(_the_element.substitute(**d))
File "sage/symbolic/expression.pyx", line 4972, in sage.symbolic.expression.Expression.substitute (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/expression.cpp:29999)
(<Expression>self.coerce_in(v))._gobj))
File "sage/symbolic/expression.pyx", line 2885, in sage.symbolic.expression.Expression.coerce_in (/projects/sage/sage-7.5/src/build/cythonized/sage/symbolic/expression.cpp:21670)
return self._parent._coerce_(z)
File "sage/structure/parent_old.pyx", line 240, in sage.structure.parent_old.Parent._coerce_ (/projects/sage/sage-7.5/src/build/cythonized/sage/structure/parent_old.c:4949)
return self.coerce(x)
File "sage/structure/parent.pyx", line 1195, in sage.structure.parent.Parent.coerce (/projects/sage/sage-7.5/src/build/cythonized/sage/structure/parent.c:11166)
raise TypeError("no canonical coercion from %s to %s" % (parent_c(x), self))
TypeError: no canonical coercion from Full MatrixSpace of 2 by 2 dense matrices over Rational Field to Callable function ring with argument x
Univariate Polynomial Ring in y over Rational Field
[ 36 50]
[ 75 111]
<type 'sage.matrix.matrix_symbolic_dense.Matrix_symbolic_dense'>
A.inverse()
[ -2 1]
[ 3/2 -1/2]
A^(-1)
[ -2 1]
[ 3/2 -1/2]
~A
[ -2 1]
[ 3/2 -1/2]
A.transpose()
[1 3]
[2 4]
A.conjugate() -- boring since real
[1 2]
[3 4]
A.antitranspose()
A.adjoint() -- matrix ov adjoint matrices
[ 4 -2]
[-3 1]
image:
Vector space of degree 3 and dimension 2 over Rational Field
Basis matrix:
[ 1 0 -1]
[ 0 1 2]
kernel:
Vector space of degree 3 and dimension 1 over Rational Field
Basis matrix:
[ 1 -2 1]
[-6 -6]
[18 21]
[0]
Vector space of degree 3 and dimension 1 over Rational Field
Basis matrix:
[1 0 0]
Error in lines 3-3
Traceback (most recent call last):
File "/projects/sage/sage-6.10/local/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 905, in execute
exec compile(block+'\n', '', 'single') in namespace, locals
File "", line 1, in <module>
File "sage/matrix/matrix2.pyx", line 4894, in sage.matrix.matrix2.Matrix.restrict (/projects/sage/sage-6.10/src/build/cythonized/sage/matrix/matrix2.c:36811)
raise ArithmeticError, "subspace is not invariant under matrix"
ArithmeticError: subspace is not invariant under matrix
And some fun...
d3-based renderer not yet implemented
3D rendering not yet implemented
d3-based renderer not yet implemented
3D rendering not yet implemented