# This file was *autogenerated* from the file sage-slides.sagetex.sage.
from sage.all_cmdline import *   # import sage library
_sage_const_3 = Integer(3); _sage_const_2 = Integer(2); _sage_const_1 = Integer(1); _sage_const_0 = Integer(0); _sage_const_7 = Integer(7); _sage_const_6 = Integer(6); _sage_const_5 = Integer(5); _sage_const_4 = Integer(4); _sage_const_9 = Integer(9); _sage_const_8 = Integer(8); _sage_const_28 = Integer(28); _sage_const_22 = Integer(22); _sage_const_23 = Integer(23); _sage_const_20 = Integer(20); _sage_const_26 = Integer(26); _sage_const_24 = Integer(24); _sage_const_25 = Integer(25); _sage_const_86 = Integer(86); _sage_const_0p2 = RealNumber('0.2'); _sage_const_0p04 = RealNumber('0.04'); _sage_const_3p5 = RealNumber('3.5'); _sage_const_2010 = Integer(2010); _sage_const_13 = Integer(13); _sage_const_12 = Integer(12); _sage_const_11 = Integer(11); _sage_const_10 = Integer(10); _sage_const_17 = Integer(17); _sage_const_16 = Integer(16); _sage_const_15 = Integer(15); _sage_const_14 = Integer(14); _sage_const_30 = Integer(30); _sage_const_19 = Integer(19); _sage_const_18 = Integer(18)## This file (sage-slides.sagetex.sage) was *autogenerated* from sage-slides.tex with sagetex.sty version 2010/10/20 v2.3.
import sagetex
_st_ = sagetex.SageTeXProcessor('sage-slides')
_do_ver_check_ = True
if _do_ver_check_ and sagetex.__version__.find('2010/10/20 v2.3') == -_sage_const_1 :
 import sys
 print '{0}.sage was generated with sagetex.sty version 2010/10/20 v2.3,'.format( sys.argv[_sage_const_0 ].split('.')[_sage_const_0 ])
 print 'but is being processed by sagetex.py version {0}.'.format( ' '.join(sagetex.__version__.strip().strip('[').split()[_sage_const_0 :_sage_const_2 ]))
 print 'SageTeX version mismatch! Exiting.'
 sys.exit(int(_sage_const_1 ))
_st_.blockbegin()
try:
 from sage.graphs.graph_latex import setup_latex_preamble
 setup_latex_preamble()
except:
 _st_.goboom(_sage_const_86 )
_st_.blockend()
try:
 _st_.inline(_sage_const_0 , latex(factor(_sage_const_2010 )))
except:
 _st_.goboom(_sage_const_10 )
try:
 _st_.plot(_sage_const_0 , format='notprovided', _p_=plot(-x**_sage_const_3 +_sage_const_3 *x**_sage_const_2 +_sage_const_7 *x-_sage_const_4 ,(x,-_sage_const_5 ,_sage_const_5 )))
except:
 _st_.goboom(_sage_const_10 )
_st_.blockbegin()
try:
 __tmp__=var("x,y"); f = symbolic_expression(x*sin(y)).function(x,y); grad_f=f.gradient()
except:
 _st_.goboom(_sage_const_16 )
_st_.blockend()
try:
 _st_.inline(_sage_const_1 , latex(f(x,y)))
except:
 _st_.goboom(_sage_const_17 )
try:
 _st_.inline(_sage_const_2 , latex(grad_f(x,y)))
except:
 _st_.goboom(_sage_const_18 )
try:
 _st_.plot(_sage_const_1 , format='notprovided', _p_=plot_vector_field(grad_f, (x,-_sage_const_3 ,_sage_const_3 ), (y,_sage_const_0 ,_sage_const_3 )), frame=True, aspect_ratio=_sage_const_1 )
except:
 _st_.goboom(_sage_const_20 )
_st_.blockbegin()
try:
 m=identity_matrix(QQ,_sage_const_3 )
 m[_sage_const_0 ]=m[_sage_const_0 ]+m[_sage_const_1 ]
 m[_sage_const_1 ]=m[_sage_const_1 ]-m[_sage_const_2 ]
 m[_sage_const_2 ]=m[_sage_const_2 ]-_sage_const_2 *m[_sage_const_1 ]
 m[_sage_const_1 ]=m[_sage_const_1 ]+_sage_const_3 *m[_sage_const_0 ]
 m[_sage_const_0 ]=_sage_const_2 *m[_sage_const_0 ]
except:
 _st_.goboom(_sage_const_23 )
_st_.blockend()
try:
 _st_.inline(_sage_const_3 , latex(m))
except:
 _st_.goboom(_sage_const_24 )
_st_.blockbegin()
try:
 M=random_matrix(QQ,_sage_const_3 ,_sage_const_4 ,algorithm='echelonizable',
     rank=_sage_const_2 , upper_bound=_sage_const_10 )
except:
 _st_.goboom(_sage_const_16 )
_st_.blockend()
try:
 _st_.inline(_sage_const_4 , latex(M))
except:
 _st_.goboom(_sage_const_17 )
try:
 _st_.inline(_sage_const_5 , latex(M.rref()))
except:
 _st_.goboom(_sage_const_18 )
_st_.blockbegin()
try:
    __tmp__=var("x,y"); f = symbolic_expression(_sage_const_2 *x**_sage_const_2 *y+x*sec(y)+e**(-_sage_const_2 *y)).function(x,y)
    resolution = _sage_const_10 
    slope_field=plot_slope_field(-diff(f,x)/diff(f,y), (x,-_sage_const_3 ,_sage_const_3 ),(y,-_sage_const_2 ,_sage_const_3p5 ),
       plot_points=resolution)
    phase=sum([implicit_plot(f(x,y)+i,(x,-_sage_const_3 ,_sage_const_3 ),(y,-_sage_const_2 ,_sage_const_3p5 ),
       plot_points=resolution*_sage_const_20 , cmap='bone') for i in (ellipsis_range(-_sage_const_22 ,Ellipsis,_sage_const_22 ,step=_sage_const_2 ))])
   
except:
 _st_.goboom(_sage_const_8 )
_st_.blockend()
try:
 _st_.plot(_sage_const_2 , format='notprovided', _p_=slope_field+phase, aspect_ratio=_sage_const_1 , figsize=(_sage_const_5 ,_sage_const_5 ))
except:
 _st_.goboom(_sage_const_11 )
try:
 _st_.inline(_sage_const_6 , latex(diff(f(x,y),x)))
except:
 _st_.goboom(_sage_const_19 )
try:
 _st_.inline(_sage_const_7 , latex(diff(f(x,y),y)))
except:
 _st_.goboom(_sage_const_19 )
_st_.blockbegin()
try:
 __tmp__=var("x,y"); f = symbolic_expression(x*sin(y)+y*cos(x)).function(x,y)
except:
 _st_.goboom(_sage_const_14 )
_st_.blockend()
try:
 _st_.plot(_sage_const_3 , format='notprovided', _p_=plot3d(f,(x,-_sage_const_2 ,_sage_const_2 ),(y,-_sage_const_2 ,_sage_const_2 )))
except:
 _st_.goboom(_sage_const_15 )
_st_.blockbegin()
try:
 mathematica('myplot=Plot3D[x^2-y^2,{x,-1,1},{y,-1,1}]')
 mathematica('Export["%s/graphicsfile.pdf", myplot]' % os.getcwd())
except:
 _st_.goboom(_sage_const_16 )
_st_.blockend()
_st_.blockbegin()
try:
   G=graphs.PetersenGraph()
   P=G.coloring()
except:
 _st_.goboom(_sage_const_16 )
_st_.blockend()
try:
 _st_.inline(_sage_const_8 , latex(G.chromatic_number()))
except:
 _st_.goboom(_sage_const_20 )
try:
 _st_.plot(_sage_const_4 , format='notprovided', _p_=G.plot(partition=P))
except:
 _st_.goboom(_sage_const_22 )
_st_.blockbegin()
try:
     g = graphs.PetersenGraph()
     g.set_latex_options(tkz_style = 'Shade')
   
except:
 _st_.goboom(_sage_const_13 )
_st_.blockend()
try:
 _st_.inline(_sage_const_9 , latex(g))
except:
 _st_.goboom(_sage_const_14 )
_st_.blockbegin()
try:
 H=graphs.HeawoodGraph()
 H.set_latex_options(
  graphic_size=(_sage_const_4 ,_sage_const_4 ),
  vertex_size=_sage_const_0p2 ,
  edge_thickness=_sage_const_0p04 ,
  edge_color='green',
  vertex_color='green',
  vertex_label_color='red')
except:
 _st_.goboom(_sage_const_28 )
_st_.blockend()
try:
 _st_.inline(_sage_const_10 , latex(H))
except:
 _st_.goboom(_sage_const_30 )
_st_.blockbegin()
try:
 G=CyclicPermutationGroup(_sage_const_4 )
 C=G.cayley_graph(generators=[G((_sage_const_1 ,_sage_const_2 ,_sage_const_3 ,_sage_const_4 )), G((_sage_const_1 ,_sage_const_4 ,_sage_const_3 ,_sage_const_2 ))])
 C.set_pos(C.layout_circular())
 C.set_latex_options(graphic_size=(_sage_const_8 ,_sage_const_6 ),vertex_shape="rectangle",
 edge_labels=True)
except:
 _st_.goboom(_sage_const_8 )
_st_.blockend()
try:
 _st_.inline(_sage_const_11 , latex(C))
except:
 _st_.goboom(_sage_const_10 )
_st_.blockbegin()
try:
 var('x,y,n')
 funcs=[x**_sage_const_2 , x**n, sin(x),cos(x)]
 table=r"\begin{table}  \centering  \begin{tabular}{cc}"
 table+=r"$f(x)$ & $f'(x)$ \\\hline"
 for f in funcs:
     table+=r"$%s$ & $%s$ \\"%(latex(f), latex(diff(f,x)))
 table+=r"\end{tabular}\end{table}"
except:
 _st_.goboom(_sage_const_25 )
_st_.blockend()
try:
 _st_.inline(_sage_const_12 , table)
except:
 _st_.goboom(_sage_const_26 )
_st_.endofdoc()
