Why are there eight gluons and not nine?

According to QCD and the standard model of particle physics, quarks carry an SU(3) "color charge" which can
be "red", "blue" or "green". The strong nuclear force which binds these together inside the nucleons is
mediated by gluons which must carry a color-anticolor charge. This seems to give 9 types of gluon:

Rather than start with the SU(3) theory, consider first what our knowledge of nature is—upon which we
will base the theory. We know that the matter we believe to be composed of quarks (the hadrons) comes in
two types: mesons (short lived particles, pions etc.) and baryons (protons, neutrons etc.), both of which have
to be strong-force neutral.

Consider the evidence: scattering experiments strongly suggest a meson to be composed of a quark anti-quark
pair and a baryon to be composed of three quarks. The famous 3R experiment also suggests that whatever
force binds the quarks together has 3 types of charge (called the 3 colors).

Now, into the realm of theory: we are looking for an internal symmetry having a 3-dimensional
representation which can give rise to a neutral combination of 3 particles (otherwise no color-neutral
baryons). The simplest such statement is that a linear combination of each type of charge (red + green +
blue) must be neutral, and following William of Occam we believe that the simplest theory describing all the
facts must be the correct one. We now postulate that the particles carrying this force, called gluons,
must occur in color anti-color units (i.e. nine of them). BUT, red + blue + green is neutral, which
means that the linear combination red anti-red + blue anti-blue + green anti-green must be non-interacting,
since otherwise the colorless baryons would be able to emit these gluons and interact with each other via the
strong force—contrary to the evidence. So, there can only be EIGHT gluons. This is just
Occam's razor again: a hypothetical particle that can't interact with anything, and therefore can't be
detected, doesn't exist.

The simplest theory describing the above is the SU(3) one with the gluons as the basis states of the Lie
algebra. That is, gluons transform in the adjoint representation of SU(3), which is 8-dimensional.

The physics of color is not understandable if all one knows is that there are 3 colors. One must
really understand something about SU(3). SU(3) is the group of 3 × 3 unitary matrices with determinant
1. This is the symmetry group of the strong force. What this means is that, as far as the strong
force is concerned, the state of a particle is given by a vector in some vector space on which elements of
SU(3) act as linear (in fact unitary) operators. We say the particle "transforms under some
representation of SU(3)". For example, since elements of SU(3) are 3 × 3 matrices, they can act on
column vectors by matrix multiplication. This gives a 3-dimensional representation of SU(3).
Quarks transform under this representation of SU(3), and because it's 3-dimensional we say quarks come in 3
colors: red, green and blue. This is just an amusing way of talking about the 3 column vectors

1
0
0
0
1
0
and
0
0
1.

Alternatively, we could let elements of SU(3) act on row vectors by multiplication on the right.
Antiquarks transform under that representation, and since it is also 3-dimensional we say they come in three
colors as well: anti-red, anti-blue, and anti-green. This is just an amusing way of talking about the 3 row
vectors

100
010
and
001.

Alternatively, we could let elements of SU(3) act on 3 × 3 hermitian matrices with trace equal to 0,
by letting the element g of SU(3) act on the matrix T to give the new matrix gTg−1. The
space of 3 × 3 hermitian matrices with trace equal to zero is 8 dimensional. Gluons transform
under this representation, so there are 8 gluons.

Some examples of a 3 × 3 hermitian matrix with trace zero are

0 1 0 0 i 0
1 0 0 -i 0 0
0 0 0 0 0 0

If we allow ourselves to take complex linear combinations of these we can get things like

0 1 0
0 0 0
0 0 0

which we could call "red anti-blue" since it has a 1 in the red row (the first
row) and the blue column (the second column). Or we could get

0 0 0
1 0 0
0 0 0

which we could call "blue anti-red".

But, no matter how we take complex linear combinations of trace-zero hermitian matrices, we cannot get

1 0 0
0 0 0
0 0 0

since this has trace 1. (I.e., the sum of the diagonal entries is 1: that's what the trace means, the
sum of the diagonal entries.) So we cannot really get red anti-red. The closest we can get are things
like

1 0 0
0 -1 0
0 0 0
or
1 0 0
0 0 0
0 0 -1
or
0 0 0
0 1 0
0 0 -1

But note, these three are not linearly independent: any one of them is a linear combination of the other
two. So we can get stuff like

(red anti-red) − (blue anti-blue)

and so on, but not 3 linearly independent things of this sort, only 2: one less than you might
expect.

If you are wondering what the hell I am doing subtracting particles from each other, well, that's quantum
mechanics.

This may have made things seem more, rather than less, mysterious, but in the long run I'm afraid this is
what one needs to think about.