[Math] Change of basis (Gram-Schmidt)

linear algebramatricesorthonormal

I was wondering whether it is possible to write down explicitely the matrix that represents the change of basis from a basis $\{v_1,….,v_n\}$ to a basis $\{e_1,…,e_n\}$, where $e_i$ is the basis constructed from $\{v_1,….,v_n\}$ by the Gram-Schmidt process. Or if the inverse map would be easier, I would also be interested in this matrix.

Best Answer

The matrix for the change from $v$-coordinates to $e$-coordinates is an automatic by-product of the algorithm, if you note things as you go. $\newcommand{\inner}[2]{\langle #1 \mspace{-3mu}\mid\mspace{-3mu} #2\rangle}$

$$e_1 = \frac{1}{\lVert v_1\rVert}\cdot v_1 \leadsto v_1 = \lVert v_1\rVert\cdot e_1 \leadsto \begin{pmatrix}\lVert v_1\rVert\\0\\\vdots\\0\end{pmatrix}$$

as the first column. If you already have $e_1,\,\dotsc,\, e_i$ and the first $i$ columns of the matrix,

$$w_{i+1} = v_{i+1} - \inner{e_1}{v_{i+1}}e_1 - \inner{e_2}{v_{i+1}}e_2 - \dotsc - \inner{e_i}{v_{i+1}}e_i; e_{i+1} := \frac{1}{\lVert w_{i+1}\rVert}w_{i+1}$$

then gives you

$$v_{i+1} = \inner{e_1}{v_{i+1}}e_1 + \inner{e_2}{v_{i+1}}e_2 + \dotsc + \inner{e_i}{v_{i+1}}e_i + \lVert w_{i+1}\rVert e_{i+1}$$

and the column

$$\begin{pmatrix}\inner{e_1}{v_{i+1}}\\\vdots\\\inner{e_i}{v_{i+1}}\\ \lVert w_{i+1}\rVert\\0\\ \vdots \\0 \end{pmatrix}$$

Related Question