# implementation of MIP optimization on Ising model

 1 1 Hi, I want to implement a minimisation on a 2D spin Ising model with 30x30 grid. For simplicity, I only include NN pair interaction and a "triangular" interaction term. The formulation I give is as followed. And I wish to ask for suggestions whether there would be some stronger formulation that could make computation faster. Thank you :D The original objective is: $$\sum\limits_{i = 1}^{29} {\sum\limits_{j = 1}^{30} {{J_1}{s_{i,j}}{s_{i + 1,j}}} } + \sum\limits_{i = 1}^{30} {\sum\limits_{j = 1}^{29} {{J_1}{s_{i,j}}{s_{i,j + 1}}} } + \sum\limits_{i = 1}^{29} {\sum\limits_{j = 1}^{29} {{J_3}{s_{i,j}}{s_{i + 1,j}}{s_{i,j + 1}}} }$$ $${s_{i,j}} \in { 0,1}$$ we linearize it so that: \begin{align} & \min: \\ & \sum\limits_{i = 1}^{29} \sum\limits_{j = 1}^{30} J_1 s_{i,j,1} + \sum\limits_{i = 1}^{30} \sum\limits_{j = 1}^{29} J_1 s_{i,j,2} + \sum\limits_{i = 1}^{29} \sum\limits_{j = 1}^{29} J_3 s_{i,j,3} \\ & \text{subject to:} \\ & \forall i = 1...29\,j = 1...30\,\;k = 1...4 \\ & \left[ \begin{matrix} s_{i,j} \\ s_{i + 1,j} \\ ss_{i,j,1} \\ \end{matrix}\right] = {y_{i,j,1,1}}\left[ \begin{matrix} 0 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,1,2}}\left[ \begin{matrix} 1 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,1,3}}\left[ \begin{matrix} 0 \\ 1 \\ 0 \\ \end{matrix}\right] + {y_{i,j,1,4}}\left[ \begin{matrix} 1 \\ 1 \\ 1 \\ \end{matrix}\right] \\ & \sum\limits_{k = 1}^4 {{y_{i,j,1,k}} = 1} \\ & 0 \le y \le 1 \\ & {y_{i,j,1,k}}{\text{ is integral}} \\ & \\ & \forall i = 1...30\,j = 1...29\,\,k = 1...4 \\ & \left[ \begin{matrix} s_{i,j} \\ s_{i,j + 1} \\ ss_{i,j,2} \\ \end{matrix}\right] = {y_{i,j,2,1}}\left[ \begin{matrix} 0 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,2,2}}\left[ \begin{matrix} 1 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,2,3}}\left[ \begin{matrix} 0 \\ 1 \\ 0 \\ \end{matrix}\right] + {y_{i,j,2,4}}\left[ \begin{matrix} 1 \\ 1 \\ 1 \\ \end{matrix}\right] \\ & \sum\limits_{k = 1}^4 {{y_{i,j,2,k}} = 1} \\ & 0 \le {y_{i,j,2,k}} \le 1 \\ & {y_{i,j,2,k}}{\text{ is integral}} \\ & \\ & \forall i = 1...29\,j = 1...29\,\,k = 1...8 \\ & \left[ \begin{matrix} s_{i,j} \\ s_{i + 1,j} \\ s_{i,j + 1} \\ ss_{i,j,3} \\ \end{matrix}\right] = {y_{i,j,3,1}}\left[ \begin{matrix} 0 \\ 0 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,3,2}}\left[ \begin{matrix} 1 \\ 0 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,3,3}}\left[ \begin{matrix} 0 \\ 1 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,3,4}}\left[ \begin{matrix} 1 \\ 1 \\ 0 \\ 0 \\ \end{matrix}\right] + {y_{i,j,3,5}}\left[ \begin{matrix} 0 \\ 0 \\ 1 \\ 0 \\ \end{matrix}\right] \\ & \qquad\qquad~~ + y_{i,j,3,6}\left[ \begin{matrix} 1 \\ 0 \\ 1 \\ 0 \\ \end{matrix}\right] + y_{i,j,3,7}\left[ \begin{matrix} 0 \\ 1 \\ 1 \\ 0 \\ \end{matrix}\right] + {y_{i,j,3,8}}\left[ \begin{matrix} 1 \\ 1 \\ 1 \\ 1 \\ \end{matrix}\right] \\ & \sum\limits_{k = 1}^8 {y_{i,j,3,k}} = 1 \\ & 0 \le y_{i,j,3,k} \le 1 \\ & y_{i,j,3,k}\quad{\text{integral}} \\ & \\ & \forall i = 1...30\,j = 1...30 \\ & 0 \le s_{i,j} \le 1 \\ & s_{i,j}\quad{\text{integral}} \end{align} asked 13 Jul '14, 23:47 Chivalry 229●2●18 accept rate: 0% fbahr ♦ 4.6k●7●16 thank you sooo much for helping me to fix my format:D (14 Jul '14, 11:44) Chivalry 1 Sometimes $$s$$ has two subscripts, sometimes three. (15 Jul '14, 15:54) Paul Rubin ♦♦ actually, those with two subscripts are spin, while those with 3 subscripts are spin products:) (15 Jul '14, 16:18) Chivalry I also edited the equation to make it more obvious... (15 Jul '14, 16:32) Chivalry
Be the first one to answer this question!
 toggle preview community wiki

### Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

Tags:

Asked: 13 Jul '14, 23:47

Seen: 663 times

Last updated: 18 Jul '14, 06:36

### Related questions

OR-Exchange! Your site for questions, answers, and announcements about operations research.