# How to exponentiate binary variables in QUBO-type problems?

Ising Model

In an Ising model, the Hamiltonian of one configuration of spins $$\vec{s}$$ is:

$$H(\vec{s}, \mathcal{J}, \mathcal{h}) = \sum_{i} h_{i} s_{i} + \sum_{i \ne j}J_{ij} s_{i}s_{j}$$

where each spin $$s_{i} = \pm 1$$.

The partition function of an Ising model is:

$$Z(\mathcal{J}, \mathcal{h}) = \sum_{\vec{r}} \exp \left [ H(\vec{r}, \mathcal{J}, \mathcal{h}) \right]$$

The summation is over all possible configurations and $$r_{i} = \pm 1$$ for all $$i$$.

Question

How to formulate the exponential of binary variables in the partition function for QUBO-type problems?

Luckily in this case, the exponential can be treated in a way very similar to how we're already familiar. If we use the example that I chose in my answer to your recent question, we would have, where your $$\vec{r}$$ is just $$(s_1,s_2)$$:
$$\tag{1} Z=\sum_{s_1,s_2} e^{\left(\mathcal{J}s_1s_2 + hs_1\right)}.$$
If $$\mathcal{J}=2.5$$ and $$h=3$$, then we would have:
\begin{align}\tag{2} \hspace{-15mm}Z &\hspace{-5mm}= e^{\left(2.5(-1)(-1) + 3(-1)\right)} + e^{\left(2.5(1)(-1) + 3(1)\right)} + e^{\left(2.5(-1)(1) + 3(-1)\right)} + e^{\left(2.5(1)(1) + 3(1)\right)} \!\!\! \\ \tag{3} &\hspace{-5mm}=e^{2.5-3}+e^{-2.5+3}+e^{-2.5-3} + e^{2.5+3}\\\tag{4} &\hspace{-5mm}=246.951. \end{align}
A more challenging, but separate, question would be how to keep something like Eq. 10 from that answer linked above, in QUBO format when we are exponentiating binary variables such as when $$\mathcal{J}$$ and $$h$$ are not known constants but are instead written using several binary variables.
• When the number of spins is 50, the number of possible configurations is $2^{50}$. That means $2^{50}$ terms in that equation. This seems to be impractical for 50 spins. Jul 25, 2021 at 6:29