# Find the orthogonal complement of the subspace of diagonal matrices

In $\mathbb{C^{3x3}}$, with the inner product of matrices defined as $$\langle A,B\rangle = \mbox{tr}(A^*B)$$ find the orthogonal complement of the subspace of diagonal matrices.

Then, considering the following matrices $\in$ $\mathbb{C^{3x3}}$

$$A=\begin{pmatrix} a_{11}&0&0\\0&a_{22}&0\\0&0&a_{33}\end{pmatrix}$$

and

$$B=\begin{pmatrix} b_{11}&0&0\\0&b_{22}&0\\0&0&b_{33}\end{pmatrix}$$

I concluded by the statement and the definition of orthogonal complement:

$$\langle A,B\rangle=Tr\begin{pmatrix} \overline{a_{11}}b_{11}&0&0\\0&\overline{a_{22}} b_{22}&0\\0&0&\overline{a_{22}}b_{33}\end{pmatrix}=0$$

After, I get the trace of the $3$-by-$3$ square matrix of the inner product $\langle A,B\rangle$

$$\overline{a_{11}} b_{11}+ \overline{a_{22}}b_{22}+ \overline{a_{33}}b_{33}=0$$

I'm stuck from here, how can I do to get the orthogonal complement?

Consider the matrix$$A=\begin{pmatrix}0&1&0\\0&0&0\\0&0&0\end{pmatrix}.$$Then $A$ belongs to the orthogonal complement $D^\bot$ of the space $D$ of diagonal matrices, since$$\left\langle A,\begin{pmatrix}a&0&0\\0&b&0\\0&0&c\end{pmatrix}\right\rangle=\operatorname{tr}\begin{pmatrix}0&b&0\\0&0&0\\0&0&0\end{pmatrix}=0.$$For the same reason, every matrix with one and only one entry whose value is $1$, which is outside the main diagonal, and such that all other entries are equal to $0$ belongs to $D^\bot$. The space $V$ spanned by all these matrices is the space of the matrices such that all entries of the main diagonal are equal to $0$. Since the $\dim V=6$, $\dim D=3$ and the whole space has dimension $9$, the space that you're after is $V$. In other words,$$D^\bot=\left\{\begin{pmatrix}0&a&b\\c&0&d\\e&f&0\end{pmatrix}\,\middle|\,a,b,c,d,e,f\in\mathbb{C}\right\}$$

Let

$$\mathcal D_3 (\mathbb C) := \{ \mbox{diag} (\mathrm c) \mid \mathrm c \in \mathbb C^3 \}$$

be the set of $3 \times 3$ diagonal matrices over $\mathbb C$. Its orthogonal complement is the set of all matrices $\mathrm X \in \mathbb C^{3 \times 3}$ such that $\langle \mbox{diag} (\mathrm c), \mathrm X \rangle = 0$ for all $\mathrm c \in \mathbb C^3$, i.e.,

$$\begin{bmatrix} | \\ \mathrm c \\ | \end{bmatrix}^* \begin{bmatrix} x_{11}\\ x_{22}\\ x_{33}\end{bmatrix} = 0$$

for all $\mathrm c \in \mathbb C^3$. Hence, we conclude that $\color{blue}{x_{11} = x_{22} = x_{33} = 0}$. The orthogonal complement is, thus, the set of $3 \times 3$ matrices over $\mathbb C$ with zeros on the main diagonal

$$\mathcal D_3^\perp (\mathbb C) := \{ \mathrm X \in \mathbb C^{3 \times 3} \mid x_{11} = x_{22} = x_{33} = 0 \}$$