next up previous
Next: Conclusions Up: On computing the eigenvectors Previous: Numerical multiple eigenvalues

Numerical examples

In this section, the proposed method is used to compute the eigenvectors of symmetric irreducible tridiagonal matrices, supposing the eigenvalues have been already computed in a certain way. There are many methods to compute the eigenvalues of a symmetric tridiagonal matrix [11,8]. In the following example we consider the values yielded by the function eig of matlab as the computed eigenvalues. The eigenvectors computed by the proposed method (denoted by eigv$ _p$) are compared with those computed by means of the matlab function eig (denoted by eigv$ _M$).

For each example, the maximum of the residuals,

$\displaystyle \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $

and the orthogonality factors

$\displaystyle \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $

are computed in order to measure the quality of the computed eigenvectors by the proposed method. In the following tables, $ n$ and $ \char93  It$ denote the order of the considered matrices and the average number of iterations of the implicitly shifted $ QR$ method to compute one eigenvector by the proposed algorithm, respectively.

The first four examples can be found in [7]. In the last two examples, the well-known Wilkinson matrices and the glued Wilkinson matrices, for different values of $ n,$ are considered.

Given the eigenvalues $ \lambda_i, \; i=1,\ldots,n, $ an orthogonal matrix $ Q $ of the $ QR$ factorization of a random matrix of order $ n$ generated by the matlab function randn is computed. Thus, the matrix $ T_n^{(0)} $ is obtained applying the Householder reduction into tridiagonal form to the matrix $ Q $   diag$ (\lambda_1, \ldots, \lambda_n) Q^T. $ All the matrices in the examples are computed in this way, unless otherwise specified.

We can see that the eigenvectors computed by the proposed method have a behavior similar to those of the eigenvectors computed by the matlab function eig.

Example 5.1  

For this example, the eigenvalues are

$\displaystyle \lambda_i= \varepsilon +(i-1) \tau,\; \; i=1,\ldots,n, \;\;$   with$\displaystyle \;\;\tau = \frac{ 1-
\varepsilon}{n-1}.$

The eigenvalues are well separated and no clusters are present in the spectrum.

The numerical results are shown in table 1. The averaged number of iterations of the implicitly shifted $ QR$ method is very low and it slightly increases with the size of the considered matrices.

Table 1:
$ \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $ $ \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $
$ n$ $ \char93  It. $ eigv$ _p$ eigv$ _M$ eigv$ _p$ eigv$ _M$
50 2.02 9.3030e-02 1.1019e-01 1.0449e+00 3.3765e-01
100 2.24 6.1713e-02 7.6537e-02 2.3864e+00 2.8038e-01
150 2.57 2.0597e-02 4.3215e-02 2.4162e+00 1.3883e-01
200 2.84 4.5924e-02 6.2735e-02 2.8777e+00 2.1381e-01
250 3.11 1.5222e-02 3.8523e-02 3.2206e+00 1.2914e-01


Example 5.2   The eigenvalues of this example are

$\displaystyle \lambda_i= \pm (\varepsilon +(i-1) \tau),\; \; i=1,\ldots,n,
\;\;$   with$\displaystyle \;\;\tau = \frac{ 1- \varepsilon}{n-1},
$

i.e., the same as the latter one, with the sign chosen randomly. Also in this case no clusters are present in the spectrum. As expected, the results are very similar to those of the previous example, and are depicted in table 2.

Table 2:
$ \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $ $ \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $
$ n$ $ \char93  It. $ eigv$ _p$ eigv$ _M$ eigv$ _p$ eigv$ _M$
50 2.10 9.1943e-02 1.3489e-01 5.9190e-01 8.3252e-02
100 2.38 6.7323e-02 1.0893e-01 6.3694e-01 6.7644e-02
150 2.59 9.7184e-02 1.1285e-01 7.0963e-01 5.9745e-02
200 2.94 2.7929e-02 7.4577e-02 7.1364e-01 4.1609e-02
250 3.22 5.2895e-02 1.1169e-01 7.8419e-01 4.0424e-02


Example 5.3   The eigenvalues of the matrices constructed in this example are

$\displaystyle \lambda_i= i\cdot \varepsilon, \;\; i=1,2, \ldots, n-1, \;\;$   and$\displaystyle \;\; \lambda_n =1.
$

There is a simple eigenvalue $ \lambda_n $ and a cluster of size $ n-1. $ Also in this case the cost of computing the whole set of eigenvectors is $ O(n^2)$ because, after very few iterations, the norm of the whole subdiagonal of the tridiagonal matrices generated by the $ QR$ method is very tiny.

Table 3:
$ \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $ $ \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $
$ n$ $ \char93  It. $ eigv$ _p$ eigv$ _M$ eigv$ _p$ eigv$ _M$
50 1.88 5.1777e-02 2.0000e-02 2.0073e-01 2.7508e-01
100 1.90 4.9323e-02 1.5013e-02 2.8044e-01 1.9137e-01
150 1.94 4.7127e-03 1.7893e-03 3.7348e-01 1.9556e-01
200 1.94 5.1156e-03 2.5195e-03 4.6506e-01 1.9910e-01
250 1.98 5.0025e-03 2.0266e-03 6.8008e-01 1.3937e-01


Example 5.4   In this example the Toeplitz matrices of order $ n$ are considered,

\begin{displaymath}
T_n^{(0)} =
\left(
\begin{array}{ccccc}
2 & 1 & & \\
1 & 2...
...\
& \ddots & \ddots & 1 \\
& & 1 & 2
\end{array}\right).
\end{displaymath}

Its eigenvalues are

$\displaystyle \lambda_i =
4 \sin^2 \frac{i\pi}{2(n+1)}, \;\; i=1,\ldots, n.
$

The results are depicted in table 4.

Table 4:
$ \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $ $ \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $
$ n$ $ \char93  It. $ eigv$ _p$ eigv$ _M$ eigv$ _p$ eigv$ _M$
50 1.92 5.2274e-02 1.0127e-01 5.2206e-01 1.0500e-01
100 1.94 3.0002e-02 5.7680e-02 4.7589e-01 6.0098e-02
150 1.98 2.6499e-02 4.5126e-02 8.4123e-01 4.5312e-02
200 2.01 2.7503e-02 3.9267e-02 7.0283e-01 4.3592e-02
250 2.03 1.8502e-02 3.5513e-02 8.6697e-01 3.2414e-02


Example 5.5   In this example the well-known Wilkinson matrices [11]

\begin{displaymath}T_n^{(0)}\equiv W_{n}^{+} =
\left(
\begin{array}{-at-{}cccccc-at-{}...
...\
& & & 1 & p-1 & 1 \\
& & & & 1 & p
\end{array}\right),
\end{displaymath}

where $ p=\lfloor n/2 \rfloor. $ Although the matrix is irreducible, the largest eigenvalues are ``numerically double''. For instance, if $ n= 41 $ the largest eigenvalues computed by eig of matlab are

$\displaystyle %% \begin{equation}
\lambda_{40} = 2.074619418290334e+01,\;\;\lambda_{41}=2.074619418290336e+01.
$

The proposed algorithm does not suffer from the loss of orthogonality although more iterations are required to compute the eigenvectors corresponding to the ``numerically double'' eigenvalues, as shown in table 5

Table 5:
$ \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $ $ \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $
$ n$ $ \char93  It. $ eigv$ _p$ eigv$ _M$ eigv$ _p$ eigv$ _M$
21 2.26 6.7827e-02 8.6703e-02 3.6755e-01 2.5964e-01
41 1.95 1.1677e-01 9.6763e-02 2.2066e+00 2.9851e-01
81 3.23 5.7159e-02 1.0413e-01 7.1695e+00 2.6711e-01
121 4.80 8.1832e-02 7.0302e-02 1.7339e+00 2.2761e-01
161 6.50 7.6940e-02 6.8713e-02 1.0057e+00 2.0665e-01
201 8.42 8.3498e-02 7.0626e-02 1.4580e+00 1.6901e-01
241 10.43 4.7523e-02 3.9518e-02 7.9602e-01 1.5877e-01


Example 5.6   In this example the glued Wilkinson matrices [11,1] are considered,

\begin{displaymath}W_{21,p}^{+} =
\left(
\begin{array}{-at-{}ccccc-at-{}}
W_{21}^{+} &...
...ray}\right),\;\; \mbox{\rm where} \;\; M=10^{-12} e_{21} e_1^T.\end{displaymath}

The results are reported in table 6.

Table 6:
$ \max_{i}\frac{ \Vert T \hat{x}_i- \hat{\lambda}_i \hat{x}_i \Vert _2}{n \varepsilon \Vert T \Vert _2} $ $ \max_{i}\frac{ \Vert \hat{X}^T \hat{x}_i- e_i \Vert _2}{n \varepsilon } $
$ n$ $ \char93  It. $ eigv$ _p$ eigv$ _M$ eigv$ _p$ eigv$ _M$
42 1.45 4.2113e-01 9.9321e-01 2.2523e+01 6.3716e+00
105 1.45 8.0750e-01 9.2957e-01 1.8972e+01 4.2258e+00
210 1.45 7.8312e-01 1.1324e+00 1.0983e+01 3.4728e+00
315 1.47 4.8794e-01 7.5062e-01 9.0341e+00 2.4917e+00
420 1.54 4.8022e-01 7.6561e-01 9.9453e+00 2.4357e+00
525 1.57 3.4735e-01 9.0144e-01 4.7771e+00 2.1117e+00



next up previous
Next: Conclusions Up: On computing the eigenvectors Previous: Numerical multiple eigenvalues
Raf Vandebril 2004-10-08