€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__variablesq¾]q¿(UL-listqÀU8M2-sage.matrix.matrix_generic_dense.Matrix_generic_denseqÁUMP2-sage.plot.plot.GraphicsqÂUBR-sage.rings.multi_polynomial_ring.MPolynomialRing_polydict_domainqÃU:a-sage.rings.finite_field_givaro.FiniteField_givaroElementqÄU:f-sage.rings.multi_polynomial_element.MPolynomial_polydictqÅUi-intqÆU4k-sage.rings.integer_mod_ring.IntegerModRing_genericqÇU7m-sage.matrix.matrix_integer_dense.Matrix_integer_denseqÈUn-sage.rings.integer.IntegerqÉUnumpy-moduleqÊU4t-sage.rings.integer_mod_ring.IntegerModRing_genericqËU:x-sage.rings.multi_polynomial_element.MPolynomial_polydictqÌU:y-sage.rings.multi_polynomial_element.MPolynomial_polydictqÍeU_Worksheet__passcryptqΈU_Worksheet__nameqÏU U_Worksheet__saltqÐU1165018376.520535qÑU_Worksheet__notebookqÒhU_Worksheet__next_block_idqÓKCU_Worksheet__idqÔKU_Worksheet__sageqÕh"U_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 Fieldr UŠ# Worksheet '' (2006-12-01 at 16:15)
sage: k = GF(9)
Traceback (most recent call last):
...
TypeError: you must specify the generator namer U:# Worksheet '' (2006-12-01 at 16:15)
sage: k = GF(9, 'a')
r UJ# Worksheet '' (2006-12-01 at 16:15)
sage: k
Finite Field in a of size 3^2r U:# Worksheet '' (2006-12-01 at 16:15)
sage: t = GF(9, 'a')
r U7# Worksheet '' (2006-12-01 at 16:15)
sage: t is k
Falser U# Worksheet '' (2006-12-01 at 16:16)
sage: k = GF(9^100, 'a')
Traceback (most recent call last):
...
ZeroDivisionError: Inverse does not exist.r U# Worksheet '' (2006-12-01 at 16:16)
sage: k = GF(3^100, 'a')
Traceback (most recent call last):
...
ZeroDivisionError: Inverse does not exist.r UJ# Worksheet '' (2006-12-01 at 16:17)
sage: k = GF(next_prime(3^100), 'a')
r Uu# Worksheet '' (2006-12-01 at 16:17)
sage: k
Ring of integers modulo 515377520732011331036461129765621272702107522149r U:# Worksheet '' (2006-12-01 at 16:17)
sage: t = GF(9, 'a')
r
UJ# Worksheet '' (2006-12-01 at 16:17)
sage: t = GF(next_prime(3^100), 'a')
r U6# Worksheet '' (2006-12-01 at 16:17)
sage: t is k
Truer U;# Worksheet '' (2006-12-01 at 16:18)
sage: f = x^2 + 3*y^3
r
U8# Worksheet '' (2006-12-01 at 16:18)
sage: f
3*y^3 + x^2r U5# Worksheet '' (2006-12-01 at 16:18)
sage: f(1,5)
376r U;# Worksheet '' (2006-12-01 at 16:18)
sage: f(1,y)
1 + 3*y^3r 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#0000000r0 Uword_wrap_colsr1 KPuU_Notebook__worksheet_dirr2 Usage_notebook/worksheetsr3 U_Notebook__history_countr4 K U_Notebook__log_serverr5 ‰U_Notebook__filenamer6 Usage_notebook/nb.sobjr7 U_Notebook__default_worksheetr8 hØU_Notebook__server_logr9 ]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__authrA U:U_Notebook__colorrB NU_Notebook__object_dirrC Usage_notebook/objectsrD U_default_filenamerE U4/Volumes/HOME/talks/2006-12-01/sage_notebook/nb.sobjrF ub.