# Ticket #11027: trac_11027-schur-decomposition-doctest-v2.patch

File trac_11027-schur-decomposition-doctest-v2.patch, 1.9 KB (added by Rob Beezer, 11 years ago)
• ## sage/matrix/matrix_double_dense.pyx

```# HG changeset patch
# User Rob Beezer <beezer@ups.edu>
# Date 1302714179 25200
# Node ID 9bfd8f9a2ee3f61ffbc93ee4aa1e60047d97e028
# Parent  72a38a0761cc77f42b35b2383c2976b9a4a598d4
11027: Schur decoposition doctest fix

diff -r 72a38a0761cc -r 9bfd8f9a2ee3 sage/matrix/matrix_double_dense.pyx```
 a [0.0 0.0 0.0 0.0] [0.0 0.0 0.0 0.0] [0.0 0.0 0.0 0.0] sage: eigenvalues = sorted(T[0:2,0:2].eigenvalues() + T[2:4,2:4].eigenvalues()) sage: eigenvalues.reverse(); eigenvalues [-0.789... + 2.336...*I, -0.789... - 2.336...*I, -5.710... + 8.382...*I, -5.710... - 8.382...*I] sage: A.eigenvalues() [-0.789... + 2.336...*I, -0.789... - 2.336...*I, -5.710... + 8.382...*I, -5.710... - 8.382...*I] sage: sorted(T[0:2,0:2].eigenvalues() + T[2:4,2:4].eigenvalues()) [-5.710... - 8.382...*I, -5.710... + 8.382...*I, -0.789... - 2.336...*I, -0.789... + 2.336...*I] sage: sorted(A.eigenvalues()) [-5.710... - 8.382...*I, -5.710... + 8.382...*I, -0.789... - 2.336...*I, -0.789... + 2.336...*I] sage: abs(A.norm()-T.norm()) < 1e-12 True [  0.139 -0.3892 -0.2648  0.8713] [ 0.4361   0.359  0.7599  0.3217] [ -0.836  0.3945  0.1438  0.3533] sage: T = T.zero_at(1.0e-12).change_ring(RDF) sage: T.round(4) [-13.5698      0.0      0.0      0.0] [     0.0  -0.8508     -0.0     -0.0] [     0.0  -0.8508      0.0      0.0] [     0.0      0.0   7.7664      0.0] [     0.0      0.0      0.0  11.6542] sage: (Q*Q.transpose()).zero_at(1.0e-12)