Solution (source code)

= Solution

Map the quaternion generators to $i\sigma_x,i\sigma_y$ (and their products), obtaining the unique two-dimensional irreducible $V$ and an embedding $Q_8\subset SU(2)$. Clebsch-Gordan gives $V\otimes V\simeq\operatorname{Sym}^2V\oplus1$ and $V^{\otimes3}\simeq\operatorname{Sym}^3V\oplus V\oplus V$. On restriction, $\operatorname{Sym}^2V$ is the sum of the three nontrivial one-dimensional characters of $Q_8$, while the other summand is trivial.