Consider a two-dimensional Ising model of $m$ rows of $n$ spins each, with the Hamiltonian $\beta H = K\sum_{\langle i,j\rangle} S_i S_j$. Denoting the partition function of the system as $Z_{n,m}$, one has $Z_{n,m}=\text{Tr}[T^m_n]$, where the transfer matrix $T_n$ is a $2^n \times 2^n$ matrix. When $m \rightarrow \infty$, (i.e. an infinite strip of width $n$), The correlation length of the system is $$ \frac{1}{\xi(n)}=\ln \frac{\lambda_0}{\lambda_1},$$ where $\lambda_0$ is the largest eigenvalue and $\lambda_1$ is the second largest eigenvalue of $T_n$. According to the exact solution, one has $$\lambda_0=(2\sinh(2K))^{\frac{n}{2}}\exp\left(\frac{1}{2}(\gamma_1+\gamma_3 + \cdots + \gamma_{2n-1})\right),$$ $$\lambda_1=(2\sinh(2K))^{\frac{n}{2}}\exp\left(\frac{1}{2}(\gamma_0+\gamma_2 + \cdots + \gamma_{2n-2})\right),$$ where $$\gamma_0=2(K-K^*)=2K+\ln(\tanh(K))$$ and $$\cosh(\gamma_l)=\cosh(2K)\cosh(2K^*)-\sinh(2K)\sinh(2K^*)\cos(l\pi/n)$$ or $$\cosh(\gamma_l)=\cosh(2K)\coth(2K)-\cos(l\pi/n).$$ for $l\neq 0$.
Write down the transfer matrix for the case of $n=2$ and $n=4$. Diagonalize the transfer matrix numerically and compare your results to the exact expression. Plot $\lambda_0$ and $\lambda_1$ as a function of temperature.
Calculate and plot $\xi(n, T)/n$ for the case of $n=2$ and $n=4$ and determine their crossing point. The crossing point should be around $T^*(n=2)=1/0.4266$.
Denote the derivate of $\xi(n, T)/n$ as $s(n, T)$, i.e., $$s(n, T)=\frac{d}{dT} \frac{\xi(n,T)}{n}.$$ then one can estimate $1/\nu$ by $$\frac{1}{\nu^*(n)} = \frac{1}{\ln(2)}\ln\left(\frac{s(n=4,T^*(n=2))}{s(n=2, T^*(n=2))}\right).$$ Evaluate $\nu^*(n=2)$ using results above.
Challenge: Repeat the same calculation with larger $n$. For example $n=4$ and $n=8$, or $n=8$ and $n=16$, etc. (Keep the ratio to 2). You should observe that as $n$ increases, your results will approach exact $T_c=2/\ln(1+\sqrt{2})$ and $\nu=1$.