# QR factorization of complex matrix

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.

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}

I just saw your email. Of course we can do that.

Example (in MATLAB):

% --------------------------------------------- n=3; a=2+3j; b=4-3j;

A=a*eye(n);
B=b*eye(n);

n2=2*n;
X=zeros(n2);
X(1:n,1:n)=A;
X(n+1:n2,n+1:n2)=B;

[U,T]=Grigoryan_code(X);

U'*T % = X


% --------------------------- end of code U =

0.5547 - 0.8321i 0 0 0 0 0
0 0.5547 - 0.8321i 0 0 0 0
0 0 0.5547 - 0.8321i 0 0 0
0 0 0 0.8000 + 0.6000i 0 0
0 0 0 0 0.8000 + 0.6000i 0
0 0 0 0 0 1.0000

T =

3.6056 0 0 0 0 0
0 3.6056 0 0 0 0
0 0 3.6056 0 0 0
0 0 0 5.0000 0 0
0 0 0 0 5.0000 0
0 0 0 0 0 4.0000 - 3.0000i

ans =

2.0000 + 3.0000i 0 0 0 0 0
0 2.0000 + 3.0000i 0 0 0 0
0 0 2.0000 + 3.0000i 0 0 0
0 0 0 4.0000 - 3.0000i 0 0
0 0 0 0 4.0000 - 3.0000i 0
0 0 0 0 0 4.0000 - 3.0000i

You can check it. It works.

Art Grigoryan UTSA

• Hi Dr. Grigoryan, we have never met but I have heard good things. I voted you up here because I think you would be a good addition to the site, but I wanted to note that you may want to expand on your Grigoryan_code(X) here. Commented Mar 15, 2013 at 19:51