# Effect of boundary conditions on partition functions

While computing partition functions in statistical mechanics models (say) on a 2d lattice one usually makes use of "circular boundary conditions" which thus gives the lattice topology of a torus. It makes the expressions, and calculations simpler; and one usually assumes that in the infinite volume limit boundary effects will be negligible. However I have never come through any general proof of this physical argument. What if we choose more complicated boundary identifications so that lattice has topology of some higher genus surface ? How will it affect the final answer for partition function or other correlation functions ?

For example, consider a 1D spin chain model (Ising, XY, Heisenberg, or whatnot) with $N$ sites and nearest neighbours interaction. For a given state of the system, the energy depends on the boundary conditions only through the interaction between two spins. Since there are $N-1$ other spins, it is very easy to convince yourself that the contribution from the boundary is negligible when $N\to\infty$.