Solution (source code)

= Solution

Use <singular value decomposition> to choose unitary matrices satisfying
$$
U_{uL}^\dagger M_uU_{uR}=\operatorname{diag}(m_u,m_c,m_t),
\qquad
U_{dL}^\dagger M_dU_{dR}=\operatorname{diag}(m_d,m_s,m_b).
$$
The neutral currents remain flavour diagonal because the same unitary matrix occurs on both sides of each bilinear. The charged current contains the mismatch
$$
V_{\mathrm{CKM}}=U_{uL}^\dagger U_{dL},
$$
and becomes
$$
\mathcal L_W=\frac g{\sqrt2}\left[
W_\mu^+\overline u_{iL}\gamma^\mu(V_{\mathrm{CKM}})_{ij}d_{jL}
+W_\mu^-\overline d_{iL}\gamma^\mu(V_{\mathrm{CKM}}^\dagger)_{ij}u_{jL}
\right].
$$

A general unitary $3$ by $3$ matrix has nine real parameters. Independent rephasings of the six quark fields remove five phases because one common baryon-number phase changes nothing. The <Cabibbo-Kobayashi-Maskawa matrix> therefore has four physical parameters: three mixing angles and one <CP-violating phase>.