Solution (source code)

= Solution

Assume $Q\ge2$ and $L\ge2$; the trivial exceptions are described below. In this <periodic Potts chain>, every satisfied bond contributes $-J$ to the <energy>, and no bond can contribute less. All $L$ bonds can be satisfied simultaneously by choosing the same state at every site. Conversely, satisfying every bond forces this uniform configuration. Therefore the <ground state> <energy> and <degeneracy factor> are
$$
\boxed{E_0=-JL,\qquad d_0=Q.}
$$
The $Q$ choices are distinct configurations on the labelled lattice: a global relabelling of the states is a <symmetry>, not an identification of microstates.