Construction of an irreducible Markov chain in the Ising model
Construction of an irreducible Markov chain in the Ising model is a mathematical method to prove results. In applied mathematics, the construction of an irreducible Markov Chain in the Ising model is the first step in overcoming a computational obstruction encountered when a Markov chain Monte Carlo method is used to get an exact goodness-of-fit test for the finite Ising model. The Ising model is used to study magnetic phase transitions and is one of the models of interacting systems. Markov bases 
Every integer vector , can be uniquely written as , where  and  are nonnegative vectors. A Markov basis for the Ising model is a set  of integer vectors such that:

(i) For all , there must be  and . (ii) For any  and any , there always exist  satisfy

 

and

 

for l = 1,...,k.

The element of  is moved. Then, by using the Metropolis–Hastings algorithm, we can get an aperiodic, reversible, and irreducible Markov Chain. The paper ‘Algebraic algorithms for sampling from conditional distributions,’ published by Persi Diaconis and Bernd Sturmfels in 1998, shows that a Markov basis can be defined algebraically as an Ising model. By the paper, any generating set for the ideal  is a Markov basis for the Ising model. Construction of an irreducible Markov chain 
Without modifying the algorithm mentioned in the paper, it is impossible to get uniform samples from , otherwise leading to inaccurate p-values. A simple swap is defined as  of the form , where  is the canonical basis vector of . Simple swaps change the states of two lattice points in y. Z denotes the set of sample swaps. Then two configurations  are -connected by Z, if there is a path between  and  in  consisting of simple swaps , which means there exists  such that

 

with

 

for l = 1,...,k

The algorithm can now be described as:

(i) Start with the Markov chain in a configuration 

(ii) Select  uniformly at random and let . (iii) Accept  if ; otherwise remain in y. Although the resulting Markov Chain possibly cannot leave the initial state, the problem does not arise for a 1-dimensional Ising model. In higher dimensions, we can overcome this problem by using the Metropolis-Hastings algorithm in the smallest expanded sample space

Irreducibility in the 1-dimensional Ising model 
The proof of irreducibility in the 1-dimensional Ising model requires two lemmas. Lemma 1:The max-singleton configuration of  for the 1-dimension Ising model is unique(up to location of its connected components) and consists of  singletons and one connected components of size . Lemma 2:For  and , let  denote the unique max-singleton configuration. There exists a sequence  such that:

 

and

 

for l = 1,...,k

Since  is the smallest expanded sample space which contains , any two configurations in  can be connected by simple swaps Z without leaving . This is proved by Lemma 2, so we an get the irreducibility of the Markov Chain based on simple swaps for the 1-dimension Ising model. It is also possible to get the same conclusion for a dimension 2 or higher Ising model via the above steps. References 

Lattice models
Markov chain Monte Carlo