For a spin 1 system l = 1 and m = -1 , 0 , 1. For the operator S z {\displaystyle S_{z}} we have
S z | l , m ⟩ {\displaystyle S_{z}|l,m\rangle } \Rightarrow Failed to parse (syntax error): {\displaystyle \left \langle l,n| S_z|l,m \rangle = m\hbar \langle l,n|l,m \rangle} ⇒ ( S z ) n m = m ℏ δ n m {\displaystyle \Rightarrow (S_{z})_{nm}=m\hbar \delta _{nm}}
So
S z = ℏ ( 1 0 0 0 0 0 0 0 − 1 ) {\displaystyle S_{z}=\hbar {\begin{pmatrix}1&0&0\\0&0&0\\0&0&-1\\\end{pmatrix}}} \Rightarrow S z 2 = ℏ 2 ( 1 0 0 0 0 0 0 0 1 ) {\displaystyle S_{z}^{2}={\hbar }^{2}{\begin{pmatrix}1&0&0\\0&0&0\\0&0&1\\\end{pmatrix}}}