# Problem

I am trying to numerically verify the fact that "the orthogonal lower (upper) triangular matrix has to be diagonal". However, I have difficulty finding general matrices that satisfies both orthogonality and triangularity since brute force search is of no hope.

Instead, I am wondering if I could manually specify such matrices. More formally, find matrices $$\mathbf{A}=[\mathbf{v}_1,\mathbf{v}_2, \cdots, \mathbf{v}_n]$$ such that $$\begin{cases} \mathbf{v}_i^T\mathbf{v}_j=0, i\neq j\\ \mathbf{v}_i^T\mathbf{v}_j=1, i=j\\ \mathbf{v}_i[i-k]=0, i\geq 2,k=1,2\cdots,(k-1) \end{cases}$$

• Well the only such matrices are diagonal. So you generate them by choosing the (nonzero) diagonal entries. That won't numerically verify anything. So it's not clear what you are asking for. – Ethan Bolker Apr 19 at 18:11
• @EthanBolker Thank you, I just realized this. – Mr.Robot Apr 19 at 18:38