For a lie algebra $\mathbb{g} $ we can define the adjoint representation as: $ ad: \mathbb{g} \rightarrow End(\mathbb{g}) $ as the map such that $ad_x(y)=[x, y] $ for all $\in \mathbb{g} $
I am wondering how to we compute adjoint matrices with respect to a given basis?
For example, let the lie algebra be $ \mathbb{g}=sl_2(\mathbb{C}) $ with the basis as follows: $X=\begin{bmatrix} 0&1\\0& 0 \end{bmatrix}$,$Y=\begin{bmatrix} 0&0\\1& 0 \end{bmatrix}$ and $H=\begin{bmatrix} 1&0\\0& -1 \end{bmatrix}$
Let $ ad: \mathbb{g} \rightarrow End(\mathbb{g}) $ be the adjoint representation
How would I compute the matrices $ ad_X $, $ ad_Y $ and $ ad_Z$ relative to the above matrices?
Since $sl_2(\Bbb C)$ is $3$-dimensional as a vector space, you can imagine the basis $\{X,Y,H\}$ of $\mathbb{g}=sl_2(\mathbb{C})$, as $\Bigg\{ \left( \begin{array}{l} 1 \\ 0 \\ 0 \end{array} \right)$, $\left(\begin{array}{l} 0 \\ 1 \\ 0 \end{array}\right)$, $\left(\begin{array}{c} 0 \\ 0 \\ 1 \end{array}\right) \Bigg\}$, i.e. a basis for $\mathbb{R}^3$
For the $X$ generator: $$ad_X(X)=[X,X]=0, \ \ ad_X(Y)=[X,Y]=H, \ \ ad_X(H)=[X,H]=-2X$$ thus: $$X\mapsto ad_X=\Big[ad_X(X),ad_X(Y),ad_X(H)\Big]=\begin{bmatrix}0 & 0 & -2 \\ 0 & 0 & \ \ \ 0 \\ 0 & 1 & \ \ \ 0 \end{bmatrix}\in End(\mathbb{g})$$ Similarly, for the $Y$ generator: $$ ad_Y(X)=[Y,X]=-H, \ \ ad_Y(Y)=[Y,Y]=0, \ \ ad_Y(H)=[Y,H]=2Y $$ thus: $$Y\mapsto ad_Y=\Big[ad_Y(X),ad_Y(Y),ad_Y(H)\Big]=\begin{bmatrix} \ \ \ 0 & 0 & 0 \\ \ \ \ 0 & 0 & 2 \\ -1 & 0 & 0 \end{bmatrix}\in End(\mathbb{g})$$ And finally, for the $H$ generator: $$ ad_H(X)=[H,X]=2X, \ \ ad_H(Y)=[H,Y]= -2Y, \ \ ad_H(H)=[H,H]=0 $$ thus: $$H\mapsto ad_H=\Big[ad_H(X),ad_H(Y),ad_H(H)\Big]=\begin{bmatrix}2 & \ \ \ 0 & 0 \\ 0 & -2 & 0 \\ 0 & \ \ \ 0 & 0 \end{bmatrix}\in End(\mathbb{g})$$