So I want to calculate the matrix of $\hat{L}_x=i\hbar(sin\phi\partial_\theta+cot\theta cos\phi\partial_\phi)$ and $\hat{L}_y=i\hbar(sin\phi\partial_\theta+cot\theta cos\phi\partial_\phi)$ with the sperical harmonics if $l=1$. So I need to calculate
$$ \hat{L}_x=\left(\begin{eqnarray} <Y_1^1|L_x|Y_1^1> & <Y_1^1|L_x|Y_1^0> & <Y_1^1|L_x|Y_1^{-1}>\\ <Y_1^0|L_x|Y_1^1> & <Y_1^0|L_x|Y_1^0> & <Y_1^0|L_x|Y_1^{-1}> \\ <Y_1^{-1}|L_x|Y_1^1> & <Y_1^{-1}|L_x|Y_1^0> & <Y_1^{-1}|L_x|Y_1^{-1}> \end{eqnarray}\right) $$ and $$ \hat{L}_y=\left(\begin{eqnarray} <Y_1^1|L_y|Y_1^1> & <Y_1^1|L_y|Y_1^0> & <Y_1^1|L_y|Y_1^{-1}>\\ <Y_1^0|L_y|Y_1^1> & <Y_1^0|L_y|Y_1^0> & <Y_1^0|L_y|Y_1^{-1}> \\ <Y_1^{-1}|L_y|Y_1^1> & <Y_1^{-1}|L_y|Y_1^0> & <Y_1^{-1}|L_y|Y_1^{-1}> \end{eqnarray}\right) $$
but I also found the identity
$$ [\hat{L}_x,\hat{L}_y]=i\hbar\hat{L}_z $$ but that implies that at least some of the entries of the $\hat{L}_x$ and $\hat{L}_y$ matrix have to be complex. Since for example take row 1 column 1. There $$ \hat{L}_{z,1,1}=1\Rightarrow i\hbar\hat{L}_{z,1,1}=i\hbar $$ And with the help of matrixcalc.org (no paid advertising) the commutator there is $$ [\hat{L}_x,\hat{L}_y]_{1,1}=<Y_1^0|L_y|Y_1^1><Y_1^1|L_y|Y_1^0>+<Y_1^{-1}|L_y|Y_1^1><Y_1^1|L_y|Y_1^{-1}>-<Y_1^1|L_y|Y_1^0><Y_1^0|L_y|Y_1^1>-<Y_1^1|L_y|Y_1^{-1}><Y_1^{-1}|L_y|Y_1^1\overset{!}{=}i\hbar $$ This implies that something on the left side has to be complex. But the expected value of an operator has to be always real. So is actually the expected value of an operator not always real ? I hope someone can help me with this