# HG changeset patch
# User Rob Beezer <beezer@ups.edu>
# Date 1301203798 25200
# Node ID 5d01988f9583105f427d87ad1883dfea3a77135a
# Parent e1e4e5f6b5a93486408ce74e6d7339c2237e5740
10791: doctest edits for GramSchmidt routines
diff r e1e4e5f6b5a9 r 5d01988f9583 sage/matrix/matrix2.pyx
a

b


6361  6361  to arrive at an orthonormal set, it must be possible to construct 
6362  6362  square roots of the elements of the base field. In Sage, your 
6363  6363  best option is the field of algebraic numbers, ``QQbar``, which 
6364   properly contain the rationals and number fields. 
 6364  properly contains the rationals and number fields. 
6365  6365  
6366  6366  If you have an approximate numerical matrix, then this routine 
6367  6367  requires that your base field be the real and complex 
… 
… 

6441  6441  
6442  6442  To scale a vector to unit length requires taking 
6443  6443  a square root, which often takes us outside the base ring. 
6444   For the integers, and rationals the field of algebraic numbers, 
6445   ``QQbar``, is big enough to contain what we need, but the price 
 6444  For the integers and the rationals, the field of algebraic numbers 
 6445  (``QQbar``) is big enough to contain what we need, but the price 
6446  6446  is that the computations are very slow, hence mostly of value 
6447  6447  for small cases or instruction. Now we need to use the 
6448  6448  ``orthonormal`` keyword. :: 
diff r e1e4e5f6b5a9 r 5d01988f9583 sage/modules/misc.py
a

b


64  64  sage: from sage.modules.misc import gram_schmidt 
65  65  sage: V = [vector(ZZ,[1,1]), vector(ZZ,[2,2]), vector(ZZ,[1,2])] 
66  66  sage: gram_schmidt(V) 
 67  Traceback (most recent call last): 
 68  ... 
 69  ValueError: linearly dependent input for module version of GramSchmidt 
67  70  """ 
68  71  import sage.modules.free_module_element 
69  72  if len(B) == 0 or len(B[0]) == 0: 