C) Deflation:, Eigenvalues and Eigenvectors
C) Deflation:, Eigenvalues and Eigenvectors
# normalisation
u:=w/LinearAlgebra[VectorNorm](w,Euclidean);
# iteration
w:=A.u;
# eigenvalue estimate
lambda:=w.u;
end do;
# output
return lambda,u;
end proc:
c) Deflation
So far: given A with |(1) | > |(2) | > . . . > |(n) | we can compute (1) and u(1) . How to
obtain the other eigenvalues (2) , (3) ,. . . , (n) ?
Idea: Construct a matrix B with eigenvalues 0, (2) , (3) , . . . , (n) (deflate the matrix A,
remove (1) ). Then (2) can be obtained by the power method.
3 0
Example 4.3: A = , eigenvalues and eigenvectors
0 2
1 0
(1) = 3, u(1) = (leading), (1) = 2, u(2) =
0 1
3 0 3 0 0 0
B= =
0 2 0 0 0 2
| {z }
1
(3, 0)
0
has eigenvalues 0 and 2. If aT = (3, 0) denotes the 1st row of A (with the 1st component
of u(1) being 1) we have B = A u(1) aT . How to generalise this example?
Construction of B:
(1)
Choose a nonzero component of u(1) , say up , (fixes p !).
Denote by aT the pth row of A, i.e., aT = (Ap1 , Ap2 , . . . , Apn ). Because of the
eigenvalue equation Au(k) = (k) u(k) we have
(k) u(k)
p = Au
(k)
p
= aT u(k) .
Consider
1 1
B =A (1)
u(1) aT , i.e., Bn = An (1)
u(1) u(1)
n Ap .
up up
B has the required properties. Namely:
1
Bu(1) = A u(1) (1) u(1) aT u(1) = 0
| {z } up | {z }
(1) (1)
u (1) u(1)
p
that means ! !
(k) (k)
up up
B u(k) (1)
u(1) = (k) u(k) (1)
u(1) .
up up
Thus (k) , k = 2, 3, . . . , n are still eigenvalues of B (but the eigenvectors have
changed).
Example 4.4:
4 14 0
A = 5 13 0
1 0 2
Eigenvalues and eigenvectors
4 1 0
(1) (1)
(2) = 3, u(2) (3) = 2, u(3)
= 6, u = 20/7 , = 1/2 , = 0
1 1 1
(1)
up=1 = 4, aT = (4, 14, 0)
30
4 14 0 4
1
B = 5 13 0 20/7 (4, 14, 0)
(4)
1 0 2 1
4 14 0 16 56 0
1
= 5 13 0 + 80/7 40 0
4
1 0 2 4 14 0
0 0 0
= 15/7 3 0
2 7/2 2
choose p OUTPUT
INPUT
A,u (1) such that aT=(A ,...,A ) (1) T (1)
B=Au a /u
(1) p1 pn
u =0 /
p
(another procedure)
(1)
choose p such that up 6= 0 is another procedure:
31
yes
INPUT (i) OUTPUT
i:=1 v =0
/
v i
no
next i
(1)
Maple code: i) procedure to compute p with up 6= 0:
pindex:=proc(v)
local i,ndim;
# number of components
ndim:=LinearAlgebra[Dimension](v);
# loop over all components
for i from 1 to ndim do
if abs(v[i])>0 then
# nonzero component
return i;
end if;
end do;
end proc:
simple_deflat:=proc(A,u)
local p,ap;
# compute p value
p:=pindex(u);
# pth row of A
ap:=A[p];
# output
return A-(u.ap)/u[p];
end proc:
Remark: The procedure pindex is ill-conditioned (see 2). Thus, it has to be replaced