HW 2022 6
HW 2022 6
1. Complex
rotator: This problem is about howto construct
a complex rotator.
Given
f 2 c −s̄ ∗ f r
∈ C , determine c, s and r such that Q = is unitary and Q = .
g s c̄ g 0
Such a matrix Q is called a complex rotator. Show that Q is not uniquely determined.
Your task is to determine c, s and r so that your rotator has the following properties:
The definition for real and complex data should be consistent, so that real data
passed to the complex algorithm (for rotator) should result in the same answer
(modulo roundoff) as from the real algorithm.
[Hint: See stable generation of rotation in the slides on Givens rotation.]
For k =1:n-1
Compute reflector Q = I- aplha * u * u’ such that
(QA)(k,k) = - sigma and (QA)(k+1:n, k) = 0
Compute w = A’ * u and A = A - alpha * u * w’
end
(a) Show that at the k-th step, the rank one update A ← A - alpha * u * w’ does
not affect the first k − 1 rows and columns of A.
(b) Modify above algorithm so that the strict upper triangular part of A contains the
strict upper triangular part of R (where A = QR), the diagonal entries of R are
stored in an extra array and the lower triangular part of A contains the householder
vectors (that is, vectors u’s that determine the reflectors).
1
4. This problem is about how to accumulate reflectors to produce Q in the QR factorization
of A ∈ Rn×n . Let Q1 , . . . , Qn−1 be reflectors such that Qn−1 Qn−2 · · · Q2 Q1 A = R, where
R is upper triangular and Qk = I − αk uk u∗k for k = 1 : n − 1. Set Q = Q1 Q2 · · · Qn−1 .
Then A = QR. Suppose that the matrix Q is explicitly required. Describe an efficient
algorithm to compute Q and give the total flop count.