<?xml version="1.0" encoding="iso-8859-1" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" 
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" > 
<?xml-stylesheet type="text/css" href="fcla-xml-1.35.css"?> 
<html  
xmlns="http://www.w3.org/1999/xhtml"  
><head><title>Section SAGE  SAGE: Open Source Mathematics Software</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> 
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> 
<!-- xhtml,mozilla,3,html --> 
<meta name="src" content="fcla-xml-1.35.tex" /> 
<meta name="date" content="2008-04-16 22:20:00" /> 
<link rel="stylesheet" type="text/css" href="fcla-xml-1.35.css" /> 
</head><body 
>
   <!--l. 59--><div class="crosslinks"><p class="noindent">[<a 
href="fcla-xml-1.35li66.xml" >prev</a>] [<a 
href="fcla-xml-1.35li66.xml#tailfcla-xml-1.35li66.xml" >prev-tail</a>] [<a 
href="#tailfcla-xml-1.35li67.xml">tail</a>] [<a 
href="fcla-xml-1.35li63.xml#fcla-xml-1.35li67.xml" >up</a>] </p></div>
   <h3 class="likesectionHead"><a 
 id="x68-342000"></a>Section SAGE&#x00A0;&#x00A0;SAGE: Open Source Mathematics Software</h3>
<!--l. 59--><p class="noindent" ><a 
 id="section.SAGE"></a> From <a 
href="http://linear.ups.edu/" ><span 
class="cmti-12">A First Course in Linear Algebra</span></a>
<br class="newline" />Version 1.35
<br class="newline" /><span 
class="cmsy-10x-x-120">&#x00A9;</span>&#x00A0;2004.
<br class="newline" />Licensed under the <a 
href="http://www.gnu.org/licenses/fdl.html" >GNU Free Documentation License</a>.
<br class="newline" /><a 
href="http://linear.ups.edu/" class="url" ><span 
class="cmtt-12">http://linear.ups.edu/</span></a>
<br class="newline" />
<br class="newline" /><a 
 id="x68-342000doc"></a> <a 
 id="dx68-342001"></a>
</p>
   <h4 class="likesubsectionHead"><a 
 id="x68-343000"></a>Computation Note R.SAGE: Rings</h4>
<!--l. 59--><p class="noindent" ><a 
 id="computation.R.SAGE"></a> <a 
 id="x68-343000doc"></a><a 
 id="dx68-343001"></a> <a 
 id="dx68-343002"></a><a 
 id="dx68-343003"></a> Contributed&#x00A0;by&#x00A0;<a 
href="fcla-xml-1.35li6.xml#CanfieldSteve">Steve&#x00A0;Canfield</a>
<br class="newline" />SAGE uses different rings to denote the type of an object. The rings are as
follows:
<br class="newline" />
                                                                          

                                                                          
</p><!--tex4ht:inline--><!--l. 17--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" ><mtable 
columnalign="left" class="align-star">
                     <mtr><mtd 
columnalign="right" class="align-odd"></mtd>                     <mtd 
class="align-even"><!--mstyle 
class="text"--><mtext  >&#x00A0;ZZ:&#x00A0;The&#x00A0;set&#x00A0;of&#x00A0;integers</mtext><!--/mstyle--><mspace width="2em"/></mtd>                               <mtd 
columnalign="right" class="align-label"></mtd>                     <mtd 
class="align-label">
                     <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                     <mtd 
class="align-even"><!--mstyle 
class="text"--><mtext  >&#x00A0;QQ:&#x00A0;The&#x00A0;set&#x00A0;of&#x00A0;rational&#x00A0;numbers</mtext><!--/mstyle--><mspace width="2em"/></mtd>                     <mtd 
columnalign="right" class="align-label"></mtd>                     <mtd 
class="align-label">
                     <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                     <mtd 
class="align-even"><!--mstyle 
class="text"--><mtext  >&#x00A0;RR:&#x00A0;The&#x00A0;real&#x00A0;numbers</mtext><!--/mstyle--><mspace width="2em"/></mtd>                               <mtd 
columnalign="right" class="align-label"></mtd>                     <mtd 
class="align-label">
                     <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                     <mtd 
class="align-even"><!--mstyle 
class="text"--><mtext  >&#x00A0;CC:&#x00A0;The&#x00A0;complex&#x00A0;numbers</mtext><!--/mstyle--><mspace width="2em"/></mtd>                           <mtd 
columnalign="right" class="align-label"></mtd>                     <mtd 
class="align-label">
                     <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                     <mtd 
class="align-even"><mspace width="2em"/></mtd>                                                      <mtd 
columnalign="right" class="align-label">
   </mtd></mtr></mtable></math>
<!--l. 18--><p class="noindent" >Most objects in SAGE will tell you which they are using with the  <span 
class="cmtt-12">base</span><span 
class="cmtt-12">_ring()</span>
command. Keep this in mind, especially when row reducing or factoring. Here&#x2019;s a
quick example of where you might go wrong.
</p><!--tex4ht:inline--><!--l. 28--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" ><mtable 
columnalign="left" class="align-star">
                         <mtr><mtd 
columnalign="right" class="align-odd"></mtd>                         <mtd 
class="align-even"><mi 
>m</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>m</mi><mi 
>a</mi><mi 
>t</mi><mi 
>r</mi><mi 
>i</mi><mi 
>x</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow><mrow ><mo 
class="MathClass-open">[</mo><mrow><mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>2</mn><mo 
class="MathClass-punc">,</mo> <mn>3</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>4</mn><mo 
class="MathClass-punc">,</mo> <mn>7</mn></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                                                         <mtd 
columnalign="right" class="align-label"></mtd>                         <mtd 
class="align-label">
                         <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                         <mtd 
class="align-even"><mi 
>m</mi><mo 
class="MathClass-punc">.</mo><mi 
>b</mi><mi 
>a</mi><mi 
>s</mi><mi 
>e</mi><!--mstyle 
class="text"--><mtext  >&#x00A0;_</mtext><!--/mstyle--><mi 
>r</mi><mi 
>i</mi><mi 
>n</mi><mi 
>g</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                                                                   <mtd 
columnalign="right" class="align-label"></mtd>                         <mtd 
class="align-label">
                         <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                         <mtd 
class="align-even"><mi 
>I</mi><mi 
>n</mi><mi 
>t</mi><mi 
>e</mi><mi 
>g</mi><mi 
>e</mi><mi 
>r</mi><mi 
>R</mi><mi 
>i</mi><mi 
>n</mi><mi 
>g</mi><mspace width="2em"/></mtd>                                                                                      <mtd 
columnalign="right" class="align-label"></mtd>                         <mtd 
class="align-label">
                         <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                         <mtd 
class="align-even"><mi 
>m</mi><mo 
class="MathClass-punc">.</mo><mi 
>e</mi><mi 
>c</mi><mi 
>h</mi><mi 
>e</mi><mi 
>l</mi><mi 
>o</mi><mi 
>n</mi><!--mstyle 
class="text"--><mtext  >&#x00A0;_</mtext><!--/mstyle--><mi 
>f</mi><mi 
>o</mi><mi 
>r</mi><mi 
>m</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                                                               <mtd 
columnalign="right" class="align-label"></mtd>                         <mtd 
class="align-label">
                         <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>                         <mtd 
class="align-even"> <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis"  
equalrows="false" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><mn>2</mn></mtd><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd><mtd 
class="array"  columnalign="center"><mn>1</mn></mtd></mtr>  <!--*\c@MaxMatrixCols c--></mtable>                                                                                              </mrow></mfenced> <mspace width="2em"/></mtd>                         <mtd 
columnalign="right" class="align-label"></mtd>                         <mtd 
class="align-label">
   <mspace width="2em"/></mtd></mtr></mtable></math>
<!--l. 29--><p class="noindent" >As you can clearly see,  <span 
class="cmtt-12">m </span>isn&#x2019;t even in reduced row-echelon form. This is because
<span 
class="cmtt-12">m </span>is defined over the ZZ. You have to create matrices with the correct ring or you
will get this type of odd result. This problem comes up in more places than just
calculating the reduced row-echelon form, so unless you are specifically working
                                                                          

                                                                          
with integers take note.
</p>
   <h4 class="likesubsectionHead"><a 
 id="x68-344000"></a>Computation Note ME.SAGE: Matrix Entry</h4>
<!--l. 59--><p class="noindent" ><a 
 id="computation.ME.SAGE"></a>  <a 
 id="x68-344000doc"></a><a 
 id="dx68-344001"></a> <a 
 id="dx68-344002"></a><a 
 id="dx68-344003"></a>A matrix in <span 
class="cmsl-12">SAGE </span>can be made a few ways. The first is simply
to define the matrix as an array of rows. <span 
class="cmsl-12">SAGE </span>uses brackets
(<!--l. 10--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mfenced separators="" 
open="["  close="" ><mrow></mrow></mfenced></math>&#x00A0;,&#x00A0;<!--l. 10--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mfenced separators="" 
open=""  close="]" ><mrow></mrow></mfenced></math>)
to delimit arrays. So the input </p><table class="equation-star"><tr><td>
<!--l. 11--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
              <mi 
>a</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>m</mi><mi 
>a</mi><mi 
>t</mi><mi 
>r</mi><mi 
>i</mi><mi 
>x</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow><mrow ><mo 
class="MathClass-open">[</mo><mrow><mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mn>2</mn><mo 
class="MathClass-punc">,</mo> <mn>3</mn><mo 
class="MathClass-punc">,</mo> <mn>4</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>5</mn><mo 
class="MathClass-punc">,</mo> <mn>6</mn><mo 
class="MathClass-punc">,</mo> <mn>7</mn><mo 
class="MathClass-punc">,</mo> <mn>8</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>9</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>0</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>2</mn></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">)</mo></mrow>
</math></td></tr></table>
<!--l. 15--><p class="indent" >   would create a <!--l. 15--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mn>3</mn> <mo 
class="MathClass-bin">&#x00D7;</mo> <mn>4</mn></math>
matrix named  <span 
class="cmtt-12">a </span>that is equal to </p><table class="equation-star"><tr><td>
<!--l. 17--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
 <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis"  
equalrows="false" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><mn>1</mn></mtd><mtd 
class="array"  columnalign="center"> <mn>2</mn> </mtd><mtd 
class="array"  columnalign="center"> <mn>3</mn> </mtd><mtd 
class="array"  columnalign="center"> <mn>4</mn> </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><mn>5</mn></mtd><mtd 
class="array"  columnalign="center"> <mn>6</mn> </mtd><mtd 
class="array"  columnalign="center"> <mn>7</mn> </mtd><mtd 
class="array"  columnalign="center"> <mn>8</mn> </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><mn>9</mn></mtd><mtd 
class="array"  columnalign="center"><mn>1</mn><mn>0</mn></mtd><mtd 
class="array"  columnalign="center"><mn>1</mn><mn>1</mn></mtd><mtd 
class="array"  columnalign="center"><mn>1</mn><mn>2</mn></mtd></mtr> <!--*\c@MaxMatrixCols c--></mtable>                                                                                        </mrow></mfenced>
</math></td></tr></table>
<!--l. 27--><p class="indent" >   <span 
class="cmsl-12">SAGE </span>will guess what type of matrix you are working with based on the inputs. If all
the entries are integers, you will get back an integer matrix. If your matrix contains an
                                                                          

                                                                          
entry in the <!--l. 27--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>&#x211D;</mi></mrow><mrow 
></mrow></msup 
></math>
or <!--l. 27--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>&#x2102;</mi></mrow><mrow 
></mrow></msup 
></math>
space, the matrix will be of those types. This can cause problems as integers
cannot become fractions, which is an issue when calculating reduced row-echelon
form. We therefore recommend using the following constructor to make your
matrices: </p><table class="equation-star"><tr><td>
<!--l. 28--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
            <mi 
>a</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>m</mi><mi 
>a</mi><mi 
>t</mi><mi 
>r</mi><mi 
>i</mi><mi 
>x</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow><mi 
>Q</mi><mi 
>Q</mi><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mn>2</mn><mo 
class="MathClass-punc">,</mo> <mn>3</mn><mo 
class="MathClass-punc">,</mo> <mn>4</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>5</mn><mo 
class="MathClass-punc">,</mo> <mn>6</mn><mo 
class="MathClass-punc">,</mo> <mn>7</mn><mo 
class="MathClass-punc">,</mo> <mn>8</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>9</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>0</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>2</mn></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">)</mo></mrow>
</math></td></tr></table>
<!--l. 31--><p class="indent" >   This gives you a matrix over the rational numbers which will be sufficient for
most of the course. If you are dealing with complex numbers you would replace
the QQ with CC.
<br class="newline" />To display a matrix named  <span 
class="cmtt-12">a </span>, type  <span 
class="cmtt-12">a </span>, and the output will be displayed with
rows and columns. If you type  <span 
class="cmtt-12">latex(a) </span>you will get latex code to display
the matrix. Finally, <span 
class="cmsl-12">SAGE </span>will build an identity matrix for you with
</p><table class="equation-star"><tr><td>
<!--l. 34--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                      <mi 
>i</mi><mi 
>m</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>i</mi><mi 
>d</mi><mi 
>e</mi><mi 
>n</mi><mi 
>t</mi><mi 
>i</mi><mi 
>t</mi><mi 
>y</mi><!--mstyle 
class="text"--><mtext  >&#x00A0;_</mtext><!--/mstyle--><mi 
>m</mi><mi 
>a</mi><mi 
>t</mi><mi 
>r</mi><mi 
>i</mi><mi 
>x</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow><mi 
>Q</mi><mi 
>Q</mi><mo 
class="MathClass-punc">,</mo> <mn>3</mn></mrow><mo 
class="MathClass-close">)</mo></mrow>
</math></td></tr></table>
<!--l. 37--><p class="indent" >   which yields </p><table class="equation-star"><tr><td>
                                                                          

                                                                          
<!--l. 38--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
 <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis"  
equalrows="false" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><mn>1</mn></mtd><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd><mtd 
class="array"  columnalign="center"><mn>1</mn></mtd><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd><mtd 
class="array"  columnalign="center"><mn>0</mn></mtd><mtd 
class="array"  columnalign="center"><mn>1</mn></mtd></mtr><!--*\c@MaxMatrixCols c--></mtable>                                                                                              </mrow></mfenced>
</math></td></tr></table>
<!--l. 59--><p class="noindent" >
</p>
   <h4 class="likesubsectionHead"><a 
 id="x68-345000"></a>Computation Note MI.SAGE: Matrix Inverse</h4>
<!--l. 59--><p class="noindent" ><a 
 id="computation.MI.SAGE"></a> <a 
 id="x68-345000doc"></a><a 
 id="dx68-345001"></a> <a 
 id="dx68-345002"></a><a 
 id="dx68-345003"></a>If <!--l. 10--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>a</mi></math>
is a matrix defined in <span 
class="cmsl-12">SAGE</span>, then  <span 
class="cmtt-12">a.inverse() </span>will return the inverse of
<!--l. 10--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>a</mi></math>, should it exist.
In the case where <!--l. 10--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>a</mi></math>
does not have an inverse <span 
class="cmsl-12">SAGE </span>will tell you the matrix must be nonsingular (see
<a 
href="fcla-xml-1.35li33.xml#theorem.NI">Theorem&#x00A0;NI</a>).
</p>
   <h4 class="likesubsectionHead"><a 
 id="x68-346000"></a>Computation Note TM.SAGE: Matrix transpose</h4>
<!--l. 59--><p class="noindent" ><a 
 id="computation.TM.SAGE"></a> <a 
 id="x68-346000doc"></a><a 
 id="dx68-346001"></a> <a 
 id="dx68-346002"></a><a 
 id="dx68-346003"></a>Suppose  <span 
class="cmtt-12">a </span>is the name of a matrix stored in <span 
class="cmsl-12">SAGE</span>. Then  <span 
class="cmtt-12">a.transpose()</span>
will return the transpose of  <span 
class="cmtt-12">a </span>.
</p>
   <h4 class="likesubsectionHead"><a 
 id="x68-347000"></a>Computation Note E.SAGE: Eigenspaces</h4>
<!--l. 59--><p class="noindent" ><a 
 id="computation.E.SAGE"></a> <a 
 id="x68-347000doc"></a><a 
 id="dx68-347001"></a> <a 
 id="dx68-347002"></a><a 
 id="dx68-347003"></a>SAGE can compute eigenspaces and eigenvalues for you. If you have a matrix
named  <span 
class="cmtt-12">a </span>and you type </p><table class="equation-star"><tr><td>
                                                                          

                                                                          
<!--l. 11--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                              <mi 
>a</mi><mo 
class="MathClass-punc">.</mo><mi 
>e</mi><mi 
>i</mi><mi 
>g</mi><mi 
>e</mi><mi 
>n</mi><mi 
>s</mi><mi 
>p</mi><mi 
>a</mi><mi 
>c</mi><mi 
>e</mi><mi 
>s</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow></mrow><mo 
class="MathClass-close">)</mo></mrow>
</math></td></tr></table>
<!--l. 14--><p class="indent" >   you will get a listing of the eigenvalues and the eigenspace for each. Let&#x2019;s do
an example.
</p><!--tex4ht:inline--><!--l. 27--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" ><mtable 
columnalign="left" class="align-star">
            <mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mi 
>m</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>m</mi><mi 
>a</mi><mi 
>t</mi><mi 
>r</mi><mi 
>i</mi><mi 
>x</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow><mi 
>Q</mi><mi 
>Q</mi><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mrow ><mo 
class="MathClass-open">[</mo><mrow><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mn>3</mn><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-bin">&#x2212;</mo><mn>8</mn><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-bin">&#x2212;</mo><mn>4</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>1</mn><mn>2</mn><mo 
class="MathClass-punc">,</mo> <mn>7</mn><mo 
class="MathClass-punc">,</mo> <mn>4</mn></mrow><mo 
class="MathClass-close">]</mo></mrow><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mn>2</mn><mn>4</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mn>6</mn><mo 
class="MathClass-punc">,</mo> <mn>7</mn></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>            <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mi 
>m</mi><mo 
class="MathClass-punc">.</mo><mi 
>e</mi><mi 
>i</mi><mi 
>g</mi><mi 
>e</mi><mi 
>n</mi><mi 
>s</mi><mi 
>p</mi><mi 
>a</mi><mi 
>c</mi><mi 
>e</mi><mi 
>s</mi><mrow ><mo 
class="MathClass-open">(</mo><mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                               <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mrow ><mo 
class="MathClass-open">[</mo><mrow><mspace width="2em"/></mtd>                                                              <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mrow ><mo 
class="MathClass-open">(</mo><mrow><mn>3</mn><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mspace width="2em"/></mtd>                                                           <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mrow ><mo 
class="MathClass-open">(</mo><mrow><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mn>2</mn><mo 
class="MathClass-bin">&#x2215;</mo><mn>3</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mo 
class="MathClass-bin">&#x2215;</mo><mn>3</mn></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                                   <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mo 
class="MathClass-punc">,</mo><mspace width="2em"/></mtd>                                                             <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mrow ><mo 
class="MathClass-open">(</mo><mrow><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mrow ><mo 
class="MathClass-open">[</mo><mrow><mspace width="2em"/></mtd>                                                         <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mrow ><mo 
class="MathClass-open">(</mo><mrow><mn>1</mn><mo 
class="MathClass-punc">,</mo> <mn>0</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn></mrow><mo 
class="MathClass-close">)</mo></mrow><mo 
class="MathClass-punc">,</mo><mspace width="2em"/></mtd>                                                     <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mrow ><mo 
class="MathClass-open">(</mo><mrow><mn>0</mn><mo 
class="MathClass-punc">,</mo> <mn>1</mn><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                                    <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"></mrow><mo 
class="MathClass-close">]</mo></mrow></mrow><mo 
class="MathClass-close">)</mo></mrow><mspace width="2em"/></mtd>                                                             <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"></mrow><mo 
class="MathClass-close">]</mo></mrow><mspace width="2em"/></mtd>                                                              <mtd 
columnalign="right" class="align-label"></mtd>            <mtd 
class="align-label">
            <mspace width="2em"/></mtd></mtr><mtr><mtd 
columnalign="right" class="align-odd"></mtd>            <mtd 
class="align-even"><mspace width="2em"/></mtd>                                                               <mtd 
columnalign="right" class="align-label">
   </mtd></mtr></mtable></math>
                                                                          

                                                                          
<!--l. 28--><p class="noindent" >Whew, that looks like a mess. At the top level, eigenspaces() returns a
dictionary whose keys are the eigenvalues. So in this case we have
eigenvalues 3 and -1. Each eigenvalue has an array after it that forms
the basis of the eigenspace. In our example, there is 1 vector for
<!--l. 28--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BB;</mi> <mo 
class="MathClass-rel">=</mo> <mn>3</mn></math> and 2
vectors for <!--l. 28--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BB;</mi> <mo 
class="MathClass-rel">=</mo> <mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></math>.
Finally, the vectors SAGE spits out may not be the nicest ones to work with. In
particular, we might want to scale the vectors to get rid of fractions.
                                                                          

                                                                          
</p>
   <!--l. 482--><div class="crosslinks"><p class="noindent">[<a 
href="fcla-xml-1.35li66.xml" >prev</a>] [<a 
href="fcla-xml-1.35li66.xml#tailfcla-xml-1.35li66.xml" >prev-tail</a>] [<a 
href="fcla-xml-1.35li67.xml" >front</a>] [<a 
href="fcla-xml-1.35li63.xml#fcla-xml-1.35li67.xml" >up</a>] </p></div>
<!--l. 482--><p class="indent" >   <a 
 id="tailfcla-xml-1.35li67.xml"></a>  </p> 
</body> 
</html> 
