## 2012年9月9日星期日

### A handy completion of orthogonal matrix from a column vector

Given a unit vector $u=(u_1,u_2,\ldots,u_n)^\top$, we seek to construct an orthogonal matrix $Q$ whose first column is $u$.

If $u=e_1=(1,0,\ldots,0)^\top$, clearly we can pick $Q=I$. Suppose $u\ne e_1$. Then the Householder reflection $Q = I - 2vv^\top$ will do, where
$v = \frac{u-e_1}{\|u-e_1\|}.$
In particular, if $u=\frac{1}{\sqrt{n}}e=(\frac{1}{\sqrt{n}},\frac{1}{\sqrt{n}},\ldots,\frac{1}{\sqrt{n}})^\top$, we may choose
$Q=\pmatrix{a&a&\cdots&\cdots&a\\ a&b+1&b&\cdots&b\\ \vdots&b&b+1&\ddots&\vdots\\ \vdots&\vdots&\ddots&\ddots&b\\ a&b&\cdots&b&b+1}$
where $a=\frac{1}{\sqrt{n}}$ and $b=\frac{-1}{n-\sqrt{n}}$.

One question remains. When $u\approx e_1$, how stable is this construction?