Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Trac #12595: eigenmatrix_left of complex floating point matrix
Browse files Browse the repository at this point in the history
add doctest to demonstrate that the trac issue has already been resolved.
  • Loading branch information
shashwat1002 committed Feb 13, 2022
1 parent 226937d commit c7e4e78
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/sage/matrix/matrix2.pyx
Expand Up @@ -6936,6 +6936,21 @@ cdef class Matrix(Matrix1):
Traceback (most recent call last):
...
RuntimeError: failed to compute eigenvectors for eigenvalue ..., check eigenvectors_left() for partial results

The following example shows that :trac:`12595` has been resolved::

sage: m = Matrix(CDF, 8, [[-1, -1, -1, -1, 1, -3, -1, -1],
....: [1, 1, 1, 1, -1, -1, 1, -3],
....: [-1, 3, -1, -1, 1, 1, -1, -1],
....: [-1, -1, -1, 3, 1, 1, -1, -1],
....: [1, 1, -3, 1, -1, -1, 1, 1],
....: [1, 1, 1, 1, -1, -1, -3, 1],
....: [3, -1, -1, -1, 1, 1, -1, -1],
....: [1, 1, 1, 1, 3, -1, 1, 1]])
sage: d, p = m.eigenmatrix_left()
sage: mm = p.inverse() * d * p # This should be equal to m up to numerical noise
sage: norm(mm - m) < 1e-12
True
"""
from sage.misc.flatten import flatten
from sage.matrix.constructor import diagonal_matrix, matrix
Expand Down

0 comments on commit c7e4e78

Please sign in to comment.