Solution (source code)

= Solution

If $A$ and $B$ are <Hermitian matrices>, then $(AB)^\dagger=B^\dagger A^\dagger=BA$. Therefore
$$
\boxed{AB\text{ is Hermitian}\iff AB=BA\iff[A,B]=0.}
$$
The required condition is that the matrices <commute>.