Solution (source code)

= Solution

Represent a <quark>-<antiquark> state by a matrix $F$ with $q_i\bar q_j\leftrightarrow E_{ij}$. Under <flavor symmetry>, $F\mapsto UFU^\dagger$, so an infinitesimal generator acts by $[T,F]$. The minus sign in this <commutator> is the <antiquark> transformation law; acting on the <quark> alone would miss states.

Start from $\pi^+=E_{ud}$. Three useful first steps are
$$
[I_-,E_{ud}]=E_{dd}-E_{uu}=-\sqrt2\,\pi^0,\quad [U_+,E_{ud}]=-E_{us}=-K^+,\quad [V_-,E_{ud}]=E_{sd}=\bar K^0.
$$
Further actions give $[I_-,E_{us}]=E_{ds}=K^0$, $[I_-,E_{sd}]=-E_{su}=-K^-$ and $[I_-,\pi^0]=\sqrt2E_{du}=\sqrt2\pi^-$. Overall phases are conventional. Finally
$$
[V_-,E_{us}]=E_{ss}-E_{uu}=-\frac{\pi^0}{\sqrt2}-\sqrt{\frac32}\,\eta_8.
$$
Thus the second neutral octet state is obtained by removing the known $\pi^0$ component. Equivalently it is the normalized diagonal state orthogonal to both $\pi^0$ and the singlet. The full <meson octet> is
$$
\boxed{\begin{aligned}
\pi^+&=u\bar d,&\pi^-&=d\bar u,&\pi^0&=(u\bar u-d\bar d)/\sqrt2,\\
K^+&=u\bar s,&K^0&=d\bar s,&K^-&=s\bar u,&\bar K^0&=s\bar d,\\
\eta_8&=(u\bar u+d\bar d-2s\bar s)/\sqrt6.
\end{aligned}}
$$
Their flavour matrices are traceless; the independent singlet is $\eta_1=(u\bar u+d\bar d+s\bar s)/\sqrt3$. The source uses $\eta'$ for this ideal singlet. That notation is a basis convention here: the physical <eta and eta prime mesons> is not an exactly pure singlet because physical neutral <pseudoscalar mesons> mix.<Quark Model in the 2024 Review of Particle Physics>[Section 15.3, singlet-octet wave functions and physical pseudoscalar mixing]{ref}