Solution (source code)

= Solution

For a finite-dimensional <Lie algebra>, the <Killing form> is the symmetric <bilinear form>
$$
\boxed{B(X,Y)=\operatorname{tr}_{\mathfrak g}(\operatorname{ad}X\,\operatorname{ad}Y),\qquad \operatorname{ad}X(Z)=[X,Z].}
$$
In the <root-space decomposition> of this <semisimple Lie algebra>, $\operatorname{ad}H$ acts as zero on the abelian <Cartan subalgebra> and as multiplication by $\alpha(H)$ on $\mathfrak g_\alpha$. For $H,K\in\mathfrak h$, their product thus acts as multiplication by $\alpha(H)\alpha(K)$ on each <root space>. Every root space here is one-dimensional. Taking the trace over the two-dimensional Cartan subalgebra and the eight root spaces proves
$$
\boxed{B(H,K)=\sum_{\alpha\in R}\alpha(H)\alpha(K).}
$$
For a general weight decomposition the trace would include the corresponding <weight multiplicities>; the root multiplicities are one in the semisimple setting here.