cimod
C++ library for a binary (and polynomial) quadratic model.
|
cimod is a C++ library for a binary quadratic model. This library provides a binary quadratic model class which contains an Ising model or a quadratic unconstrained binary optimization (QUBO) model. It also provides utilities for constructing a model and transforming to some other interfaces. This library is created based on dimod (https://github.com/dwavesystems/dimod).
A binary quadratic model class can contain an Ising model or a QUBO model.
An energy of an Ising model \(E_{\mathrm{Ising}}\) is represented by
\[ E_{\mathrm{Ising}} = \sum_{i} h_i s_i + \sum_{i \neq j} J_{ij} s_i s_j + \delta_{\mathrm{Ising}}, \]
where \(s_i \in \{+1, -1\}\) denotes a spin at the site \(i\), \(h_i\) denotes an external magnetic field parameter, \(J_{ij}\) denotes an interaction parameter and \(\delta_{\mathrm{Ising}}\) denotes an offset. Note that this library assumes that the interaction is not symmetric, i.e., \(J_{ij} \neq J_{ji}\).
An evaluation function of a QUBO model \(E_{\mathrm{QUBO}}\) is represented by
\[ E_{\mathrm{QUBO}} = \sum_{i, j} Q_{ij} x_i x_j + \delta_{\mathrm{QUBO}}, \]
where \(x_i \in \{0, 1\}\) denotes a decision variable, \(Q_{ij}\) denotes a quadratic bias and \(\delta_{\mathrm{QUBO}}\) denotes an offset. Note that this library assumes that the quadratic bias is not symmetric, i.e., \(Q_{ij} \neq Q_{ji}\) if \(i \neq j\).
A binary polynomial model, which can be regarded as an extended model of the binary quadratic model, can handle Ising and HUBO models.
An energy of an "extended" Ising model \(E_{\mathrm{Ising}}\) is represented by
\[ E_{\mathrm{Ising}} = \sum_{i} h_i s_i + \sum_{i \neq j} J_{ij} s_i s_j + \sum_{i \neq j \neq k} J_{ijk} s_i s_j s_k + \ldots \]
Here \(s_i \in \{+1, -1\}\) denotes the spin at the site \(i\), \( h_i \) denotes the external magnetic field at the site \( i \), and \(J_{ijk\ldots}\) represents the interaction between the sites. Note that \( i \neq j \neq k \) means \( i \neq j \), \( j \neq k \), and \( i \neq k \). This library assumes that the interaction is not symmetric. For example, \(J_{ij} \neq J_{ji}\) for \( i\neq j\), \(J_{ijk} \neq J_{jik}\) for \( i \neq j \neq k \), and so on.
An energy of an "extended" QUBO model \( E_{\mathrm{HUBO}}\), here we call polynomial unconstrained binary optimization (HUBO), is represented by
\[ E_{\mathrm{HUBO}} = \sum_{i \neq j} Q_{ij} x_i x_j + \sum_{i \neq j \neq k} Q_{ijk} x_i x_j x_k + \ldots \]
Here \( x_i \in \{0, 1\} \) denotes the spin at the site \( i \) and \(Q_{ijk\ldots}\) represents the interaction between the sites. Note that \( i \neq j \neq k \) means \( i \neq j \), \( j \neq k \), and \( i \neq k \). This library assumes that the interaction is not symmetric. For example, \(Q_{ij} \neq Q_{ji}\) for \( i\neq j\), \(Q_{ijk} \neq Q_{jik}\) for \( i \neq j \neq k \), and so on.