--- a/sage-3.1.1/devel/doc-main/tut/tut.tex 2008-08-30 20:52:45.000000000 +1000 +++ b/sage-3.1.1/devel/doc-main/tut/tut.tex 2008-08-30 20:46:40.000000000 +1000 @@ -183,14 +183,14 @@ \end{itemize}%two are needed for some weird reason
-\section{Longterm Goals for \SAGE} +\section{Long-Term Goals for \SAGE} \index{goals for SAGE} \begin{itemize} \item \textbf{Useful}: \SAGE's intended audience is mathematics students (from high school to graduate -school), teachers, and research mathematics. The aim +school), teachers, and research mathematicians. The aim is to provide software that can be used to explore and experiment with mathematical constructions in algebra, geometry, number theory, calculus, numerical computation, etc. @@ -657,7 +657,7 @@ help to simplify and organize your \sage programs. Below, we define a class that represents the list of even positive integers up -to \emph{n}; it derives from the builtin type \code{list}. +to \emph{n}; it derives from the built-in type \code{list}. \begin{verbatim} sage: class Evens(list): ... def __init__(self, n): @@ -1019,7 +1019,7 @@ Numerically approximate \emph{z}(\emph{t}) at \emph{t}=1 using 4 steps of Euler's method, where $z''+tz'+z=0$, $z(0)=1$, $z'(0)=0$. -One must reduce the 2nd order ODE down to a system of two +We must reduce the 2nd order ODE down to a system of two first order DEs (using $x=z$, $y=z'$) and apply Euler's method: %skip -- no way to doctest attach commands since can't be converted to python code. \begin{verbatim} @@ -1344,7 +1344,7 @@ \end{verbatim}%link There is one subtlety in defining complex numbers: as mentioned above, -the symbol \code{i} represents a square root of \minusone, but it is a +the symbol \code{i} represents the square root of \minusone, but it is a \emph{formal} square root of \minusone; it is not in the complex numbers. Calling \code{CC(i)} returns the complex square root of \minusone. %link @@ -1394,7 +1394,7 @@ \end{verbatim}%link This creates a polynomial ring and tells \SAGE to use (the string) `t' -as the indeterminate when printing to the screen; however, this does +as the indeterminate when printing to the screen. However, this does not define the symbol \code{t} for use in \sage, so you cannot use it to enter a polynomial (such as \latexhtml{$t^2+1$}{\emph{t}\begin{rawhtml}<sup>2</sup>\end{rawhtml}+1}) @@ -1552,7 +1552,7 @@ \end{verbatim} \SAGE also has support for power series and Laurent series rings over -any base ring. In the following example we create an element of +any base ring. In the following example, we create an element of \latexhtml{$\F_7[[T]]$}{\textbf{F}\begin{rawhtml}<sub>7</sub>\end{rawhtml}[[\emph{T}]]} and divide to create an element of \latexhtml{$\F_7((T))$}{\textbf{F}\begin{rawhtml}<sub>7</sub>\end{rawhtml}((\emph{T}))}. @@ -2109,12 +2109,12 @@ [(1, 1, 1, 1), (1, 1, 2), (2, 2), (1, 3), (4,)] \end{verbatim} -\subsection{\latexhtml{$p$}{\emph{p}}-adic numbers} +\subsection{\latexhtml{$p$}{\emph{p}}-adic Numbers} \index{p-adic numbers} The field of \latexhtml{$p$}{\emph{p}}-adic numbers is implemented in \sage. Note that once a \latexhtml{$p$}{\emph{p}}-adic field is -created, you can not change its precision. +created, you cannot change its precision. \begin{verbatim} sage: K = Qp(11); K @@ -2739,12 +2739,12 @@ \chapter{The Interactive Shell}\label{ch:shell} \index{interactive shell, using SAGE in} \index{command line, using SAGE in} -In most of this tutorial we assume you start the \SAGE interpreter +In most of this tutorial, we assume you start the \SAGE interpreter using the \code{sage} command. This starts a customized version of the IPython shell, and imports many functions and classes, so they are ready to use from the command prompt. Further customization is possible by editing the \code{SAGE_ROOT/ipythonrc} file. Upon -starting \SAGE you get output similar to the following: +starting \SAGE, you get output similar to the following: %skip \begin{verbatim} @@ -2757,7 +2757,7 @@ sage: \end{verbatim} \index{quitting}\index{exitting} -To quit \SAGE either press Ctrl-D or type \code{quit} or \code{exit}. +To quit \SAGE, either press Ctrl-D or type \code{quit} or \code{exit}. %skip \begin{verbatim} sage: quit @@ -2772,13 +2772,13 @@ Maple processes, or cleanup temporary files from \code{\$HOME/.sage/tmp}.} -\section{Your \SAGE session} +\section{Your \SAGE Session} \index{session!SAGE} \index{session|boldidx} The {\it session} is the sequence of input and output from when you start \SAGE until you quit. -\SAGE logs all \SAGE input, via IPython. In fact if you're using the +\SAGE logs all \SAGE input, via IPython. In fact, if you're using the interactive shell (not the notebook interface), then at any point you may type \code{\%hist} to get a listing of all input lines typed so far. @@ -2987,7 +2987,7 @@ This means that 0.66 seconds total were taken, and the ``Wall time'', i.e., the amount of time that elapsed on your wall clock, is also 0.66 seconds. If your computer is heavily loaded -with other programs the wall time may be much larger than +with other programs, the wall time may be much larger than the CPU time. Next we time exponentiation using the native \SAGE Integer type, @@ -3114,7 +3114,7 @@ The interactive debugger is sometimes useful for understanding what -went wrong. You can toggle it being on or off using +went wrong. You can toggle it on or off using \code{\%pdb} (the default is off). The prompt \code{ipdb>} appears if an exception is raised and the debugger is on. From within the debugger, you can print the state of @@ -3132,7 +3132,7 @@ ipdb> \end{verbatim} -For a list of commands in the debugger type \code{?} at +For a list of commands in the debugger, type \code{?} at the \code{ipdb>} prompt: %skip @@ -3338,7 +3338,7 @@ particularly helpful to type \code{help(module_name)}. For example, vector spaces are defined in \code{sage.modules.free_module}, so type \code{help(sage.modules.free_module)} for documentation about that -whole module. When viewing documentation using help you can search by +whole module. When viewing documentation using help, you can search by typing \code{/} and in reverse by typing \code{?}. \index{documentation, viewing inline} @@ -3370,7 +3370,7 @@ Almost all \sage objects x can be saved in compressed form to disk using \code{save(x, filename)} (or in many cases -\code{x.save(filename)}). To load the object back in use +\code{x.save(filename)}). To load the object back in, use \code{load(filename)}. %skip \begin{verbatim} @@ -3414,7 +3414,7 @@ sage: v = E.anlist(100000) # instant! \end{verbatim} -\note{In Python saving and loading is accomplished using +\note{In Python, saving and loading is accomplished using the \module{cPickle} module. In particular, a \sage object x can be saved via \code{cPickle.dumps(x, 2)}. Note the $2$!} \index{cPickle} @@ -3449,7 +3449,8 @@ architectures or operating systems, e.g., you could save a huge matrix on 32-bit OS X and reload it on 64-bit Linux, find the echelon form, then move it back. Also, in many cases you can even load objects into -version of \sage that are different than they were saved in, as long +versions of \sage that are different from the versions they were saved +in, as long as the code for that object isn't too different. All the attributes of the objects are saved, along with the class (but not source code) that defines the object. If that class no longer exists in a new @@ -3458,7 +3459,7 @@ dictionary (with \code{x.__dict__}), and save the dictionary, and load that into the newer version. -\subsection{Saving as text} +\subsection{Saving as Text} You can also save the ASCII text representation of objects to a plain text file by simply opening a file in write mode and writing the string representation @@ -3590,7 +3591,7 @@ or \sage, or whatever, that human-readable file contains everything needed to reconstruct your worksheet. -From within \sage type \code{notebook?} for much +From within \sage, type \code{notebook?} for much more about how to start a notebook server. The following diagram illustrates the architecture of the \SAGE Notebook: @@ -3663,7 +3664,7 @@ sage: pari('znprimroot(10007)') Mod(5, 10007) \end{verbatim} -In the first case a separate copy of the GP interpreter is +In the first case, a separate copy of the GP interpreter is started as a server, and the string \code{'znprimroot(10007)'} is sent to it, evaluated by GP, and the result is assigned to a variable in GP (which takes up space in the child GP @@ -3684,8 +3685,8 @@ can do absolutely anything you could do in the usual GP/PARI command line program, since it {\em is} running that program. In particular, you can load complicated PARI programs and run them. -In contrast, the PARI interface (via the C library) is much more restrictive; -first not all member functions have been implemented. Second, a lot of code, +In contrast, the PARI interface (via the C library) is much more restrictive. +First, not all member functions have been implemented. Second, a lot of code, e.g., involving numerical integration, won't work via the PARI interface. That said, the PARI interface can be significantly faster and more robust than the GP one. @@ -3962,7 +3963,7 @@ \chapter{Programming} -\section{Loading and Attaching \SAGE files}\label{sec:loadattach} +\section{Loading and Attaching \SAGE Files}\label{sec:loadattach} \index{attach into SAGE} \index{load into SAGE} @@ -4151,7 +4152,7 @@ print factor(sage_eval(sys.argv[1])) \end{verbatim} -In order to use this script your \code{SAGE_ROOT} must +In order to use this script, your \code{SAGE_ROOT} must be in your PATH. If the above script is called \code{factor}, here is an example usage: %skip @@ -4184,7 +4185,7 @@ <type 'float'> \end{verbatim} -To this \sage adds many other types. E.g., vector spaces: +To this \sage adds many other types. For example, vector spaces: \begin{verbatim} sage: V = VectorSpace(QQ, 1000000); V Vector space of dimension 1000000 over Rational Field @@ -4212,7 +4213,7 @@ -1.46035450880959 \end{verbatim} -In some very common cases the usual functional notation is also supported for +In some very common cases, the usual functional notation is also supported for convenience and because mathematical expressions might look confusing using object-oriented notation. Here are some examples. \begin{verbatim} @@ -4246,7 +4247,7 @@ \code{A.}, then type the \code{[tab]} key on your keyboard, as explained in Section~\ref{sec:tabcompletion}. -\section{Lists, Tuples, and Sequence} +\section{Lists, Tuples, and Sequences} \index{list!creating a} The list data type stores elements of arbitrary type. Like in C, C++, @@ -4627,9 +4628,9 @@ \end{verbatim} When comparing objects of different types in \SAGE, in most cases \SAGE tries to find a canonical coercion of both objects to a common -parent, and if successful the comparison is performed between the -coerced objects; if not successful the objects are considered not -equal. For testing whether two variables reference the same object +parent. If successful, the comparison is performed between the +coerced objects; if not successful, the objects are considered not +equal. For testing whether two variables reference the same object, use \code{is}. For example: \begin{verbatim} sage: 1 is 2/2 @@ -4639,7 +4640,7 @@ sage: 1 == 2/2 True \end{verbatim} -In the following two lines the first equality is \code{False} because +In the following two lines, the first equality is \code{False} because there is no {\em canonical} morphism $\Q\to \F_5$, hence no canonical way to compare the $1$ in $\F_5$ to the $1 \in \Q$. In contrast, there is a canonical map $\Z \to \F_5$, hence the second comparison is \code{True}. @@ -4814,7 +4815,7 @@ from invocation until exit), \code{percall} is the quotient of \code{cumtime} divided by primitive calls, and \code{filename:lineno(function)} provides the respective data of each function. The rule of thumb here is: The -higher the function in that listing the more expensive it is. Thus it +higher the function in that listing, the more expensive it is. Thus it is more interesting for optimization. As usual, \code{prun?} provides details on how to use the profiler and @@ -4834,7 +4835,7 @@ because prun is an IPython shell command, not a regular function. %Strip this, as it is not SAGE self contained? -For a nice graphical representation of profiling data you can use the +For a nice graphical representation of profiling data, you can use the hotshot profiler, a small script called \code{hotshot2cachetree} and the program \code{kcachegrind} (Unix only). The same example with the hotshot profiler: @@ -4857,7 +4858,7 @@ directory. It can now be converted to the cachegrind format for visualization. -On a system shell type +On a system shell, type %skip \begin{verbatim} hotshot2calltree -o cachegrind.out.42 pythongrind.prof @@ -4906,7 +4907,7 @@ to your current username. \item Run \code{d = dsage.start_all()}. This command will launch the server, the web server, $2$ workers and return an object (\code{d}) which - is a connection to the server. From here on your interaction with + is a connection to the server. From here on, your interaction with \code{dsage} will be mainly though the \code{d} object. \item Open up your browser and go to \url{http://localhost:8082} to see the web interface of \code{dsage}. From here you will be able to see the @@ -4926,7 +4927,7 @@ \subsection{Example 2} -In this example we will show you how to use the \code{DistributedFactor} +In this example, we will show you how to use the \code{DistributedFactor} class that comes built-in with \code{dsage}. DistributedFactor attempts to factor numbers by using a combination of the ECM and the QSieve algorithm, as well as trial factorization for small factors. @@ -4968,7 +4969,7 @@ \section{Why Python?} \index{Python and SAGE} -\subsection{Advantages to Python} +\subsection{Advantages of Python} The primary implementation language of \SAGE is Python (see \cite{Py}), though code that must be fast is implemented in a compiled language. @@ -5111,7 +5112,7 @@ be imported into \SAGE. \note{To install a Python library, for example that you have found on -the internet, follow the directions, but run \code{sage -python} +the Internet, follow the directions, but run \code{sage -python} instead of \code{python}. Very often this means typing \code{sage -python setup.py install}.} @@ -5121,10 +5122,10 @@ appreciated! It can range from substantial code contributions to adding to the \SAGE documentation to reporting bugs. -Browse the \SAGE web page for information for developers; among other +Browse the \SAGE web page for information for developers. Among other things, you can find a long list of \SAGE-related projects ordered by priority and category. The ``\SAGE Programming Guide'' has helpful -information, as well, and you can also check out the \code{sage-devel} +information as well, and you can also check out the \code{sage-devel} Google group. @@ -5167,7 +5168,7 @@ What is \verb|3^2*4 + 2%5|? The value (38) is determined by this ``operator precedence table''. The table below is based on the table in \S 5.14 of the \emph{Python Language Reference Manual} by G. Rossum -and F. Drake; the operations are listed here in increasing order of +and F. Drake. The operations are listed here in increasing order of precedence. \begin{center} -- Regards Minh Van Nguyen Web: http://nguyenminh2.googlepages.com Blog: http://mvngu.wordpress.com --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---