€csage.server.notebook.notebook
Notebook
q)q}q(U_Notebook__worksheetsq}q(U (csage.server.notebook.worksheet
Worksheet
qoq}q(U_Worksheet__filenameq U_U_Worksheet__cellsq
]q((csage.server.notebook.cell
Cell
qoq
}q(U _Cell__inqU m = matrix([[1/3,2+x],[3,4]]); mqU_Cell__introspect_htmlqU!
qU_Cell__worksheetqhU_Cell__completionsq‰U_Cell__introspectq‰U_Cell__out_htmlqU U _Cell__idqMU_Cell__is_htmlq‰U_before_preparseqUoos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/19")
m = matrix([[1/3,2+x],[3,4]]); mqU
_Cell__dirqU#sage_notebook/worksheets/_/cells/19qU
_Cell__outqU
[ 1/3 2 + x]
[ 3 4]
qUhas_new_outputq‰U_Cell__sageq csage.interfaces.sage0
reduce_load_Sage
q!)Rq"U_Cell__versionq#KU_Cell__typeq$Uwrapq%U_Cell__timeq&‰U_Cell__interruptedq'‰ub(hoq(}q)(hUm = matrix(3, range(9));m q*hU!q+hhh‰h‰hU hMh‰hUhos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/20")
m = matrix(3, range(9));mq,hU#sage_notebook/worksheets/_/cells/20q-hU
[0 1 2]
[3 4 5]
[6 7 8]
q.h‰h h"h#Kh$h%h&‰h'‰ub(hoq/}q0(hU parent(m)q1hU!q2hhh‰h‰hU hMh‰hUXos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/21")
parent(m)q3hU#sage_notebook/worksheets/_/cells/21q4hU>
Full MatrixSpace of 3 by 3 dense matrices over Integer Ring
q5h‰h h"h#Kh$h%h&‰h'‰ub(hoq6}q7(hUmatrix_plotq8hTc Type: <type 'instance'>
Definition: matrix_plot( ... )
Docstring:
A plot of a given matrix or 2D array.
Each (ith, jth) matrix element is given a different
color value depending on its relative size compared
to the other elements in the matrix.
The tick marks drawn on the frame axes denote the
(ith, jth) element of the matrix.
EXAMPLES:
A matrix over ZZ colored with different grey levels:
sage: M1 = Matrix(ZZ,3,4,[[1,3,5,1],[2,4,5,6],[1,3,5,7]])
sage: MP1 = matrix_plot(M1)
Here we make a random matrix over RR and use cmap='hsv'
to color the matrix elements different RGB colors:
sage: n = 22
sage: L = [n*random() for i in range(n*n)]
sage: M2 = Matrix(RR, n, n, L)
sage: MP2 = matrix_plot(M2, cmap='hsv')q9hhh‰h]q:(Umatrix_plot?q;U ehU hMh‰hU[os.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/17")
matrix_plot?qhU#sage_notebook/worksheets/_/cells/17q?hU h‰h#K h$h%h&‰h'‰ub(hoq@}qA(hUŽ sage: n = 22
sage: L = [n*random() for i in range(n*n)]
sage: M2 = Matrix(RR, n, n, L)
sage: MP2 = matrix_plot(M2, cmap='hsv')qBhU!qChhh‰h‰hU hMh‰hUÙos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/16")
sage: n = 22
sage: L = [n*random() for i in range(n*n)]
sage: M2 = Matrix(RR, n, n, L)
sage: MP2 = matrix_plot(M2, cmap='hsv')qDhU#sage_notebook/worksheets/_/cells/16qEhU
qFh‰h h"h#Kh$h%h&‰h'‰ub(hoqG}qH(hU show(MP2)qIhU!qJhhh‰h‰hU:
qKhM h‰hUWos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/0")
show(MP2)qLhU"sage_notebook/worksheets/_/cells/0qMhU
qNh‰h h"h#Kh$h%h&‰h'‰ub(hoqO}qP(hUR. = PolynomialRing(QQ)qQhU!qRhhh‰h‰hU hMh‰hUjos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/1")
R. = PolynomialRing(QQ)qShU"sage_notebook/worksheets/_/cells/1qThU
qUh‰h h"h#Kh$h%h&‰h'‰ub(hoqV}qW(hURhU!qXhhh‰h‰hU hMh‰hUOos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/2")
RqYhU"sage_notebook/worksheets/_/cells/2qZhU.
Polynomial Ring in x, y over Rational Field
q[h‰h h"h#Kh$h%h&‰h'‰ub(hoq\}q](hUR._assign_names(['z','w'])q^hU!q_hhh‰h‰hU hMh‰hUhos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/3")
R._assign_names(['z','w'])q`h=UR._asqahU"sage_notebook/worksheets/_/cells/3qbhTá
Traceback (most recent call last):
File "", line 1, in
File "/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/code/6.py", line 4, in
exec compile(ur'R._assign_names([\u0027z\u0027,\u0027w\u0027])' + '\n', '', 'single')
File "/Volumes/HOME/s/local/lib/python2.5/", line 1, in
File "parent_gens.pyx", line 311, in parent_gens.ParentWithGens._assign_names
ValueError: variable names cannot be changed after object creation.qch‰h h"h#Kh$h%h&‰h'‰ub(hoqd}qe(hUf = x^2 + 3*y^3qfhU!qghhh‰h‰hU hM
h‰hU^os.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/10")
f = x^2 + 3*y^3qhhU#sage_notebook/worksheets/_/cells/10qihU
qjh‰h h"h#Kh$h%h&‰h'‰ub(hoqk}ql(hUfhU!qmhhh‰h‰hU hMh‰hUPos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/11")
fqnhU#sage_notebook/worksheets/_/cells/11qohU
3*y^3 + x^2
qph‰h h"h#Kh$h%h&‰h'‰ub(hoqq}qr(hUparent(f(1,y))qshU!qthhh‰h‰hU hMh‰hU]os.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/12")
parent(f(1,y))quhU#sage_notebook/worksheets/_/cells/12qvhU.
Polynomial Ring in x, y over Rational Field
qwh‰h h"h#Kh$h%h&‰h'‰ub(hoqx}qy(hUa = GF(9,'a').gen()qzhU!q{hhh‰h‰hU hM
h‰hUbos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/13")
a = GF(9,'a').gen()q|hU#sage_notebook/worksheets/_/cells/13q}hU
q~h‰h h"h#Kh$h%h&‰h'‰ub(hoq}q€(hUf(a,1)qhU!q‚hhh‰h‰hU hMh‰hUUos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/14")
f(a,1)qƒh=Uf.basq„hU#sage_notebook/worksheets/_/cells/14q…hT¼
Traceback (most recent call last):
File "", line 1, in
File "/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/code/51.py", line 4, in
exec compile(ur'f(a,Integer(1))' + '\n', '', 'single')
File "/Volumes/HOME/s/local/lib/python2.5/", line 1, in
File "/Volumes/HOME/s/local/lib/python/site-packages/sage/rings/multi_polynomial_element.py", line 106, in __call__
y += c*misc.mul([ x[i]**m[i] for i in range(n) ])
File "element.pyx", line 983, in element.RingElement.__mul__
File "element.pyx", line 1797, in element.bin_op_c
TypeError: unsupported operand parent(s) for '*': 'Rational Field' and 'Finite Field in a of size 3^2'q†h‰h h"h#Kh$h%h&‰h'‰ub(hoq‡}qˆ(hUR.characteristicq‰hU hhh‰h]qŠ(UR.chaq‹U ehU hMh‰hUTos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/15")
R.chaqŒh=h‹hU#sage_notebook/worksheets/_/cells/15qhU h‰h#K h$h%h&‰h'‰ub(hoqŽ}q(hU)with localvars(R, ['z','w']):
print RqhU!q‘hhh‰h‰hU hMh‰hUwos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/4")
with localvars(R, ['z','w']):
print Rq’h=URhU"sage_notebook/worksheets/_/cells/4q“hU.
Polynomial Ring in z, w over Rational Field
q”h‰h h"h#Kh$h%h&‰h'‰ub(hoq•}q–(hUk = GF(next_prime(3^100), 'a')q—hU!q˜hhh‰h‰hU hMh‰hUlos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/5")
k = GF(next_prime(3^100), 'a')q™hU"sage_notebook/worksheets/_/cells/5qšhU
q›h‰h h"h#Kh$h%h&‰h'‰ub(hoqœ}q(hUkhU!qžhhh‰h‰hU hMh‰hUOos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/6")
kqŸhU"sage_notebook/worksheets/_/cells/6q hUK
Ring of integers modulo 515377520732011331036461129765621272702107522149
q¡h‰h h"h#Kh$h%h&‰h'‰ub(hoq¢}q£(hUt = GF(next_prime(3^100), 'a')q¤hU!q¥hhh‰h‰hU hMh‰hUlos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/7")
t = GF(next_prime(3^100), 'a')q¦hU"sage_notebook/worksheets/_/cells/7q§hU
q¨h‰h h"h#Kh$h%h&‰h'‰ub(hoq©}qª(hUt is kq«hU!q¬hhh‰h‰hU hMh‰hUTos.chdir("/Volumes/HOME/talks/2006-12-01/sage_notebook/worksheets/_/cells/8")
t is kqhU"sage_notebook/worksheets/_/cells/8q®hU
True
q¯h‰h h"h#Kh$h%h&‰h'‰ub(hoq°}q±(hU hhh‰hU hM hU"sage_notebook/worksheets/_/cells/9q²hU h‰h#K h$h%h'‰ubeU_Worksheet__synchroq³KBU_Worksheet__comp_is_runningq´‰U_Worksheet__dirqµUsage_notebook/worksheets/_q¶U_Worksheet__attachedq·}q¸U_Worksheet__passcodeq¹U
11G3BJNEUV/PkqºU_Worksheet__queueq»]q¼U_Worksheet__next_idq½MU_Worksheet__passcryptq¾ˆU_Worksheet__nameq¿U U_Worksheet__saltqÀU1165018376.520535qÁU_Worksheet__notebookqÂhU_Worksheet__next_block_idqÃKCU_Worksheet__idqÄKU_Worksheet__systemqÅNubU _scratch_qÆ(hoqÇ}qÈ(U_Worksheet__filenameqÉU _scratch_qÊU_Worksheet__cellsqË]qÌ(hoqÍ}qÎ(U _Cell__inqÏU U_Cell__worksheetqÐhÇU_Cell__completionsqщU _Cell__idqÒK U
_Cell__dirqÓU*sage_notebook/worksheets/_scratch_/cells/0qÔU
_Cell__outqÕU Uhas_new_outputqÖ‰U_Cell__versionq×K U_Cell__interruptedq؉ubaU_Worksheet__nameqÙU _scratch_qÚU_Worksheet__dirqÛU"sage_notebook/worksheets/_scratch_qÜU_Worksheet__saltqÝU1165017883.911366qÞU_Worksheet__queueqß]qàU_Worksheet__next_idqáKU_Worksheet__passcryptqâˆU_Worksheet__comp_is_runningqã‰U_Worksheet__passcodeqäU
11G3BJNEUV/PkqåU_Worksheet__notebookqæhU_Worksheet__idqçK U_Worksheet__systemqèNubuU_Notebook__historyqé]qê(U0# Worksheet '' (2006-12-01 at 16:13)
sage: 2+2
4qëUH# Worksheet '' (2006-12-01 at 16:13)
sage: R. = PolynomialRing(QQ)
qìUX# Worksheet '' (2006-12-01 at 16:13)
sage: R
Polynomial Ring in x, y over Rational FieldqíU°# Worksheet '' (2006-12-01 at 16:13)
sage: R._assign_names(['z','w'])
Traceback (most recent call last):
...
ValueError: variable names cannot be changed after object creation.qîUƒ# Worksheet '' (2006-12-01 at 16:13)
sage: with localvars(R, ['z','w']):
... print R
Polynomial Ring in z, w over Rational FieldqïUŠ# Worksheet '' (2006-12-01 at 16:15)
sage: k = GF(9)
Traceback (most recent call last):
...
TypeError: you must specify the generator nameqðU:# Worksheet '' (2006-12-01 at 16:15)
sage: k = GF(9, 'a')
qñUJ# Worksheet '' (2006-12-01 at 16:15)
sage: k
Finite Field in a of size 3^2qòU:# Worksheet '' (2006-12-01 at 16:15)
sage: t = GF(9, 'a')
qóU7# Worksheet '' (2006-12-01 at 16:15)
sage: t is k
FalseqôU# Worksheet '' (2006-12-01 at 16:16)
sage: k = GF(9^100, 'a')
Traceback (most recent call last):
...
ZeroDivisionError: Inverse does not exist.qõU# Worksheet '' (2006-12-01 at 16:16)
sage: k = GF(3^100, 'a')
Traceback (most recent call last):
...
ZeroDivisionError: Inverse does not exist.qöUJ# Worksheet '' (2006-12-01 at 16:17)
sage: k = GF(next_prime(3^100), 'a')
q÷Uu# Worksheet '' (2006-12-01 at 16:17)
sage: k
Ring of integers modulo 515377520732011331036461129765621272702107522149qøU:# Worksheet '' (2006-12-01 at 16:17)
sage: t = GF(9, 'a')
qùUJ# Worksheet '' (2006-12-01 at 16:17)
sage: t = GF(next_prime(3^100), 'a')
qúU6# Worksheet '' (2006-12-01 at 16:17)
sage: t is k
TrueqûU;# Worksheet '' (2006-12-01 at 16:18)
sage: f = x^2 + 3*y^3
qüU8# Worksheet '' (2006-12-01 at 16:18)
sage: f
3*y^3 + x^2qýU5# Worksheet '' (2006-12-01 at 16:18)
sage: f(1,5)
376qþU;# Worksheet '' (2006-12-01 at 16:18)
sage: f(1,y)
1 + 3*y^3qÿU;# Worksheet '' (2006-12-01 at 16:18)
sage: f(1,y) in R
Truer Ue# Worksheet '' (2006-12-01 at 16:18)
sage: parent(f(1,y))
Polynomial Ring in x, y over Rational Fieldr UH# Worksheet '' (2006-12-01 at 16:18)
sage: R. = PolynomialRing(ZZ)
r U;# Worksheet '' (2006-12-01 at 16:19)
sage: f = x^2 + 3*y^3
r U8# Worksheet '' (2006-12-01 at 16:19)
sage: f
3*y^3 + x^2r U?# Worksheet '' (2006-12-01 at 16:19)
sage: a = GF(9,'a').gen()
r U3# Worksheet '' (2006-12-01 at 16:19)
sage: f(1,a)
1r U3# Worksheet '' (2006-12-01 at 16:19)
sage: f(2,a)
1r U7# Worksheet '' (2006-12-01 at 16:19)
sage: f(a,1)
a + 1r UH# Worksheet '' (2006-12-01 at 16:19)
sage: R. = PolynomialRing(QQ)
r UX# Worksheet '' (2006-12-01 at 16:19)
sage: R
Polynomial Ring in x, y over Rational Fieldr
U;# Worksheet '' (2006-12-01 at 16:19)
sage: f = x^2 + 3*y^3
r U8# Worksheet '' (2006-12-01 at 16:19)
sage: f
3*y^3 + x^2r Ue# Worksheet '' (2006-12-01 at 16:19)
sage: parent(f(1,y))
Polynomial Ring in x, y over Rational Fieldr
U?# Worksheet '' (2006-12-01 at 16:19)
sage: a = GF(9,'a').gen()
r U¿# Worksheet '' (2006-12-01 at 16:19)
sage: f(a,1)
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for '*': 'Rational Field' and 'Finite Field in a of size 3^2'r UŽ# Worksheet '' (2006-12-01 at 16:20)
sage: f.base_extend(ZZ)(a,1)
Traceback (most recent call last):
...
TypeError: base extension not definedr U¿# Worksheet '' (2006-12-01 at 16:20)
sage: f(a,1)
Traceback (most recent call last):
...
TypeError: unsupported operand parent(s) for '*': 'Rational Field' and 'Finite Field in a of size 3^2'r U8# Worksheet '' (2006-12-01 at 16:22)
sage: import numpy
r U°# Worksheet '' (2006-12-01 at 16:33)
sage: n = 22
sage: L = [n*random() for i in range(n*n)]
sage: M2 = Matrix(RR, n, n, L)
sage: MP2 = matrix_plot(M2, cmap='hsv')
r U5# Worksheet '' (2006-12-01 at 16:33)
sage: show(MP2)
r Ug# Worksheet '' (2006-12-01 at 17:15)
sage: m = matrix([[1/3,2+x],[3,4]]); m
[ 1/3 2 + x]
[ 3 4]r UD# Worksheet '' (2006-12-01 at 17:16)
sage: m = matrix(3, range(9));
r U\# Worksheet '' (2006-12-01 at 17:16)
sage: m = matrix(3, range(9));m
[0 1 2]
[3 4 5]
[6 7 8]r Up# Worksheet '' (2006-12-01 at 17:16)
sage: parent(m)
Full MatrixSpace of 3 by 3 dense matrices over Integer Ringr eU_Notebook__defaultsr }r (Ucell_output_colorr U#0000EEr Umax_history_lengthr MôUcell_input_colorr U#0000000r Uword_wrap_colsr KPuU_Notebook__worksheet_dirr! Usage_notebook/worksheetsr" U_Notebook__history_countr# K U_Notebook__log_serverr$ ‰U_Notebook__filenamer% Usage_notebook/nb.sobjr& U_Notebook__default_worksheetr' hÇU_Notebook__server_logr( ]r) U_Notebook__next_worksheet_idr* KU_Notebook__kill_idler+ K U_Notebook__systemr, NU_Notebook__show_debugr- ‰U_Notebook__dirr. U
sage_notebookr/ U_Notebook__authr0 U:U_Notebook__colorr1 NU_Notebook__object_dirr2 Usage_notebook/objectsr3 U_default_filenamer4 U4/Volumes/HOME/talks/2006-12-01/sage_notebook/nb.sobjr5 ub.