Matrix representation of operators - II
Let \(\mid \psi\rangle\) be a vector in an \(n-\) dimensional vector space.
\[\begin{equation} |\psi\rangle =a_1 | a_1 \rangle + a_2\left|a_2\right\rangle+a_3\left|a_3\right\rangle+\cdots +a_n\left|a_n\right\rangle \label{eq1} \end{equation}\]where \(\mid a_{i}\rangle\, (i=1,2,3,...,n)\) are the basis vectors.
By taking inner product of \(\mid \psi\rangle\) with \(\langle a_{1}\mid\), we get,
\[\begin{equation*} \langle a_1 \mid \psi \rangle = a_1+a_2 \underbrace{\left\langle a_1 \mid a_2\right\rangle}_{=0}+a_3 \underbrace{\left\langle a_1 \mid a_3\right\rangle}_{=0}+\cdots+a_n \underbrace{\left\langle a_1 \mid a_n\right\rangle}_{=0} \\ \end{equation*}\]Basis vectors \(\mid a_{i}\rangle\) are orthogonal each other, and hence \(\left \langle a_i | a_j\right\rangle = 0\) for \(i\neq j\).
By successively taking inner products with all the basis vectors, we can write the coefficients \(a_i\) as,
\[\begin{equation} a_1 =\left\langle a_1 \mid \psi\right\rangle, a_2=\left\langle a_2 \mid \psi\right\rangle, \ldots a_n=\left\langle a_n \mid \psi\right\rangle. \label{eq2} \end{equation}\]By combining equations \eqref{eq1} and \eqref{eq2}, we can express \(\mid \psi\rangle\) as:
\[\begin{equation} |\psi\rangle =\left|a_1\right\rangle\left\langle a_1 \mid \psi\right\rangle+\left|a_2\right\rangle\left\langle a_2 \mid \psi\right\rangle+\left|a_3\right\rangle\left\langle a_3 \mid \psi\right\rangle+\cdots+\left|a_n\right\rangle\left\langle a_n \mid \psi\right\rangle \label{eq3} \end{equation}\]Let \(\mid \phi\rangle\) be another vector with coefficients \(b_i\), where \(i=1,2,3,..,n\).
\[\begin{equation*} |\phi\rangle = b_1\left|a_1\right\rangle+b_2\left|a_2\right\rangle+b_3\left|a_3\right\rangle+\cdots+b_n\left|a_n\right\rangle \end{equation*}\]Since \(b_i = \langle a_i \mid \phi\rangle\), we can write,
\[\begin{equation} |\phi\rangle =\left|a_1\right\rangle\left\langle a_1 \mid \phi\right\rangle+\left|a_2\right\rangle\left\langle a_2 \mid \phi\right\rangle+\left|a_3\right\rangle\left\langle a_3 \mid \phi\right\rangle+\cdots +\left|a_n\right\rangle\left\langle a_n \mid \phi\right\rangle \label{eq4} \end{equation}\]Let \(\hat{A}\) be an operator whose action on \(\mid \psi\rangle\) yields \(\mid \phi\rangle\):
\[\begin{equation} \hat{A}|\psi\rangle =|\phi\rangle \label{eq5} \end{equation}\]Substituting for \(\mid \psi\rangle\) and \(\mid \phi\rangle\) from \eqref{eq3} and \eqref{eq4} in \eqref{eq5}, we get:
\[\begin{equation} \hat{A}\left[\left|a_1\right\rangle\left\langle a_1 \mid \psi\right\rangle+\left|a_2\right\rangle\left\langle a_2 \mid \psi\right\rangle+\cdots \cdot\left|a_n\right\rangle\left\langle a_n \mid \psi\right\rangle\right] = \left|a_1\right\rangle\left\langle a_1 \mid \phi\right\rangle+\left|a_2\right\rangle\left\langle a_2 \mid \phi\right\rangle+\cdots \cdot\left|a_n\right\rangle\left\langle a_n \mid \phi\right\rangle \label{eq6} \end{equation}\]Take inner products of \eqref{eq6} with \(\langle a_i\mid\):
\[\begin{equation} \begin{array}{l} \left\langle a_1|\hat{A}| a_1\right\rangle\left\langle a_1 \mid \psi\right\rangle+\left\langle a_1|\hat{A}| a_2\right\rangle\left\langle a_2 \mid \psi\right\rangle+\cdots \cdot+\left\langle a_1|\hat{A}| a_n\right\rangle\left\langle a_n \mid \psi\right\rangle=\left\langle a_1 |\phi\right\rangle \\ %\left\langle a_1 \mid a_2\right\rangle=\left\langle a_1 \mid %a_3\right\rangle=\ldots=\left\langle a_1|a_n\right\rangle=0 \\ \left\langle a_2|\hat{A}| a_1\right\rangle\left\langle a_1 \mid \psi\right\rangle+\left\langle a_2|\hat{A}| a_2\right\rangle\left\langle a_2 \mid \psi\right\rangle+\cdots+\left\langle a_2|\hat{A}| a_n\right\rangle\left\langle a_n \mid \psi\right\rangle=\left\langle a_2 | \phi\right\rangle \\ \vdots \\ \left\langle a_n|\hat{A}| a_1\right\rangle\left\langle a_1 \mid \psi\right\rangle+\left\langle a_n|\hat{A}| a_2\right\rangle\left\langle a_2 \mid \psi\right\rangle+\cdots+\left\langle a_n|\hat{A}| a_n\right\rangle\left\langle a_n \mid \psi\right\rangle=\left\langle a_n | \phi\right\rangle \end{array} \label{eq7} \end{equation}\]Equation \eqref{eq7} can be conveniently written in the form of matrices:
\[\begin{equation} \left(\begin{array}{cc} \left\langle a_1|\hat{A}| a_1\right\rangle & \left\langle a_1|\hat{A}| a_2\right\rangle & \cdots & \left\langle a_1 |\hat{A} \mid a_n\right\rangle \\ \left\langle a_2|\hat{A}| a_1\right\rangle & \left\langle a_2|\hat{A}| a_2\right\rangle & \cdots & \left\langle a_2|\hat{A}\mid a_n\right\rangle\\ \vdots & \vdots & & \vdots \\ \left\langle a_n|\hat{A}| a_1\right\rangle & \left\langle a_n|\hat{A}| a_2\right\rangle & \cdots & \left\langle a_n|\hat{A}\mid a_n\right\rangle\\ \end{array}\right) \\ \left(\begin{array}{c} \left\langle a_1 \mid \psi\right\rangle \\ \left\langle a_2 \mid \psi\right\rangle \\ \vdots \\ \left\langle a_2 \mid \psi\right\rangle \end{array}\right)= \left(\begin{array}{c} \left\langle a_1 \mid \phi\right\rangle \\ \left\langle a_2 \mid \phi\right\rangle \\ \vdots \\ \left\langle a_2 \mid \phi\right\rangle \end{array}\right) \label{eq8} \end{equation}\]The column vector on the LHS of equation \eqref{eq8} is the matrix representation of \(\mid \psi \rangle\), and that on the RHS is the matrix representation of \(\mid \phi \rangle\). By comparing equations \eqref{eq5} and \eqref{eq8}, we can conclude that the square matrix in equation \eqref{eq8} is the matrix representation of the operator \(\hat{A}\). There are \(n^2\) elements in the matrix representation of \(\hat{A}\), where \(n\) is the dimension of the vector space we are operating in.
If the basis vectors \(\mid a_i\rangle\) are eigen vectors of the operator \(\hat{A}\), then,
\[\begin{equation} \hat{A}|a_i\rangle = k_i|a_i\rangle, \end{equation}\]where \(k_i\) are the eigen values. Consequently,
\[\begin{aligned} \left\langle a_1|\hat{A}| a_1\right\rangle &= k_1\left\langle a_1 \mid a_1\right\rangle=k_1 \\ \left\langle a_2|\hat{A}| a_2\right\rangle &= k_2\left\langle a_2 \mid a_2\right\rangle=k_2 \\ \vdots \\ \left\langle a_n|\hat{A}| a_n\right\rangle &= k_n\left\langle a_n \mid a_n\right\rangle=k_n, \end{aligned}\]and all other terms will be zero. In general,
\[\begin{aligned} \left\langle a_i|\hat{A}| a_j\right\rangle &=k_j \text { if } i=j \\ &=0 \text { if } i \neq j. \end{aligned}\]Therefore, if the basis vectors are eigen vectors of the operator \(\hat{A}\), we end up with a diagonal matrix with the eigen values along the diagonal:
\[\left(\begin{array}{ccccc} k_1 & 0 & 0 & \cdots & 0 \\ 0 & k_2 & 0 & \cdots & 0 \\ \vdots & & & & \\ \vdots & 0 & 0 & \cdots & k_n \end{array}\right).\]