# HG changeset patch
# User Rob Beezer <beezer@ups.edu>
# Date 1336191978 25200
# Node ID 491a1560bddfe1f9a3144210bbb87cc1e0539f6f
# Parent b4e3a4f911ce0905a5e200d9228419fd8095fc5a
11608: RDF/CDF eigenvalues, symmetric matrices, multiplicities, updated
diff git a/sage/matrix/matrix_double_dense.pyx b/sage/matrix/matrix_double_dense.pyx
a

b


1463  1463  with doubleprecision floating point entries. 
1464  1464  Uses the :meth:`~scipy.linalg.eigvals` method from SciPy. 
1465  1465  
1466    ``'symmetric'``  checks that any complex matrix 
1467   (i.e. with entries from :class:`~sage.rings.complex_double.CDF`) 
1468   can be coerced into a real matrix (i.e. with entries from 
1469   :class:`~sage.rings.real_double.RDF`), then applies the 
1470   algorithm for Hermitian matrices. This algorithm can 
1471   be significantly faster than the ``'default'`` algorithm. 
 1466   ``'symmetric'``  converts the matrix into a real matrix 
 1467  (i.e. with entries from :class:`~sage.rings.real_double.RDF`), 
 1468  then applies the algorithm for Hermitian matrices. This 
 1469  algorithm can be significantly faster than the 
 1470  ``'default'`` algorithm. 
1472  1471  
1473  1472   ``'hermitian'``  uses the :meth:`~scipy.linalg.eigh` method 
1474   from SciPy, which applies only to Hermitian matrices. Since 
1475   Hermitian is defined as a matrix equaling its conjugatetranspose, 
1476   for a matrix with real entries this property is equivalent to 
1477   being symmetric. This algorithm can be significantly faster 
1478   than the ``'default'`` algorithm. 
 1473  from SciPy, which applies only to real symmetric or complex 
 1474  Hermitian matrices. Since Hermitian is defined as a matrix 
 1475  equaling its conjugatetranspose, for a matrix with real 
 1476  entries this property is equivalent to being symmetric. 
 1477  This algorithm can be significantly faster than the 
 1478  ``'default'`` algorithm. 
1479  1479  
1480  1480   ``'tol'``  default: ``None``  if set to a value other than 
1481  1481  ``None`` this is interpreted as a small real number used to aid in 
1482  1482  grouping eigenvalues that are numerically similar. See the output 
1483  1483  description for more information. 
1484  1484  
1485   .. warning:: 
1486   
1487   When using the ``'symmetric'`` or ``'hermitian'`` algorithms, 
1488   no check is made on the input matrix, and only the entries below, 
1489   and on, the main diagonal are employed in the computation. 
 1485  .. WARNING:: 
 1486  
 1487  When using the ``'symmetric'`` or ``'hermitian'`` algorithms, 
 1488  no check is made on the input matrix, and only the entries below, 
 1489  and on, the main diagonal are employed in the computation. 
 1490  
 1491  Methods such as :meth:`is_symmetric` and :meth:`is_hermitian` 
 1492  could be used to verify this beforehand. 
1490  1493  
1491  1494  OUTPUT: 
1492  1495  
… 
… 

1508  1511  interval containing similar eigenvalues could be as large as sum 
1509  1512  of the reciprocals of the first $n$ integers times ``tol``. 
1510  1513  
1511   .. warning:: 
1512   
1513   Use caution when using the ``tol`` parameter to group eigenvalues. 
1514   See the examples below to see how this can go wrong. 
 1514  .. WARNING:: 
 1515  
 1516  Use caution when using the ``tol`` parameter to group 
 1517  eigenvalues. See the examples below to see how this can go wrong. 
1515  1518  
1516  1519  EXAMPLES:: 
1517  1520  
… 
… 

1567  1570  sage: A.eigenvalues(algorithm='symmetric', tol=1.0e5) 
1568  1571  [(2.0, 4), (1.0, 5), (3.0, 1)] 
1569  1572  
1570   sage: A.eigenvalues(algorithm='symmetric', tol=1.0e20) 
1571   [(2.0, 1), (2.0, 2), (2.0, 1), (1.0, 1), (1.0, 1), (1.0, 1), (1.0, 1), (1.0, 1), (3.0, 1)] 
1572   
1573  1573  sage: A.eigenvalues(algorithm='symmetric', tol=2.5) 
1574  1574  [(2.0, 4), (1.33333333333, 6)] 
1575  1575  