TITLE: QR factorization of complex matrix
QUESTION [8 upvotes]: If you have two complex numbers $a,b$ how can you find the QR factorization of 
$
M = \begin{bmatrix}
       aI_n\\
         bI_n \end{bmatrix} $,
I can't seem to be able to do it. I tried an earlier trick, but I now know it's not necessary true for complex numbers. Is there anyway to do this?
I think if I use a Givens algorithm I should be able to reduce it to a QR factorization.

REPLY [6 votes]: This may be done with the same complex Givens rotations on the pairs of rows. Here is the math, with $c$ and $s$ complex:
$$\pmatrix{c & s \\ -\bar{s} & \bar{c}} \begin{bmatrix}
       a\\
         b \end{bmatrix} = \begin{bmatrix} ca + sb \\ -\bar{s}a + \bar{c}b\end{bmatrix} = \begin{bmatrix} * \\ 0\end{bmatrix}$$
The element (*) will have magnitude of $\sqrt{|a|^2 + |b|^2}$.
To ensure the matrix is unitary, we only need $|c|^2 + |s|^2 = 1$.
For $$-\bar{s}a + \bar{c}b = 0$$
use
\begin{align}
  s_0 &= \bar{b} \\
  c_0 &= \bar{a} \\
  \Rightarrow c &= \frac{c_0}{\sqrt{|c_0|^2 + |s_0|^2}} \\
  \Rightarrow s &= \frac{s_0}{\sqrt{|c_0|^2 + |s_0|^2}} \\
\end{align}