As Lubos Motl and twistor59 explain, a necessary condition for unitarity is that the Yang Mills (YM) gauge group $G$ with corresponding Lie algebra $g$ should be real and have a positive (semi)definite associative/invariant bilinear form $\kappa: g\times g \to \mathbb{R}$, cf. the kinetic part of the Yang Mills action. The bilinear form $\kappa$ is often chosen to be (proportional to) the Killing form, but that need not be the case.

If $\kappa$ is degenerate, this will induce additional zeromodes/gauge-symmetries, which will have to be gauge-fixed, thereby effectively diminishing the gauge group $G$ to a smaller subgroup, where the corresponding (restriction of) $\kappa$ is non-degenerate.

When $G$ is semi-simple, the corresponding Killing form is non-degenerate.
But $G$ does *not* have to be semi-simple. Recall e.g. that $U(1)$ by definition is *not* a simple Lie group. Its Killing form is identically zero. Nevertheless, we have the following YM-type theories:

QED with $G=U(1)$.

the Glashow-Weinberg-Salam model for electroweak interaction with $G=U(1)\times SU(2)$.

Also the gauge group $G$ does in principle not have to be compact.

This post imported from StackExchange Physics at 2015-01-19 14:11 (UTC), posted by SE-user Qmechanic