Solution (source code)

= Solution

Let $\beta=1/(k_BT)$ and use the two <spin> values $+1,-1$ as row and column labels. Define the <spin-chain transfer matrix>
$$
W_{st}=e^{-\beta E_0(s,t)},\qquad s,t\in\{+1,-1\}.
$$
It is a real <symmetric matrix> because $E_0(s,t)=E_0(t,s)$; every entry is strictly positive for finite bond <energies> at $T>0$. The <Boltzmann factor> of a <spin> configuration factorizes into the product $W_{\sigma_1\sigma_2}\cdots W_{\sigma_L\sigma_1}$. Summing the intermediate <spin> labels is exactly <matrix multiplication>, and the final closure imposes <periodic boundary conditions>. Thus
$$
\boxed{Z_L=\sum_{\sigma_1,\ldots,\sigma_L}\prod_{j=1}^LW_{\sigma_j\sigma_{j+1}}=\operatorname{Tr}W^L.}
$$
Writing $W=\left(\begin{smallmatrix}a&b\\b&d\end{smallmatrix}\right)$, its <eigenvalues> are
$$
\lambda_\pm=\frac{a+d\pm\sqrt{(a-d)^2+4b^2}}2,
\qquad \boxed{Z_L=\lambda_+^L+\lambda_-^L.}
$$
A positive-entry <matrix> need not have two positive <eigenvalues>; $\lambda_-$ can be negative. The <Perron–Frobenius theorem> ensures $\lambda_+>|\lambda_-|$ here. Therefore the <Helmholtz free energy> is $F_L=-k_BT\ln Z_L$, and its value per <spin> in the <thermodynamic limit> is $-k_BT\ln\lambda_+$.